/* Variables CSS */
:root {
    --primary-color: #E63946;       /* Main Red from logo (e.g., Les Complices text) */
    --primary-color-darker: #C21807; /* Darker Red for hovers/accents */
    --secondary-color: #4A4A4A;     /* Dark Gray, previously green, used for elements like price text */
    --light-gray: #f4f4f4;
    --medium-gray: #ccc;
    --dark-gray: #333;              /* General dark gray for text, backgrounds, secondary buttons */
    --text-color: #333;
    --light-text-color: #fff;
    --body-font: 'Open Sans', sans-serif;
    --heading-font: 'Montserrat', sans-serif;
    --container-width: 1100px;
    --header-height: 70px;
    --success-color: #28a745;
    --error-color: #dc3545;
}


/* Reset et Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--body-font);
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff;
    padding-top: var(--header-height); /* Pour header fixe */
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--heading-font);
    font-weight: 700;
    margin-bottom: 0.8em;
    line-height: 1.2;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

p {
    margin-bottom: 1em;
}

a {
    text-decoration: none;
    color: var(--primary-color);
}

a:hover {
    color: var(--primary-color-darker);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Header & Navigation */
header {
    background-color: #fff;
    color: var(--text-color);
    padding: 0;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    height: var(--header-height);
}

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

.logo-link {
    display: flex;
    align-items: center;
}
.logo-img {
    height: 50px;
    margin-right: 10px;
}
.logo-text {
    font-family: var(--heading-font);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}
.logo-text:hover {
    color: var(--primary-color-darker);
}


.nav-menu {
    display: flex;
}

.nav-menu li {
    margin-left: 25px;
}

.nav-menu a {
    color: var(--text-color);
    font-weight: 600;
    padding: 5px 0;
    position: relative;
    transition: color 0.3s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-color);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

.nav-toggle {
    display: none; 
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.hamburger {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    position: relative;
    transition: background-color 0.3s ease;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    left: 0;
    transition: transform 0.3s ease, top 0.3s ease;
}

.hamburger::before { top: -8px; }
.hamburger::after { top: 8px; }

.nav-open .hamburger { background-color: transparent; }
.nav-open .hamburger::before { transform: rotate(45deg); top: 0; }
.nav-open .hamburger::after { transform: rotate(-45deg); top: 0; }


/* Hero Section */
.hero {
    /* Red (E63946 is 230, 57, 70) to dark overlay gradient over background image */
    background: linear-gradient(rgba(230, 57, 70, 0.7), rgba(0, 0, 0, 0.4)), url('../images/hero-bg.jpg') no-repeat center center/cover;
    /* If you prefer a solid gradient without an image, or as a fallback: */
    /* background: linear-gradient(45deg, var(--primary-color), var(--primary-color-darker)); */
    color: var(--light-text-color);
    height: calc(80vh - var(--header-height));
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 0.5em;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 1.5em;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Boutons */
.btn {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 5px;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
    text-align: center;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: var(--primary-color); /* Main Red */
    color: var(--light-text-color);
}

.btn-primary:hover {
    background-color: var(--primary-color-darker); /* Darker Red */
    transform: translateY(-2px);
    color: var(--light-text-color);
}

.btn-secondary {
    background-color: var(--dark-gray); /* Dark Gray for secondary actions */
    color: var(--light-text-color);
}

.btn-secondary:hover {
    background-color: #555; /* Slightly different dark gray for hover */
    transform: translateY(-2px);
    color: var(--light-text-color);
}

/* Sections générales */
section {
    padding: 60px 0;
}

.about-section {
    background-color: var(--light-gray);
}
.about-content {
    display: flex;
    gap: 30px;
    align-items: center;
}
.about-text {
    flex: 2;
}
.about-text ul {
    list-style: disc;
    padding-left: 20px;
}
.about-text ul li {
    margin-bottom: 0.5em;
}
.about-image {
    flex: 1;
    text-align: center; 
}

.services-preview {
    text-align: center;
}

.services-grid-preview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 30px;
    margin-bottom: 30px;
    text-align: left;
}

.service-item-preview {
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    text-align: center;
}
.service-item-preview .service-icon-preview {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px auto;
    background-color: var(--primary-color); /* Red icon background */
    border-radius: 50%; 
    /* Consider using actual SVG icons with fill: var(--primary-color) or similar */
}
.service-item-preview h3 {
    color: var(--primary-color); /* Red title */
    margin-bottom: 10px;
}

.contact-section {
    background-color: var(--primary-color); /* Red background */
    color: var(--light-text-color);
    text-align: center;
}
.contact-section h2 {
    color: var(--light-text-color);
}
.contact-section a {
    color: var(--light-text-color); /* White links on red background */
    font-weight: bold;
    text-decoration: underline;
}
.contact-section a:hover {
    color: #ffeeee; /* Slightly off-white/light pink for hover on red background */
}
.contact-info p { margin-bottom: 0.5em; }
.contact-note {
    font-size: 0.9em;
    margin-top: 20px;
    background-color: rgba(0,0,0,0.1); /* Semi-transparent black overlay */
    padding: 10px;
    border-radius: 5px;
    display: inline-block;
}


/* Page Titre (pour Services, Boutique) */
.page-title-section {
    background-color: var(--dark-gray); /* Dark gray background for titles */
    color: var(--light-text-color);
    padding: 40px 0;
    text-align: center;
}
.page-title-section h1 {
    margin-bottom: 0.2em;
}

/* Page Services - Liste */
.services-list-section {
    padding-top: 40px;
}
.service-card {
    display: flex;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    overflow: hidden; /* Important for image cropping if image is larger than its container */
}

.service-card-img {
    width: 300px;           /* DESKTOP: Define a fixed width for the image area */
    height: 220px;          /* DESKTOP: Define a fixed height for the image area. Adjust as needed. */
    object-fit: cover;      /* This is key:
                               - Scales the image to maintain its aspect ratio while filling the element's entire content box.
                               - If the image's aspect ratio does not match the aspect ratio of its box, then the image will be clipped to fit.
                               - This prevents distortion (squishing/stretching). */
    object-position: center; /* Optional: Defines how the image is positioned within its box if clipped. 'center' is often a good default.
                                You can use 'top', 'bottom', 'left', 'right', or percentages. */
    flex-shrink: 0;         /* Prevents the image from shrinking if the text content is long and flexbox tries to make space */
}
.service-card-content {
    padding: 25px;
    flex: 1;
    display: flex;          /* Added for better internal alignment if needed */
    flex-direction: column; /* Added for better internal alignment if needed */
    justify-content: space-between; /* Optional: pushes button to bottom if card heights vary due to content */
}

.service-card h3 {
    color: var(--primary-color); /* Red service titles */
    margin-top: 0;
}
.service-price {
    font-weight: bold;
    color: var(--secondary-color); /* Dark Gray for prices */
    margin-top: 15px;
    margin-bottom: 20px;
}


/* Footer */
footer {
    background-color: var(--dark-gray); /* Dark gray footer */
    color: var(--medium-gray);
    text-align: center;
    padding: 30px 0;
    font-size: 0.9em;
}
footer p {
    margin-bottom: 0.3em;
}

/* Cart Icon in Header */
.cart-icon-container {
    position: relative;
    margin-left: 20px; /* Adjust as needed */
}
#cart-toggle-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem; /* Adjust size of icon */
    cursor: pointer;
    padding: 5px;
    position: relative;
}
#cart-toggle-btn:hover {
    color: var(--primary-color);
}
#cart-count {
    position: absolute;
    top: -5px;
    right: -8px;
    background-color: var(--primary-color);
    color: var(--light-text-color);
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: bold;
}


