/* ============================================================
   HEADER COMPONENTS — Desktop only (min-width: 1000px)
   1. Single-line header layout (logo | menu | icons)
      with FR/€ row above — responsive down to 1000px
   2. Account dropdown with green dot
   ============================================================ */

/* ===========================================================
   1. HEADER LAYOUT
   =========================================================== */

@media (min-width: 1000px) {

    #header {
        display: flex;
        flex-wrap: wrap;
        flex-direction: row;
        align-items: center;
        position: relative;
    }

    #header > .header-nav {
        display: contents;
    }

    .header-nav__row {
        display: contents;
    }

    /* --- ROW 1a: Banner --- */
    #header > .header-banner {
        width: 100%;
        order: 0;
    }

    /* --- ROW 1b: FR / € selectors --- */
    .header-nav__start {
        order: 1;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 4px;
        padding: 0px 27px 0px;
      
    }

    .header-nav__start .open-megamenu-button {
        display: none !important;
    }

    .header-nav__start #_desktop_language_selector,
    .header-nav__start #_desktop_currency_selector {
        display: flex !important;
        align-items: center;
    }

    .header-nav__start .language-selector,
    .header-nav__start .currency-selector {
        margin-top: 0 !important;
    }

    .header-nav__start .language-selector > button,
    .header-nav__start .currency-selector > button {
        padding-bottom: 0 !important;
    }

    .header-nav__start .expand-more {
        font-size: 12px !important;
        font-weight: 500;
        letter-spacing: .5px;
    }

    /* --- ROW 2: Logo | Megamenu | Icons --- */

    /* Logo: fluid width — scales from 160px @1000px to 260px @1600px+ */
    .header-nav__logo {
        order: 2;
        flex: 0 0 auto;
        padding: 0 clamp(8px, 1.2vw, 20px) 0 clamp(12px, 1.5vw, 27px);
        display: flex;
        align-items: center;
    }

    .header-nav__logo .logo {
        width: clamp(160px, 14vw, 260px) !important;
        padding: 10px 0;
        margin: 0 !important;
    }

    /* Megamenu: fills remaining space, no wrap */
    #header > .ets_mm_megamenu {
        order: 3;
        flex: 1 1 0%;
        min-width: 0;
        overflow: visible;
    }

    /* Menu items: fluid font-size + gap, forced single line */
    #header .ets_mm_megamenu .mm_menus_ul {
        justify-content: flex-start !important;
        padding-left: clamp(0px, 0.5vw, 10px);
        flex-wrap: nowrap !important;
    }

    #header .mm_menus_li > a {
        font-size: clamp(9px, 0.75vw, 11px) !important;
        padding-inline: clamp(8px, 0.9vw, 18px) !important;
    }

    #header .mm_menu_content_title {
        padding-left: clamp(8px, 1vw, 25px);
        padding-right: clamp(8px, 1vw, 25px);
        font-size: clamp(9px, 0.75vw, 11px);
    }

    /* Icons */
    .header-nav__end {
        order: 4;
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        gap: clamp(3px, 0.5vw, 7px);
        padding-right: clamp(10px, 1.5vw, 27px);
    }

    /* Clean up */
    #header .header-nav {
        padding: 0 !important;
        border: none;
    }

    #header > .ets_mm_megamenu {
        box-shadow: none !important;
        background: transparent;
    }

    .ets_mm_megamenu_content {
        border: none !important;
    }
}

/* Mobile: original layout preserved */
@media (max-width: 999px) {
    .header-nav__row {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
    }

    .header-nav__start {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
    }

    .header-nav__logo {
        flex: 1;
        display: flex;
        justify-content: center;
    }

    .header-nav__end {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        gap: 7px;
    }
}


/* ===========================================================
   2. ACCOUNT DROPDOWN — Desktop only
   =========================================================== */

