/* GlamHair desktop navigation */

.glam-desktop-menu { display: none; }
@media (min-width: 992px) {
  #header.header-page:not(.fixed-top) { position: relative; z-index: 100; }
  #header .header-top > .container,
  #header .header-nav > .container { max-width: min(96vw, 1640px); }
  #header .header-top > .container { width:100%; max-width:1640px; padding-inline:clamp(12px, 1.6vw, 28px); }
  #header .header-top > .container > .inner-wrapper {
    display: flex; align-items: center; flex-wrap: nowrap;
    gap: clamp(8px, 1vw, 16px); position: relative; margin-inline:0;
  }
  #header #_desktop_top_menu { display: none !important; }
  #header #_desktop_logo, #header #_desktop_search_bar, #header #_desktop_wishlist_top {
    flex: 0 0 auto; width: auto; max-width: none;
  }
  #header #_desktop_logo img { width: 150px; max-width: 12vw; height: auto; }
  #header #_desktop_logo { padding-inline:0; }
  #header #_desktop_search_bar, #header #_desktop_wishlist_top { width:32px; padding-inline:0; text-align:center; }
  .glam-desktop-menu { display: block; flex: 1 1 auto; min-width: 0; align-self: stretch; }
  .glam-desktop-categories {
    display: flex; align-items: stretch; justify-content: space-evenly; height: 100%;
    gap: clamp(.2rem, .45vw, .65rem); margin: 0; padding: 0; list-style: none;
  }
  .glam-desktop-categories > li { display: flex; align-items: center; }
  .glam-desktop-categories > li > a {
    display: block; padding: 1.82em .5em; font-size: 12px;
    font-family: inherit; font-weight: 400; line-height: 1.25;
    color: #636363; text-transform: uppercase; white-space: nowrap; text-align: center;
  }
  .glam-desktop-megamenu {
    display: none; position: absolute; inset-inline: 0; top: 100%; z-index: 100;
    grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px 12px;
    margin: 0; padding: 40px 20px 30px; list-style: none; background: white;
    box-shadow: 0 5px 18px #0002; max-height: 65vh; overflow: auto;
  }
  .glam-desktop-megamenu a { display: block; font-size: 14px; font-weight: 600; text-transform: uppercase; color: #636363; }
  .glam-desktop-megamenu a:hover, .glam-desktop-megamenu a:focus-visible { color: #28769a; }
  .glam-desktop-categories > li:hover > .glam-desktop-megamenu,
  .glam-desktop-categories > li:focus-within > .glam-desktop-megamenu { display: grid; }
}
@media (min-width: 1140px) {
  .glam-desktop-categories > li > a { font-size: 13px; padding-inline: .85em; }
}
.glam-desktop-categories > li.current > a,
.glam-desktop-categories > li > a:hover,
.glam-desktop-categories > li > a:focus-visible { color: #28769a; }
#glam-stock-alert { scroll-margin-top: calc(var(--scroll-padding-top, 100px) + 1rem); }
#glam-stock-alert label { display: block; margin-bottom: .35rem; }
#glam-stock-alert input[type=email] { display: block; width: 100%; margin-bottom: .5rem; }
@media (min-width: 992px) {
  #header.header-page { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  #header.header-page > .header-banner { grid-column: 1 / -1; }
  #header.header-page > .header-top { grid-column: 1; grid-row: 3; min-width: 0; }
  #header.header-page > .header-nav,
  #header.header-page > .header-nav > .container,
  #header.header-page > .header-nav > .container > .inner-wrapper { display: contents; }
  #header.header-page .header-nav .left-nav { grid-column: 1 / -1; grid-row: 2; }
  #header.header-page .header-nav .right-nav { grid-column: 2; grid-row: 3; padding-inline-end:0; }
  #header.header-page > :not(.header-banner, .header-nav, .header-top) { grid-column: 1 / -1; }
}
@media (min-width: 992px) {
  #header.header-page .glam-desktop-account-tools {
    display: flex;
    align-items: center;
    gap: .65rem;
    flex: 0 0 auto;
  }
  #header #_desktop_cart .cart-header.d-block,
  #header #_desktop_cart .cart-header > .inner-wrapper {
    display:flex !important; align-items:center; justify-content:center;
    height:32px; margin:0; padding:0; line-height:1;
  }
  #header #_desktop_cart .cart-header .font-cart { line-height:1; }
}

