/* ============================================================
   1. IMPORTATIONS & POLICES
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600&family=Montserrat:wght@300;400;500;600;700&display=swap');

/* ============================================================
   2. VARIABLES (DESIGN SYSTEM BEIGE MONOCHROME)
   ============================================================ */
:root {
    /* Fond et Surfaces */
    --bg-main: #FFFFFF;           /* Fond blanc pur pour les points */
    --bg-page: #FDFBF9;           /* Teinte de secours */
    --dot-color: #E5DED1;         /* Couleur des pointillés (Beige doux) */
    
    /* Couleurs de texte */
    --text-main: #5C554E;         /* Brun-gris profond */
    --text-muted: #8E847A;        /* Beige foncé pour les détails */
    --white: #FFFFFF;

    /* Palette Beige Harmonisée */
    --beige-light: #F4F1ED;       /* Fond de badge */
    --beige-medium: #E5DED1;      /* Bordures */
    --beige-dark: #BCAF9C;        /* Éléments actifs */

    /* Boutons & États */
    --btn-beige-soft: #D9D2C5;    /* Bouton secondaire */
    --btn-beige-bold: #BCAF9C;    /* Bouton principal */
    --text-cancel: #A67C7C;       /* Rose terreux (Annulation) */
    --bg-reserved: #F2F2F2;       /* Fond gris beige (Réservé) */
}

/* ============================================================
   3. RESET & STRUCTURE GÉNÉRALE
   ============================================================ */
* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    padding: 0;
    color: var(--text-main);
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;

    /* --- EFFET PAPIER POINTILLÉ (AGENDA) --- */
    background-color: var(--bg-main);
    background-image: radial-gradient(var(--dot-color) 1px, transparent 1px);
    background-size: 25px 25px; /* Écartement des points */
    background-attachment: fixed; /* Les points restent fixes au scroll */
}

/* ============================================================
   4. SECTION HERO (L'EN-TÊTE)
   ============================================================ */
.hero {
    position: relative;
    height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    overflow: hidden;
    background-image: 
        linear-gradient(135deg, rgba(92, 85, 78, 0.7) 0%, rgba(188, 175, 156, 0.4) 100%), 
        url('https://cache.magicmaman.com/data/photo/w1000_ci/4w/foetus-echographie.webp'); 
    background-size: cover;
    background-position: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.hero h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 3.5rem;
    font-weight: 500;
    margin: 0 0 15px 0;
    line-height: 1.1;
    max-width: 900px;
    text-shadow: 0 2px 15px rgba(0,0,0,0.3);
}

.hero p {
    font-size: 1.2rem;
    font-weight: 400;
    margin: 0;
    letter-spacing: 3px;
    text-transform: uppercase;
    opacity: 0.95;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

/* ============================================================
   5. CONTENEUR & LAYOUT
   ============================================================ */
.container {
    max-width: 1200px;
    margin: -50px auto 60px auto; /* Remonte sur le hero */
    padding: 0 20px;
    position: relative;
    z-index: 20;
}

/* ============================================================
   6. BARRE DE TRI (SORT CONTAINER)
   ============================================================ */
.sort-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.sort-label {
    font-size: 0.85rem;
    color: var(--white);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-shadow: 0 2px 5px rgba(0,0,0,0.4);
}

.sort-buttons {
    display: flex;
    background: rgba(255, 255, 255, 0.98);
    padding: 6px;
    border-radius: 50px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    border: 1px solid var(--beige-medium);
}

.sort-buttons a {
    text-decoration: none;
    color: var(--text-muted);
    padding: 10px 25px;
    font-size: 0.9rem;
    border-radius: 50px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-weight: 600;
}

.sort-buttons a.active {
    background: var(--beige-dark);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(188, 175, 156, 0.4);
}

.sort-buttons a:hover:not(.active) {
    background: var(--beige-light);
    color: var(--text-main);
}

/* ============================================================
   7. GRILLE DE PRODUITS (RESPONSIVE)
   ============================================================ */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

/* ============================================================
   8. CARTES PRODUITS (THE CARD)
   ============================================================ */
.card {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column; /* Pour l'alignement des boutons en bas */
    transition: all 0.4s ease;
    border: 1px solid var(--beige-medium);
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    height: 100%;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(92, 85, 78, 0.1);
    border-color: var(--beige-dark);
}

/* Zone Image */
.card-img {
    height: 250px;
    background: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 25px;
    position: relative;
}

.card-img img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.card:hover .card-img img {
    transform: scale(1.08);
}

/* Corps de la Carte */
.card-body {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Remplit l'espace pour pousser les boutons */
    text-align: center;
}

/* Titre Aligné */
.card-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: var(--text-main);
    line-height: 1.2;
    min-height: 2.8em; /* Force 2 lignes pour l'alignement */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Description (Masquée sur petit mobile, flexible ici) */
.card-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 25px;
    flex-grow: 1; /* Pousse les éléments suivants au fond */
    font-weight: 400;
}

