/**
 * Styles pour le composant de Emocard
 * Projet : Cartes cadeaux séances photo Chambéry
 */

/* Variables pour la carte */
:root {
    --card-primary: #2C3E50;
    --card-accent: #E5C687;
    --card-bg: #f9f7f5;
    --card-width: 340px; /* 🎯 Réduit de 380px à 340px (≈-11%) */
    --card-height: 420px; /* 🎯 Réduit de 480px à 420px (≈-13%) */
    --card-transition: 0.8s; /* Augmenté pour des transitions plus douces */
    --card-easing: cubic-bezier(0.25, 0.46, 0.45, 0.94); /* Easing amélioré pour des animations plus naturelles */
    --flip-easing: cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Easing spécial pour le retournement */
    
    /* Nouvelles couleurs distinctes pour les formules */
    --essentiel-color: #CD7F32; /* Bronze */
    --premium-color: #C0C0C0;  /* Argent */
    --luxe-color: #D4AF37;     /* Or */
    
    /* Variables pour les dégradés de formules */
    --essentiel-bg: linear-gradient(135deg, #CD7F32 0%, #E8B27D 100%);
    --premium-bg: linear-gradient(135deg, #C0C0C0 0%, #E8E8E8 100%);
    --luxe-bg: linear-gradient(135deg, #D4AF37 0%, #F5D76E 100%);
    
    /* Variables responsives pour les différentes tailles d'écran */
    --card-mobile-width: 90vw;
    --card-mobile-max-width: 320px;
    --card-mobile-height: auto;
    
    /* Variables pour une meilleure gestion des proportions */
    --card-ratio: 0.79; /* Width/Height pour maintenir les proportions */
}


.card-subtitle {
    font-size: 0.8rem;
    color: var(--card-primary);
    text-align: center;
    font-family: 'Didot', 'Playfair Display', serif;
    letter-spacing: 1px;
}

/* Zone de la carte 3D avec perspective améliorée et marges optimisées */
.card-container {
    perspective: 2500px; /* Perspective augmentée pour un effet 3D plus prononcé */
    perspective-origin: center center; /* Centre la perspective */
    width: var(--card-width);
    height: var(--card-height);
    max-width: 100%; /* Empêche le débordement horizontal */
    margin: 1.5rem auto; /* Marges réduites pour plus de compacité */
    transform-style: preserve-3d;
    position: relative;
    overflow: visible; /* Pour éviter que les effets 3D et boutons soient coupés */
    z-index: 1; /* Assure que la carte reste au-dessus des autres éléments */
}

/* Container principal pour la carte premium qui englobe carte + texte - marges optimisées */
.premium-card-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: var(--card-width);
    margin: 1rem auto; /* Marges réduites pour plus de compacité */
    padding-top: 0.5rem; /* Padding réduit pour économiser l'espace */
}

.gift-card {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform var(--card-transition) var(--card-easing);
    cursor: grab;
    border-radius: 15px;
    box-shadow: 
        0 25px 50px rgba(50, 50, 50, 0.15), 
        0 10px 25px rgba(0, 0, 0, 0.08),
        0 5px 10px rgba(0, 0, 0, 0.05);
    will-change: transform; /* Optimisation de performance pour les animations */
    transform-origin: center center; /* Centre les transformations */
    aspect-ratio: calc(1 / var(--card-ratio)); /* Garantit un ratio constant même lors du redimensionnement */
}

.gift-card:active {
    cursor: grabbing; /* Changement du curseur pendant le déplacement */
}

.gift-card.flipped {
    transform: rotateY(180deg);
    transition: transform 1s var(--flip-easing); /* Transition spéciale pour le retournement */
}

/* Amélioration de l'effet 3D au survol */
.gift-card:hover {
    box-shadow: 
        0 35px 70px rgba(50, 50, 50, 0.2), 
        0 15px 35px rgba(0, 0, 0, 0.12),
        0 8px 15px rgba(0, 0, 0, 0.08);
    transform: translateY(-5px) scale(1.02);
    transition: all 0.4s var(--card-easing);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* Changé de space-between à center pour un meilleur alignement */
    padding: 2rem;
    background: white;
    border: 1px solid rgba(229, 198, 135, 0.3);
    transform-style: preserve-3d;
    transition: box-shadow 0.4s ease, border-color 0.4s ease;
}

/* Effet d'ombre amélioré au survol */
.gift-card:hover .card-face {
    box-shadow: 0 0 40px rgba(229, 198, 135, 0.4) inset;
    border-color: rgba(229, 198, 135, 0.6);
}

.card-back {
    transform: rotateY(180deg);
}

/* Suppression des puces pour les listes avec des coeurs */
.card-back ul,
.card-back li,
.gift-card ul,
.gift-card li {
    list-style: none !important;
    padding-left: 0 !important;
}

/* Éléments de design de la carte avec parallaxe intégré */
.card-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    min-width: 48px;
    min-height: 48px;
    max-width: 90px;
    max-height: 90px;
    background: linear-gradient(135deg, #D4AF37 0%, #F5D76E 100%) !important;
    border-radius: 50%;
    overflow: hidden;
    color: white;
    font-size: 0.8rem;
    letter-spacing: 1px;
    position: relative;
    margin-bottom: 1.5rem;
    flex-shrink: 0;
}

.card-logo .logo-emocard-svg {
    width: 60px;
    height: 60px;
    max-width: 90%;
    max-height: 90%;
    display: block;
    margin: 0 auto;
    object-fit: contain;
    pointer-events: none;
}

.card-logo:not(:has(.logo-emocard-svg)) {
    /* Style fallback texte */
    font-family: 'Didot', 'Playfair Display', serif;
    font-size: 1.1rem;
    text-align: center;
    line-height: 1.1;
    letter-spacing: 2px;
    opacity: 0.85;
}

.card-logo:hover {
    transform: translateZ(25px) scale(1.05);
    box-shadow: 0 10px 20px rgba(44, 62, 80, 0.3);
}

.card-logo::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    transition: opacity 0.3s ease;
    opacity: 0;
}

.gift-card:hover .card-logo::after {
    opacity: 1;
}

.card-title {
    font-size: 1.8rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 1rem;
    position: relative;
    padding-bottom: 0.5rem;
    text-align: center;
    font-family: 'Didot', 'Playfair Display', serif;
    color: var(--card-primary);
    transform: translateZ(30px);
    transition: transform 0.4s var(--card-easing);
    width: 100%; /* Assure la largeur complète pour le centrage */
    flex-shrink: 0; /* Empêche la réduction du titre */
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    white-space: nowrap;
    overflow: visible;
    min-height: auto;
}

/* ✅ NOUVELLE GESTION RESPONSIVE POUR LE TITRE */
@media (min-width: 600px) and (max-width: 900px) {
    .card-title {
        font-size: 1.4rem !important;
        letter-spacing: 1.5px !important;
        margin-bottom: 0.8rem !important;
        line-height: 1.2 !important;
        white-space: normal !important;
    }
}

@media (min-width: 700px) and (max-width: 850px) and (min-height: 600px) and (max-height: 800px) {
    .card-title {
        font-size: 1.3rem !important;
        letter-spacing: 1px !important;
        margin-bottom: 0.6rem !important;
        padding-bottom: 0.3rem !important;
    }
    
    .card-title::after {
        width: 35px !important;
        height: 1.5px !important;
    }
}

/* ✅ ZONE PROBLÉMATIQUE 800x700 - TITRE FORCÉ */
@media (min-width: 750px) and (max-width: 850px) and (min-height: 650px) and (max-height: 750px) {
    .card-container, .premium-card-container {
        height: auto !important;
        min-height: 400px !important;
        max-height: 90vh !important;
    }
    
    .gift-card {
        min-height: 400px !important;
        max-height: 85vh !important;
        height: auto !important;
    }
    
    .card-face {
        padding: 1.4rem 1.2rem !important;
        min-height: 380px !important;
        height: auto !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
    }
    
    .card-title {
        font-size: 1.25rem !important;
        letter-spacing: 1px !important;
        margin-bottom: 0.5rem !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        flex-shrink: 0 !important;
        order: 1 !important;
    }
    
    .card-subtitle {
        font-size: 0.75rem !important;
        margin-bottom: 0.5rem !important;
        order: 2 !important;
    }
    
    .formula-badge {
        order: 3 !important;
        margin: 8px 0 !important;
        padding: 6px 16px !important;
        font-size: 0.8rem !important;
    }
    
    .card-recipient {
        order: 4 !important;
        font-size: 1rem !important;
        margin: 0.3rem 0 !important;
    }
    
    .card-message {
        order: 5 !important;
        font-size: 0.85rem !important;
        padding: 10px !important;
        min-height: 60px !important;
        margin: 0.5rem 0 !important;
        flex: 1 !important;
    }
    
    .card-from {
        order: 6 !important;
        font-size: 1rem !important;
        margin: 0.3rem 0 !important;
    }
    
    .card-footer {
        order: 7 !important;
        font-size: 0.75rem !important;
        margin-top: 0.5rem !important;
    }
}

.gift-card:hover .card-title {
    transform: translateZ(35px) scale(1.02);
    /* Garde la couleur d'origine */
}

.card-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background: var(--card-accent);
    transition: width 0.4s var(--card-easing), background 0.4s ease;
}

