/* Variables CSS */
:root {
    --primary-color: #D2B48C;
    --secondary-color: #8B4513;
    --text-dark: #2c3e50;
    --text-light: #666;
    --white: #ffffff;
    --beige: #F5F2E8;
    --shadow: rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
}

/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    padding-top: 90px; /* Compenser le header fixe */
}

/* Section hero avec image de fond */
.hero-section {
    position: relative;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 0;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
    url('https://images.unsplash.com/photo-1578985545062-69928b1d9587?ixlib=rb-4.0.3&auto=format&fit=crop&w=1989&q=80');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--white);
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    margin: 0;
}

/* Section informations */
.info-section {
    background-color: var(--beige);
    padding: 40px 20px;
    border-top: 1px solid rgba(210, 180, 140, 0.3);
}

.info-container {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

.info-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-dark);
    font-weight: 400;
}

.info-text strong {
    font-weight: 600;
    color: var(--secondary-color);
}

/* Container principal */
.patisserie-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
    background: var(--white);
}

.patisserie-container:not(:last-of-type) {
    border-bottom: 1px solid rgba(210, 180, 140, 0.2);
    padding-bottom: 80px;
}

/* Titre de section */
.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 50px;
    font-weight: 600;
    position: relative;
}

.section-title:after {
    content: '';
    display: block;
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    margin: 20px auto 0;
    border-radius: 2px;
}

/* Grille de produits */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 0;
}

/* Carte produit - DESIGN VERTICAL AVEC GRANDE IMAGE */
.product-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px var(--shadow);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    border: 1px solid rgba(210, 180, 140, 0.2);
    display: flex;
    flex-direction: column; /* Layout vertical */
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

/* Image du produit - TRÈS GRANDE */
.product-image-container {
    position: relative;
    padding-top: 75%; /* Ratio 4:3 pour une image bien proportionnée */
    overflow: hidden;
    background: #f8f9fa;
}

.product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-card:hover .product-image {
    transform: scale(1.08);
}

/* Contenu de la carte - EN DESSOUS DE L'IMAGE */
.product-content {
    padding: 25px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.product-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    color: var(--text-dark);
    margin: 0;
    font-weight: 600;
    line-height: 1.3;
}

.product-price {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    color: var(--secondary-color);
    font-weight: 700;
    margin: 0;
}

/* Message aucun produit */
.no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: var(--text-light);
    font-size: 1.2rem;
}

/* Modal - AVEC HEADER ET FOOTER VISIBLES - PLUS LARGE */
.modal {
    display: none;
    position: fixed;
    z-index: 9999; /* Inférieur au header pour rester en dessous */
    left: 0;
    top: 90px; /* Commence après le header */
    width: 100%;
    height: calc(100vh - 90px); /* Hauteur moins le header */
    background-color: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
}

.modal-content {
    position: relative;
    background-color: var(--white);
    margin: 20px auto; /* Marges réduites */
    border-radius: var(--border-radius);
    width: 98%; /* Plus large */
    max-width: 1600px; /* Largeur max augmentée */
    min-height: calc(100vh - 200px); /* Laisse de l'espace pour le footer */
    overflow-y: auto;
    animation: slideIn 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.close {
    position: absolute;
    top: 20px;
    right: 25px;
    color: var(--text-dark);
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.close:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: scale(1.1);
}

.modal-body {
    display: flex;
    flex-direction: row;
    min-height: 600px;
    padding: 50px; /* Plus de padding */
    gap: 80px; /* Plus d'espace entre image et contenu */
}

/* Image dans la modal - À GAUCHE */
.modal-image {
    flex: 1.2; /* Légèrement plus d'espace pour l'image */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    background: #f8f9fa;
}

.modal-image img {
    width: 100%;
    height: auto;
    max-height: 600px; /* Hauteur max augmentée */
    object-fit: cover;
    border-radius: var(--border-radius);
}

/* Informations dans la modal - À DROITE */
.modal-info {
    flex: 1.3; /* Plus d'espace pour le contenu */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 20px 0;
    text-align: left;
}

.modal-info h2 {
    font-family: 'Playfair Display', serif;
    font-size: 3.2rem; /* Titre plus grand */
    color: var(--text-dark);
    margin-bottom: 35px;
    font-weight: 700;
    line-height: 1.2;
}

/* Onglets de la modal */
.modal-tabs {
    display: flex;
    margin-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
}

.tab-btn {
    background: none;
    border: none;
    padding: 18px 30px; /* Plus de padding */
    font-size: 1.2rem; /* Plus grand */
    font-weight: 500;
    color: var(--text-light);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    font-family: 'Roboto', sans-serif;
}

.tab-btn:hover {
    color: var(--secondary-color);
    background: rgba(210, 180, 140, 0.1);
}

.tab-btn.active {
    color: var(--secondary-color);
    border-bottom-color: var(--primary-color);
    background: rgba(210, 180, 140, 0.15);
}

/* Contenu des onglets */
.tab-content {
    margin-bottom: 35px;
}

.tab-pane {
    display: none;
    animation: fadeInContent 0.3s ease;
}

.tab-pane.active {
    display: block;
}

.tab-pane p {
    color: var(--text-light);
    font-size: 1.3rem; /* Plus grand */
    line-height: 1.5; /* Réduction de l'interligne pour les sauts de ligne */
    text-align: justify;
    margin: 0;
    min-height: 120px;
    /* Gestion optimisée des sauts de ligne */
    white-space: normal;
    word-wrap: break-word;
}

/* Styles spécifiques pour les <br> générés par JavaScript */
.tab-pane p br {
    line-height: 0.8; /* Réduction de l'espace des <br> */
}

/* Section Parts dans la modal - NOUVEAUX STYLES POUR LES BOUTONS */
.parts-section-modal {
    margin-bottom: 35px;
}

.part-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.part-button {
    background: var(--white);
    border: 2px solid var(--primary-color);
    color: var(--secondary-color);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 600;
    font-family: 'Playfair Display', serif;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: capitalize;
    min-width: 110px;
    position: relative;
    overflow: hidden;
}

.part-button:hover {
    background: rgba(210, 180, 140, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(210, 180, 140, 0.3);
}

.part-button.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    border-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 69, 19, 0.4);
}

