/* * =======================================================
 * PALETTE DE COULEURS AJUSTÉE
 * =======================================================
 */
:root {
    /* Theme: Dark (Default) */
    --color-background: #0A0A0A;
    --color-surface-1: #1f2937;
    /* bg-gray-800 */
    --color-surface-2: #111827;
    /* bg-gray-900 */
    --color-surface-3: #030712;
    /* bg-gray-950 */
    --color-surface-blur: rgba(10, 10, 10, 0.7);
    --color-text-primary: #ffffff;
    --color-text-secondary: #9ca3af;
    /* gray-400 */
    --color-text-tertiary: #6b7280;
    /* gray-500 */
    --color-border: #374151;
    /* gray-700 */
    --color-accent-primary: #1E90FF;
    --color-accent-secondary: #6CBE45;
    --color-accent-secondary-vibrant: #A0FF50;
    --color-accent-tertiary: #D7BDE2;
    --map-filter: invert(95%) hue-rotate(180deg) saturate(0.8);
    --logo-filter: none;
    --color-product-image-bg: #ffffff;

    /* Original variables for compatibility */
    --color-dark-theme: var(--color-surface-2);
    --color-vibrant-green: var(--color-accent-secondary-vibrant);
    --color-primary-blue: var(--color-accent-primary);
    --color-light-violet: var(--color-accent-tertiary);
    --color-logo-blue: #2A85FF;
    --color-logo-green: var(--color-accent-secondary);

    /* Variables pour la barre latérale extensible */
    --sidebar-width-mini: 5rem;
    --sidebar-width-expanded: 14rem;

    /* Variables pour le SLIDER DE LOGOS */
    --slide-speed: 25s;
    --logo-min-width: 12rem;
    --max-translation: calc(var(--logo-min-width) * 6);

    /* Heartbeat Separator Variables MISES À JOUR */
    --heartbeat-color: var(--color-vibrant-green);
    /* Couleur : Vert Vibrant */
    --heartbeat-speed: 4.0s;
    /* Vitesse LENT : 3.0 secondes par battement */
    --heartbeat-thickness: 3px;
    /* Épaisseur de la ligne EKG réduite */
    --heartbeat-height: 40px;
    /* Hauteur de la section réduite */
    --heartbeat-glow: rgba(160, 255, 80, 0.4);
    /* Lueur plus douce */
}

html.light-mode {
    /* Theme: Light */
    --color-background: #f9fafb;
    /* gray-50 */
    --color-surface-1: #ffffff;
    --color-surface-2: #f3f4f6;
    /* gray-100 */
    --color-surface-3: #e5e7eb;
    /* gray-200 */
    --color-surface-blur: rgba(255, 255, 255, 0.85);
    --color-text-primary: #111827;
    /* gray-900 */
    --color-text-secondary: #4b5563;
    /* gray-600 */
    --color-text-tertiary: #6b7280;
    /* gray-500 */
    --color-border: #d1d5db;
    /* gray-300 */
    --map-filter: none;
    --logo-filter: none;
    --color-product-image-bg: #ffffff;

    --color-vibrant-green: var(--color-accent-secondary);
}

html {
    /* scroll-snap-type: y mandatory; */
    /* scroll-behavior: smooth; */
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--color-background);
    color: var(--color-text-primary);
    transition: padding-left 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow-x: hidden;
    /* Empêche le défilement horizontal */
}

/* Classes ajoutées dynamiquement au BODY pour décaler le contenu principal */
.content-shifted-mini {
    padding-left: var(--sidebar-width-mini);
}

.content-shifted-expanded {
    padding-left: var(--sidebar-width-expanded);
}

/* Important: On n'applique ce décalage que sur Desktop/Tablet */
@media (max-width: 639px) {

    .content-shifted-mini,
    .content-shifted-expanded {
        padding-left: 0 !important;
    }
}

/* ----------------------------------------------- */
/* SECTION HERO AVEC DEGRADE COMPLEXE (Inchangée) */
/* ----------------------------------------------- */
.hero-gradient {
    background-image: url('../images/pic/acceuilph.png');
    background-size: cover;
    background-position: center 25%;
    background-repeat: no-repeat;
}