/* Category listing controls. */
@media (max-width: 575px) {
  body#category #js-product-list-top .sort-by-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    row-gap: 8px;
  }
  body#category #js-product-list-top .sort-by-row > .compact-toggle.external {
    margin: 0;
    padding: 6px 10px;
  }
  body#category #js-product-list-top .sort-by-row > .pagination {
    order: 10;
    flex: 0 0 100%;
    width: 100%;
    margin: 0;
    justify-content: center;
  }
  body#category #js-product-list-top .pagination .page-list {
    justify-content: center;
    flex-wrap: wrap;
    margin: 0;
  }
}

/* Mobile header: separate 44px targets, with the original 32px icon discs. */
@media (max-width:991px) {
 #header .header-nav .left-nav,
 #header .header-nav .right-nav { display:none; }
 #header .header-nav > .container > .inner-wrapper > .mobile {
   display:grid; grid-template-columns:44px minmax(80px,1fr) repeat(3,44px);
   column-gap:4px; align-items:center; width:100%; padding:6px;
 }
 #header .header-nav .mobile > .menu-icon { grid-column:1; grid-row:1; width:44px; height:44px; justify-content:center; }
 #header .header-nav .mobile > #_mobile_logo { grid-column:2; grid-row:1; width:100%; min-width:0; padding:0; justify-content:center; }
 #header .header-nav .mobile > #_mobile_contact_link { grid-column:3; grid-row:1; }
 #header .header-nav .mobile > #_mobile_user_info { grid-column:4; grid-row:1; }
 #header .header-nav .mobile > #_mobile_cart { grid-column:5; grid-row:1; }
 #header .header-nav .mobile > #_mobile_contact_link,
 #header .header-nav .mobile > #_mobile_user_info,
 #header .header-nav .mobile > #_mobile_cart { width:44px; height:44px; margin:0; }
 #header .header-nav .mobile .btn-toggle-mobile,
 #header #_mobile_cart .cart-header.d-block,
 #header #_mobile_cart .cart-header > .inner-wrapper {
   display:flex !important; align-items:center; justify-content:center;
   width:44px; height:44px; margin:0; padding:0; line-height:1;
 }
 #header .header-nav .mobile .btn-toggle-mobile { background-color:transparent; }
 #header .header-nav .mobile .btn-toggle-mobile > .material-icons {
   display:flex; align-items:center; justify-content:center;
   width:32px; height:32px; border-radius:50%; background-color:#52788D;
 }
 #header #_mobile_logo img.logo { width:80px; max-width:100%; height:auto; }
}