.part-button.active:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
}

/* Animation pour les boutons de parts */
.part-button::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.5s;
}

.part-button:hover::before {
    left: 100%;
}

@keyframes fadeInContent {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-price {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem; /* Plus grand */
    color: var(--secondary-color);
    font-weight: 700;
    margin-bottom: 40px !important;
    text-align: left !important;
    transition: all 0.3s ease;
}

.btn-commande {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    text-decoration: none;
    padding: 20px 50px; /* Plus gros bouton */
    border-radius: 50px;
    font-size: 1.3rem; /* Plus grand */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(139, 69, 19, 0.3);
    text-align: center;
    align-self: flex-start;
    margin-top: 20px;
}

.btn-commande:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(139, 69, 19, 0.4);
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive */
@media (max-width: 1400px) {
    .modal-content {
        width: 96%;
        max-width: 1400px;
    }

    .modal-body {
        padding: 40px;
        gap: 60px;
    }
}

@media (max-width: 1024px) {
    .modal-content {
        width: 95%;
        max-width: 1200px;
    }

    .modal-body {
        flex-direction: column;
        padding: 30px;
        gap: 30px;
    }

    .modal-image {
        flex: none;
        max-height: 400px;
    }

    .modal-info {
        flex: none;
        padding: 10px 0;
        text-align: center;
    }

    .modal-info h2 {
        font-size: 2.6rem;
    }

    .btn-commande {
        align-self: center;
    }

    .tab-btn {
        padding: 15px 25px;
        font-size: 1.1rem;
    }

    .parts-section-modal {
        text-align: center;
    }

    .part-buttons {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-section {
        height: 300px;
    }

    .info-section {
        padding: 30px 15px;
    }

    .info-text {
        font-size: 1rem;
    }

    .patisserie-container {
        padding: 40px 15px;
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 40px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }

    .modal {
        top: 70px; /* Header mobile plus petit */
        height: calc(100vh - 70px);
    }

    .modal-content {
        margin: 10px auto;
        width: 98%;
        min-height: calc(100vh - 100px);
    }

    .close {
        top: 15px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 24px;
    }

    .modal-body {
        padding: 20px;
        gap: 25px;
        min-height: auto;
    }

    .modal-info h2 {
        font-size: 2.2rem;
    }

    .tab-pane p {
        font-size: 1.1rem;
        min-height: 80px;
    }

    .modal-price {
        font-size: 2rem;
    }

    .btn-commande {
        padding: 15px 35px;
        font-size: 1.1rem;
    }

    .part-button {
        padding: 12px 20px;
        font-size: 1.1rem;
        min-width: 100px;
    }

    .part-buttons {
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .section-title {
        font-size: 1.8rem;
        margin-bottom: 30px;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .product-content {
        padding: 20px 15px;
    }

    .product-name {
        font-size: 1.2rem;
    }

    .product-price {
        font-size: 1.4rem;
    }

    .modal-content {
        margin: 5px auto;
        width: 99%;
    }

    .modal-body {
        padding: 15px;
        gap: 20px;
    }

    .modal-info h2 {
        font-size: 1.9rem;
        margin-bottom: 25px;
    }

    .tab-btn {
        padding: 12px 18px;
        font-size: 1rem;
    }

    .tab-pane p {
        font-size: 1rem;
        min-height: 60px;
    }

    .btn-commande {
        padding: 12px 25px;
        font-size: 1rem;
    }

    .part-button {
        padding: 10px 15px;
        font-size: 1rem;
        min-width: 80px;
        flex: 1;
    }

    .part-buttons {
        gap: 8px;
    }
}

/* Animation au scroll pour les cartes */
.product-card {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease forwards;
}

.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }
.product-card:nth-child(5) { animation-delay: 0.5s; }
.product-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ajustements pour la modal avec header/footer visibles */
body.modal-open {
    overflow: hidden;
}

.modal.show {
    display: block;
}

/* Assurer que le header reste au-dessus */
.main-header {
    z-index: 10000 !important;
}