/* ----------------------------------------------- */
/* STYLES : SIDEBAR (Expandable) */
/* ----------------------------------------------- */
#floating-navbar {
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width-mini);
    transform: translateX(-100%);
    transition:
        transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        width 0.3s ease-in-out;
    z-index: 55;
    position: fixed;
    display: none;
}

@media (min-width: 640px) {
    #floating-navbar {
        display: block;
    }
}

.sidebar-visible {
    transform: translateX(0) !important;
}

/* État étendu : la barre prend la nouvelle largeur */
#floating-navbar.expanded {
    width: var(--sidebar-width-expanded);
}

#floating-navbar .nav-container {
    height: 100%;
    background-image: linear-gradient(to bottom, var(--color-logo-green), var(--color-primary-blue));
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    border-right: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0;
}

/* Override sidebar logo colors for visibility */
#floating-navbar .brand-logo-svg {
    --color-logo-green: white;
    --color-logo-blue: white;
}

/* Affichage du label lorsque la barre est étendue */
#floating-navbar.expanded .nav-link span {
    opacity: 1;
    max-width: 10rem;
    /* Allow space for the text to appear */
    transform: translateX(0);
}

/* Make label color match icon color on hover/active */
#nav-links-sidebar .nav-link:hover span,
#nav-links-sidebar .nav-link.active span {
    color: var(--color-logo-green);
}

/* Text color overrides for custom sidebar background */
#floating-navbar .nav-link,
#floating-navbar.sidebar-visible .nav-link span {
    color: white;
}

#floating-navbar.sidebar-visible .nav-link {
    color: white;
}

#floating-navbar.sidebar-visible .nav-link:hover {
    opacity: 0.8;
    color: white;
}

#floating-navbar.sidebar-visible .nav-link.active {
    opacity: 1;
    color: white;
}

#floating-navbar.sidebar-visible .nav-link:hover span,
#floating-navbar.sidebar-visible .nav-link.active span {
    color: white;
}

#floating-navbar.sidebar-visible .nav-link:hover::before,
#floating-navbar.sidebar-visible .nav-link.active::before {
    background-color: rgba(255, 255, 255, 0.15);
    border-left-color: white;
}

/* ----------------------------------------------- */
/* STYLES : LIENS DE SIDEBAR (Extensible) */
/* ----------------------------------------------- */
#nav-links-sidebar .nav-link {
    position: relative;
    display: flex;
    justify-content: start;
    align-items: center;
    height: 3.5rem;
    margin: 0.25rem 0;
    cursor: pointer;
    transition: color 0.3s, background-color 0.3s;
    width: 100%;
    padding: 0 1rem;
}

/* Accent Vertical */
#nav-links-sidebar .nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 100%;
    background-color: rgba(160, 255, 80, 0.2);
    border-left: 3px solid var(--color-logo-green);
    transition: width 0.3s, background-color 0.3s;
    border-radius: 0 5px 5px 0;
    z-index: 10;
}

#nav-links-sidebar .nav-link:hover::before,
#nav-links-sidebar .nav-link.active::before {
    width: 100%;
    background-color: rgba(160, 255, 80, 0.2);
}

#nav-links-sidebar .nav-link.active {
    color: var(--color-logo-green);
}

#nav-links-sidebar .nav-link svg {
    position: relative;
    z-index: 20;
    transition: transform 0.2s;
}

#nav-links-sidebar .nav-link span {
    position: relative;
    display: inline-block;
    /* Ensure it's a block-like element for transitions */
    overflow: hidden;
    /* Hide text that overflows during animation */
    margin-left: 0.75rem;
    white-space: nowrap;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    /* Improved readability */
    pointer-events: none;
    z-index: 20;

    /* Animation properties for a smooth reveal */
    max-width: 0;
    opacity: 0;
    transform: translateX(-10px);
    transition: max-width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        opacity 0.3s ease-out 0.1s,
        /* Delay opacity slightly */
        transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        color 0.3s;
    /* Add color transition */
}