@media (min-width: 1000px) {

    .account-dropdown-wrapper {
        position: relative;
    }

    .account-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        cursor: pointer;
        position: relative;
        padding: 0;
    }

    .account-btn .montagut-icon {
        font-size: inherit;
        line-height: inherit;
    }

    .account-btn__online-dot {
        position: absolute;
        bottom: -2px;
        right: -4px;
        width: 9px;
        height: 9px;
        background: #34c759;
        border: 2px solid #fff;
        border-radius: 50%;
        pointer-events: none;
    }

    .account-dropdown {
        display: none;
        position: absolute;
        top: calc(100% + 10px);
        right: -20px;
        width: 280px;
        background: #fff;
        border-radius: 14px;
        box-shadow: 0 4px 24px rgba(0, 0, 0, .12), 0 0 0 1px rgba(0, 0, 0, .04);
        padding: 22px 0 18px;
        z-index: 2100;
        opacity: 0;
        transform: translateY(-6px);
        transition: opacity .2s ease, transform .2s ease;
    }

    .account-dropdown::after {
        content: '';
        position: absolute;
        bottom: 100%;
        right: 0;
        width: 80px;
        height: 16px;
    }

    .account-dropdown::before {
        content: '';
        position: absolute;
        top: -6px;
        right: 28px;
        width: 12px;
        height: 12px;
        background: #fff;
        transform: rotate(45deg);
        border-top-left-radius: 2px;
        box-shadow: -1px -1px 2px rgba(0, 0, 0, .04);
    }

    .account-dropdown-wrapper.is-open .account-dropdown,
    .account-dropdown-wrapper:hover .account-dropdown {
        display: block;
        opacity: 1;
        transform: translateY(0);
    }

    .account-dropdown__greeting {
        font-family: 'Gotham', sans-serif;
        font-weight: 700;
        font-size: 15px;
        color: #1a1a1a;
        text-align: center;
        padding: 0 24px 16px;
        letter-spacing: .3px;
    }

    .account-dropdown__divider {
        height: 1px;
        background: #e8e8e8;
        margin: 0 20px;
    }

    .account-dropdown__link {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px 24px;
        font-family: 'Gotham', sans-serif;
        font-size: 13px;
        font-weight: 500;
        color: #1a1a1a !important;
        text-decoration: none !important;
        transition: background .15s ease;
    }

    .account-dropdown__link:hover {
        background: #f7f7f7;
        color: #000 !important;
    }

    .account-dropdown__link svg {
        flex-shrink: 0;
        color: #1a1a1a;
    }

    .account-dropdown__flower-icon {
        flex-shrink: 0;
        border-radius: 4px;
        object-fit: contain;
    }

    .account-dropdown__logout {
        display: block;
        text-align: center;
        padding: 14px 24px 4px;
        font-family: 'Gotham', sans-serif;
        font-size: 13px;
        font-weight: 500;
        color: #1a1a1a !important;
        text-decoration: underline !important;
        text-underline-offset: 3px;
    }

    .account-dropdown__logout:hover {
        color: #000 !important;
    }

    #_desktop_user_info .account--mobile {
        display: none !important;
    }

}

@media (max-width: 999px) {
    .account-dropdown-wrapper {
        display: none !important;
    }
}


/* ===========================================================
   3. STICKY HEADER ICONS — Desktop only
   =========================================================== */

