/* Header and menu refresh (app/header-ui.php). Everything is scoped to body.ic-hdr. */

/* ---------- Desktop ---------- */
@media (min-width: 768px) {
  /* Utility links (Help Center / Track Order): readable, not light grey */
  body.ic-hdr #header .header_top_right-wrap a {
    color: #4d5c6b !important;
    letter-spacing: .1em;
    transition: color .15s;
  }
  body.ic-hdr #header .header_top_right-wrap a:hover { color: #8a6a35 !important; }

  /* Search: wider, with a magnifier, brand focus ring */
  body.ic-hdr #header .search-form-wrapper { width: 100%; max-width: 26rem; }
  body.ic-hdr #header .search-form-wrapper input.search-field {
    height: 42px;
    padding-left: 40px !important;
    border: 1px solid #e2d6c3 !important;
    border-radius: 999px !important;
    background: #faf7f2 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a6a35' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") 14px center / 17px no-repeat !important;
    color: #1a202c !important;
    transition: border-color .15s, box-shadow .15s, background-color .15s;
  }
  body.ic-hdr #header .search-form-wrapper input.search-field:focus {
    border-color: #d3ae76 !important;
    background-color: #fff !important;
    box-shadow: 0 0 0 3px rgba(211, 174, 118, .25);
  }

  /* Category row: a little tighter, gold underline on hover / open / current */
  body.ic-hdr #dropdown-bar { padding-top: .5rem !important; padding-bottom: .5rem !important; }
  body.ic-hdr #dropdown-bar nav.shop_nav ul.nav > li > a { position: relative; }
  body.ic-hdr #dropdown-bar nav.shop_nav ul.nav > li > a::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 2px;
    border-radius: 2px;
    background: #d3ae76;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .18s ease;
  }
  body.ic-hdr #dropdown-bar nav.shop_nav ul.nav > li:hover > a::after,
  body.ic-hdr #dropdown-bar nav.shop_nav ul.nav > li:focus-within > a::after,
  body.ic-hdr #dropdown-bar nav.shop_nav ul.nav > li.current-menu-item > a::after,
  body.ic-hdr #dropdown-bar nav.shop_nav ul.nav > li.current-menu-ancestor > a::after { transform: scaleX(1); }

  /* Mega menu: a quick fade instead of the 0.3s scaleY; also opens from the keyboard */
  body.ic-hdr #header nav.shop_nav ul.nav li.has-dropdown ul.dropdown-menu {
    transform: translateY(-6px) !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .16s ease, transform .16s ease, visibility 0s linear .16s !important;
    box-shadow: 0 18px 40px rgba(26, 32, 44, .14);
    border-radius: 0 0 12px 12px;
  }
  body.ic-hdr #header nav.shop_nav ul.nav li.has-dropdown:hover ul.dropdown-menu,
  body.ic-hdr #header nav.shop_nav ul.nav li.has-dropdown:focus-within ul.dropdown-menu {
    transform: none !important;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity .16s ease .05s, transform .16s ease .05s, visibility 0s !important;
  }
  body.ic-hdr #dropdown-bar nav ul.dropdown-menu > li.card { border-radius: 10px; overflow: hidden; }

  /* Right links (About Us, Tapas Academy, Blog): same colour logic as the categories */
  body.ic-hdr #header .header_bottom_right-wrap a { color: #4d5c6b !important; transition: color .15s; }
  body.ic-hdr #header .header_bottom_right-wrap a:hover { color: #8a6a35 !important; }
}

/* Product sliders' "Discover all…" card stuck out 16px on phones (also in production), so the
   whole page could be dragged sideways. clip (not hidden) keeps position: sticky working. */
html:has(> body.ic-hdr),
body.ic-hdr { overflow-x: clip; }