/* ----------------------------------------------- */
/* STYLES : LOGO SPINNER */
/* ----------------------------------------------- */
.logo-spinner {
    transition: transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.group:hover .logo-spinner {
    transform: rotate(360deg);
}




/* ----------------------------------------------- */
/* NOUVEAUX STYLES : SEPARATEUR EKG (HEARTBEAT) */
/* ----------------------------------------------- */
#heartbeat-separator {
    position: relative;
    height: 0;
    /* Collapse the section to remove its background space */
    width: 100%;
    z-index: 10;
    /* Ensure it's above section content */
    overflow: hidden;
    /* VERY IMPORTANT: Prevents the wrapper from overflowing and causing lag */
}

.ekg-wrapper {
    width: 200%;
    /* Must be 200% for the seamless loop animation to work correctly */
    height: var(--heartbeat-height);
    position: absolute;
    top: 0;
    /* Position on the boundary between sections */
    left: 0;
    transform: translateY(-50%);
    /* Center vertically on the boundary */
    /* The animation is now controlled by the 'is-animating' class added via JavaScript */
}

.ekg-wrapper.is-animating {
    animation: ekg-flow var(--heartbeat-speed) linear infinite;
}

@keyframes ekg-flow {
    0% {
        transform: translateX(0) translateY(-50%);
    }

    100% {
        transform: translateX(-50%) translateY(-50%);
    }
}

/* Style de la ligne SVG */
.ekg-svg {
    display: block;
    width: 100%;
    height: 100%;
}

.ekg-svg path {
    stroke-width: var(--heartbeat-thickness);
    fill: none;
    /* Lueur ajustée pour être plus douce */
    filter: drop-shadow(0 0 3px var(--heartbeat-glow)) drop-shadow(0 0 5px rgba(160, 255, 80, 0.2));
}

/* Styles Top Nav et autres (Inchangés) */
.section-title {
    position: relative;
    display: inline-block;
    padding-bottom: 0.5rem;
    font-family: 'Montserrat', sans-serif;
    /* Gradient text effect */
    background-image: linear-gradient(90deg, var(--color-logo-green) 10%, var(--color-primary-blue) 40%, var(--color-light-violet) 100%, var(--color-logo-blue) 150%, var(--color-vibrant-green) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50%;
    height: 4px;
    background-color: var(--color-accent-primary);
    border-radius: 9999px;
}

#top-navbar {
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.nav-link-top {
    position: relative;
    padding: 0.5rem 1rem;
    transition: color 0.3s;
}

.nav-link-top::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background-color: var(--color-logo-green);
    border-radius: 9999px 9999px 0 0;
    transition: width 0.3s;
}

.nav-link-top:hover::after,
.nav-link-top.active::after {
    width: 70%;
}

.nav-link-top.active {
    color: var(--color-vibrant-green);
}

.top-padding-offset {
    padding-top: 40px;
}

#animated-title-container {
    perspective: 1000px;
    display: inline-block;
    white-space: normal;
}

@keyframes text-reveal {
    0% {
        opacity: 0;
        transform: rotateX(120deg) rotateY(-50deg) translateY(50px) scale(0.5);
        text-shadow: 0 0 15px var(--color-light-violet);
    }

    100% {
        opacity: 1;
        transform: rotateX(0deg) rotateY(0deg) translateY(0) scale(1);
        text-shadow: none;
    }
}

/* NOUVEAU: Appliquer l'animation aux lettres du titre */
#animated-title-container .animated-letter {
    display: inline-block;
    animation: text-reveal 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* NOUVEAU: Animation pour le sous-titre et les boutons */
@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#hero-subtitle,
#hero-buttons {
    opacity: 0;
    animation: fade-in-up 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

#hero-subtitle {
    animation-delay: 0.8s;
}

#hero-buttons {
    animation-delay: 1.2s;
}

.fade-in-up-animation {
    opacity: 0;
    animation: fade-in-up 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

#animated-title-container .text-green-200 {
    color: var(--color-logo-green);
}