/* Élargissement de la ligne de titre au survol */
.gift-card:hover .card-title::after {
    width: 80px;
    background: linear-gradient(90deg, var(--card-accent), var(--card-primary));
}

.formula-badge {
    position: relative;
    color: #000000; /* Changé en noir pour meilleur contraste */
    background: rgba(255, 255, 255, 0.95); /* Fond blanc avec transparence */
    display: inline-block;
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 1;
    margin: 10px 0; /* Changé de margin-top à margin pour un espacement équilibré */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transform: translateZ(25px);
    transition: all 0.5s var(--card-easing);
    overflow: hidden;
    text-align: center; /* Centrage du texte dans le badge */
    align-self: center; /* Auto-centrage du badge */
    flex-shrink: 0; /* Empêche la réduction du badge */
    border: 1px solid rgba(170, 123, 76, 0.3); /* Bordure subtile */
}

/* Effet au survol pour le badge de formule */
.gift-card:hover .formula-badge {
    transform: translateZ(30px) scale(1.08) rotateX(5deg);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
}

/* Animation de brillance pour le badge - RÉDUITE */
.formula-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.8s ease;
}

.gift-card:hover .formula-badge::before {
    left: 100%;
}

.card-recipient, .card-from {
    font-size: 1.4rem;
    font-style: italic;
    margin: 0.5rem 0; /* Réduit l'espacement pour un meilleur équilibre */
    text-align: center;
    transition: opacity 0.5s var(--card-easing), transform 0.5s var(--card-easing);
    font-family: 'Didot', 'Playfair Display', serif;
    color: var(--card-primary);
    transform: translateZ(15px);
    position: relative;
    width: 100%; /* Assure la largeur complète pour le centrage */
    flex-shrink: 0; /* Empêche la réduction */
}

