/**
 * SkipTheQueue — premium UI layer: motion, focus, depth, smooth scrolling.
 */

:root {
  --stq-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --stq-ease-spring: cubic-bezier(0.34, 1.3, 0.64, 1);
  --stq-shadow-sm: 0 1px 2px rgba(28, 28, 28, 0.04);
  --stq-shadow-card: 0 4px 24px rgba(28, 28, 28, 0.06), 0 2px 8px rgba(28, 28, 28, 0.04);
  --stq-shadow-card-hover: 0 12px 40px rgba(28, 28, 28, 0.08), 0 4px 16px rgba(28, 28, 28, 0.05);
  --stq-nav-h: 3.5rem;
}

@media (min-width: 640px) {
  :root {
    --stq-nav-h: 4rem;
  }
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--stq-nav-h) + 12px);
}

body.stq-ui {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(230, 138, 78, 0.22);
  color: #1c1c1c;
}

/* Focus: visible, on-brand */
.stq-focus-ring:focus-visible,
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #e68a4e;
  outline-offset: 2px;
}

button:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
  outline: none;
}

/* Frosted top nav */
.stq-nav-glass {
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(12px) saturate(1.35);
  backdrop-filter: blur(12px) saturate(1.35);
  border-bottom-color: #eaeaea !important;
  box-shadow: var(--stq-shadow-sm);
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .stq-nav-glass {
    background: #ffffff;
  }
}

/* Sticky cart bar — glass + hairline */
#stqStickyCart .stq-sticky-cart__inner {
  background: rgba(255, 255, 255, 0.94) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
  border-top: 1px solid #eaeaea !important;
  box-shadow: 0 -8px 32px rgba(28, 28, 28, 0.06), 0 -1px 0 rgba(255, 255, 255, 0.9) inset !important;
}

/* Desktop nav links — subtle underline */
.stq-nav-link {
  position: relative;
  padding: 0.25rem 0;
}
.stq-nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: #e68a4e;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--stq-ease-out);
}
.stq-nav-link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Scroll-in reveal (IntersectionObserver adds .stq-in-view) */
.stq-reveal {
  opacity: 0;
  transform: translate3d(0, 16px, 0);
  transition:
    opacity 0.5s var(--stq-ease-out),
    transform 0.55s var(--stq-ease-out);
  transition-delay: calc(min(var(--stq-i, 0), 10) * 40ms);
}
.stq-reveal.stq-in-view {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Menu / product cards */
.stq-menu-card {
  box-shadow: var(--stq-shadow-card);
  transition:
    box-shadow 0.4s var(--stq-ease-out),
    transform 0.35s var(--stq-ease-out),
    border-color 0.25s ease;
}
.stq-menu-card:hover {
  box-shadow: var(--stq-shadow-card-hover);
  transform: translate3d(0, -2px, 0);
}
.stq-menu-card--muted:hover {
  transform: none !important;
  box-shadow: var(--stq-shadow-card) !important;
}

/* Refined skeleton (brand-tinted) */
.skeleton {
  background: linear-gradient(
    90deg,
    #f5f0ea 0%,
    #ebe4dc 40%,
    #f2ebe4 60%,
    #f5f0ea 100%
  ) !important;
  background-size: 200% 100% !important;
  animation: stq-skeleton-shimmer 1.1s ease-in-out infinite !important;
}
@keyframes stq-skeleton-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

/* Page enter — slightly richer */
#page-transition {
  animation-duration: 0.32s !important;
  animation-timing-function: var(--stq-ease-out) !important;
}

/* Tracker chip polish */
#activeOrderTracker .tracker-bar-inner {
  box-shadow: var(--stq-shadow-card);
  border-color: #eaeaea !important;
  transition: transform 0.2s var(--stq-ease-out), box-shadow 0.25s ease;
}
#activeOrderTracker .tracker-bar-inner:active {
  transform: scale(0.99);
}

/* Mobile drawer links */
.stq-mobile-link {
  border-radius: 0.75rem;
  transition: background-color 0.2s ease, transform 0.15s ease;
}
.stq-mobile-link:active {
  transform: scale(0.99);
}

/* User dropdown */
.stq-dropdown {
  border-radius: 0.875rem;
  box-shadow: var(--stq-shadow-card-hover);
  border-color: #eaeaea !important;
}

/* Home / marketing cards — subtle lift */
.stq-lift-hover {
  transition:
    transform 0.35s var(--stq-ease-out),
    box-shadow 0.35s var(--stq-ease-out),
    border-color 0.25s ease;
}
.stq-lift-hover:hover {
  transform: translate3d(0, -3px, 0);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
    scroll-padding-top: var(--stq-nav-h);
  }
  .stq-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .stq-menu-card {
    transition: box-shadow 0.2s ease !important;
  }
  .stq-menu-card:hover {
    transform: none !important;
  }
  .stq-lift-hover:hover {
    transform: none !important;
  }
  #page-transition {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .stq-nav-link::after {
    transition: none !important;
    transform: scaleX(0) !important;
  }
  .stq-nav-link:hover::after {
    transform: scaleX(1) !important;
  }
  .skeleton {
    animation: none !important;
  }
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: #e68a4e #f0ebe4;
}
