/* 
 * L'îlot Épinay - Stylesheet
 * Vanilla CSS using CSS Variables for Design System
 */

@font-face {
    font-family: 'Seiva Poster';
    src: url('../assets/fonts/seiva-poster.woff2') format('woff2'),
        url('../assets/fonts/seiva-poster.woff') format('woff'),
        url('../assets/fonts/seiva-poster.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    /* Colors derived from brand manual */
    --c-bg: #F4F4EE;
    /* Off-white/beige background */
    --c-text: #1a1a1a;
    --c-green: #6DA481;
    /* Sunburst green */
    --c-blue: #94ADD8;
    /* Sunburst blue */
    --c-pink: #D9A0A8;
    /* Sunburst pink */
    --c-rose: #E6BCCD;
    /* Sunburst light rose */
    --c-orange: #ED8B7A;
    /* Sunburst orange */

    --c-primary: var(--c-green);
    --c-primary-rgb: 109, 164, 129;

    --c-white: #ffffff;
    --c-light-grey: #e9e9e5;

    /* Typography */
    --font-heading: 'Seiva Poster', 'Syne', sans-serif;
    --font-body: 'Outfit', sans-serif;

    /* Spacing */
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: clamp(1.5rem, 3vw, 2rem);
    --space-xl: clamp(2rem, 5vw, 4rem);
    --space-xxl: clamp(4rem, 8vw, 8rem);

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background-color: var(--c-bg);
    color: var(--c-text);
    line-height: 1.6;
    overflow-x: hidden;
}

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

h1 {
    font-size: clamp(2rem, 6vw + 1rem, 4.5rem);
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: var(--space-md);
    font-size: 1.1rem;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

ul {
    list-style: none;
}

/* Utilities */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-xl);
}

@media (min-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr 1fr;
    }
}

.align-center {
    align-items: center;
}

.mt-4 {
    margin-top: var(--space-xl);
}

.text-small {
    font-size: 0.9rem;
    opacity: 0.8;
}

.italic {
    font-style: italic;
}

.bg-light {
    background-color: var(--c-white);
}

/* Text colors */
.text-green {
    color: var(--c-green);
}

.text-blue {
    color: var(--c-blue);
}

.text-pink {
    color: var(--c-pink);
}

.text-orange {
    color: var(--c-orange);
}

/* Decorative letters */
.sunburst,
.sunburst-pink,
.sunburst-rose,
.sunburst-orange,
.sunburst-blue {
    position: relative;
    display: inline-block;
    color: transparent !important;
    /* Rend la lettre 'o' invisible pour laisser place au logo */
}

.sunburst::before,
.sunburst-pink::before,
.sunburst-rose::before,
.sunburst-orange::before,
.sunburst-blue::before {
    content: '';
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0.7em;
    height: 0.7em;
    /* Slightly larger for SVGs */
    z-index: 1;
    /* Passe au premier plan */
}

.sunburst-rose::before { background-image: url('../assets/1.svg'); background-size: contain; background-repeat: no-repeat; background-position: center; }
.sunburst-orange::before { background-image: url('../assets/2.svg'); background-size: contain; background-repeat: no-repeat; background-position: center; }
.sunburst-pink::before { background-image: url('../assets/3.svg'); background-size: contain; background-repeat: no-repeat; background-position: center; }
.sunburst-blue::before { background-image: url('../assets/4.svg'); background-size: contain; background-repeat: no-repeat; background-position: center; }

.logo-img {
    height: 3rem; /* Adjusted for better visibility */
    width: auto;
    display: block;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-family: var(--font-heading);
    cursor: pointer;
    transition: all var(--transition-normal);
    border: none;
    text-align: center;
}

.btn-primary {
    background-color: var(--c-text);
    color: var(--c-white);
}