.card-from {
    transform: translateZ(10px);
}

.gift-card:hover .card-recipient {
    transform: translateZ(20px) scale(1.02);
    /* Garde la couleur d'origine */
}

.gift-card:hover .card-from {
    transform: translateZ(15px) scale(1.02);
    /* Garde la couleur d'origine */
}

.card-message {
    font-size: 1.1rem;
    line-height: 1.6;
    text-align: center;
    font-style: italic;
    margin: 1rem 0;
    max-width: 100%;
    overflow-wrap: break-word;
    transition: opacity 0.5s var(--card-easing), transform 0.5s var(--card-easing), background-color 0.4s ease;
    font-family: 'Didot', 'Playfair Display', serif;
    color: var(--card-primary);
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    position: relative;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateZ(20px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    flex: 1; /* Permet au message de prendre l'espace disponible */
    width: 100%; /* Assure la largeur complète */
}

.gift-card:hover .card-message {
    transform: translateZ(25px) scale(1.01);
    background-color: rgba(249, 247, 245, 0.9);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.card-message::before {
    content: '"';
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    color: rgba(229, 198, 135, 0.3);
    position: absolute;
    top: -5px;
    left: 5px;
    transition: transform 0.4s var(--card-easing), color 0.4s ease;
}

.gift-card:hover .card-message::before {
    transform: scale(1.2) rotate(5deg);
    color: rgba(229, 198, 135, 0.5);
}

.card-footer {
    width: 100%;
    text-align: center;
    font-size: 0.9rem;
    margin-top: auto; /* Pousse le footer vers le bas */
    letter-spacing: 1px;
    font-family: 'Didot', 'Playfair Display', serif;
    color: var(--card-primary);
    transform: translateZ(5px);
    transition: transform 0.4s var(--card-easing);
    flex-shrink: 0; /* Empêche la réduction du footer */
}

/* Animation de brillance améliorée pour la carte - RÉDUITE ET PLUS SUBTILE */
@keyframes shimmer {
    0% { 
        transform: translateX(-120%) rotate(45deg) scale(0.5); 
        opacity: 0;
    }
    50% {
        opacity: 0.3;
    }
    100% { 
        transform: translateX(220%) rotate(45deg) scale(0.8); 
        opacity: 0;
    }
}

/* Effet de brillance au survol seulement - BEAUCOUP PLUS SUBTIL */
.gift-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0) 45%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0) 55%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: translateX(-120%) rotate(45deg) scale(0.5);
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gift-card:hover::before {
    animation: shimmer 3s ease-in-out infinite;
}

/* Animation pour les changements de contenu - AMÉLIORÉE */
@keyframes textFadeIn {
    0% { 
        opacity: 0; 
        transform: translateY(-10px) scale(0.95);
    }
    50% {
        opacity: 0.7;
        transform: translateY(-2px) scale(0.98);
    }
    100% { 
        opacity: 1; 
        transform: translateY(0) scale(1);
    }
}

@keyframes textFadeOut {
    0% { 
        opacity: 1; 
        transform: translateY(0) scale(1);
    }
    100% { 
        opacity: 0; 
        transform: translateY(5px) scale(1.02);
    }
}

.text-updating {
    animation: textFadeOut 0.3s var(--card-easing) forwards,
               textFadeIn 0.4s var(--card-easing) 0.3s forwards;
}

/* Animation d'entrée pour la carte - AMÉLIORÉE */
@keyframes cardEntrance {
    0% {
        opacity: 0;
        transform: translateY(30px) rotateX(-15deg) scale(0.9);
    }
    50% {
        opacity: 0.7;
        transform: translateY(10px) rotateX(-5deg) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotateX(0deg) scale(1);
    }
}

.card-container {
    animation: cardEntrance 1.2s var(--card-easing) forwards;
}

/* Animation des coins au survol - DÉSACTIVÉES */
.corner-decoration {
    display: none !important;
}

.gift-card:hover .corner-decoration {
    /* Décorations masquées */
    display: none !important;
}

/* Positions des coins - DÉSACTIVÉES
.top-left {
    display: none;
}

.top-right {
    display: none;
}

.bottom-left {
    display: none;
}

.bottom-right {
    display: none;
}
*/

/* Motif doré masqué - DÉSACTIVÉ */
.golden-pattern {
    display: none !important;
}

.gift-card:hover .golden-pattern {
    opacity: 0.8;
    transform: scale(1.02);
}

