/* storefront/layout.css — Site chrome: preloader, sticky header, side navigation drawer, footer,
   floating WhatsApp button and toast.
   Part 3 of 9; files are linked in this order in views/storefront.html (cascade order matters). */

/* ============================================================================
   PRELOADER
   ============================================================================ */
.mk-preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-page);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  transition:
    opacity 0.55s var(--ease),
    visibility 0.55s var(--ease);
  /* Safety net: if the scripts never run, never leave the site covered */
  animation: mk-preloader-timeout 0.55s var(--ease) 6s forwards;
}

.mk-preloader.mk-preloader-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@keyframes mk-preloader-timeout {
  to {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

.mk-preloader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.mk-preloader-logo {
  width: auto;
  height: 96px;
  margin-bottom: 18px;
}

.mk-preloader-brand {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: var(--ink);
  letter-spacing: 0.04em;
}

.mk-preloader-sub {
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--brand-ink);
  margin: 6px 0 22px;
}

.mk-preloader-bar-track {
  width: 160px;
  height: 1px;
  background: var(--line);
  overflow: hidden;
}

.mk-preloader-bar-fill {
  height: 100%;
  background: var(--brand-primary);
  transform-origin: left;
  animation: mkPreloaderProgress 0.9s var(--ease) forwards;
}

@keyframes mkPreloaderProgress {
  from {
    transform: scaleX(0.08);
  }
  to {
    transform: scaleX(1);
  }
}

/* ============================================================================
   HEADER
   ============================================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(252, 251, 248, 0.94);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
  transition:
    box-shadow 0.3s ease,
    background-color 0.3s ease,
    border-color 0.3s ease;
}

/* Once the page scrolls (js/storefront/ui.js): a soft shadow and a slightly smaller logo.
   The bar keeps its height, so nothing below it jumps. */
.site-header.is-scrolled {
  background: rgba(252, 251, 248, 0.97);
  border-bottom-color: transparent;
  box-shadow: var(--shadow-header);
}

.site-header .brand-logo-img {
  transition: transform 0.3s var(--ease);
  transform-origin: center;
}

.site-header.is-scrolled .brand-logo-img {
  transform: scale(0.88);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: 24px;
  flex-wrap: nowrap;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
  min-width: 0;
}

.hamburger-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 4px;
  background: none;
  border: none;
  color: var(--ink);
  flex-shrink: 0;
  white-space: nowrap;
}

.hamburger-lines {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 20px;
  height: 11px;
  flex-shrink: 0;
}

.hamburger-lines span {
  display: block;
  height: 1.5px;
  width: 100%;
  background: currentColor;
  transition: width 0.25s var(--ease);
}

.hamburger-lines span:nth-child(2) {
  width: 70%;
}

.hamburger-btn:hover .hamburger-lines span:nth-child(2) {
  width: 100%;
}

.hamburger-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1;
}

.brand-logo-wrap {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  flex-shrink: 0;
  padding-inline-start: 18px;
  border-inline-start: 1px solid var(--line);
}

/* The logo file is light lettering on a dark tile. Inverting it (and rotating the
   hue back) turns the tile white and the white "mini" black while keeping KITCHEN
   orange; multiply then drops the white, so the lettering sits on the page. */
.brand-logo-img,
.mk-preloader-logo {
  filter: invert(1) hue-rotate(172deg) brightness(1.16) contrast(1.15) saturate(1.4);
  mix-blend-mode: multiply;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-logo-img {
  width: 105px;
  height: 70px;
  overflow: hidden;
}

.site-footer .brand-logo-img {
  width: 156px;
  height: 104px;
}

.brand-logo-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  white-space: nowrap;
}

.brand-logo-title {
  font-family: var(--font-serif);
  font-size: 1.22rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.brand-logo-sub {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand-ink);
  margin-top: 4px;
  line-height: 1.1;
}

.header-center-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-shrink: 0;
  height: 100%;
}

.nav-pill {
  position: relative;
  height: 100%;
  padding: 0 2px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  transition: color 0.2s ease;
}

.nav-pill::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  bottom: -1px;
  height: 1px;
  background: var(--brand-primary);
  transform: scaleX(0);
  transition: transform 0.25s var(--ease);
}

