/* ==========================================================================
   Sadia's Kitchen - Frontend Header
   Top utility bar + main header + primary navigation + mega menu
   ========================================================================== */

:root {
  --sk-accent: var(--primary-color, #ec1a23);
  --sk-accent-dark: #c1161d;
  --sk-accent-soft: #fdeced;
  --sk-badge: #ff0f07;
  --sk-head-text: #1f2937;
  --sk-head-muted: #6b7280;
  --sk-head-border: #e9e9e9;
  --sk-head-shadow: 0 14px 30px rgba(0, 0, 0, 0.1);
  --sk-header-height: 164px;
}

/* ---------------------------------------------------------
   1. TOP UTILITY BAR
   --------------------------------------------------------- */
.sk-topbar {
  height: 38px;
  background: #fff;
  border-bottom: 1px solid var(--sk-head-border);
}

.sk-topbar-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.sk-topbar-left,
.sk-topbar-right,
.sk-topbar-info {
  display: flex;
  align-items: center;
}

.sk-topbar-left {
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--sk-head-text);
}

.sk-topbar-left iconify-icon {
  font-size: 16px;
  color: var(--sk-accent);
}

.sk-topbar-right {
  gap: 26px;
}

.sk-topbar-info {
  gap: 6px;
  font-size: 13px;
  color: var(--sk-head-muted);
  max-width: 380px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s ease;
}

.sk-topbar-info iconify-icon {
  font-size: 15px;
  color: var(--sk-accent);
  flex: 0 0 auto;
}

.sk-topbar-info .sk-topbar-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

a.sk-topbar-info:hover {
  color: var(--sk-accent);
}

/* ---------------------------------------------------------
   2. MAIN HEADER
   --------------------------------------------------------- */
.sk-main {
  background: #fff;
}

.sk-main-inner {
  height: 78px;
  display: flex;
  align-items: center;
  gap: 26px;
}

/* Logo (grows equally with the actions so the search stays centered) */
.sk-logo {
  display: flex;
  align-items: center;
  flex: 1 1 0;
}

.sk-logo img {
  height: 58px;
  width: auto;
  object-fit: contain;
}

/* Search (input + button as one connected component) - centered */
.sk-search {
  flex: 0 1 560px;
  max-width: 560px;
  height: 46px;
  display: flex;
  align-items: stretch;
  background: #fff;
  border: 1px solid #e2e5e9;
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sk-search:focus-within {
  border-color: var(--sk-accent);
  box-shadow: 0 0 0 3px rgba(236, 26, 35, 0.15);
}

.sk-search input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0 18px;
  font-family: var(--secondary-font);
  font-size: 14px;
  color: var(--sk-head-text);
  background: transparent;
}

.sk-search input::placeholder {
  color: #9ca3af;
}

.sk-search button {
  flex: 0 0 auto;
  width: 54px;
  border: 0;
  background: var(--sk-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.sk-search button:hover {
  background: var(--sk-accent-dark);
}

.sk-search button iconify-icon {
  font-size: 21px;
}

/* Right side action blocks */
.sk-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 26px;
  flex: 1 1 0;
}

.sk-action {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--sk-head-text);
  transition: color 0.2s ease;
}

.sk-action-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sk-accent);
}

.sk-action-icon iconify-icon {
  font-size: 27px;
}

.sk-action-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.sk-action-text small {
  font-size: 11.5px;
  font-weight: 400;
  color: var(--sk-head-muted);
  white-space: nowrap;
}

.sk-action-text strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--sk-head-text);
  white-space: nowrap;
}

.sk-action:hover .sk-action-text strong {
  color: var(--sk-accent);
}

/* Mobile search toggle */
.sk-search-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 0;
  background: transparent;
  color: var(--sk-head-text);
  cursor: pointer;
}

.sk-search-toggle iconify-icon {
  font-size: 23px;
}

/* Cart block (keeps the `.cart` class so cart.js opens the existing cart sidebar) */
.sk-header .sk-header-cart.cart {
  position: relative;
  top: auto;
  right: auto;
  transform: none;
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  color: var(--sk-head-text);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
}

.sk-header .sk-header-cart-icon {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 9px;
  background: var(--sk-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.sk-header .sk-header-cart:hover .sk-header-cart-icon {
  background: var(--sk-accent-dark);
}

.sk-header .sk-header-cart-icon iconify-icon {
  font-size: 23px;
}

/* Desktop keeps the light glyph; the <=991 block swaps in the bolder fill one */
.sk-header .sk-header-cart-icon .sk-cart-icon-fill {
  display: none;
}

.sk-header .sk-header-cart .notification {
  position: absolute;
  top: -7px;
  right: -7px;
  left: auto;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--sk-badge);
  color: #fff;
  border: 2px solid #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.sk-header .sk-header-cart-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.sk-header .sk-header-cart-text small {
  font-size: 11.5px;
  color: var(--sk-head-muted);
}

.sk-header .sk-header-cart-text strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--sk-head-text);
  white-space: nowrap;
}