.btn-primary:hover {
    background-color: var(--c-green);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(244, 244, 238, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: var(--space-md) 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

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

.nav-list {
    display: flex;
    gap: var(--space-lg);
}

.nav-list a {
    font-weight: 500;
    font-family: var(--font-heading);
}

.nav-list a:hover {
    color: var(--c-green);
}

/* Mobile Menu */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    width: 30px;
    height: 20px;
    position: relative;
    z-index: 1001;
}

.menu-toggle span {
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: var(--c-text);
    left: 0;
    transition: all var(--transition-normal);
}

.menu-toggle span:nth-child(1) {
    top: 0;
}

.menu-toggle span:nth-child(2) {
    top: 50%;
    transform: translateY(-50%);
}

.menu-toggle span:nth-child(3) {
    bottom: 0;
}

@media (max-width: 767px) {
    .menu-toggle {
        display: block;
    }

    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background-color: var(--c-white);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
        display: flex;
        align-items: center;
        justify-content: center;
        transition: right var(--transition-normal);
    }

    .nav.active {
        right: 0;
    }

    .nav-list {
        flex-direction: column;
        text-align: center;
        gap: var(--space-xl);
    }

    .nav-list a {
        font-size: 1.5rem;
    }

    .menu-toggle.active span:nth-child(1) {
        top: 50%;
        transform: translateY(-50%) rotate(45deg);
    }

    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active span:nth-child(3) {
        top: 50%;
        transform: translateY(-50%) rotate(-45deg);
    }
}

/* Hero Section */
.hero {
    padding-top: calc(80px + var(--space-xxl));
    padding-bottom: var(--space-xxl);
    min-height: 85vh;
    display: flex;
    align-items: center;
    position: relative;
    background-image: url('../assets/design/hero_background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    /* Effet parallaxe élégant */
}

.hero-content {
    max-width: 900px;
    animation: fadeUp 1s ease forwards;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: clamp(2rem, 6vw, 4.5rem);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

.hero-title {
    font-size: clamp(2.5rem, 8.5vw, 5.5rem);
    line-height: 1.1;
    margin-bottom: var(--space-md);
    font-family: var(--font-heading);
}

.hero-subtitle {
    font-size: clamp(1.4rem, 4.5vw, 2.2rem);
    margin-bottom: var(--space-lg);
    font-family: var(--font-heading);
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sections */
section {
    padding: var(--space-xxl) 0;
}

.section-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto var(--space-xl);
}

.section-header-inline {
    text-align: left;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

@media (min-width: 992px) {
    .section-header-inline {
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
    }
    
    .section-header-inline h2 {
        flex: 0 0 50%;
        margin-bottom: 0;
    }
    
    .section-header-inline p {
        flex: 0 0 45%;
        margin-bottom: 0;
        text-align: right;
    }
}

/* Smart Gallery Grid */
.gallery-grid {
    display: grid;
    gap: var(--space-md);
    grid-template-columns: 1fr; /* Mobile default */
}

@media (min-width: 768px) {
    /* 1 Item */
    .gallery-count-1 {
        grid-template-columns: 1fr;
        grid-template-rows: 400px;
    }
    
    /* 2 Items */
    .gallery-count-2 {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 400px;
    }
    
    /* 3 Items (1 large left, 2 small right) */
    .gallery-count-3 {
        grid-template-columns: 2fr 1fr;
        grid-template-rows: 250px 250px;
    }
    .gallery-count-3 .gallery-item:first-child {
        grid-row: span 2;
    }
    
    /* 4 Items (2x2 grid) */
    .gallery-count-4 {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 250px 250px;
    }
    
    /* 5 Items (1 large left, 4 small right in 2x2) */
    .gallery-count-5 {
        grid-template-columns: 2fr 1fr 1fr;
        grid-template-rows: 250px 250px;
    }
    .gallery-count-5 .gallery-item:first-child {
        grid-row: span 2;
    }
}

.gallery-item {
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--transition-normal);
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Shops Grid */
.shops-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-lg);
    justify-content: center; /* Centrer les blocs sur le site */
}

.shop-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: var(--space-xl);
    justify-content: center;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid var(--c-light-grey);
    background-color: var(--c-white);
    border-radius: 20px;
    font-size: 0.9rem;
    font-family: var(--font-body);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--c-text);
}