.map-container {
    height: 400px;
    min-height: 400px;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.map-container iframe {
    filter: var(--map-filter);
}

/* Styles pour les icônes de section animées */
.section-title-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    /* Corresponds to Tailwind's gap-4 */
    text-align: center;
    /* The margin-bottom is kept on the element via Tailwind for section-specific spacing */
}

.section-icon {
    font-size: 2.5rem;
    opacity: 0;
    display: inline-block;
    background-image: linear-gradient(90deg, var(--color-logo-green) 0%, var(--color-primary-blue) 50%, var(--color-light-violet) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    transition: opacity 0.8s ease-in-out;
}

@keyframes slow-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.section-icon.is-visible {
    opacity: 1;
    animation: slow-spin 5.0s linear infinite;
}

/* Styles pour le modal */
body.modal-open {
    overflow: hidden;
}

#info-modal.visible {
    opacity: 1;
    pointer-events: auto;
}

#info-modal.visible #modal-content {
    transform: scale(1);
}

.category-filter-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--color-accent-primary);
    color: var(--color-accent-primary);
    background-color: transparent;
    border-radius: 9999px;
    font-weight: 600;
    transition: all 0.3s;
    cursor: pointer;
}

.category-filter-btn:hover {
    background-color: var(--color-accent-primary);
    color: var(--color-text-primary);
}

.category-filter-btn.active {
    background-color: var(--color-logo-green);
    border-color: var(--color-logo-green);
    color: var(--color-dark-theme);
}

/*
=========================================================
STYLES POUR LE SLIDER DE PRODUITS
=========================================================
*/
.product-card {
    flex: 0 0 calc(25% - 1.125rem);
    /* 25% pour 4 cartes, moins l'espacement (gap-6 = 1.5rem -> 1.5 * 3/4) */
    min-width: calc(25% - 1.125rem);
}

@media (max-width: 1280px) {

    /* xl */
    .product-card {
        flex: 0 0 calc(33.33% - 1rem);
        min-width: calc(33.33% - 1rem);
    }

    /* 3 cartes */
}

@media (max-width: 768px) {

    /* md */
    .product-card {
        flex: 0 0 calc(50% - 0.75rem);
        min-width: calc(50% - 0.75rem);
    }

    /* 2 cartes */
}

@media (max-width: 640px) {

    /* sm */
    .product-card {
        flex: 0 0 100%;
        min-width: 100%;
    }

    /* 1 carte */
}

.product-slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 30;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.product-slider-arrow:hover {
    background-color: rgba(30, 144, 255, 0.8);
}

.product-slider-arrow.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
    visibility: hidden;
    /* Cache complètement le bouton */
}

/* Styles for Product Card Images */
.product-card img {
    height: 12rem;
    /* 192px */
    width: 100%;
    object-fit: contain;
    /* Prevents image distortion */
    padding: 1rem;
    border-radius: 0.375rem;
    /* rounded-md */
    background-color: var(--color-product-image-bg);
    transition: background-color 0.3s ease;
}

header,
main>section[data-section] {
    /* scroll-snap-align: start; */
    /* overflow: hidden; */
    /* Prevent content from breaking the 100vh layout */
}

/* Make the footer a scroll-snap target as well */
footer[data-section] {
    /* scroll-snap-align: start; */
}

.info-card {
    cursor: pointer;
}

/*
=========================================================
STYLES FOR THEME TOGGLE & LIGHT MODE
=========================================================
*/

/* Theme Toggle Switch */
#theme-toggle-indicator {
    color: #111827;
    /* Dark icon color */
}

html.light-mode #theme-toggle {
    background-color: var(--color-surface-3);
}

html.light-mode #theme-toggle-indicator {
    transform: translateX(1.5rem);
    /* 24px */
    background-color: var(--color-surface-1);
    color: var(--color-text-primary);
}

/* Light Mode Overrides for Tailwind classes */
html.light-mode .text-white,
html.light-mode .text-gray-200 {
    color: var(--color-text-primary);
}