/* Boutique Specific Styles */
.boutique-section {
    padding: 40px 0;
}

.filters-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
    padding: 15px;
    background-color: var(--light-gray);
    border-radius: 8px;
}

.filter-group {
    display: flex;
    flex-direction: column;
}
.filter-group label {
    font-size: 0.9em;
    margin-bottom: 5px;
    font-weight: 600;
}
.filter-group select,
.filter-group input[type="text"] {
    padding: 8px 12px;
    border: 1px solid var(--medium-gray);
    border-radius: 5px;
    font-family: var(--body-font);
    min-width: 200px; /* Ensure decent width */
}
.filter-group.search-group {
    flex-grow: 1; /* Allow search to take more space */
}
.filter-group.search-group input[type="text"] {
    width: 100%;
}


.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.product-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.product-image-container {
    position: relative;
    width: 100%;
    /* Aspect ratio padding trick for responsive height, e.g., 4:3 */
    padding-top: 75%; /* 3/4 * 100% */
    background-color: var(--light-gray); /* Placeholder while image loads */
}
.product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0; /* Start hidden, fade in */
    transition: opacity 0.5s ease;
}
.product-image.loaded {
    opacity: 1;
}

.product-image-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.product-card:hover .product-image-nav {
    opacity: 1;
}
.product-image-nav button {
    background-color: rgba(0,0,0,0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.product-image-nav button:hover {
    background-color: rgba(0,0,0,0.8);
}

.product-info {
    padding: 20px;
    flex-grow: 1; /* Allow text content to take available space */
    display: flex;
    flex-direction: column;
}
.product-info h3 {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 10px;
}
.product-description {
    font-size: 0.9em;
    margin-bottom: 15px;
    flex-grow: 1; 
    color: var(--secondary-color);
    line-height: 1.5; /* Added for better readability */
    min-height: 50px; /* Give some minimum space */
}
.product-price {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 15px;
}

.product-customization {
    margin-bottom: 15px;
}
.product-customization label {
    display: block;
    font-size: 0.85em;
    margin-bottom: 5px;
    font-weight: 500;
}
.product-customization input[type="file"] {
    font-size: 0.9em;
    width: 100%;
    padding: 5px;
    border: 1px solid var(--medium-gray);
    border-radius: 4px;
}
.customization-preview {
    max-width: 100px;
    max-height: 100px;
    margin-top: 10px;
    border: 1px solid var(--medium-gray);
    border-radius: 4px;
    object-fit: contain;
}
.customization-notes {
    font-size: 0.8em;
    color: var(--secondary-color);
    margin-top: 5px;
    background-color: #f9f9f9;
    padding: 8px;
    border-radius: 4px;
    border-left: 3px solid var(--primary-color-darker);
}


.product-actions {
    margin-top: auto; /* Push to bottom if product-info is flex container */
}
.product-actions .btn {
    width: 100%;
}
.product-actions .btn:disabled {
    background-color: var(--medium-gray);
    cursor: not-allowed;
    transform: none;
}

/* Shopping Cart Sidebar */
#cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px; /* Start off-screen, adjust width as needed */
    width: 100%;
    max-width: 400px;
    height: 100%;
    background-color: #fff;
    box-shadow: -5px 0 15px rgba(0,0,0,0.2);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease-in-out;
}
#cart-sidebar.open {
    right: 0;
}
#cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
    display: none; /* Hidden by default */
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}
#cart-overlay.active {
    display: block;
    opacity: 1;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--light-gray);
}
.cart-header h2 {
    margin: 0;
    font-size: 1.5rem;
}
#close-cart-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-color);
}