/* ---------- Mobile header ---------- */
@media (max-width: 767px) {
  body.ic-hdr #header > .container { row-gap: 0; padding-top: 6px; }
  body.ic-hdr #header .brand img.mobile { width: 104px !important; }
  body.ic-hdr #header .search-nav-wrap { padding-top: 6px !important; padding-bottom: 4px !important; }
  body.ic-hdr #header .search-form-wrapper input.search-field {
    height: 40px !important;
    padding-left: 38px !important;
    border: 1px solid #e2d6c3 !important;
    border-radius: 999px !important;
    background: #faf7f2 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a6a35' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") 13px center / 16px no-repeat !important;
    font-size: 16px !important; /* no iOS zoom on focus */
    color: #1a202c !important;
  }
  /* Category chips: scrollable row with a fade that says "there is more" */
  body.ic-hdr #mobile-category-bar { position: relative; }
  body.ic-hdr #mobile-category-bar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 36px;
    pointer-events: none;
    background: linear-gradient(to right, rgba(255, 255, 255, 0), #fff 80%);
  }
  body.ic-hdr #mobile-category-bar .mobile-cat-nav { padding-right: 32px !important; }
  body.ic-hdr #mobile-category-bar .mobile-cat-nav > li > a { color: #1a202c !important; font-size: 15px !important; }
}