.nav-pill:hover {
  color: var(--ink);
}

.nav-pill.active {
  color: var(--ink);
  font-weight: 600;
}

.nav-pill.active::after {
  transform: scaleX(1);
  height: 2px;
}

/* Restaurant and delivery are side businesses: after a hairline, a size smaller */
.nav-divider {
  width: 1px;
  height: 18px;
  background: var(--line-strong);
  flex-shrink: 0;
}

.nav-pill-secondary {
  font-size: 0.8rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-pref-btn,
.header-cart-btn {
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border-radius: var(--radius-control);
  border: 1px solid var(--line-strong);
  background: var(--bg-card);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  transition: var(--transition);
}

.header-pref-btn:hover,
.header-cart-btn:hover {
  border-color: var(--ink);
}

.header-cart-btn i {
  font-size: 0.95rem;
}

.cart-count-badge {
  background: var(--ink);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  line-height: 1;
}

.btn-whatsapp-header {
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: var(--radius-control);
  border: none;
  background: var(--whatsapp);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1;
  transition: var(--transition);
}

.btn-whatsapp-header i {
  font-size: 1.05rem;
}

.btn-whatsapp-header:hover {
  background: var(--whatsapp-hover);
}

/* ============================================================================
   SIDE NAVIGATION DRAWER (and the backdrop it shares with the basket)
   ============================================================================ */
.nav-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(29, 27, 24, 0.32);
  backdrop-filter: blur(3px);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.nav-drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.nav-drawer {
  position: fixed;
  top: 0;
  inset-inline-start: 0;
  width: 100%;
  max-width: 400px;
  height: 100vh;
  height: 100dvh;
  background: var(--bg-card);
  color: var(--text);
  z-index: 2001;
  transform: translateX(-100%);
  transition:
    transform 0.38s var(--ease),
    visibility 0s linear 0.38s;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  visibility: hidden;
}

.nav-drawer.open {
  transform: translateX(0);
  visibility: visible;
  box-shadow: var(--shadow-dialog);
  transition-delay: 0s;
}

.nav-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}

.nav-drawer-header .brand-logo-wrap {
  padding-inline-start: 0;
  border-inline-start: none;
}

.drawer-close-btn {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.drawer-close-btn:hover {
  border-color: var(--ink);
}

.nav-drawer-body {
  padding: 12px 24px 28px;
  flex: 1;
}

.drawer-menu-list {
  list-style: none;
  margin-bottom: 18px;
}

.drawer-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 4px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-align: start;
  transition: var(--transition);
}

.drawer-menu-sub {
  padding-inline-start: 28px;
}

.drawer-item-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--brand-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.drawer-item-text {
  flex: 1;
  min-width: 0;
}

.drawer-item-title {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.25;
}

.drawer-menu-sub .drawer-item-title {
  font-size: 1.02rem;
}

.drawer-group-label {
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 6px 4px 0;
}

.drawer-menu-secondary .drawer-item-icon {
  width: 30px;
  height: 30px;
  font-size: 0.8rem;
}

.drawer-item-desc {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.drawer-item-arrow {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform 0.25s var(--ease);
}

.drawer-menu-item:hover .drawer-item-arrow,
.drawer-menu-item.active .drawer-item-arrow {
  transform: translateX(3px);
  color: var(--brand-ink);
}

.drawer-menu-item.active .drawer-item-icon {
  border-color: var(--brand-primary);
  background: var(--brand-soft);
}

.drawer-utility-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.drawer-utility-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-control);
  border: 1px solid var(--line-strong);
  background: var(--bg-card);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 600;
  transition: var(--transition);
}

.drawer-utility-item i {
  color: var(--brand-ink);
}

.drawer-utility-item:hover {
  border-color: var(--ink);
}

.drawer-whatsapp-box {
  background: var(--bg-ivory);
  border-radius: var(--radius-card);
  padding: 18px 18px 8px;
}

.drawer-wa-buttons {
  display: flex;
  flex-direction: column;
  margin-top: 6px;
}

.drawer-wa-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 500;
}

.drawer-wa-btn:last-child {
  border-bottom: none;
}

.drawer-wa-number {
  color: var(--whatsapp);
  font-weight: 700;
  white-space: nowrap;
  direction: ltr;
}