.filter-btn:hover {
    border-color: var(--c-primary);
    color: var(--c-primary);
}

.filter-btn.active {
    background-color: var(--c-primary);
    color: var(--c-white);
    border-color: var(--c-primary);
}

.shop-card {
    background-color: var(--c-bg);
    border-radius: var(--radius-lg);
    overflow: visible; /* Changed to visible to allow badge to stick out */
    transition: transform var(--transition-normal);
    border: 1px solid var(--c-light-grey);
    display: flex;
    flex-direction: column;
    position: relative;
    width: 100%;
    max-width: 380px; /* Assure que toutes les cartes ont exactement la même largeur */
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .shop-card {
        width: calc((100% - var(--space-lg)) / 2); /* 2 colonnes sur tablette */
    }
}

@media (min-width: 992px) {
    .shop-card {
        width: calc((100% - 2 * var(--space-lg)) / 3); /* 3 colonnes sur ordinateur */
    }
}

.shop-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.05);
}

.shop-card-header {
    background-color: var(--c-light-grey);
    padding: var(--space-md) var(--space-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    min-height: 80px; /* Assure un alignement parfait de la hauteur des en-têtes */
}

.coming-soon-badge {
    position: absolute;
    top: -12px;
    right: -12px;
    background-color: var(--c-orange);
    color: white;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    z-index: 10;
    transform: rotate(5deg);
}

.shop-card-header h3 {
    margin: 0;
    font-size: 1.5rem;
    letter-spacing: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.shop-title-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    flex: 1;
    min-width: 0; /* Important to allow children to truncate */
}

.shop-title-text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.shop-logo {
    width: 32px !important;
    height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
    border-radius: 6px;
    object-fit: contain;
    background-color: var(--c-white);
    padding: 2px;
    margin-top: 2px;
    box-sizing: border-box !important;
}

.shop-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    color: var(--c-dark-grey);
}

.shop-card-body {
    padding: var(--space-lg);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 180px; /* Assure une hauteur uniforme pour toutes les cartes */
}

.shop-desc-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.shop-desc-text {
    flex-grow: 1;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
}

.shop-desc-wrapper.expanded .shop-desc-text {
    display: block;
    -webkit-line-clamp: none;
    overflow: visible;
    text-overflow: clip;
}

.btn-read-more {
    align-self: flex-start;
    background: none;
    border: none;
    color: var(--c-primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    margin-top: var(--space-xs);
    display: inline-flex;
    align-items: center;
    transition: color var(--transition-fast);
}

.btn-read-more:hover {
    color: var(--c-text);
    text-decoration: underline;
}

/* Hours Dropdown */
.shop-hours-toggle {
    margin-top: var(--space-md);
    border-top: 1px solid var(--c-light-grey);
    padding-top: var(--space-md);
}

.btn-toggle-hours {
    width: 100%;
    background: none;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    color: var(--c-green);
    padding: 0.5rem 0;
}

.btn-toggle-hours svg {
    transition: transform var(--transition-normal);
}

.btn-toggle-hours[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.shop-hours-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal);
}

.hours-list {
    margin-top: var(--space-md);
    font-size: 0.95rem;
}

.hours-list li {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.1);
}

.hours-list li:last-child {
    border-bottom: none;
}

.sunday {
    color: var(--c-orange);
    font-weight: 500;
}

/* News & Offers Section (Carousel) */
.news {
    padding: var(--space-xl) 0;
    overflow: hidden;
}

.news-grid {
    display: flex;
    gap: var(--space-lg);
    overflow-x: auto;
    padding-bottom: var(--space-lg);
    scroll-snap-type: x mandatory;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}
.news-grid::-webkit-scrollbar {
    display: none; /* Safari/Chrome */
}