@media (min-width: 1000px) {

    /* Sticky bar icons layout */
    body:not(#product) #header.__sticky_enabled #header_cart_sticky,
    #header_cart_sticky {
        justify-content: flex-end !important;
        display: flex;
        align-items: center !important;
        gap: 7px;
        position: absolute;
        right: 0px;
        top: 10px;
    }

    #header_cart_sticky .sticky-icon {
        padding: 0 !important;
    }

    /* Account dropdown inside sticky — same styles, already inherited */
    #header_cart_sticky .account-dropdown-wrapper {
        position: relative;
    }

    #header_cart_sticky .account-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        cursor: pointer;
        position: relative;
        padding: 0;
    }

    #header_cart_sticky .account-btn .montagut-icon {
        font-size: inherit;
        line-height: inherit;
    }

    #header_cart_sticky .account-btn__online-dot {
        position: absolute;
        bottom: -2px;
        right: -4px;
        width: 9px;
        height: 9px;
        background: #34c759;
        border: 2px solid #fff;
        border-radius: 50%;
        pointer-events: none;
    }

    #header_cart_sticky .account-dropdown {
        display: none;
        position: absolute;
        top: calc(100% + 10px);
        right: -20px;
        width: 280px;
        background: #fff;
        border-radius: 14px;
        box-shadow: 0 4px 24px rgba(0, 0, 0, .12), 0 0 0 1px rgba(0, 0, 0, .04);
        padding: 22px 0 18px;
        z-index: 2100;
        opacity: 0;
        transform: translateY(-6px);
        transition: opacity .2s ease, transform .2s ease;
    }

    #header_cart_sticky .account-dropdown::after {
        content: '';
        position: absolute;
        bottom: 100%;
        right: 0;
        width: 80px;
        height: 16px;
    }

    #header_cart_sticky .account-dropdown::before {
        content: '';
        position: absolute;
        top: -6px;
        right: 28px;
        width: 12px;
        height: 12px;
        background: #fff;
        transform: rotate(45deg);
        border-top-left-radius: 2px;
        box-shadow: -1px -1px 2px rgba(0, 0, 0, .04);
    }

    #header_cart_sticky .account-dropdown-wrapper.is-open .account-dropdown,
    #header_cart_sticky .account-dropdown-wrapper:hover .account-dropdown {
        display: block;
        opacity: 1;
        transform: translateY(0);
    }
}


#header {
    box-shadow: none !important;
}
#header #_desktop_cart {
    padding-inline: 5px 0px!important;
}

@media (min-width: 1000px) {
  #header .mm_columns_ul {
    height: 500px;
    min-width: 100vw !important;
    transform: translate(-50%) !important;
    left: 45% !important;
    background: #fff;
    padding-top: 20px !important;
    border: 1px solid #cecece;
    flex-wrap: wrap;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,.15);
  }
}

.mm_columns_ul{
    width: 115%!important;
}




.cart-sticky-link {
    position: relative;
}

.cart-products-count-sticky {
    position: absolute;
    top: -5px;
    right: -8px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    color: #000;
}

/* ===========================================================
   STICKY HEADER — Match desktop header sizing
   =========================================================== */

@media (min-width: 1000px) {

    /* Sticky logo: same fluid width as desktop */
    #header.__sticky_enabled #header_logo_sticky {
        display: flex !important;
        align-items: center;
        padding: 0 clamp(8px, 1.2vw, 20px) 0 clamp(12px, 1.5vw, 27px);
    }

    #header.__sticky_enabled #header_logo_sticky .logo {
        width: clamp(160px, 14vw, 260px) !important;
        padding: 10px 0;
        margin: 0 !important;
    }

    /* Sticky menu items: same font-size & padding as desktop */
    #header.__sticky_enabled .mm_menus_li > a {
        font-size: clamp(9px, 0.75vw, 11px) !important;
        padding-inline: clamp(8px, 0.9vw, 18px) !important;
    }

    #header.__sticky_enabled .mm_menu_content_title {
        padding-left: clamp(8px, 1vw, 25px);
        padding-right: clamp(8px, 1vw, 25px);
        font-size: clamp(9px, 0.75vw, 11px);
    }

    /* Sticky icons: same layout as .header-nav__end */
    body:not(#product) #header.__sticky_enabled #header_cart_sticky,
    #header.__sticky_enabled #header_cart_sticky {
        position: absolute;
        right: 14px;
        top: 50%;
        transform: translateY(-50%);
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
               gap: clamp(3px, 0.5vw, 7px);
        padding-right: clamp(10px, 1.5vw, 27px);
                margin-right: 5px;
    }

    #header.__sticky_enabled #header_cart_sticky .sticky-icon {
        padding: 0 !important;
    }

    /* Sticky menu ul: same alignment as desktop */
    #header.__sticky_enabled .mm_menus_ul {
        justify-content: flex-start !important;
        padding-left: clamp(0px, 0.5vw, 10px);
        flex-wrap: nowrap !important;
        align-items: center;
    }
}