/* Bouton de retournement stylisé */
.card-flip-button {
    position: absolute;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--card-primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s var(--card-easing);
    box-shadow: 0 4px 15px rgba(44, 62, 80, 0.3);
    z-index: 10;
}

.card-flip-button:hover {
    background: var(--card-accent);
    color: var(--card-primary);
    transform: translateX(-50%) scale(1.1) rotate(180deg);
    box-shadow: 0 6px 20px rgba(229, 198, 135, 0.4);
}

.card-flip-button:active {
    transform: translateX(-50%) scale(0.95) rotate(180deg);
}

/* Indication d'action améliorée - REPOSITIONNÉE */
.action-hint {
    text-align: center;
    margin-top: 30px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--card-primary);
    opacity: 0.7;
    transition: all 0.3s ease;
    font-style: italic;
    width: 100%;
    display: block;
    position: relative;
    order: 2; /* S'assure que le texte vient après la carte */
}

.premium-card-container .card-container {
    order: 1; /* S'assure que la carte vient en premier */
    margin-bottom: 0; /* Supprime la marge du bas de la carte */
}

.card-container:hover + .action-hint,
.premium-card-container:hover .action-hint {
    opacity: 1;
    transform: translateY(-5px);
    color: var(--card-accent);
}

/* Styles pour les différentes formules - AMÉLIORÉS */
.card-style-essentiel {
    --formula-shadow: 0 4px 20px rgba(205, 127, 50, 0.3);
}

.card-style-premium {
    --formula-shadow: 0 4px 20px rgba(192, 192, 192, 0.3);
}

.card-style-luxe {
    --formula-shadow: 0 4px 20px rgba(212, 175, 55, 0.3);
}

.card-style-essentiel .formula-badge {
    background: var(--essentiel-bg);
    color: #3A2914;
    box-shadow: var(--formula-shadow);
}

.card-style-premium .formula-badge {
    background: var(--premium-bg);
    color: #333;
    box-shadow: var(--formula-shadow);
}

.card-style-luxe .formula-badge {
    background: var(--luxe-bg);
    color: #43370D;
    box-shadow: var(--formula-shadow);
}

/* Réduction du titre DÉTAILS DE L'OFFRE au verso */
.card-back .card-title,
.card-back .card-details-title {
    font-size: 1.1rem !important;
    letter-spacing: 1px !important;
    padding: 0.2em 0.4em !important;
    margin-bottom: 0.7em !important;
    background: none !important;
    text-transform: none !important;
}

/* Effet de focus amélioré pour l'accessibilité */
.gift-card:focus-visible {
    outline: 3px solid var(--card-accent);
    outline-offset: 5px;
}

.card-flip-button:focus-visible {
    outline: 2px solid var(--card-accent);
    outline-offset: 3px;
}

/* Performance optimizations */
.gift-card,
.card-face,
.corner-decoration,
.formula-badge,
.golden-pattern {
    will-change: transform;
}

/* Réduction des animations sur les appareils avec reduced motion */
@media (prefers-reduced-motion: reduce) {
    .gift-card,
    .card-face,
    .corner-decoration,
    .formula-badge,
    .card-title,
    .card-recipient,
    .card-from,
    .card-message,
    .card-footer {
        transition: none !important;
        animation: none !important;
    }
    
    .gift-card::before {
        display: none;
    }
}

/* ========== RESPONSIVITÉ AMÉLIORÉE ========== */

/* Tablettes et grands mobiles */
@media (max-width: 992px) {
    .card-container, 
    .premium-card-container {
        width: 95%;
        max-width: 360px;
        margin: 1.5rem auto;
    }
    
    .card-face {
        padding: 1.8rem;
    }
    
    .card-title {
        font-size: 1.6rem;
        letter-spacing: 2px;
    }
    
    .card-recipient, .card-from {
        font-size: 1.2rem;
    }
    
    .card-message {
        font-size: 1rem;
        padding: 15px;
        min-height: 100px;
    }
    
    .card-logo {
        width: 60px;
        height: 60px;
        margin-bottom: 1.2rem;
    }
    
    /* Réduction des effets 3D sur tablette */
    .gift-card:hover {
        transform: translateY(-3px) scale(1.01);
    }
    
    .card-flip-button {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
        bottom: -50px;
    }
}