.news-card {
    flex: 0 0 300px;
    background-color: var(--c-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

@media (min-width: 768px) {
    .news-card {
        flex: 0 0 350px;
    }
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.news-img-wrapper {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.news-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card:hover .news-img-wrapper img {
    transform: scale(1.05);
}

.news-date {
    position: absolute;
    bottom: var(--space-sm);
    left: var(--space-sm);
    background-color: var(--c-white);
    color: var(--c-dark);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.news-content {
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.news-tag {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--space-xs);
}

.news-content h3 {
    font-size: 1.25rem;
    margin-bottom: var(--space-sm);
    line-height: 1.3;
}

.news-content p {
    font-size: 0.95rem;
    opacity: 0.8;
    margin-bottom: var(--space-md);
    flex-grow: 1;
}

.news-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--c-blue);
    text-decoration: none;
    transition: color 0.3s ease;
}
.news-link svg {
    transition: transform 0.3s ease;
}
.news-link:hover {
    color: var(--c-green);
}
.news-link:hover svg {
    transform: translateX(4px);
}

/* Infos */
.info-group {
    margin-bottom: var(--space-lg);
    background-color: var(--c-white);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
}

.address-link-hover {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: all var(--transition-normal);
}

.address-link-hover:hover {
    transform: translateY(-2px);
}

.address-link-hover:hover span {
    color: var(--c-orange) !important;
}

.map-placeholder {
    background-color: var(--c-light-grey);
    height: 100%;
    min-height: 400px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(0, 0, 0, 0.4);
    font-family: var(--font-heading);
    font-size: 1.2rem;
}

/* Footer */
.footer {
    background-color: var(--c-bg);
    color: var(--c-text);
    padding: var(--space-xl) 0 var(--space-lg);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr;
    }
}

.footer-brand .logo-text {
    color: var(--c-text);
}

.footer-brand .logo-img {
    height: 4rem;
    margin-bottom: var(--space-md);
}

.footer-brand p {
    opacity: 0.7;
    max-width: 300px;
}

.footer-links h4,
.footer-contact h4 {
    margin-bottom: var(--space-md);
    color: var(--c-text);
}

.footer-links ul li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    opacity: 0.7;
}

.footer-links a:hover {
    opacity: 1;
    color: var(--c-green);
}

.footer-contact p {
    opacity: 0.7;
    margin-bottom: 0.5rem;
}

.footer-bottom {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding-top: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    opacity: 0.7;
    font-size: 0.9rem;
}

@media (min-width: 768px) {
    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.legal-links {
    display: flex;
    gap: var(--space-md);
}

.legal-links a:hover {
    color: var(--c-text);
}

/* Coworking Section */
.coworking-gallery {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    position: relative;
}
.coworking-img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}
.coworking-img-1 {
    transform: translateY(30px);
}
@media (max-width: 767px) {
    .coworking-gallery {
        margin-top: var(--space-xl);
    }
    .coworking-img {
        height: 200px;
    }
}

/* Services Section */
.services {
    background-color: var(--c-white);
    padding: var(--space-xxl) 0;
}

/* Services Carousel Wrapper & Buttons */
.services-carousel-wrapper {
    position: relative;
    width: 100%;
}

.services-grid.carousel-active {
    display: flex !important;
    overflow-x: auto !important;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    width: 100%;
}

.services-grid.carousel-active::-webkit-scrollbar {
    display: none;
}

.services-grid.carousel-active {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* Force cards to keep a nice size and prevent squeezing when scrolling is enabled */
.services-grid.carousel-active .service-card {
    flex: 0 0 calc((100% - 4 * var(--space-lg)) / 5) !important; /* Exact 1/5 width matching desktop */
    min-width: 200px;
    max-width: none !important;
    scroll-snap-align: start;
}

/* Carousel Button styles */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background-color: var(--c-white);
    border: 1px solid var(--c-light-grey);
    color: var(--c-text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all var(--transition-fast);
    z-index: 10;
}

.carousel-btn:hover {
    background-color: var(--c-primary);
    color: var(--c-white);
    border-color: var(--c-primary);
    transform: translateY(-50%) scale(1.05);
}

.carousel-btn.prev-btn {
    left: -22px;
}

.carousel-btn.next-btn {
    right: -22px;
}

@media (max-width: 991px) {
    .carousel-btn {
        display: none !important; /* Utilise le défilement tactile natif de l'appareil sur mobile et tablette */
    }
}

.services-grid {
    display: flex;
    overflow-x: auto;
    gap: var(--space-lg);
    margin-top: var(--space-xl);
    padding: 12px 0 var(--space-md) 0; /* Pas de marges négatives, reste sagement dans le container */
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    align-items: stretch; /* Force toutes les cartes de services à avoir la même hauteur */
}

.services-grid::-webkit-scrollbar {
    height: 6px;
}

.services-grid::-webkit-scrollbar-track {
    background: var(--c-light-grey);
    border-radius: 3px;
}

.services-grid::-webkit-scrollbar-thumb {
    background: var(--c-grey);
    border-radius: 3px;
}

.service-card {
    background-color: var(--c-bg);
    border: 1px solid var(--c-light-grey);
    border-radius: var(--radius-lg);
    padding: var(--space-xl) var(--space-md);
    text-align: center;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    flex: 0 0 280px;
    scroll-snap-align: start;
}

@media (min-width: 992px) {
    .services-grid {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        overflow-x: visible;
        padding: 12px 0;
    }
    .service-card {
        flex: none;
    }
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.06);
    border-color: var(--card-color);
}

.service-icon-wrapper {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    background-color: var(--card-color);
    color: var(--c-white);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-normal);
    margin-bottom: var(--space-sm);
}