.cart-items-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
}
.empty-cart-message {
    text-align: center;
    color: var(--secondary-color);
    margin-top: 30px;
}

.cart-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--light-gray);
}
.cart-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}
.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--light-gray);
    flex-shrink: 0;
}
.cart-item-details {
    flex-grow: 1;
}
.cart-item-details h4 {
    margin: 0 0 5px 0;
    font-size: 1rem;
}
.cart-item-price {
    font-size: 0.9em;
    color: var(--secondary-color);
    margin-bottom: 8px;
}
.cart-item-customization-preview {
    max-width: 60px;
    max-height: 60px;
    border-radius: 3px;
    margin-top: 5px;
    border: 1px solid var(--medium-gray);
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.cart-item-actions input[type="number"] {
    width: 50px;
    padding: 5px;
    text-align: center;
    border: 1px solid var(--medium-gray);
    border-radius: 4px;
}
/* Hide spinner buttons for number input */
.cart-item-actions input[type=number]::-webkit-inner-spin-button, 
.cart-item-actions input[type=number]::-webkit-outer-spin-button { 
  -webkit-appearance: none; 
  margin: 0; 
}
.cart-item-actions input[type=number] {
  -moz-appearance: textfield; /* Firefox */
}

.cart-item-remove-btn {
    background: none;
    border: none;
    color: var(--error-color);
    cursor: pointer;
    font-size: 0.9em;
}
.cart-item-remove-btn:hover {
    text-decoration: underline;
}

.cart-footer {
    padding: 15px 20px; /* Légère réduction du padding si nécessaire */
    border-top: 1px solid var(--light-gray);
    background-color: #fdfdfd;
}
/* Cart Footer Summary */
.cart-summary {
    margin-bottom: 15px;
    text-align: right;
}
.cart-summary p {
    margin-bottom: 5px;
    font-size: 0.95rem;
}
.cart-summary .cart-total {
    font-size: 1.2rem;
    margin-top: 10px;
}
.cart-summary .cart-total strong {
    color: var(--text-color);
}
.cart-footer .btn {
    width: 100%;
    margin-bottom: 10px;
}
.cart-footer .btn:last-child {
    margin-bottom: 0;
}
.cart-footer .btn:disabled {
    background-color: var(--medium-gray);
    cursor: not-allowed;
    color: var(--dark-gray);
}

.loading-products {
    text-align: center;
    font-style: italic;
    color: var(--secondary-color);
    width: 100%; /* Span across grid if it's the only item */
    grid-column: 1 / -1; /* Make it span all columns if grid is already defined */
}
.no-products-found {
    text-align: center;
    color: var(--secondary-color);
    width: 100%;
    grid-column: 1 / -1;
    padding: 20px;
    background-color: #fff3f3;
    border: 1px solid var(--error-color);
    border-radius: 5px;
}

/* Text Customization Input in Product Card */
.product-customization input[type="text"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--medium-gray);
    border-radius: 4px;
    font-family: var(--body-font);
    font-size: 0.9em;
    margin-top: 5px;
}