/* Tablettes portrait et mobiles landscape */
@media (max-width: 768px) {
    :root {
        --card-width: var(--card-mobile-width);
        --card-height: var(--card-mobile-height);
    }
    
    .card-container, 
    .premium-card-container {
        width: var(--card-mobile-width);
        max-width: var(--card-mobile-max-width);
        height: auto;
        margin: 1rem auto;
        padding: 0 10px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .gift-card {
        min-height: 420px;
        /* Maintien du ratio d'aspect */
        aspect-ratio: 0.75/1;
    }
    
    .card-face {
        padding: 1.5rem 1.2rem;
        justify-content: space-between;
    }
    
    .card-title {
        font-size: 1.4rem;
        letter-spacing: 1.5px;
        margin-bottom: 0.8rem;
    }
    
    .card-recipient, .card-from {
        font-size: 1.1rem;
        margin: 0.4rem 0;
    }
    
    .card-message {
        font-size: 0.95rem;
        padding: 12px;
        min-height: 80px;
        line-height: 1.5;
    }
    
    .card-message::before {
        font-size: 2.5rem;
        top: -8px;
        left: 2px;
    }
    
    .card-logo {
        width: 55px;
        height: 55px;
        margin-bottom: 1rem;
        font-size: 0.7rem;
    }
    
    .formula-badge {
        padding: 6px 16px;
        font-size: 0.85rem;
        margin: 8px 0;
    }
    
    .card-footer {
        font-size: 0.8rem;
        margin-top: 0.5rem;
    }
    
    /* Désactivation partielle des effets 3D sur mobile */
    .gift-card:hover {
        transform: translateY(-2px) scale(1.005);
        box-shadow: 
            0 20px 40px rgba(50, 50, 50, 0.15), 
            0 8px 20px rgba(0, 0, 0, 0.1);
    }
    
    .card-flip-button {
        width: 38px;
        height: 38px;
        font-size: 1rem;
        bottom: -45px;
    }
    
    /* Amélioration du texte d'action */
    .action-hint {
        font-size: 0.85rem;
        margin-top: 25px;
        margin-bottom: 15px;
        padding: 0 10px;
    }
    
    /* Ajustement des décorations coins */
    .corner-decoration {
        width: 25px;
        height: 25px;
    }
    
    .gift-card:hover .corner-decoration {
        width: 30px;
        height: 30px;
    }
}

/* Mobiles portrait (petits écrans) */
@media (max-width: 480px) {
    :root {
        --card-mobile-max-width: 300px;
    }
    
    .card-container, 
    .premium-card-container {
        width: 95vw;
        max-width: var(--card-mobile-max-width);
        margin: 0.8rem auto;
        padding: 0 8px;
    }
    
    .gift-card {
        min-height: 380px;
        aspect-ratio: 0.78/1;
        border-radius: 12px;
    }
    
    .card-face {
        padding: 1.2rem 1rem;
        border-radius: 12px;
    }
    
    .card-title {
        font-size: 1.2rem;
        letter-spacing: 1px;
        margin-bottom: 0.6rem;
    }
    
    .card-title::after {
        width: 30px;
        height: 1.5px;
    }
    
    .gift-card:hover .card-title::after {
        width: 60px;
    }
    
    .card-recipient, .card-from {
        font-size: 1rem;
        margin: 0.3rem 0;
    }
    
    .card-message {
        font-size: 0.9rem;
        padding: 10px;
        min-height: 70px;
        line-height: 1.4;
        border-radius: 8px;
    }
    
    .card-message::before {
        font-size: 2rem;
        top: -10px;
        left: 0;
    }
    
    .card-logo {
        width: 50px;
        height: 50px;
        margin-bottom: 0.8rem;
        font-size: 0.65rem;
    }
    
    .formula-badge {
        padding: 5px 14px;
        font-size: 0.8rem;
        margin: 6px 0;
        border-radius: 20px;
    }
    
    .card-footer {
        font-size: 0.75rem;
        letter-spacing: 0.5px;
    }
    
    /* Effets 3D encore plus réduits sur petits mobiles */
    .gift-card:hover {
        transform: translateY(-1px) scale(1.002);
        box-shadow: 
            0 15px 30px rgba(50, 50, 50, 0.12), 
            0 6px 15px rgba(0, 0, 0, 0.08);
    }
    
    .card-flip-button {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
        bottom: -40px;
    }
    
    .action-hint {
        font-size: 0.8rem;
        margin-top: 20px;
        margin-bottom: 10px;
        line-height: 1.3;
    }
    
    /* Décorations coins plus petites */
    .corner-decoration {
        width: 20px;
        height: 20px;
    }
    
    .gift-card:hover .corner-decoration {
        width: 25px;
        height: 25px;
    }
    
    .top-left, .top-right, .bottom-left, .bottom-right {
        top: 8px;
        right: 8px;
        bottom: 8px;
        left: 8px;
    }
}

/* Très petits mobiles (iPhone SE, anciens Android) */
@media (max-width: 375px) {
    .card-container, 
    .premium-card-container {
        width: 98vw;
        max-width: 280px;
        margin: 0.5rem auto;
        padding: 0 5px;
    }
    
    .gift-card {
        min-height: 350px;
        aspect-ratio: 0.8/1;
    }
    
    .card-face {
        padding: 1rem 0.8rem;
    }
    
    .card-title {
        font-size: 1.1rem;
        letter-spacing: 0.5px;
    }
    
    .card-recipient, .card-from {
        font-size: 0.95rem;
    }
    
    .card-message {
        font-size: 0.85rem;
        padding: 8px;
        min-height: 60px;
    }
    
    .card-logo {
        width: 45px;
        height: 45px;
        font-size: 0.6rem;
    }
    
    .formula-badge {
        padding: 4px 12px;
        font-size: 0.75rem;
    }
    
    .card-footer {
        font-size: 0.7rem;
    }
}

/* Optimisations pour mode paysage mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .card-container, 
    .premium-card-container {
        margin: 0.5rem auto;
    }
    
    .gift-card {
        min-height: 300px;
        max-height: 85vh;
    }
    
    .card-face {
        padding: 1rem;
    }
    
    .card-message {
        min-height: 50px;
        font-size: 0.85rem;
    }
    
    .card-flip-button {
        bottom: -35px;
    }
    
    .action-hint {
        margin-top: 15px;
        margin-bottom: 8px;
        font-size: 0.75rem;
    }
}

/* Optimisations pour les écrans tactiles */
@media (hover: none) and (pointer: coarse) {
    /* Suppression des effets hover pour les appareils tactiles */
    .gift-card:hover {
        transform: none;
        box-shadow: 
            0 25px 50px rgba(50, 50, 50, 0.15), 
            0 10px 25px rgba(0, 0, 0, 0.08),
            0 5px 10px rgba(0, 0, 0, 0.05);
    }
    
    .gift-card:hover .card-face {
        box-shadow: none;
        border-color: rgba(229, 198, 135, 0.3);
    }
    
    .gift-card:hover .card-logo,
    .gift-card:hover .card-title,
    .gift-card:hover .card-recipient,
    .gift-card:hover .card-from,
    .gift-card:hover .card-message {
        transform: none;
    }
    
    .gift-card:hover .formula-badge {
        transform: translateZ(25px);
    }
    
    /* Augmentation de la zone de toucher pour les boutons */
    .card-flip-button {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
    
    /* Amélioration du feedback tactile */
    .gift-card:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
}

/* Optimisations pour les écrans haute densité */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .card-logo,
    .formula-badge,
    .corner-decoration {
        /* Amélioration de la netteté sur les écrans Retina */
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Adaptation pour les très grands écrans */
@media (min-width: 1400px) {
    .card-container, 
    .premium-card-container {
        max-width: 420px;
    }
    
    .gift-card {
        --card-width: 420px;
        --card-height: 520px;
    }
    
    .card-face {
        padding: 2.5rem;
    }
    
    .card-title {
        font-size: 2rem;
    }
    
    .card-recipient, .card-from {
        font-size: 1.5rem;
    }
}

/* ========== RESPONSIVITÉ AMÉLIORÉE - CORRECTION ANGLE MORT 800x700 ========== */

/* ✅ NOUVEAU : Zone critique 800x700px - Angle mort corrigé */
@media (min-width: 769px) and (max-width: 900px), 
       (min-height: 600px) and (max-height: 800px) and (min-width: 700px) and (max-width: 900px) {
    :root {
        --card-width: 350px;
        --card-height: 450px;
    }
    
    .card-container, 
    .premium-card-container {
        width: 90%;
        max-width: 350px;
        margin: 1.5rem auto;
        padding: 0 15px;
    }
    
    .gift-card {
        min-height: 420px;
        max-height: 70vh; /* Limitation de hauteur pour éviter débordement */
    }
    
    .card-face {
        padding: 1.6rem 1.4rem;
        justify-content: space-between;
    }
    
    .card-title {
        font-size: 1.5rem;
        letter-spacing: 2px;
        margin-bottom: 0.8rem;
    }
    
    .card-recipient, .card-from {
        font-size: 1.15rem;
        margin: 0.4rem 0;
    }
    
    .card-message {
        font-size: 0.98rem;
        padding: 14px;
        min-height: 90px;
        line-height: 1.5;
    }
    
    .card-logo {
        width: 58px;
        height: 58px;
        margin-bottom: 1.1rem;
        font-size: 0.75rem;
    }
    
    .formula-badge {
        padding: 7px 18px;
        font-size: 0.87rem;
        margin: 9px 0;
    }
    
    .card-footer {
        font-size: 0.82rem;
        margin-top: 0.6rem;
    }
    
    .card-flip-button {
        width: 42px;
        height: 42px;
        font-size: 1.05rem;
        bottom: -48px;
    }
    
    .action-hint {
        font-size: 0.87rem;
        margin-top: 28px;
        margin-bottom: 16px;
    }
    
    /* Ajustements 3D pour cette taille */
    .gift-card:hover {
        transform: translateY(-4px) scale(1.015);
    }
    
    /* Décorations proportionnelles */
    .corner-decoration {
        width: 28px;
        height: 28px;
    }
    
    .gift-card:hover .corner-decoration {
        width: 35px;
        height: 35px;
    }
}

/* Tablettes et grands mobiles - AJUSTÉ */
@media (max-width: 992px) and (min-width: 769px) {
    .card-container, 
    .premium-card-container {
        width: 95%;
        max-width: 360px;
        margin: 1.5rem auto;
    }
    
    .card-face {
        padding: 1.8rem;
    }
    
    .card-title {
        font-size: 1.6rem;
        letter-spacing: 2px;
    }
    
    .card-recipient, .card-from {
        font-size: 1.2rem;
    }
    
    .card-message {
        font-size: 1rem;
        padding: 15px;
        min-height: 100px;
    }
    
    .card-logo {
        width: 60px;
        height: 60px;
        margin-bottom: 1.2rem;
    }
    
    /* Réduction des effets 3D sur tablette */
    .gift-card:hover {
        transform: translateY(-3px) scale(1.01);
    }
    
    .card-flip-button {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
        bottom: -50px;
    }
}

/* ✅ NOUVEAU : Gestion spéciale pour écrans intermédiaires landscape */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) and (max-height: 768px) {
    .card-container, 
    .premium-card-container {
        margin: 1rem auto;
        max-width: 340px;
    }
    
    .gift-card {
        max-height: 75vh;
        min-height: 380px;
    }
    
    .card-face {
        padding: 1.4rem 1.2rem;
    }
    
    .card-message {
        min-height: 70px;
        font-size: 0.9rem;
        padding: 12px;
    }
    
    .card-flip-button {
        bottom: -40px;
    }
}

/* Tablettes portrait et mobiles landscape - OPTIMISÉ */
@media (max-width: 768px) {
    :root {
        --card-width: var(--card-mobile-width);
        --card-height: var(--card-mobile-height);
    }
    
    .card-container, 
    .premium-card-container {
        width: var(--card-mobile-width);
        max-width: var(--card-mobile-max-width);
        height: auto;
        margin: 1rem auto;
        padding: 0 10px;
    }
    
    .gift-card {
        min-height: 420px;
        /* Maintien du ratio d'aspect */
        aspect-ratio: 0.75/1;
    }
    
    .card-face {
        padding: 1.5rem 1.2rem;
        justify-content: space-between;
    }
    
    .card-title {
        font-size: 1.4rem;
        letter-spacing: 1.5px;
        margin-bottom: 0.8rem;
    }
    
    .card-recipient, .card-from {
        font-size: 1.1rem;
        margin: 0.4rem 0;
    }
    
    .card-message {
        font-size: 0.95rem;
        padding: 12px;
        min-height: 80px;
        line-height: 1.5;
    }
    
    .card-message::before {
        font-size: 2.5rem;
        top: -8px;
        left: 2px;
    }
    
    .card-logo {
        width: 55px;
        height: 55px;
        margin-bottom: 1rem;
        font-size: 0.7rem;
    }
    
    .formula-badge {
        padding: 6px 16px;
        font-size: 0.85rem;
        margin: 8px 0;
    }
    
    .card-footer {
        font-size: 0.8rem;
        margin-top: 0.5rem;
    }
    
    /* Désactivation partielle des effets 3D sur mobile */
    .gift-card:hover {
        transform: translateY(-2px) scale(1.005);
        box-shadow: 
            0 20px 40px rgba(50, 50, 50, 0.15), 
            0 8px 20px rgba(0, 0, 0, 0.1);
    }
    
    .card-flip-button {
        width: 38px;
        height: 38px;
        font-size: 1rem;
        bottom: -45px;
    }
    
    /* Amélioration du texte d'action */
    .action-hint {
        font-size: 0.85rem;
        margin-top: 25px;
        margin-bottom: 15px;
        padding: 0 10px;
    }
    
    /* Ajustement des décorations coins */
    .corner-decoration {
        width: 25px;
        height: 25px;
    }
    
    .gift-card:hover .corner-decoration {
        width: 30px;
        height: 30px;
    }
}

/* Mobiles portrait (petits écrans) */
@media (max-width: 480px) {
    :root {
        --card-mobile-max-width: 300px;
    }
    
    .card-container, 
    .premium-card-container {
        width: 95vw;
        max-width: var(--card-mobile-max-width);
        margin: 0.8rem auto;
        padding: 0 8px;
    }
    
    .gift-card {
        min-height: 380px;
        aspect-ratio: 0.78/1;
        border-radius: 12px;
    }
    
    .card-face {
        padding: 1.2rem 1rem;
        border-radius: 12px;
    }
    
    .card-title {
        font-size: 1.2rem;
        letter-spacing: 1px;
        margin-bottom: 0.6rem;
    }
    
    .card-title::after {
        width: 30px;
        height: 1.5px;
    }
    
    .gift-card:hover .card-title::after {
        width: 60px;
    }
    
    .card-recipient, .card-from {
        font-size: 1rem;
        margin: 0.3rem 0;
    }
    
    .card-message {
        font-size: 0.9rem;
        padding: 10px;
        min-height: 70px;
        line-height: 1.4;
        border-radius: 8px;
    }
    
    .card-message::before {
        font-size: 2rem;
        top: -10px;
        left: 0;
    }
    
    .card-logo {
        width: 50px;
        height: 50px;
        margin-bottom: 0.8rem;
        font-size: 0.65rem;
    }
    
    .formula-badge {
        padding: 5px 14px;
        font-size: 0.8rem;
        margin: 6px 0;
        border-radius: 20px;
    }
    
    .card-footer {
        font-size: 0.75rem;
        letter-spacing: 0.5px;
    }
    
    /* Effets 3D encore plus réduits sur petits mobiles */
    .gift-card:hover {
        transform: translateY(-1px) scale(1.002);
        box-shadow: 
            0 15px 30px rgba(50, 50, 50, 0.12), 
            0 6px 15px rgba(0, 0, 0, 0.08);
    }
    
    .card-flip-button {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
        bottom: -40px;
    }
    
    .action-hint {
        font-size: 0.8rem;
        margin-top: 20px;
        margin-bottom: 10px;
        line-height: 1.3;
    }
    
    /* Décorations coins plus petites */
    .corner-decoration {
        width: 20px;
        height: 20px;
    }
    
    .gift-card:hover .corner-decoration {
        width: 25px;
        height: 25px;
    }
    
    .top-left, .top-right, .bottom-left, .bottom-right {
        top: 8px;
        right: 8px;
        bottom: 8px;
        left: 8px;
    }
}

/* Très petits mobiles (iPhone SE, anciens Android) */
@media (max-width: 375px) {
    .card-container, 
    .premium-card-container {
        width: 98vw;
        max-width: 280px;
        margin: 0.5rem auto;
        padding: 0 5px;
    }
    
    .gift-card {
        min-height: 350px;
        aspect-ratio: 0.8/1;
    }
    
    .card-face {
        padding: 1rem 0.8rem;
    }
    
    .card-title {
        font-size: 1.1rem;
        letter-spacing: 0.5px;
    }
    
    .card-recipient, .card-from {
        font-size: 0.95rem;
    }
    
    .card-message {
        font-size: 0.85rem;
        padding: 8px;
        min-height: 60px;
    }
    
    .card-logo {
        width: 45px;
        height: 45px;
        font-size: 0.6rem;
    }
    
    .formula-badge {
        padding: 4px 12px;
        font-size: 0.75rem;
    }
    
    .card-footer {
        font-size: 0.7rem;
    }
}

/* Optimisations pour mode paysage mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .card-container, 
    .premium-card-container {
        margin: 0.5rem auto;
    }
    
    .gift-card {
        min-height: 300px;
        max-height: 85vh;
    }
    
    .card-face {
        padding: 1rem;
    }
    
    .card-message {
        min-height: 50px;
        font-size: 0.85rem;
    }
    
    .card-flip-button {
        bottom: -35px;
    }
    
    .action-hint {
        margin-top: 15px;
        margin-bottom: 8px;
        font-size: 0.75rem;
    }
}

/* ========== STYLES FAQ - CENTRAGE ET RESPONSIVITÉ CORRIGÉS ========== */

.faq-section {
    width: 100%;
    max-width: 1200px;
    margin: 60px auto;
    padding: 0 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

#faq-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.faq-component {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 0;
    text-align: center;
}

.faq-component .faq-header {
    text-align: center;
    margin-bottom: 40px;
    width: 100%;
}

.faq-component .faq-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--card-primary, #2C3E50);
    margin: 0 0 10px 0;
    text-align: center;
}

.faq-component .faq-header p {
    color: var(--card-primary, #2C3E50);
    opacity: 0.7;
    font-size: 1.1rem;
    margin: 0;
    text-align: center;
}

.faq-component .faq-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    align-items: center;
}

.faq-component .faq-item {
    background: white;
    border: 1px solid rgba(229, 198, 135, 0.2);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 100%;
}

.faq-component .faq-item:hover {
    border-color: var(--card-accent, #E5C687);
    box-shadow: 0 4px 15px rgba(229, 198, 135, 0.1);
}

.faq-component .faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.faq-component .faq-question:hover {
    background: rgba(229, 198, 135, 0.05);
}

.faq-component .faq-question h3 {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--card-primary, #2C3E50);
    margin: 0;
    flex: 1;
    text-align: left;
}

.faq-component .faq-icon {
    font-size: 1.2rem;
    color: var(--card-accent, #E5C687);
    font-weight: bold;
    transition: transform 0.3s ease;
    min-width: 20px;
    text-align: center;
}

.faq-component .faq-item.active .faq-icon {
    transform: rotate(45deg);
}

.faq-component .faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-component .faq-answer p {
    padding: 0 20px 20px;
    margin: 0;
    color: var(--card-primary, #2C3E50);
    opacity: 0.8;
    line-height: 1.6;
    text-align: left;
}

.faq-component .faq-item.active .faq-answer {
    max-height: 300px;
}

/* ✅ CORRECTION CRITIQUE: Assurer que le titre s'affiche TOUJOURS */
.card-title {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    white-space: nowrap;
    overflow: visible;
    min-height: auto;
}

/* ✅ RESPONSIVITÉ FAQ AMÉLIORÉE */
@media (max-width: 768px) {
    .faq-section {
        margin: 40px auto;
        padding: 0 15px;
    }
    
    .faq-component .faq-header h2 {
        font-size: 1.5rem;
    }
    
    .faq-component .faq-question {
        padding: 15px;
    }
    
    .faq-component .faq-question h3 {
        font-size: 1rem;
    }
    
    .faq-component .faq-answer p {
        padding: 0 15px 15px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .faq-section {
        margin: 30px auto;
        padding: 0 10px;
    }
    
    .faq-component .faq-header h2 {
        font-size: 1.3rem;
    }
    
    .faq-component .faq-header p {
        font-size: 1rem;
    }
    
    .faq-component .faq-question {
        padding: 12px;
    }
    
    .faq-component .faq-question h3 {
        font-size: 0.95rem;
    }
    
    .faq-component .faq-answer p {
        padding: 0 12px 12px;
        font-size: 0.85rem;
        line-height: 1.5;
    }
    
    .faq-component .faq-item.active .faq-answer {
        max-height: 250px;
    }
}