/* Compact category links: native navigation, no script or image requests. */
body#category .glam-explore-lines {
  margin:0 0 22px; padding:0; border:0; min-width:0;
}
body#category .glam-explore-title {
  margin:0 0 8px; padding:0; font-size:15px; line-height:1.35;
  font-weight:600; color:#343a40; text-transform:none;
}
body#category .glam-explore-list {
  display:flex; flex-wrap:wrap; gap:8px; list-style:none;
  margin:0; padding:3px; min-width:0; max-width:100%;
}
body#category .glam-explore-list > li { flex:0 0 auto; margin:0; padding:0; width:auto; }
body#category .glam-explore-list a {
  display:inline-flex; align-items:center; min-height:36px; padding:7px 12px;
  border:1px solid #cbd5db; border-radius:7px; background:#fff;
  color:#42525d; font-size:13px; line-height:1.35; font-weight:400;
  text-decoration:none; white-space:nowrap;
}
body#category .glam-explore-list a:hover,
body#category .glam-explore-list a:focus-visible { background:#fff; border-color:#72aac5; color:#28769a; }
body#category .glam-explore-list a:focus-visible { outline:2px solid #28769a; outline-offset:2px; }
body#category .glam-explore-list a[aria-current="page"] { background:#edf5f9; border-color:#72aac5; color:#28769a; }
/* Shared subcategory appearance, identical to the approved Alfaparf component. */
body#category .glam-explore-lines--visual .glam-explore-list a {
  gap:8px; min-height:52px; padding:6px 10px;
  font-size:14px; font-weight:500; color:#343a40;
}
body#category .glam-explore-lines--visual .glam-explore-list a:hover,
body#category .glam-explore-lines--visual .glam-explore-list a:focus-visible {
  background:#edf5f9; border-color:#72aac5; color:#245f7a;
}
body#category .glam-explore-lines--visual .glam-line-image {
  display:block; width:38px; height:38px; flex:0 0 38px;
}
body#category .glam-explore-lines--visual .glam-line-image img {
  display:block; width:38px; height:38px; object-fit:contain; background:#fff;
}
/* Retain the verified white bottle; strengthen only its faint photographic edges. */
body#category .glam-explore-lines--visual .glam-line-image img[src*="/8200-"] {
  filter:contrast(1.12);
}
@media (max-width:767px) {
  body#category .glam-explore-list {
    flex-wrap:nowrap; overflow-x:auto; padding-bottom:7px;
    -webkit-overflow-scrolling:touch; scrollbar-width:thin;
  }
  body#category .glam-explore-lines--visual .glam-explore-list {
    scrollbar-width:none; -ms-overflow-style:none; padding-bottom:3px;
  }
  body#category .glam-explore-lines--visual .glam-explore-list::-webkit-scrollbar {
    display:none; width:0; height:0;
  }
  body#category .glam-explore-lines--visual .glam-explore-title {
    display:flex; align-items:center; justify-content:space-between; gap:12px;
  }
  body#category .glam-explore-lines--visual .glam-explore-title::after {
    content:"Scorri ↔"; flex:0 0 auto; font-size:11px; line-height:1.35;
    font-weight:400; color:#286c8e; text-transform:none;
  }
}

/* Symmetric mobile tracks keep the logo at the actual viewport centre. */
.glam-mobile-search-toggle,#glam-mobile-search-panel { display:none; }
@media(max-width:991px){
 #header .header-nav > .container > .inner-wrapper > .mobile {grid-template-columns:44px 44px minmax(80px,1fr) 44px 44px;column-gap:2px;}
 #header .header-nav .mobile > #_mobile_logo {grid-column:3;}
 #header .header-nav .mobile > #_mobile_contact_link {display:none;}
 #header .header-nav .mobile > #_mobile_user_info {grid-column:4;}
 #header .header-nav .mobile > #_mobile_cart {grid-column:5;}
 #header .header-nav .mobile > .glam-mobile-search-toggle {grid-column:2;grid-row:1;display:flex;align-items:center;justify-content:center;width:44px;height:44px;padding:0;margin:0;border:0;background:transparent;color:#52788D;cursor:pointer;}
 #header .glam-mobile-search-toggle i {font-size:25px;}
 #header #glam-mobile-search-panel:not([hidden]) {display:flex;align-items:center;gap:4px;width:100%;padding:6px 12px 10px;background:#fff;}
 #header #glam-mobile-search-panel[hidden] {display:none;}
 #header #glam-mobile-search-panel #search_widget {display:block;width:auto;min-width:0;flex:1;margin:0;}
 #header #glam-mobile-search-panel .search-btn-toggle {display:none!important;}
 #header #glam-mobile-search-panel .search-form {display:block!important;position:static!important;opacity:1!important;visibility:visible!important;transform:none!important;width:100%;margin:0;padding:0;}
 #header #glam-mobile-search-panel .search-field {display:flex;width:100%;max-width:none;padding:0;margin:0;}
 #header #glam-mobile-search-panel input[name=s] {width:100%;min-width:0;height:44px;box-sizing:border-box;}
 #header #glam-mobile-search-panel .glam-search-close {flex:0 0 44px;width:44px;height:44px;border:0;background:transparent;color:#52788D;font-size:28px;}
}