/* Prix Indicatif */
.card-price {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 20px;
    background: var(--beige-light);
    padding: 12px;
    border-radius: 12px;
    color: var(--text-main);
    border: 1px dashed var(--beige-medium);
}

/* ============================================================
   9. BOUTONS (DESIGN MONOCHROME)
   ============================================================ */
.btn {
    display: block;
    width: 100%;
    padding: 14px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    text-align: center;
    transition: 0.3s all ease;
    font-family: 'Montserrat', sans-serif;
}

/* Voir l'article (Secondaire) */
.btn-teal {
    background: var(--btn-beige-soft);
    color: var(--text-main);
    margin: 0 auto 20px auto;
    width: fit-content;
    padding: 10px 25px;
    border: 1px solid var(--beige-medium);
}

/* Réserver (Principal) */
.btn-green {
    background: var(--btn-beige-bold);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(188, 175, 156, 0.3);
}

.btn:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

/* ============================================================
   10. ÉTATS DE RÉSERVATION & FORMULAIRES
   ============================================================ */
.btn-reserved-state {
    background: var(--bg-reserved);
    color: var(--text-muted);
    padding: 15px;
    border-radius: 12px;
    font-size: 0.9rem;
    margin-bottom: 12px;
    text-align: center;
    font-weight: 600;
    border: 1px solid var(--beige-medium);
}

.btn-cancel-text {
    background: transparent;
    color: var(--text-cancel);
    border: none;
    font-size: 0.8rem;
    text-decoration: underline;
    cursor: pointer;
    width: 100%;
    padding: 8px;
    font-family: inherit;
    transition: 0.3s;
}

.btn-cancel-text:hover {
    color: #8c6666;
}

.reserve-form {
    margin-top: auto;
}

.reserve-form input {
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid var(--beige-medium);
    border-radius: 10px;
    background: var(--bg-main);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    outline: none;
    transition: 0.3s;
}

.reserve-form input:focus {
    border-color: var(--beige-dark);
    box-shadow: 0 0 0 3px rgba(188, 175, 156, 0.1);
}

/* --- PERSONNALISATION DE LA CHECKBOX --- */
.checkbox-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 0.8rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
    position: relative;
}

/* On cache la vraie checkbox moche */
.checkbox-group input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

/* On crée notre propre carré de check */
.checkbox-custom {
    height: 18px;
    width: 18px;
    background-color: var(--white);
    border: 2px solid var(--beige-medium);
    border-radius: 4px; /* Un peu arrondi pour la douceur */
    position: relative;
    transition: all 0.3s ease;
}

/* Style quand c'est coché */
.checkbox-group input:checked ~ .checkbox-custom {
    background-color: var(--beige-dark);
    border-color: var(--beige-dark);
}