.drawer-wa-btn:hover {
  color: var(--whatsapp);
}

/* ============================================================================
   FOOTER: catering call-to-action band, four columns, bottom line with "Back to top"
   ============================================================================ */
.site-footer {
  background: var(--bg-ivory);
  color: var(--text);
  border-top: 1px solid var(--line);
  padding: var(--space-8) 0 var(--space-6);
  font-size: var(--fs-small);
}

.footer-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-5) var(--space-7);
  margin: 0 0 var(--space-8);
  padding: clamp(28px, 4vw, 44px) clamp(24px, 4vw, 48px);
  background: var(--ink);
  color: rgba(255, 255, 255, 0.82);
  border-radius: var(--radius-dialog);
}

.footer-cta .eyebrow {
  color: #f0d79a;
}

.footer-cta-title {
  font-family: var(--font-serif);
  font-size: clamp(1.45rem, 2.6vw, 2rem);
  line-height: 1.2;
  color: #fff;
  margin-top: var(--space-2);
}

.footer-cta-text {
  margin-top: var(--space-2);
  font-size: 0.95rem;
}

.footer-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.footer-cta .btn-primary {
  background: #fff;
  color: var(--ink);
}

.footer-cta .btn-primary:hover {
  background: var(--bg-sunken);
}

.footer-cta :focus-visible {
  outline-color: #fff;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.35fr;
  gap: var(--space-7);
  margin-bottom: var(--space-7);
}

.site-footer .brand-logo-wrap {
  padding-inline-start: 0;
  border-inline-start: none;
  margin-bottom: var(--space-4);
}

.footer-about {
  color: var(--text-muted);
  max-width: 38ch;
}

.footer-heading {
  font-family: var(--font-sans);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--brand-ink);
  margin-bottom: var(--space-4);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-link-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: var(--fs-small);
  text-align: start;
  padding: 0;
}

.footer-links a,
.footer-link-btn {
  transition: color 0.2s ease;
}

.footer-links a:hover,
.footer-link-btn:hover {
  color: var(--brand-ink);
}

.footer-contact li {
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.footer-contact i {
  width: 16px;
  color: var(--brand-ink);
  flex-shrink: 0;
  text-align: center;
}

.footer-contact a {
  color: var(--ink);
  font-weight: 600;
  direction: ltr;
  unicode-bidi: isolate;
  white-space: nowrap;
}

.social-icons-row {
  display: flex;
  gap: 10px;
  margin-top: var(--space-5);
}

.social-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.social-icon-btn:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: var(--space-5);
  border-top: 1px solid var(--line);
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.footer-top-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  background: none;
  border: none;
  color: var(--ink);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.footer-top-btn i {
  transition: transform 0.25s var(--ease);
}

.footer-top-btn:hover i {
  transform: translateY(-2px);
}

/* ============================================================================
   FLOATING WHATSAPP BUTTON & TOAST
   ============================================================================ */
.floating-wa-container {
  position: fixed;
  bottom: 22px;
  inset-inline-end: 22px;
  z-index: 1500;
  transition:
    opacity 0.3s ease,
    transform 0.3s var(--ease);
}

.floating-wa-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 50px;
  padding: 0 20px;
  border-radius: var(--radius-control);
  border: none;
  background: var(--whatsapp);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 14px 32px -12px rgba(26, 128, 69, 0.5);
  white-space: nowrap;
  transition: var(--transition);
}

.floating-wa-btn i {
  font-size: 1.3rem;
}

.floating-wa-btn:hover {
  background: var(--whatsapp-hover);
  transform: translateY(-2px);
}

.mk-toast {
  position: fixed;
  bottom: calc(90px + var(--bar-h));
  inset-inline-end: 22px;
  z-index: 3000;
  max-width: min(380px, calc(100vw - 44px));
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: var(--radius-card);
  background: var(--bg-card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--brand-primary);
  box-shadow: var(--shadow-float);
  font-size: var(--fs-small);
  font-weight: 600;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition:
    opacity 0.3s ease,
    transform 0.3s var(--ease);
}

.mk-toast.show {
  opacity: 1;
  transform: none;
}

.mk-toast i {
  color: var(--success);
}