/* ---------- Mobile drawer ---------- */
body.ic-hdr .ic-mobile-menu-v2 .ic-menu-header { order: 0; padding-bottom: 8px; }
body.ic-hdr .ic-mobile-menu-v2 .ic-menu-search { display: none; } /* the search is always open below */
body.ic-hdr .ic-mobile-menu-v2 .ic-menu-search-form { display: block !important; order: 1; margin: 0 0 6px; padding: 6px 24px 12px; border: 0; animation: none; }
body.ic-hdr .ic-mobile-menu-v2 .search-field { height: 44px; border: 1px solid #e2d6c3; border-radius: 999px; background: #faf7f2; font-family: Gordita, sans-serif; }
body.ic-hdr .ic-mobile-menu-v2 .search-submit { border-radius: 999px; background: #1a202c; font-family: Gordita, sans-serif; }
body.ic-hdr .ic-mobile-menu-v2 .ichdr-drawer { order: 2; }
body.ic-hdr .ic-mobile-menu-v2 .ic-menu-login { order: 3; margin: 6px 0 36px; }
body.ic-hdr .ic-mobile-menu-v2 .ic-menu-login:has(form)::before {
  content: 'Sign in with a link to your email (no password)';
  display: block;
  margin: 0 0 8px;
  font: 400 13px/1.4 Gordita, sans-serif;
  color: #4d5c6b;
}

.ic-mobile-menu-v2 .ichdr-drawer { padding: 0 24px 8px; font-family: Gordita, 'Helvetica Neue', Arial, sans-serif; }
.ic-mobile-menu-v2 .ichdr-drawer__label { margin: 10px 0 4px; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #8a6a35; }
.ic-mobile-menu-v2 .ichdr-ico { width: 20px; height: 20px; flex: none; }
.ic-mobile-menu-v2 .ichdr-acc { list-style: none; border-top: 1px solid #eee7dc; }
.ic-mobile-menu-v2 .ichdr-acc__item { border-bottom: 1px solid #eee7dc; }
.ic-mobile-menu-v2 .ichdr-acc__btn,
.ic-mobile-menu-v2 .ichdr-acc__btn:focus,
.ic-mobile-menu-v2 .ichdr-acc__btn:active {
  display: flex !important;
  align-items: center;
  justify-content: space-between !important;
  outline: none;
  width: 100%;
  min-height: 56px;
  background: none;
  border: 0;
  font: 600 19px/1.2 Gordita, sans-serif;
  color: #1a202c;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ic-mobile-menu-v2 .ichdr-acc__btn > span { flex: 1; min-width: 0; text-align: left; }
/* common.js appends a <span id="loading"> spinner to every clicked button (as in boards.php). */
.ic-mobile-menu-v2 .ichdr-acc__btn #loading { display: none !important; }
.ic-mobile-menu-v2 .ichdr-acc__btn:focus-visible { box-shadow: inset 0 0 0 2px rgba(211, 174, 118, .6); border-radius: 6px; }
.ic-mobile-menu-v2 .ichdr-acc__btn .ichdr-ico { margin-left: auto; color: #d3ae76; transition: transform .2s ease; }
.ic-mobile-menu-v2 .ichdr-acc__btn[aria-expanded="true"] .ichdr-ico { transform: rotate(180deg); }
.ic-mobile-menu-v2 .ichdr-acc__panel { list-style: none; padding: 0 0 14px 2px; }
.ic-mobile-menu-v2 .ichdr-acc__panel[hidden] { display: none; }
.ic-mobile-menu-v2 .ichdr-acc__panel a {
  display: block;
  padding: 10px 0 10px 14px;
  border-left: 2px solid #f1e8da;
  font: 400 15px/1.35 Gordita, sans-serif;
  color: #4d5c6b;
  text-decoration: none;
}
.ic-mobile-menu-v2 .ichdr-acc__panel a:active { color: #8a6a35; border-left-color: #d3ae76; }
.ic-mobile-menu-v2 .ichdr-acc__panel a.ichdr-acc__all { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-weight: 600; color: #8a6a35; border-left-color: #d3ae76; }
.ic-mobile-menu-v2 .ichdr-acc__all .ichdr-ico { width: 16px; height: 16px; }

.ic-mobile-menu-v2 .ichdr-feature {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 20px 0 26px;
  padding: 12px 14px 12px 12px;
  border: 1px solid #e9dcc6;
  border-radius: 12px;
  background: #fbf6ee;
  color: #1a202c;
  text-decoration: none;
}
.ic-mobile-menu-v2 .ichdr-feature img { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; flex: none; }
.ic-mobile-menu-v2 .ichdr-feature__text { flex: 1; min-width: 0; }
.ic-mobile-menu-v2 .ichdr-feature__title { display: block; font-size: 16px; font-weight: 700; line-height: 1.25; }
.ic-mobile-menu-v2 .ichdr-feature__sub { display: block; margin-top: 2px; font: 400 13px/1.35 Aleo, Georgia, serif; color: #4d5c6b; }
.ic-mobile-menu-v2 .ichdr-feature > .ichdr-ico { color: #8a6a35; }

.ic-mobile-menu-v2 .ichdr-links { list-style: none; margin-bottom: 18px; }
.ic-mobile-menu-v2 .ichdr-links a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  font: 400 16px/1.3 Gordita, sans-serif;
  color: #1a202c;
  text-decoration: none;
}
.ic-mobile-menu-v2 .ichdr-links .ichdr-ico { color: #8a6a35; }

/* ---------- Account access on phones ---------- */
body.ic-hdr .ichdr-mob-account { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-right: 2px; color: #1a202c; }
body.ic-hdr .ichdr-mob-account .ichdr-ico { width: 26px; height: 26px; }
body.ic-hdr .ichdr-mob-account__dot { position: absolute; top: 7px; right: 7px; width: 9px; height: 9px; border: 2px solid #fff; border-radius: 50%; background: #22a55a; }
.ic-mobile-menu-v2 .ichdr-account {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 14px;
  padding: 12px 14px;
  border: 1px solid #e9dcc6;
  border-radius: 12px;
  background: #fbf6ee;
  color: #1a202c;
  text-decoration: none;
}
.ic-mobile-menu-v2 .ichdr-account > .ichdr-ico:first-child { width: 38px; height: 38px; padding: 8px; border-radius: 50%; background: #fff; color: #8a6a35; }
.ic-mobile-menu-v2 .ichdr-account > .ichdr-ico:last-child { width: 18px; height: 18px; margin-left: auto; color: #8a6a35; }
.ic-mobile-menu-v2 .ichdr-account__text { min-width: 0; }
.ic-mobile-menu-v2 .ichdr-account__title { display: block; font: 700 16px/1.25 Gordita, sans-serif; }
.ic-mobile-menu-v2 .ichdr-account__sub { display: block; margin-top: 2px; font: 400 13px/1.35 Gordita, sans-serif; color: #4d5c6b; }
/* The account row replaces the old login block at the bottom of the drawer */
body.ic-hdr .ic-mobile-menu-v2 .ic-menu-login { display: none !important; }