/* Le petit "V" blanc à l'intérieur */
.checkbox-custom:after {
    content: "";
    position: absolute;
    display: none;
    left: 5px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* On affiche le "V" quand c'est coché */
.checkbox-group input:checked ~ .checkbox-custom:after {
    display: block;
}

/* Petit effet au survol */
.checkbox-group:hover .checkbox-custom {
    border-color: var(--beige-dark);
}

@media (max-width: 600px) {
    body {
        background-size: 20px 20px;
    }

    .container {
        padding: 0 10px;
        margin-top: -30px;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        /* Aligne toutes les cartes de la même ligne sur la même hauteur */
        align-items: stretch; 
    }

    .card {
        border-radius: 15px;
        display: flex;
        flex-direction: column;
        height: 100%; /* Force la carte à prendre toute la hauteur disponible */
    }

    .card-img {
        height: 120px; /* Un peu plus petit pour laisser de la place au texte */
        padding: 10px;
    }

    .card-body {
        padding: 12px;
        display: flex;
        flex-direction: column;
        flex-grow: 1; /* Remplit l'espace */
    }

    .card-title {
        font-size: 0.85rem;
        /* FIXE : Hauteur pour exactement 3 lignes de texte maximum */
        min-height: 3.6em; 
        max-height: 3.6em;
        overflow: hidden;
        margin-bottom: 8px;
        display: flex;
        align-items: center; /* Centre verticalement le titre court */
        justify-content: center;
    }

    /* On s'assure que le formulaire de réservation est bien tout en bas */
    .reserve-form {
        margin-top: auto; 
    }

    .card-desc {
        display: none; /* Toujours masqué sur mobile pour gagner de la place */
    }

    .card-price {
        font-size: 0.7rem;
        padding: 6px;
        margin-bottom: 10px;
        min-height: 45px; /* Aligne les badges de prix entre eux */
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .btn {
        padding: 10px 5px;
        font-size: 0.75rem;
        margin-top: 5px;
    }

    .btn-teal {
        padding: 6px 10px;
        font-size: 0.65rem;
        margin-bottom: 10px;
        width: 100%; /* Passe en pleine largeur pour éviter les décalages */
    }

    .checkbox-group {
        font-size: 0.7rem;
        margin-bottom: 8px;
    }

    .reserve-form input {
        padding: 8px;
        font-size: 0.75rem;
        margin-bottom: 8px;
    }
}

/* ============================================================
   12. ESPACE ADMINISTRATION (PANEL)
   ============================================================ */
.admin-header {
    background: var(--white);
    padding: 25px;
    text-align: center;
    border-bottom: 1px solid var(--beige-medium);
    margin-bottom: 40px;
}

.admin-form {
    background: var(--white);
    padding: 40px;
    border-radius: 25px;
    margin-bottom: 50px;
    border: 1px solid var(--beige-medium);
    box-shadow: 0 10px 40px rgba(0,0,0,0.03);
}

.admin-form label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: var(--text-main);
}

.admin-form input, 
.admin-form textarea {
    width: 100%;
    padding: 14px;
    margin-bottom: 25px;
    border: 1px solid var(--beige-medium);
    border-radius: 12px;
    font-family: 'Montserrat', sans-serif;
    background: var(--bg-page);
}

/* Tableau Admin */
.table-container {
    overflow-x: auto;
    background: var(--white);
    border-radius: 20px;
    border: 1px solid var(--beige-medium);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: var(--beige-light);
    padding: 20px;
    text-align: left;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

td {
    padding: 20px;
    border-bottom: 1px solid var(--beige-light);
    font-size: 0.9rem;
}

.admin-thumb {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid var(--beige-medium);
}

/* ============================================================
   13. SWEETALERT CUSTOM STYLES
   ============================================================ */
.swal2-popup {
    font-family: 'Montserrat', sans-serif !important;
    border-radius: 25px !important;
    padding: 2em !important;
}

.swal2-title {
    font-family: 'Cormorant Garamond', serif !important;
    font-size: 2rem !important;
    color: var(--text-main) !important;
}

.swal2-confirm {
    border-radius: 50px !important;
    padding: 12px 35px !important;
    font-weight: 600 !important;
}

/* --- PERSONNALISATION SWEETALERT BEIGE --- */
.swal-custom-popup {
    background-color: #FFFFFF !important;
    background-image: radial-gradient(#E5DED1 1px, transparent 1px) !important; /* On garde les petits points agenda ! */
    background-size: 20px 20px !important;
    border-radius: 25px !important;
    border: 1px solid var(--beige-medium) !important;
}

.swal-custom-title {
    font-family: 'Cormorant Garamond', serif !important;
    color: var(--text-main) !important;
    font-size: 2rem !important;
}

.swal-custom-content {
    font-family: 'Montserrat', sans-serif !important;
    color: var(--text-muted) !important;
    font-size: 0.95rem !important;
}

/* Le bouton Confirmer (Beige foncé) */
.swal-confirm-btn {
    background-color: var(--beige-dark) !important;
    color: white !important;
    border-radius: 50px !important;
    padding: 12px 30px !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 15px rgba(188, 175, 156, 0.3) !important;
}

/* Le bouton Annuler (Beige clair) */
.swal-cancel-btn {
    background-color: var(--beige-light) !important;
    color: var(--text-main) !important;
    border-radius: 50px !important;
    padding: 12px 30px !important;
}

/* ============================================================
   14. FIN DU FICHIER (TOTAL LIGNES ESTIMÉES)
   ============================================================ */