:root {
    --costume-marie: #5c4131; 
    --halo-lumineux: #835e47; 
    
    --moka: #5c4738;
    --caramel: #a8846f;
    --nude: #dfc5b5;
    --ivoire-gris: #eadecc;
    --ivoire-blanc: #fdfbf7;
    --dark: #3a322d;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    margin: 0; padding: 0;
    width: 100%;
    height: 100vh; /* Bloque la hauteur sur la taille exacte de l'écran du téléphone */
    overflow: hidden; /* Interdit au corps du site de scroller */
}

body {
    font-family: 'Garamond', 'Georgia', 'Times New Roman', serif;
    background: radial-gradient(circle at center, var(--halo-lumineux) 0%, var(--costume-marie) 100%) !important;
    background-attachment: fixed !important;
    color: var(--ivoire-blanc);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.navigation-bar { padding: 15px; max-width: 600px; margin: 0 auto; text-align: left; width: 100%; }

.btn-back {
    display: inline-block; padding: 10px 20px; border: 2px solid var(--caramel);
    color: var(--ivoire-blanc); background: transparent; border-radius: 50px;
    font-family: sans-serif; font-size: 0.7rem; font-weight: 600; text-decoration: none; text-transform: uppercase;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.intro-header { padding: 10px 15px; text-align: center; }

.foliage-frame-mini {
    max-width: 500px; margin: 0 auto; padding: 15px;
    border: 1px solid var(--nude); border-radius: 15px; 
    background: rgba(253, 251, 247, 0.95);
    box-shadow: 0 10px 25px rgba(58, 41, 49, 0.25);
}
.page-title { font-size: 1.6rem; color: var(--moka); font-style: italic; font-weight: 400; }
.page-instruction { font-family: sans-serif; font-size: 0.8rem; color: #6e6560; margin-top: 4px; }

/* --- 📱 GRILLE COMPACTE ULTRA-DENSE : 4 IMAGES PAR LIGNE SUR MOBILE --- */
/* 🛑 BLOCAGE DE L'ÉCRAN GLOBAL (EFFET APP NATIF) */


/* 🔄 RENDRE UNIQUEMENT LA ZONE DES CADEAUX CYCLIQUE ET FLUIDE */
.gifts-container { 
    padding: 10px; 
    max-width: 600px; 
    margin: 0 auto; 
    width: 100%;
    
    /* Paramètres magiques pour activer le scroll interne sans barre visible */
    height: calc(100vh - 130px); /* S'adapte à l'espace restant sous ton en-tête */
    overflow-y: auto; /* Autorise le défilement vertical uniquement ici */
    -webkit-overflow-scrolling: touch; /* Force la fluidité sur iPhone/Safari */
}

/* 🔍 CACHE DÉFINITIVEMENT LA BARRE DE SCROLL SUR TOUS LES NAVIGATEURS */
.gifts-container::-webkit-scrollbar {
    display: none; /* Cache la barre sur Chrome, Safari et téléphones Android */
}
.gifts-container {
    -ms-overflow-style: none;  /* Cache la barre sur Internet Explorer / Edge */
    scrollbar-width: none;  /* Cache la barre sur Firefox */
}


.gifts-compact-grid {
    display: grid; 
    grid-template-columns: repeat(4, 1fr); /* 4 rectangles par ligne sur mobile, alignés comme avant */
    gap: 8px; 
}

/* Design des blocs rectangulaires épurés sans marge inutile */
.gift-card {
    background: rgba(255, 255, 255, 0.96); 
    border: 1px solid var(--nude);
    border-radius: 6px; /* Coins très légèrement adoucis pour faire habillé */
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); 
    cursor: pointer;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Zone image respectant le format vertical de l'IA (aspect-ratio 3/4) */
.gift-card-image-box {
    width: 100%;
    aspect-ratio: 3 / 4; 
    overflow: hidden;
    background: #fff;
}
.gift-card-image-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Fine étiquette de disponibilité superposée tout en bas */
.gift-card-badge {
    position: absolute;
    bottom: 0; left: 0; width: 100%;
    background: rgba(253, 251, 247, 0.95);
    color: var(--dark);
    font-family: sans-serif;
    font-size: 0.6rem; /* Plus petit pour rentrer proprement sur 4 colonnes mobile */
    font-weight: 700;
    text-align: center;
    padding: 4px 0;
    border-top: 1px solid rgba(168, 132, 111, 0.15);
}

.gift-card-taken { opacity: 0.55; }
.gift-card-taken .gift-card-badge {
    color: #c62828 !important;
    background: rgba(255, 235, 235, 0.96);
}

/* Adaptation Écrans PC (Passe en 5 colonnes pour garder ton harmonie d'origine) */
@media (min-width: 768px) {
    .gifts-compact-grid { grid-template-columns: repeat(5, 1fr); gap: 15px; }
    .gift-card-badge { font-size: 0.75rem; padding: 6px 0; }
    .gift-card { border-radius: 12px; }
}

/* --- MODAL POP-UP CORRIGÉ : PLUS DE CERCLE QUI COUPE L'IMAGE --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(58, 41, 33, 0.65); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    z-index: 999; display: none; justify-content: center; align-items: center; padding: 15px;
}
.modal-window {
    background: rgba(253, 251, 247, 0.98); border-radius: 20px; width: 100%; max-width: 380px;
    padding: 20px; box-shadow: 0 15px 40px rgba(0,0,0,0.3);
    position: relative; text-align: center; border: 1px solid var(--nude);
    color: var(--dark);
}
.close-modal { position: absolute; top: 12px; right: 12px; background: none; border: none; font-size: 1.3rem; color: var(--caramel); cursor: pointer; }

/* 🛑 RECTIFICATION DU CARRÉ DE L'IMAGE DANS LE ZOOM (ZÉRO ROND) */
.modal-gift-icon { 
    width: 140px; 
    height: 180px; /* Format rectangulaire vertical comme l'image IA */
    margin: 0 auto 10px; 
    overflow: hidden;
    border-radius: 8px; /* Coins légèrement adoucis, mais reste un rectangle parfait */
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.modal-gift-icon img { 
    width: 100% !important; 
    height: 100% !important; 
    object-fit: cover !important; 
    border-radius: 0 !important; /* Supprime définitivement la découpe en rond */
    border: 1px solid var(--nude);
}

.modal-gift-title { font-size: 1.4rem; color: var(--moka); font-style: italic; font-weight: 400; margin-top: 5px; }
.modal-status-label { font-family: sans-serif; font-size: 0.8rem; color: var(--caramel); margin-bottom: 12px; }

.modal-form-area { text-align: left; margin-top: 5px; }
.modal-group label { display: block; font-family: sans-serif; font-size: 0.7rem; font-weight: 600; color: var(--moka); letter-spacing: 0.5px; margin-bottom: 4px; }
.modal-field {
    width: 100%; padding: 10px 14px; border: 1px solid var(--nude); border-radius: 50px;
    font-family: sans-serif; font-size: 0.85rem; margin-bottom: 10px; outline: none; background-color: var(--ivoire-blanc);
    color: var(--dark);
}
.profile-alert { color: #c87460; font-size: 0.75rem; font-weight: 600; margin-bottom: 8px; font-family: sans-serif; }

.btn-modal-action {
    display: block; width: 100%; padding: 12px; background-color: var(--moka); color: white;
    border: none; border-radius: 50px; font-family: sans-serif; font-size: 0.8rem; font-weight: 600;
    text-transform: uppercase; cursor: pointer; box-shadow: 0 4px 15px rgba(92, 71, 56, 0.25);
}

footer { padding: 20px; text-align: center; font-size: 0.8rem; color: var(--caramel); font-weight: 500; background-color: transparent; }