.sk-header .sk-header-cart:hover .sk-header-cart-text strong {
  color: var(--sk-accent);
}

/* Mobile menu button */
.sk-burger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--sk-head-border);
  border-radius: 8px;
  background: #fff;
  color: var(--sk-head-text);
  cursor: pointer;
}

.sk-burger iconify-icon {
  font-size: 24px;
}

/* ---------------------------------------------------------
   3. PRIMARY NAVIGATION
   --------------------------------------------------------- */
.sk-nav {
  position: relative;
  background: #fff;
  border-top: 1px solid var(--sk-head-border);
  border-bottom: 1px solid var(--sk-head-border);
}

.sk-nav-inner {
  display: flex;
  justify-content: center;
}

.sk-nav-list {
  display: flex;
  align-items: stretch;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.sk-nav-item {
  position: relative;
  display: flex;
  align-items: stretch;
}

.sk-nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 46px;
  padding: 0 22px;
  font-family: var(--secondary-font);
  font-size: 15px;
  font-weight: 500;
  color: var(--sk-head-text);
  letter-spacing: 0.01em;
  transition: color 0.2s ease;
}

.sk-nav-link .sk-caret {
  font-size: 14px;
  color: #9ca3af;
  transition: color 0.2s ease;
}

.sk-nav-item:hover > .sk-nav-link,
.sk-nav-item.is-active > .sk-nav-link,
.sk-nav-item.open > .sk-nav-link {
  color: var(--sk-accent);
}

.sk-nav-item:hover > .sk-nav-link .sk-caret,
.sk-nav-item.is-active > .sk-nav-link .sk-caret,
.sk-nav-item.open > .sk-nav-link .sk-caret {
  color: var(--sk-accent);
}

/* Simple dropdown panels */
.sk-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 210px;
  background: #fff;
  border: 1px solid var(--sk-head-border);
  border-radius: 0 0 8px 8px;
  box-shadow: var(--sk-head-shadow);
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  z-index: 30;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

.sk-nav-item:hover .sk-dropdown,
.sk-nav-item.open .sk-dropdown {
  opacity: 1;
  visibility: visible;
}

.sk-dropdown a {
  display: block;
  padding: 9px 22px;
  font-size: 14px;
  color: #4b5563;
  white-space: nowrap;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.sk-dropdown a:hover,
.sk-dropdown a.is-current {
  color: var(--sk-accent);
  background: var(--sk-accent-soft);
}

/* Wide dropdown (branch list) */
.sk-dropdown-wide {
  display: grid;
  grid-template-columns: repeat(2, 180px);
  max-height: 340px;
  overflow-y: auto;
}

.sk-dropdown-wide a {
  white-space: normal;
}

/* ---------------------------------------------------------
   4. ORDER MENU MEGA MENU
   --------------------------------------------------------- */
.sk-mega {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid var(--sk-head-border);
  box-shadow: var(--sk-head-shadow);
  padding: 26px 0 30px;
  opacity: 0;
  visibility: hidden;
  z-index: 20;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

.sk-nav.mega-open .sk-mega {
  opacity: 1;
  visibility: visible;
}

.sk-nav.mega-open .sk-has-mega > .sk-nav-link,
.sk-nav.mega-open .sk-has-mega > .sk-nav-link .sk-caret {
  color: var(--sk-accent);
}

.sk-mega-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
}

.sk-mega-col h6 {
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0f0f0;
  font-family: var(--primary-font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sk-head-text);
}

.sk-mega-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sk-mega-col ul li a {
  display: block;
  padding: 6px 0;
  font-size: 14px;
  color: #4b5563;
  transition: color 0.15s ease;
}

.sk-mega-col ul li a:hover {
  color: var(--sk-accent);
}

.sk-mega-col ul li.sk-highlight a {
  color: var(--sk-accent);
  font-weight: 600;
}

/* Dark overlay while the mega menu is active.
   Negative z-index keeps it under the header chrome but above the page. */
.sk-mega-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  z-index: -1;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.sk-mega-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ---------------------------------------------------------
   MOBILE OFFCANVAS MENU
   --------------------------------------------------------- */

/* Panel: full height column, no default padding (header/menu/social own it) */
.sk-sidebar {
  width: min(86vw, 320px);
  left: calc(-1 * min(86vw, 320px));
  height: 100dvh;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.08);
}

/* ---- Header row: title + close on the same line ---- */
.sk-sidebar-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: #fff;
  border-bottom: 1px solid #eceff3;
}