/* Limiter strictement la taille de n'importe quel pictogramme, SVG ou image pour éviter tout bug d'affichage */
.service-icon-wrapper svg,
.service-icon-wrapper img,
.service-icon-wrapper i {
    width: 30px !important;
    height: 30px !important;
    max-width: 30px !important;
    max-height: 30px !important;
    box-sizing: border-box !important;
}

.service-card:hover .service-icon-wrapper {
    transform: scale(1.1);
}

.service-card h3 {
    font-size: 1.25rem;
    margin: 0;
    color: var(--c-text);
    font-family: var(--font-heading);
    letter-spacing: 0.5px;
}

.service-card p {
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
    color: var(--c-text);
    opacity: 0.85;
}

/* ==========================================================================
   WYSIWYG VISUAL EDITOR - ADMINISTRATIVE INTERFACE STYLES
   ========================================================================== */

/* 1. Top Admin Bar */
.admin-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 65px;
    background-color: #111827; /* Charcoal black */
    color: #f3f4f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--space-xl);
    z-index: 99999;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    font-family: var(--font-body);
}

.admin-bar-logo {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.admin-logo-img {
    height: 35px;
    filter: brightness(0) invert(1); /* Force brand logo to white on dark background */
}

.admin-badge {
    background-color: var(--c-primary); /* Green brand color */
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    letter-spacing: 1px;
}

.admin-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #10b981; /* Default active/saved green */
    display: inline-block;
    transition: background-color 0.3s;
}

@keyframes adminPulse {
    0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5); }
    70% { box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); }
    100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

.status-indicator.status-dirty {
    background-color: #f59e0b !important; /* Orange warning for unsaved changes */
    animation: adminPulse 1.8s infinite;
}

.admin-actions {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.admin-actions .btn {
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
}

.btn-outline-white {
    background: transparent;
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
}

.btn-outline-white:hover {
    background: rgba(255,255,255,0.1);
    border-color: white;
}

.btn-save {
    background-color: #374151;
    color: #9ca3af;
    border: none;
    cursor: not-allowed;
    transition: all 0.3s;
}

@keyframes savePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.04); }
    100% { transform: scale(1); }
}

