/* Import Google Fonts with font-display: swap for better performance */
@import url('https://fonts.googleapis.com/css2?family=Cormorant:wght@400;500;600;700&family=Nunito+Sans:wght@400;500;600;700&display=swap');

/* Theme Colors - Primary Navy Blue */
:root {
  --color-primary: #062451;
  --color-primary-50: #e6e9f0;
  --color-primary-100: #ccd3e1;
  --color-primary-200: #99a7c3;
  --color-primary-300: #667ba5;
  --color-primary-400: #334f87;
  --color-primary-500: #062451;
  --color-primary-600: #051d41;
  --color-primary-700: #041631;
  --color-primary-800: #030f20;
  --color-primary-900: #020810;
  --color-primary-950: #010408;
  
  --color-heading: #1a202c;
  --color-body: #4a5568;
  
  /* Hero section heights - standardized across the site */
  --hero-height-mobile: 60vh;
  --hero-height-desktop: 50vh;
  --hero-height-home-mobile: 100vh;
  --hero-height-home-desktop: 70vh;
}

/* ===== HERO SECTION STANDARDIZATION ===== */
/* Standard hero for inner pages - consistent height across all pages */
.hero-section {
  height: var(--hero-height-mobile);
}

@media (min-width: 768px) {
  .hero-section {
    height: var(--hero-height-desktop);
  }
}

/* Homepage hero - taller to make an impact */
.hero-section-home {
  height: var(--hero-height-home-mobile);
}

@media (min-width: 768px) {
  .hero-section-home {
    height: var(--hero-height-home-desktop);
  }
}

/* Override heading font with Cormorant serif */
h1, h2, h3, h4, h5, h6,
.text-heading {
  font-family: 'Cormorant', serif;
  color: var(--color-heading);
}

/* Body text uses Nunito Sans */
body {
  font-family: 'Nunito Sans', sans-serif;
  color: var(--color-body);
}

/* Ensure buttons and other UI elements use body font */
button, .btn, input, select, textarea {
  font-family: 'Nunito Sans', sans-serif;
}

/* Primary color classes */
.bg-primary {
  background-color: var(--color-primary) !important;
}

.text-primary {
  color: var(--color-primary) !important;
}

.border-primary {
  border-color: var(--color-primary) !important;
}

.hover\:bg-primary:hover {
  background-color: var(--color-primary) !important;
}

.hover\:text-primary:hover {
  color: var(--color-primary) !important;
}

.hover\:bg-primary\/90:hover {
  background-color: rgba(6, 36, 81, 0.9) !important;
}

/* ===== STATIC CTA - No hover effect ===== */
.static-cta,
.static-cta:hover,
.static-cta:focus,
.static-cta:active {
  background-color: white !important;
  color: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
}

/* Allergen Legend and Tag Styles */
.allergen-legend {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.allergen-legend-title {
  font-weight: 600;
  color: var(--color-heading);
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.allergen-legend-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-size: 0.8125rem;
  color: #64748b;
}

.allergen-legend-items span {
  white-space: nowrap;
}

.allergen-legend-items strong {
  color: var(--color-primary);
  font-weight: 600;
}

.allergen-disclaimer {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e2e8f0;
  line-height: 1.5;
}

/* Inline allergen tags next to dish names */
.allergen-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-left: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 500;
  vertical-align: middle;
}

.allergen-tag {
  background-color: #f1f5f9;
  color: #475569;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.allergen-tag.vegan {
  background-color: #dcfce7;
  color: #166534;
}

.allergen-tag.vegetarian {
  background-color: #d1fae5;
  color: #065f46;
}

/* Variety selection row styles for consistent layout */
.variety-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.75rem;
  align-items: center;
}

.variety-row .variety-select {
  min-width: 0;
}