/* Mobile search sizing: fix the actual controls, never mask document overflow. */
@media(max-width:991px){
 #header #glam-mobile-search-panel {box-sizing:border-box;min-width:0;max-width:100%;flex:0 0 100%;}
 #header #glam-mobile-search-panel #search_widget,
 #header #glam-mobile-search-panel .search-form,
 #header #glam-mobile-search-panel .search-field {box-sizing:border-box;min-width:0;max-width:100%;}
 #header #glam-mobile-search-panel input[name=s] {flex:1 1 0;min-width:0;max-width:100%;font-size:16px;}
 #header #glam-mobile-search-panel .search-btn {box-sizing:border-box;flex:0 0 44px;width:44px;min-width:0;}
 /* The native widget appends its suggestions to body, outside the header panel. */
 .ui-autocomplete.-searchbar,
 .ui-autocomplete.searchbar-autocomplete {box-sizing:border-box;max-width:calc(100% - 24px)!important;left:12px!important;right:auto!important;}
 .ui-autocomplete.-searchbar li,
 .ui-autocomplete.searchbar-autocomplete li {min-width:0;max-width:100%;overflow-wrap:anywhere;}
}

/* Light mobile controls; existing layout, hit areas and behavior unchanged. */
@media(max-width:767px){
 #header #_mobile_logo img.logo {width:86px;}
 #header .header-nav .mobile .btn-toggle-mobile,
 #header .header-nav .mobile .btn-toggle-mobile > .material-icons,
 body #header #_mobile_cart .cart-header > .inner-wrapper i {
  background:transparent!important;color:#52788D!important;font-size:24px!important;
 }
 #header .header-nav .mobile .menu-icon,
 #header .header-nav .mobile .menu-icon i {color:#52788D;}
 body .product-miniature.glam-product-card button.add-to-cart,
 body .product-miniature.glam-product-card .wrapper-buy > .out-of-stock-link {
  background:#fff!important;color:#52788D!important;border:1px solid #52788D!important;box-shadow:none;
 }
 body .product-miniature.glam-product-card button.add-to-cart::before {
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='5' y='8' width='14' height='13' rx='1.5' fill='%2352788D'/%3E%3Cpath d='M9 9V6a3 3 0 0 1 6 0v3' fill='none' stroke='%2352788D' stroke-width='2'/%3E%3C/svg%3E");
 }
 body .product-miniature.glam-product-card button.add-to-cart:hover,
 body .product-miniature.glam-product-card .wrapper-buy > .out-of-stock-link:hover {background:#edf2f5!important;color:#52788D!important;}
}

/* Match the footer newsletter gutter; the cookie wrapper has no grid padding. */
@media(max-width:767px){
 #footer .update-cookies {padding-inline:15px;}
}

/* gh-support-center: balance existing 1.6rem vertical margin; retain bar height. */
@media(min-width:992px){
 #header.header-page .header-nav .left-nav > p {
  margin-top:.8rem;
  margin-bottom:.8rem;
  align-self:center;
 }
}

@media (max-width: 991px) {
  .ui-autocomplete.-searchbar,
  .ui-autocomplete.searchbar-autocomplete {
    background: #fff;
    border: 1px solid #e7e7e7;
    padding: 0;
    min-height: 0;
    max-height: min(26rem, 48vh);
    max-height: min(26rem, 48dvh);
    overflow-y: auto;
    overscroll-behavior-y: contain;
  }

  .ui-autocomplete.-searchbar > li + li,
  .ui-autocomplete.searchbar-autocomplete > li + li {
    border-top: 1px solid #e7e7e7;
  }

  .ui-autocomplete.-searchbar .results-item,
  .ui-autocomplete.searchbar-autocomplete > li > a {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 9px;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .ui-autocomplete.-searchbar .results-item .thumbnail,
  .ui-autocomplete.searchbar-autocomplete .autocomplete-thumbnail {
    flex: 0 0 46px;
    width: 46px;
    min-width: 46px;
    height: auto;
    margin: 0;
  }

  .ui-autocomplete.-searchbar .results-item .descr {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .ui-autocomplete.-searchbar .results-item :is(.name, .price) {
    line-height: 1.3;
  }
}

/* Use the same mobile input size in the menu and the header search panel. */
@media (max-width: 991px) {
  #mobile_top_menu_wrapper #search_widget input[name="s"] {
    font-size: 16px;
  }
}