/* Cart Item Comments */
.cart-item-comment-section {
    margin-top: 10px;
    width: 100%; /* Ensure it spans well */
}
.cart-item-comment-section textarea {
    width: 100%;
    min-height: 60px;
    padding: 8px;
    font-family: var(--body-font);
    font-size: 0.85em;
    border: 1px solid var(--medium-gray);
    border-radius: 4px;
    margin-bottom: 5px;
    resize: vertical;
    transition: background-color 0.2s ease, border-color 0.2s ease; /* MODIFIED LINE */
}
/* NEW: Style for read-only textarea */
.cart-item-comment-section textarea[readonly] {
    background-color: var(--light-gray); /* Grayed out background */
    color: var(--secondary-color);      /* Slightly dimmer text */
    border-color: var(--medium-gray);
    cursor: default; /* Indicate it's not directly editable */
}
/* Renamed .btn-toggle-comment to .btn-add-comment-initial for clarity in JS */
/* Keeping general styling for comment related buttons */
.btn-add-comment-initial, /* This replaces .btn-toggle-comment for the "Ajouter" button */
.btn-save-comment, 
.btn-edit-comment { /* Added .btn-edit-comment */
    font-size: 0.8em;
    padding: 4px 8px;
    background-color: var(--light-gray);
    border: 1px solid var(--medium-gray);
    color: var(--text-color);
    border-radius: 4px;
    cursor: pointer;
    margin-top: 5px;
    margin-right: 5px; /* Optional: Add some spacing */
}
.btn-add-comment-initial:hover, /* Updated selector */
.btn-save-comment:hover, 
.btn-edit-comment:hover {
    background-color: var(--medium-gray);
}
/* NEW: Style for the "Éditer Note" state button */
.btn-edit-comment {
    background-color: var(--secondary-color); /* Or another distinct color */
    color: var(--light-text-color);
    border-color: var(--secondary-color);
}
.btn-edit-comment:hover {
    background-color: #555; /* Darker shade of secondary-color */
}