.btn-save.pulse {
    background-color: #10b981 !important;
    color: white !important;
    cursor: pointer;
    animation: savePulse 2s infinite ease-in-out;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-save.pulse:hover {
    background-color: #059669 !important;
}

.btn-danger {
    background-color: #dc2626;
    color: white;
    border: none;
}

.btn-danger:hover {
    background-color: #b91c1c;
}

/* 2. Inline Text Editors */
.wysiwyg-editable {
    cursor: text;
    transition: all 0.2s;
    position: relative;
}

.wysiwyg-editable:hover {
    outline: 2px dashed #10b981 !important;
    outline-offset: 4px;
    border-radius: var(--radius-sm);
}

.wysiwyg-editable:focus {
    outline: 2px solid #10b981 !important;
    outline-offset: 4px;
    background: rgba(16, 185, 129, 0.05);
    border-radius: var(--radius-sm);
}

/* 3. Inline Link / Button Editors */
.wysiwyg-link-editable {
    cursor: pointer;
}

.wysiwyg-link-editable:hover {
    outline: 2px dashed #3b82f6 !important;
    outline-offset: 4px;
}

/* 4. Inline Image Editors */
.wysiwyg-img-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.wysiwyg-img-wrapper img {
    display: block;
    width: 100%;
}

.wysiwyg-img-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(17, 24, 39, 0.85);
    backdrop-filter: blur(4px);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 10px 18px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    opacity: 0.95;
    transition: opacity 0.25s, transform 0.2s;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.wysiwyg-img-wrapper:hover img {
    filter: brightness(0.6);
}

.wysiwyg-img-wrapper:hover .wysiwyg-img-btn {
    opacity: 1;
}

.wysiwyg-img-btn:hover {
    transform: translate(-50%, -50%) scale(1.05);
    background: #111827;
}

/* 5. Collection Cards Admin Controls */
.admin-editable-card {
    position: relative;
}

.admin-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(17, 24, 39, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    opacity: 0;
    transition: opacity 0.25s ease-in-out;
    pointer-events: none;
    z-index: 99;
    border-radius: var(--radius-lg);
    padding: var(--space-md);
}

.admin-editable-card:hover .admin-card-overlay {
    opacity: 1;
    pointer-events: auto;
}

.admin-card-overlay .btn {
    width: 80%;
    max-width: 160px;
    padding: 10px var(--space-md);
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* 6. Sorting utilities & ghost class */
.admin-sortable .shop-card,
.admin-sortable .service-card {
    cursor: grab;
}

.admin-sortable .shop-card:active,
.admin-sortable .service-card:active {
    cursor: grabbing;
}

.sortable-ghost {
    opacity: 0.3;
    border: 2px dashed var(--c-primary) !important;
    background: rgba(16, 185, 129, 0.05);
}

.btn-add-collection {
    background-color: var(--c-primary);
    color: white;
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 10px 20px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-add-collection:hover {
    background-color: #0d8a56;
}

/* 7. Inline Background Image Editors */
.wysiwyg-bg-editable {
    position: relative !important;
}

.wysiwyg-bg-editable::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    transition: background-color 0.25s;
    pointer-events: none;
    z-index: 2;
}

.wysiwyg-bg-editable:hover::before {
    background: rgba(0, 0, 0, 0.4);
}

.wysiwyg-bg-btn {
    position: absolute;
    top: 110px; /* Éviter le chevauchement avec le header fixe (z-index 1000) */
    right: 20px;
    background: rgba(17, 24, 39, 0.85);
    backdrop-filter: blur(4px);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 10px 18px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    opacity: 0.95;
    transition: opacity 0.25s, transform 0.2s;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.wysiwyg-bg-editable:hover .wysiwyg-bg-btn {
    opacity: 1;
}

.wysiwyg-bg-btn:hover {
    transform: scale(1.05);
    background: #111827;
}