html.light-mode .text-gray-300,
html.light-mode .text-gray-400 {
    color: var(--color-text-secondary);
}

html.light-mode .text-gray-500 {
    color: var(--color-text-tertiary);
}

html.light-mode .bg-gray-950 {
    background-color: var(--color-background);
}

html.light-mode .bg-gray-900\/50 {
    background-color: rgba(229, 231, 235, 0.5);
}

/* gray-200/50 */
html.light-mode .bg-gray-800 {
    background-color: var(--color-surface-1);
}

html.light-mode .bg-gray-700 {
    background-color: var(--color-surface-2);
}

html.light-mode .border-gray-700 {
    border-color: var(--color-border);
}

html.light-mode .hover\:text-white:hover {
    color: var(--color-text-primary);
}

html.light-mode .hero-gradient {
    background-color: var(--color-background);
}

html.light-mode .scroller-logo img {
    filter: var(--logo-filter);
}

html.light-mode .info-card {
    background-color: var(--color-surface-1);
    border-color: var(--color-border);
}

html.light-mode .hover\:shadow-blue-500\/50:hover {
    box-shadow: 0 0 15px 0 rgba(30, 144, 255, 0.3);
}

html.light-mode .hover\:shadow-lime-400\/50:hover {
    box-shadow: 0 0 15px 0 rgba(108, 190, 69, 0.3);
}

html.light-mode .hover\:shadow-violet-500\/50:hover {
    box-shadow: 0 0 15px 0 rgba(215, 189, 226, 0.5);
}

html.light-mode #modal-content {
    background-color: var(--color-surface-1);
    border-color: var(--color-border);
}

html.light-mode #modal-close-btn:hover {
    color: var(--color-text-primary);
}

/*
=========================================================
STYLES POUR LE CARROUSEL DE LOGOS CLIENTS
=========================================================
*/

/* 1. Animation de défilement */
@keyframes scroll-anim {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-100%);
    }
}

.scrolling-list {
    animation: scroll-anim 25s linear infinite;
}

/* 2. Styles pour la transparence en mode sombre */
/* Par défaut, en mode sombre (pas de classe .light-mode sur <html>) */

/* Pour les logos avec un fond blanc (BMC, Philips) */
.logo-white-bg {
    mix-blend-mode: multiply;
}

/* Pour les logos avec du texte sombre (Fisher & Paykel) */
.logo-dark-text {
    filter: invert(1);
}

/* Pour les logos avec un fond coloré (Piston, ResMed) */
.logo-colored-bg {
    mix-blend-mode: lighten;
}

/* Annuler ces effets en mode clair */
html.light-mode #logo-scroller img {
    mix-blend-mode: normal;
    filter: none;
}

html.light-mode .logo-with-white-bg,
html.light-mode .logo-dark-text {
    mix-blend-mode: multiply !important;
    filter: none !important;
}

/*
=========================================================
CORRECTIF POUR LES LOGOS SUR FOND BLANC EN MODE SOMBRE
=========================================================
*/
html:not(.light-mode) .logo-with-white-bg {
    filter: invert(1) hue-rotate(180deg);
    mix-blend-mode: screen;
    background-color: transparent !important;
}

html:not(.light-mode) .logo-dark-text {
    filter: invert(1);
    mix-blend-mode: screen;
}

/*
=========================================================
CORRECTIF POUR LE MENU DÉROULANT EN MODE CLAIR
=========================================================
*/
/* Force le texte du dropdown à rester blanc même en mode clair */
html.light-mode .nav-drop-link {
    color: #ffffff !important;
}

/* Force le fond du dropdown à rester sombre en mode clair pour le contraste */
html.light-mode .group .absolute {
    background-color: rgba(17, 24, 39, 0.9) !important; /* bg-gray-900/90 equivalent */
    border-color: #374151 !important; /* border-gray-700 equivalent */
}

/* Force le hover à avoir un fond vert et texte sombre (comme en mode sombre) */
html.light-mode .nav-drop-link:hover {
    background-color: var(--color-logo-green) !important;
    color: #111827 !important; /* gray-900 */
}