.variety-row .variety-qty {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.variety-row .variety-remove {
  width: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.variety-row .variety-remove.invisible {
  visibility: hidden;
}

@media (max-width: 480px) {
  .variety-row {
    grid-template-columns: 1fr auto;
  }
  .variety-row .variety-select {
    grid-column: 1 / -1;
  }
}

/* Item card selection styles */
.item-card {
  transition: all 0.3s ease;
}

.item-card.has-selection {
  border-color: var(--color-primary) !important;
  box-shadow: 0 0 0 2px rgba(6, 36, 81, 0.1), 0 4px 12px rgba(6, 36, 81, 0.08);
}

.item-card.has-selection .item-card-badge {
  display: flex;
}

.item-card-badge {
  display: none;
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background-color: var(--color-primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  align-items: center;
  gap: 0.25rem;
  z-index: 10;
}

/* Sticky order summary bar */
.sticky-order-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  padding: 1rem;
  z-index: 50;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.sticky-order-bar.visible {
  transform: translateY(0);
}

.sticky-order-bar-content {
  max-width: 80rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

@media (max-width: 640px) {
  .sticky-order-bar-content {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .sticky-order-bar-content button {
    width: 100%;
  }
}

/* ===== ORDER PROGRESS INDICATOR ===== */
.order-progress {
  background: white;
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  border: 1px solid #e2e8f0;
}

.order-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.order-progress-label {
  font-weight: 600;
  color: var(--color-heading);
  font-size: 0.875rem;
}

.order-progress-count {
  font-size: 0.875rem;
  color: #64748b;
}

.order-progress-count span {
  font-weight: 700;
  color: var(--color-primary);
}

.order-progress-bar {
  height: 8px;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
}

.order-progress-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: 9999px;
  transition: width 0.3s ease;
  min-width: 0;
}

.order-progress-fill.complete {
  background: #16a34a;
}

.order-progress-status {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: #64748b;
}

.order-progress-status.ready {
  color: #16a34a;
  font-weight: 600;
}

.order-progress-status.warning {
  color: #dc2626;
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */

/* Smooth scrolling for better UX */
html {
  scroll-behavior: smooth;
}

/* Prevent content jump on scrollbar appearance */
html {
  overflow-y: scroll;
}

/* Image optimization - prevent layout shift */
img {
  height: auto;
  max-width: 100%;
}

/* Lazy-loaded images placeholder */
img[loading="lazy"] {
  background-color: #f3f4f6;
}

/* GPU acceleration for frequently animated elements */
.transition-transform,
.transition-all,
.group:hover .group-hover\:scale-105,
header,
.mobile-menu,
.dropdown-menu,
#contact-popup,
#contact-toggle {
  will-change: transform;
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Optimize touch targets for mobile (44px minimum) */
@media (max-width: 768px) {
  a, button, .faq-question {
    min-height: 44px;
  }
}

/* Add bottom padding to body when sticky bar is visible */
body.has-sticky-bar {
  padding-bottom: 100px;
}

@media (max-width: 640px) {
  body.has-sticky-bar {
    padding-bottom: 140px;
  }
}

/* ===== FOCUS STATES FOR ACCESSIBILITY ===== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ===== LOADING SKELETON ===== */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== FAQ ACCORDION ANIMATIONS ===== */
.faq-answer {
  overflow: hidden;
  transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
}

.faq-icon {
  transition: transform 0.2s ease;
}

.faq-icon.rotate-180 {
  transform: rotate(180deg);
}

/* ===== HERO IMAGE OPTIMIZATION ===== */
section[class*="min-h-screen"] img,
section[class*="h-[60vh]"] img,
section[class*="h-[50vh]"] img,
.hero-section img,
.hero-section-home img {
  object-fit: cover;
  object-position: center;
}

/* ===== CONTACT WIDGET OPTIMIZATION ===== */
#contact-popup {
  transform-origin: bottom right;
}

#contact-toggle {
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== BUTTON HOVER STATES OPTIMIZATION ===== */
.bg-primary,
.border-primary,
a[href="/reservations"],
a[href="/menu"] {
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

/* ===== GALLERY IMAGE HOVER OPTIMIZATION ===== */
.group .aspect-square img {
  transition: transform 0.3s ease;
  backface-visibility: hidden;
}

/* ===== MOBILE MENU TRANSITIONS ===== */
.mobile-menu {
  transition: max-height 0.3s ease-out;
  overflow: hidden;
}

.mobile-menu.hidden {
  max-height: 0;
  padding: 0;
}

/* ===== DROPDOWN OPTIMIZATION ===== */
.dropdown-menu {
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.catering-dropdown:hover .dropdown-menu {
  pointer-events: auto;
}

/* ===== FORM INPUT OPTIMIZATION ===== */
input, select, textarea {
  -webkit-appearance: none;
  appearance: none;
  font-size: 16px; /* Prevents iOS zoom on focus */
}

/* ===== BACK TO TOP BUTTON ===== */
.back-to-top {
  position: fixed;
  bottom: 6rem;
  right: 1.5rem;
  z-index: 40;
  width: 3rem;
  height: 3rem;
  background-color: var(--color-primary);
  color: white;
  border-radius: 9999px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
}

.back-to-top:hover {
  background-color: rgba(6, 36, 81, 0.9);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

/* ===== PRINT STYLES ===== */
@media print {
  header,
  footer,
  #contact-widget,
  .sticky-order-bar,
  .mobile-menu-button,
  .back-to-top {
    display: none !important;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.5;
  }
  
  a {
    text-decoration: underline;
    color: #000;
  }
  
  img {
    max-width: 100% !important;
    page-break-inside: avoid;
  }
}

/* ===== SUBTLE TEXT COLOR UTILITY ===== */
.text-subtle {
  color: #64748b;
}

.text-body {
  color: var(--color-body);
}

/* ===== SCROLL MARGIN FOR ANCHOR LINKS ===== */
.scroll-mt-32 {
  scroll-margin-top: 8rem;
}

/* ===== SCROLLBAR HIDE UTILITY ===== */
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ===== PRODUCT PAGE OVERRIDES ===== */
wish-list-button {
  display: none !important;
}