/* Réinitialisation de base et styles globaux */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fdfaf6; /* Couleur de fond douce */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: #8a6e5a; /* Couleur terreuse pour les liens */
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1, h2 {
    font-family: 'Playfair Display', serif;
    color: #5a3e2b; /* Brun foncé pour les titres */
    margin-bottom: 1rem;
    text-align: center;
}

/* Header */
header {
    background-color: #fff;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 50px;
    margin-right: 10px;
}

.logo h1 {
    margin-bottom: 0;
    font-size: 1.8rem;
}

.logo-link, .logo-link:hover {
    text-decoration: none; /* Remove underline from logo link */
    color: inherit; /* Inherit color from parent h1 */
}

nav ul {
    list-style: none;
    display: flex;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    font-weight: 400;
    transition: color 0.3s ease;
}

nav ul li a:hover {
    color: #a8907d;
    text-decoration: none;
}

/* Hero Section */
.hero {
    position: relative;
    height: 60vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    overflow: hidden; /* Pour contenir l'image de fond */
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Couvre toute la section */
    z-index: -1; /* Derrière le contenu */
    filter: brightness(0.6); /* Assombrir pour la lisibilité */
}

.hero-content {
    z-index: 1;
    background: rgba(0, 0, 0, 0.3); /* Fond semi-transparent pour le texte */
    padding: 2rem;
    border-radius: 8px;
}

.hero h2 {
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
    color: #fff;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    font-weight: 300;
}

.cta-button {
    display: inline-block;
    background-color: #8a6e5a;
    color: white;
    padding: 12px 25px;
    border-radius: 5px;
    font-weight: 400;
    transition: background-color 0.3s ease;
}

.cta-button:hover {
    background-color: #5a3e2b;
    text-decoration: none;
}

.cta-button.secondary {
    background-color: #f0eade; /* Lighter background */
    color: #5a3e2b; /* Darker text */
    border: 1px solid #a8907d;
}

.cta-button.secondary:hover {
    background-color: #e6dace;
    border-color: #8a6e5a;
}

/* Index Page Specific Styles */
.welcome-section {
    padding: 2rem 0;
    text-align: center;
}

.welcome-section h2 {
    margin-bottom: 1.5rem;
}

.welcome-section p {
    max-width: 800px;
    margin: 0 auto 2rem auto;
    line-height: 1.7;
    color: #555;
}

.featured-products-preview {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

.featured-products-preview h3 {
    font-family: 'Playfair Display', serif;
    color: #5a3e2b;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.preview-grid {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.preview-grid img {
    width: 150px; /* Adjust size as needed */
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.preview-grid img:hover {
    transform: scale(1.05);
}

/* Main Content & Product Grid */
main {
    padding: 3rem 0;
}

main h2 {
    margin-bottom: 2rem;
    font-size: 2.2rem;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Responsive grid */
    gap: 2rem;
}

.product-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.12);
}

.product-card img {
    width: 100%;
    height: 250px; /* Hauteur fixe pour les images */
    object-fit: cover; /* S'assure que l'image couvre la zone */
    display: block;
}

.product-info {
    padding: 1.5rem;
    flex-grow: 1; /* Permet au contenu de pousser le bouton vers le bas */
    display: flex;
    flex-direction: column;
}

.product-info h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    color: #5a3e2b;
    margin-bottom: 0.5rem;
    text-align: left;
}

.product-description {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 1rem;
    flex-grow: 1; /* Occupe l'espace disponible */
}

.product-price {
    font-size: 1.2rem;
    font-weight: bold;
    color: #8a6e5a;
    margin-bottom: 1rem;
    text-align: right;
}

.add-to-cart-button {
    display: block;
    width: 100%;
    background-color: #a8907d;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    text-align: center;
    transition: background-color 0.3s ease;
}

.add-to-cart-button:hover {
    background-color: #8a6e5a;
}

/* Contact Page Styles */
#contact-page h2 {
    margin-bottom: 2.5rem; /* More space for contact page title */
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two columns layout */
    gap: 3rem;
    align-items: start; /* Align items to the top */
}