.header-nav__row--checkout {
    display: flex;
    justify-content: center;
    padding: 10px 0;
}

.header-nav__logo--checkout .logo {
    width: clamp(180px, 14vw, 260px) !important;
}
@media (min-width: 1000px) {
    body#checkout #header {
        display: block !important;
    }

    body#checkout .header-nav__row--checkout {
        display: flex !important;
        justify-content: center;
        padding: 10px 0;
    }

    body#checkout .header-nav__logo--checkout {
        flex: none !important;
        order: unset !important;
        padding: 0 !important;
    }

    body#checkout .header-nav__logo--checkout .logo {
        width: clamp(180px, 14vw, 260px) !important;
    }
}



body .ets_mm_megamenu::before {
    content: "";
    position: fixed!important;
    top: 123px;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

/* ============================================
   CHECKOUT - Fixed Bottom Submit Button
   Toutes les étapes du tunnel de commande
   ============================================ */

/* Cible générique : tous les conteneurs de boutons submit dans l'étape active */
.checkout-step.-current .step-submit-fixed,
.checkout-step.-current .form-footer,
.checkout-step.-current #payment-confirmation {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: #fff;
  padding: 12px 20px;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Le bouton lui-même */
.checkout-step.-current .step-submit-fixed .btn-primary,
.checkout-step.-current .form-footer .btn-primary,
.checkout-step.-current #payment-confirmation .btn-primary {
  width: 100%;
  max-width: 480px;
  padding: 14px 30px;
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 4px;
  float: none !important;
  margin: 0 auto;
  display: block;
}

/* Espace en bas du contenu pour ne pas masquer le formulaire */
.checkout-step.-current .content {
  padding-bottom: 90px;
}

/* Cacher le champ hidden submitAddress proprement */
.checkout-step.-current .form-footer input[type="hidden"] {
  position: absolute;
}

/* Paiement : alerte + bouton en colonne */
.checkout-step.-current #payment-confirmation {
  flex-direction: column;
  gap: 6px;
  padding: 10px 20px 14px;
}

/* Quand l'étape n'est PAS active, remettre le positionnement normal */
.checkout-step:not(.-current) .form-footer,
.checkout-step:not(.-current) #payment-confirmation,
.checkout-step:not(.-current) .step-submit-fixed {
  position: static;
  box-shadow: none;
  padding: 0;
  background: transparent;
  display: block;
}

/* ---- Desktop ---- */
@media (min-width: 992px) {
  .checkout-step.-current .step-submit-fixed,
  .checkout-step.-current .form-footer,
  .checkout-step.-current #payment-confirmation {
    padding: 14px 40px;
  }
  .checkout-step.-current .step-submit-fixed .btn-primary,
  .checkout-step.-current .form-footer .btn-primary,
  .checkout-step.-current #payment-confirmation .btn-primary {
    max-width: 400px;
  }
}

/* ---- Mobile ---- */
@media (max-width: 767px) {
  .checkout-step.-current .step-submit-fixed,
  .checkout-step.-current .form-footer,
  .checkout-step.-current #payment-confirmation {
    padding: 10px 15px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }
  .checkout-step.-current .step-submit-fixed .btn-primary,
  .checkout-step.-current .form-footer .btn-primary,
  .checkout-step.-current #payment-confirmation .btn-primary {
    max-width: 100%;
    padding: 15px 20px;
  }
  .checkout-step.-current .content {
    padding-bottom: 100px;
  }
}