/**
 * SYSTÈME DE BOUTONS UNIFIÉ - La Belle Bretagne
 * Boutons cohérents et réutilisables sur tout le site
 * Utilise le design system pour une cohérence totale
 */

/* ========================================
   BOUTON DE BASE
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-2);
    padding: var(--spacing-3) var(--spacing-6);
    border: none;
    border-radius: 12px;
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-base);
    white-space: nowrap;
    user-select: none;
}

.btn:focus {
    outline: 2px solid var(--color-primary-500);
    outline-offset: 2px;
}

.btn:focus:not(:focus-visible) {
    outline: none;
}

/* ========================================
   BOUTON PRIMARY - Actions principales
   Usage: Réserver, Explorer, S'abonner, Valider
   ======================================== */
.btn-primary {
    background: var(--color-primary-900);
    color: white;
    box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
    background: var(--color-primary-800);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

/* ========================================
   BOUTON SECONDARY - Actions secondaires
   Usage: En savoir plus, Voir plus, Détails
   ======================================== */
.btn-secondary {
    background: transparent;
    color: var(--color-primary-900);
    border: var(--border-width-base) solid var(--color-primary-900);
}

.btn-secondary:hover {
    background: var(--color-primary-900);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:active {
    transform: translateY(0);
}

/* ========================================
   BOUTON ACCENT - Actions tertiaires
   Usage: Découvrir, Fermer, Actions moins importantes
   ======================================== */
.btn-accent {
    background: var(--color-primary-600);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-accent:hover {
    background: var(--color-primary-700);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
}

.btn-accent:active {
    transform: translateY(0);
}

/* ========================================
   BOUTON GHOST - Transparent avec icône
   Usage: Liens discrets, Navigation
   ======================================== */
.btn-ghost {
    background: transparent;
    color: var(--btn-secondary-text);
    border: none;
    box-shadow: none;
}

.btn-ghost:hover {
    background: rgba(30, 58, 138, 0.1);
    transform: none;
}

/* ========================================
   BOUTON DANGER - Actions destructives
   Usage: Supprimer, Annuler (actions critiques)
   ======================================== */
.btn-danger {
    background: #dc2626;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

.btn-danger:hover {
    background: #b91c1c;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.3);
}

/* ========================================
   ÉTATS DISABLED
   ======================================== */
.btn:disabled,
.btn.disabled {
    background: var(--btn-disabled-bg) !important;
    color: var(--btn-disabled-text) !important;
    border-color: var(--btn-disabled-bg) !important;
    cursor: not-allowed !important;
    opacity: 0.6;
    transform: none !important;
    box-shadow: none !important;
}

/* ========================================
   TAILLES DE BOUTONS
   ======================================== */

/* Petit bouton */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 10px;
}

/* Bouton moyen (par défaut) */
.btn-md {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 12px;
}

/* Grand bouton */
.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
    border-radius: 12px;
}

/* Bouton extra-large */
.btn-xl {
    padding: 1.25rem 2.5rem;
    font-size: 1.25rem;
    border-radius: 14px;
}

/* ========================================
   VARIANTES DE FORME
   ======================================== */

/* Bouton carré (icons) */
.btn-square {
    padding: 0.75rem;
    border-radius: 12px;
}

.btn-square.btn-sm {
    padding: 0.5rem;
}

.btn-square.btn-lg {
    padding: 1rem;
}

/* Bouton arrondi complet (pill) */
.btn-pill {
    border-radius: var(--btn-radius-full);
}

/* Bouton pleine largeur */
.btn-block {
    width: 100%;
    display: flex;
}

/* ========================================
   GROUPES DE BOUTONS
   ======================================== */
.btn-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Boutons côte à côte sans espace */
.btn-group-attached {
    display: flex;
    gap: 0;
}

.btn-group-attached .btn:not(:first-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.btn-group-attached .btn:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* ========================================
   BOUTONS AVEC ICÔNES
   ======================================== */
.btn i {
    font-size: 1.1em;
}

.btn-icon-left i {
    margin-right: 0.5rem;
}

.btn-icon-right i {
    margin-left: 0.5rem;
}

/* Bouton icon seulement */
.btn-icon-only {
    padding: 0.75rem;
}

.btn-icon-only.btn-sm {
    padding: 0.5rem;
}

.btn-icon-only.btn-lg {
    padding: 1rem;
}

/* ========================================
   ANIMATIONS ET LOADING
   ======================================== */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: btn-spin 0.6s linear infinite;
}

@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   RESPONSIVE - Optimisé pour mobile
   ======================================== */
@media (max-width: 768px) {
    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
    }

    .btn-lg {
        padding: 1.15rem 1.75rem;
        font-size: 1rem;
        min-height: 56px;
    }

    /* Boutons pleine largeur sur mobile */
    .btn-mobile-block {
        width: 100%;
        display: flex;
    }

    .btn-group {
        flex-direction: column;
        gap: 0.5rem;
    }

    .btn-group .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
    }

    .btn-lg {
        padding: 1.2rem 1.5rem;
        font-size: 1rem;
        min-height: 58px;
    }
}

/* ========================================
   CLASSES UTILITAIRES
   ======================================== */

/* Ombre custom */
.btn-shadow-none {
    box-shadow: none !important;
}

.btn-shadow-lg {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

/* Sans coins arrondis */
.btn-square-corners {
    border-radius: 0;
}

/* Transition rapide */
.btn-fast {
    transition: all 0.15s ease;
}

/* Pas d'effet hover */
.btn-no-hover:hover {
    transform: none !important;
    box-shadow: none !important;
}