.contact-info h3, .contact-form h3 {
    font-family: 'Playfair Display', serif;
    color: #5a3e2b;
    margin-bottom: 1.5rem;
    font-size: 1.6rem;
    text-align: left; /* Align subsection titles left */
}

.contact-info p {
    margin-bottom: 1rem;
    line-height: 1.7;
    color: #555;
}

.contact-info ul {
    list-style: none;
    padding: 0;
    margin-bottom: 1rem;
}

.contact-info ul li {
    margin-bottom: 0.8rem;
    color: #555;
}

.contact-info ul li strong {
    color: #333;
    margin-right: 5px;
}

/* Contact Form Styles */
.contact-form .form-group {
    margin-bottom: 1.5rem;
}

.contact-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #555;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.contact-form input[type="text"]:focus,
.contact-form input[type="email"]:focus,
.contact-form textarea:focus {
    border-color: #8a6e5a;
    outline: none;
}

.contact-form textarea {
    resize: vertical; /* Allow vertical resizing */
}

.contact-form .cta-button {
    /* Uses existing button styles, ensure it fits */
    width: auto; /* Adjust if needed */
    cursor: pointer;
}

.form-feedback {
    margin-top: 1rem;
    font-weight: bold;
}

/* Header Cart Indicator */
.cart-link {
    position: relative;
    padding-right: 10px; /* Space for the indicator */
}

.cart-indicator {
    position: absolute;
    top: -8px; /* Adjust positioning */
    right: -5px; /* Adjust positioning */
    background-color: #e74c3c; /* Red color for visibility */
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.75rem;
    line-height: 1;
    font-weight: bold;
    min-width: 18px; /* Ensure circle shape for single digit */
    text-align: center;
    display: none; /* Hidden by default, shown by JS */
}

/* Cart Page Styles */
#panier-page main {
    padding-bottom: 3rem;
}

#panier-page h2 {
    margin-bottom: 2rem;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}

.cart-table th, .cart-table td {
    border-bottom: 1px solid #eee;
    padding: 1rem 0.5rem;
    text-align: left;
    vertical-align: middle;
}

.cart-table th {
    font-family: 'Playfair Display', serif;
    color: #5a3e2b;
    font-weight: normal;
    padding-bottom: 0.8rem;
}

.cart-table td:nth-child(1) { width: 80px; } /* Image column */
.cart-table td:nth-child(2) { width: auto; } /* Name column */
.cart-table td:nth-child(3) { width: 100px; text-align: right; } /* Price */
.cart-table td:nth-child(4) { width: 100px; text-align: center; } /* Quantity */
.cart-table td:nth-child(5) { width: 120px; text-align: right; font-weight: bold; } /* Total */
.cart-table td:nth-child(6) { width: 100px; text-align: center; } /* Action */


.cart-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.cart-item-quantity {
    width: 60px;
    padding: 5px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.cart-remove-button {
    background-color: #f8d7da; /* Light red */
    color: #721c24; /* Dark red text */
    border: 1px solid #f5c6cb;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.cart-remove-button:hover {
    background-color: #f5c6cb;
}

#cart-summary {
    text-align: right;
    margin-bottom: 2rem;
}

.cart-total-label {
    font-size: 1.4rem;
    font-weight: bold;
    color: #5a3e2b;
}

#cart-total {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem; /* Slightly larger for emphasis */
    color: #8a6e5a;
    margin-left: 10px;
}

#cart-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    gap: 1rem; /* Add gap between buttons */
}

#cart-actions .cta-button {
    margin: 0; /* Reset margin if any */
}