.payment-info-note {
    font-size: 0.9em;
    margin-top: 15px;
    background-color: #fff3cd; /* Jaune clair pour l'information */
    padding: 10px 15px;
    border-radius: 5px;
    color: #664d03; /* Texte foncé sur fond clair */
    border: 1px solid #ffecb5;
    text-align: left; /* Ou center si vous préférez */
}
.payment-info-note i {
    margin-right: 8px;
    color: #cea000; /* Couleur de l'icône assortie */
}


/* Clarification du paiement dans le panier */
.payment-clarification {
    background-color: var(--light-gray); /* Ou une autre couleur douce pour se démarquer */
    padding: 12px 15px;
    margin-bottom: 15px; /* Espace avant le bouton de commande */
    border-radius: 5px;
    border: 1px dashed var(--medium-gray); /* Bordure subtile */
    text-align: left; /* Ou center */
}

.payment-clarification p {
    font-size: 0.85em; /* Un peu plus petit pour une note */
    color: var(--text-color); /* Ou var(--secondary-color) pour un peu moins d'emphase */
    margin-bottom: 8px;
    line-height: 1.4;
}
.payment-clarification p:last-child {
    margin-bottom: 0;
}
.payment-clarification strong {
    color: var(--primary-color); /* Mettre en évidence le point clé */
}
.payment-clarification i {
    margin-right: 6px;
    color: var(--primary-color); /* Icône assortie */
}


/* Responsive Design */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    .hero h1 { font-size: 2.2rem; }
    .hero p { font-size: 1rem; }

    .nav-menu {
        display: none; 
        flex-direction: column;
        position: absolute;
        top: var(--header-height);
        left: 0;
        width: 100%;
        background-color: #fff;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        padding: 10px 0;
    }
    .nav-menu.active {
        display: flex; 
    }
    .nav-menu li {
        margin: 0;
        width: 100%;
    }
    .nav-menu a {
        display: block;
        padding: 15px 20px;
        text-align: center;
        border-bottom: 1px solid var(--light-gray);
    }
    .nav-menu a::after { display: none; } 
    .nav-menu li:last-child a { border-bottom: none; }

    .nav-toggle {
        display: block; 
    }

    .about-content {
        flex-direction: column;
    }
    .about-image {
        margin-top: 20px;
    }

    .service-card {
        flex-direction: column;
    }
    .service-card-img {
        width: 100%;        /* MOBILE: Image takes full width of the card */
        height: 200px;      /* MOBILE: Define a fixed height. Adjust as needed.
                               Or use max-height if you want shorter images to result in a shorter image area,
                               but fixed height gives more consistency. */
        /* object-fit: cover; is inherited from the base style, no need to repeat unless you want to change it */
        /* object-position: center; is also inherited */
    }
    .filters-toolbar {
        flex-direction: column;
        gap: 15px;
    }
    .filter-group select,
    .filter-group input[type="text"] {
        min-width: 100%; /* Full width on mobile */
        width: 100%;
    }
    .cart-icon-container {
        /* Ensure it's properly aligned with the hamburger on mobile */
        margin-left: auto; /* Push to the right */
        padding-right: 10px; /* Space from hamburger if nav-toggle is also there */
    }

    #cart-sidebar {
        width: 100%;
        max-width: 320px; /* Slightly smaller on mobile */
        right: -320px;
    }
}