.sk-sidebar-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--primary-font);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2;
  color: #16181d;
}

.sk-sidebar-title iconify-icon {
  font-size: 22px;
  color: var(--sk-accent);
}

.sk-sidebar .sk-close-btn {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid #e4e7ec;
  border-radius: 6px;
  background: #f4f6f9;
  font-size: 20px;
  line-height: 1;
  color: #16181d;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease,
    transform 0.15s ease;
}

.sk-sidebar .sk-close-btn:hover,
.sk-sidebar .sk-close-btn:focus-visible {
  background: var(--sk-accent);
  border-color: var(--sk-accent);
  color: #fff;
  outline: none;
}

.sk-sidebar .sk-close-btn:active {
  transform: scale(0.95);
}

/* ---- Menu list ---- */
.sk-sidebar .sk-sidebar-menu {
  flex: 1 1 auto;
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.sk-sidebar .sk-sidebar-menu > li {
  margin: 0;
  border-bottom: 1px solid #eceff3;
}

.sk-sidebar .sk-sidebar-menu > li:last-child {
  border-bottom: 0;
}

/* One shared row style for every item (links + dropdown summaries) */
.sk-sidebar .sk-sidebar-menu > li > a,
.sk-sidebar .sk-sidebar-menu > li > details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  margin: 0;
  padding: 14px 16px;
  font-family: var(--secondary-font);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  color: #1f2430;
  text-decoration: none;
  background: none;
  border: 0;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.sk-sidebar .sk-sidebar-menu > li > a > span,
.sk-sidebar .sk-sidebar-menu > li > details > summary > span {
  min-width: 0;
}

.sk-sidebar .sk-sidebar-menu > li > a:hover,
.sk-sidebar .sk-sidebar-menu > li > a:focus-visible,
.sk-sidebar .sk-sidebar-menu > li > details > summary:hover,
.sk-sidebar .sk-sidebar-menu > li > details > summary:focus-visible {
  color: var(--sk-accent);
  background: var(--sk-accent-soft);
  transform: none;
  outline: none;
}

.sk-sidebar .sk-sidebar-menu > li.is-active > a {
  color: var(--sk-accent);
  font-weight: 600;
}

/* Native <details> marker off */
.sk-sidebar .sk-sidebar-menu summary {
  list-style: none;
}

.sk-sidebar .sk-sidebar-menu summary::-webkit-details-marker {
  display: none;
}

/* ---- Arrow icons ---- */
.sk-sidebar-arrow {
  font-size: 18px;
  color: #aeb6c2;
  flex-shrink: 0;
  transition: transform 0.25s ease, color 0.2s ease;
}

.sk-sidebar .sk-sidebar-menu > li > a:hover .sk-sidebar-arrow {
  color: var(--sk-accent);
}

.sk-sidebar .sk-sidebar-menu > li > details[open] > summary .sk-sidebar-arrow {
  transform: rotate(90deg);
  color: var(--sk-accent);
}

/* ---- Sub menu ---- */
.sk-sidebar .sk-sidebar-sub {
  padding: 0 0 6px;
  background: #fafbfc;
  border-top: 1px solid #f4f6f8;
}

.sk-sidebar .sk-sidebar-sub a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 11px 16px 11px 34px;
  font-family: var(--secondary-font);
  font-size: 14.5px;
  font-weight: 400;
  color: #4b5563;
  text-decoration: none;
  border-bottom: 1px solid #f1f3f6;
  transition: color 0.2s ease, background 0.2s ease;
}

.sk-sidebar .sk-sidebar-sub a:last-child {
  border-bottom: 0;
}

.sk-sidebar .sk-sidebar-sub a:hover,
.sk-sidebar .sk-sidebar-sub a:focus-visible {
  color: var(--sk-accent);
  background: #fff;
  transform: none;
}

/* ---- CTA button ---- */
.sk-sidebar .sk-sidebar-menu > li.sk-sidebar-cta {
  padding: 16px;
  border-bottom: 0;
}

.sk-sidebar .sk-sidebar-menu .sk-sidebar-cta .order-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  max-width: none;
  padding: 12px 18px;
  border: 0;
  border-radius: 6px;
  background: var(--sk-accent);
  font-family: var(--secondary-font);
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  text-align: center;
  transition: background 0.2s ease;
}

.sk-sidebar .sk-sidebar-menu .sk-sidebar-cta .order-button:hover,
.sk-sidebar .sk-sidebar-menu .sk-sidebar-cta .order-button:focus-visible {
  background: var(--sk-accent-dark);
  color: #fff;
  transform: none;
}

/* ---- Dynamic social icons ---- */
.sk-sidebar .sk-sidebar-social {
  flex: 0 0 auto;
  padding: 16px;
  background: #fff;
  border-top: 1px solid #eceff3;
}