/* Footer */
footer {
    background-color: #f0eade; /* Couleur de fond légèrement différente */
    color: #5a3e2b;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

footer p {
    margin-bottom: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    nav ul {
        margin-top: 1rem;
        justify-content: center;
    }

    nav ul li {
        margin: 0 10px;
    }

    .hero {
        height: 50vh;
    }

    .hero h2 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
    }

    .product-card img {
        height: 200px;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.5rem;
    }

    .hero {
        height: 40vh;
    }

    .hero h2 {
        font-size: 1.6rem;
    }

    .hero p {
        font-size: 0.9rem;
    }

    .cta-button {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    main h2 {
        font-size: 1.8rem;
    }

    .product-grid {
        grid-template-columns: 1fr; /* Une seule colonne sur très petits écrans */
        gap: 1.5rem;
    }

    .product-info h3 {
        font-size: 1.2rem;
    }
}

@media (max-width: 992px) {
    .contact-content {
        grid-template-columns: 1fr; /* Stack columns on medium screens */
        gap: 2rem;
    }
    .contact-info, .contact-form {
        max-width: 600px; /* Limit width when stacked */
        margin: 0 auto; /* Center the stacked blocks */
    }
    .contact-info h3, .contact-form h3 {
        text-align: center; /* Center titles when stacked */
    }
}

@media (max-width: 768px) {
    .welcome-section p {
        padding: 0 10px; /* Add padding for text on smaller screens */
    }
    .preview-grid {
        gap: 1rem;
    }
    .preview-grid img {
        width: 120px;
        height: 120px;
    }
}

@media (max-width: 480px) {
    .preview-grid img {
        width: 100px;
        height: 100px;
    }

    .contact-info ul li {
        font-size: 0.95rem; /* Slightly smaller font for contact details */
    }
    .contact-form input[type="text"],
    .contact-form input[type="email"],
    .contact-form textarea {
        padding: 10px; /* Smaller padding for form inputs */
    }
}

/* Responsive Cart Page */
@media (max-width: 768px) {
     .cart-table thead {
        display: none; /* Hide table headers on small screens */
    }

    .cart-table tbody, .cart-table tr, .cart-table td {
        display: block; /* Make table elements behave like block elements */
        width: 100%;
    }

    .cart-table tr {
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
        border-bottom: 2px solid #ddd; /* Separate items clearly */
    }

     .cart-table td {
        text-align: right; /* Align text to the right */
        padding-left: 50%; /* Create space for label */
        position: relative;
        border-bottom: none; /* Remove individual cell borders */
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
     }

     .cart-table td::before {
        content: attr(data-label); /* Use data-label for pseudo-header */
        position: absolute;
        left: 10px;
        width: calc(50% - 20px); /* Adjust width */
        padding-right: 10px;
        font-weight: bold;
        text-align: left;
        white-space: nowrap;
        color: #5a3e2b; /* Match header color */
    }

    /* Add data-label attributes via JS or manually if static */
    /* Example (needs JS to be dynamic): */
     .cart-table td:nth-child(1)::before { content: "Image"; }
     .cart-table td:nth-child(2)::before { content: "Produit"; }
     .cart-table td:nth-child(3)::before { content: "Prix"; }
     .cart-table td:nth-child(4)::before { content: "Quantité"; }
     .cart-table td:nth-child(5)::before { content: "Total"; }
     .cart-table td:nth-child(6)::before { content: "Action"; }


     .cart-table td:nth-child(1) { height: 80px; } /* Give image cell some height */
     .cart-table td:nth-child(1) img { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); } /* Position image */
     .cart-table td:nth-child(1)::before { display: none;} /* Hide label for image */

     .cart-table td:nth-child(4), /* Quantity */
     .cart-table td:nth-child(6) { /* Action */
        text-align: center; /* Center quantity input and remove button */
        padding-left: 0; /* Reset padding */
     }
      .cart-table td:nth-child(4)::before,
      .cart-table td:nth-child(6)::before {
         display: block; /* Make label appear above */
         position: static;
         width: 100%;
         text-align: center;
         margin-bottom: 5px;
         padding-right: 0;
      }


    #cart-summary {
        text-align: center; /* Center total on small screens */
    }

    #cart-actions {
        flex-direction: column; /* Stack buttons vertically */
        align-items: center;
    }
    #cart-actions .cta-button {
        width: 100%;
        max-width: 300px; /* Limit button width */
        text-align: center;
    }
}