.sk-sidebar .sk-sidebar-social-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.sk-sidebar .sk-sidebar-social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid #e4e7ec;
  border-radius: 50%;
  background: #f4f6f9;
  font-size: 19px;
  color: #1f2430;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease,
    transform 0.2s ease;
}

.sk-sidebar .sk-sidebar-social-links a:hover,
.sk-sidebar .sk-sidebar-social-links a:focus-visible {
  background: var(--sk-accent);
  border-color: var(--sk-accent);
  color: #fff;
  transform: translateY(-2px);
}

/* ---------------------------------------------------------
   COMPACT SCROLL STATE
   On scroll the top utility bar and the primary nav collapse
   (animated together by the header script), so only the main
   header row (.sk-main) stays pinned at the top.
   --------------------------------------------------------- */

/* Hiding/showing those bars changes the height of the document. Scroll
   anchoring would then compensate the scroll offset for that change,
   pushing it back across the hide/show threshold of the header script -
   the two fight each other and the bars oscillate (shake) instead of
   settling. The script owns the scroll state, so the document opts out
   of anchoring (on both root boxes: the viewport scroller is associated
   with the document element, `body` excludes every visible subtree).
   Harmless in browsers without scroll anchoring (Safari). */
html,
body {
  overflow-anchor: none;
}

.sk-header.is-compact .sk-main {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
}

.sk-header.is-compact .sk-topbar,
.sk-header.is-compact .sk-nav {
  pointer-events: none;
}

/* ---------------------------------------------------------
   RESPONSIVE
   --------------------------------------------------------- */
@media (max-width: 1199.98px) {
  :root {
    --sk-header-height: 164px;
  }

  .sk-topbar-address {
    display: none;
  }

  .sk-action-phone {
    display: none;
  }

  .sk-main-inner {
    gap: 18px;
  }

  .sk-actions {
    gap: 18px;
  }

  .sk-nav-link {
    padding: 0 16px;
    font-size: 14.5px;
  }

  .sk-mega-grid {
    gap: 22px;
  }
}

@media (max-width: 991.98px) {
  :root {
    --sk-header-height: 106px;
  }

  .sk-topbar {
    height: 38px;
  }

  .sk-main-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    height: auto;
    min-height: 68px;
    padding: 0 5px;
    gap: 12px 0;
  }

  /* Actions sit flush with the 5px inner padding - keep the cart badge
     inside the viewport instead of 7px past the button edge */
  .sk-header .sk-header-cart .notification {
    right: -4px;
  }

  /* Burger left | logo centered | account / search / cart right */
  .sk-burger {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    display: flex;
  }

  .sk-logo {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
  }

  .sk-actions {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    justify-content: flex-end;
    gap: 6px;
  }

  .sk-logo img {
    height: 48px;
  }

  /* Search becomes a full-width row when toggled open */
  .sk-search {
    display: none;
    grid-column: 1 / -1;
    grid-row: 2;
    max-width: none;
    height: 44px;
  }

  .sk-header.sk-search-open .sk-search {
    display: flex;
  }

  .sk-search-toggle {
    display: flex;
  }

  .sk-action-text {
    display: none;
  }

  .sk-header .sk-header-cart-text {
    display: none;
  }

  /* Mobile cart icon: bolder fill glyph, sized/padded like the search + account buttons */
  .sk-header .sk-header-cart-icon {
    width: 40px;
    height: 40px;
    border-radius: 9px;
    padding: 6px;
  }

  .sk-header .sk-header-cart-icon iconify-icon {
    font-size: 24px;
  }

  .sk-header .sk-header-cart-icon .sk-cart-icon-light {
    display: none;
  }

  .sk-header .sk-header-cart-icon .sk-cart-icon-fill {
    display: inline-flex;
  }

  /* Navigation collapses into the offcanvas menu */
  .sk-nav {
    display: none;
  }
}

@media (max-width: 767.98px) {
  :root {
    --sk-header-height: 62px;
  }

  .sk-topbar {
    display: none;
  }

  .sk-main-inner {
    min-height: 62px;
    padding: 0 5px;
  }

  .sk-logo img {
    height: 44px;
  }

  .sk-action-icon iconify-icon {
    font-size: 24px;
  }

  /* Keep the left group narrow enough that the centered logo never shifts */
  .sk-actions {
    gap: 4px;
  }

  .sk-burger {
    width: 36px;
    height: 36px;
  }

  .sk-search-toggle {
    width: 36px;
    height: 36px;
  }

  .sk-header .sk-header-cart-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    padding: 6px;
  }
}

@media (max-width: 480px) {
  .sk-main-inner {
    gap: 8px 0;
  }

  .sk-actions {
    gap: 4px;
  }

  .sk-logo img {
    height: 40px;
  }
}
