/* Hand-authored bespoke layout for Baharan (CstRestaurant.Id = 1), built to match the
   restaurant's own uploaded HTML design. Everything here is scoped under
   body.has-custom-template so it can never leak onto another restaurant's pages — see
   Core/Domain/CustomThemeStore.cs and PublicController.ResolveCustomTemplateOwner. It
   restyles the existing markup contract (script.js's cart selectors, checkout flow) —
   it never changes them. theme.css (loaded just before this file) already set the
   Baharan color palette into the site's --primary-color, --color-*, --radius-*, and
   --shadow-* custom properties; this file builds the extra structure (hero, dividers,
   section icons, pill rows, footer band) on top of those same variables so light/dark
   stay in sync automatically. */

/* ============ HERO HEADER ============ */
body.has-custom-template header.tpl-hero {
  position: relative;
  width: 100%;
  min-height: clamp(220px, 42vw, 380px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 4px solid rgba(0, 0, 0, 0.15);
}
body.has-custom-template .tpl-hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--primary-color) 55%, black) 0%,
    var(--primary-color) 30%,
    color-mix(in srgb, var(--primary-color) 70%, white) 100%
  );
  z-index: 0;
}
body.has-custom-template header.tpl-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.22);
  z-index: 1;
}
/* style.css's generic "header > a" rule (the old small-header logo link) would
   otherwise paint this as a red pill box too — it targets any direct-child anchor of
   any header, so it has to be explicitly cancelled here. */
body.has-custom-template .tpl-hero-poster {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  width: auto;
  margin: 0;
  background-color: transparent;
  border-radius: 0;
}
body.has-custom-template .tpl-hero-poster img {
  display: block;
  width: clamp(160px, 34vw, 300px);
  height: auto;
  max-width: 78vw;
  border-radius: var(--radius-lg);
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.28));
}
body.has-custom-template .tpl-hero-name {
  font-size: clamp(1.5rem, 5vw, 2.4rem);
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}
body.has-custom-template .tpl-theme-btn {
  position: absolute;
  z-index: 3;
  top: clamp(10px, 2.5vw, 20px);
  left: clamp(10px, 2.5vw, 20px);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
  background: #fff;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transition: transform var(--transition-fast, 150ms ease);
}
body.has-custom-template .tpl-theme-btn:hover {
  transform: translateY(-2px);
}
body.has-custom-template .tpl-theme-btn svg {
  position: absolute;
  width: 18px;
  height: 18px;
  transition: opacity 0.3s ease, transform 0.4s ease;
}
body.has-custom-template .tpl-icon-sun {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}
body.has-custom-template.dark .tpl-icon-moon {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}
body.has-custom-template.dark .tpl-icon-sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* ============ CATEGORY NAV — the existing swiper strip, re-skinned as pills ============ */
body.has-custom-template .category-swiper-container {
  width: 100%;
  margin: 0;
  position: sticky;
  top: 0;
  z-index: 85;
  background: var(--color-background);
  padding: 0.6rem 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}
body.has-custom-template .swiper-slide:has(.category-slide) {
  height: 2.5rem;
  border-radius: var(--radius-pill);
  background: transparent;
  border: 1px solid transparent;
  padding: 0;
  margin: 0 0.2rem;
}
body.has-custom-template .swiper-slide-active:has(.category-slide) {
  background: color-mix(in srgb, var(--primary-color) 10%, var(--color-surface));
  border-color: color-mix(in srgb, var(--primary-color) 20%, transparent);
  box-shadow: none;
}
body.has-custom-template .category-slide {
  flex-direction: row;
  gap: 0.4rem;
  padding: 0 1rem;
}
body.has-custom-template .category-slide > img {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  object-fit: cover;
}
body.has-custom-template .category-slide > span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-muted);
}
body.has-custom-template .swiper-slide-active .category-slide > span {
  color: var(--primary-color);
}

body.has-custom-template .category-meal-container {
  gap: 1rem;
}

/* Meal-row and category-section-header styling now lives in the restaurant's own
   Meals.cshtml / _MealCategoryPartial.cshtml / _MealPartial.cshtml under
   wwwroot/custom-themes/restaurant-1/Views (loaded via meals-view.css), not here —
   this file only carries what's still shared markup: the _NavBar hero, _Footer band,
   and the basket/stepper controls below.

   Grow-pill add/remove control — same elements script.js already listens on, just a
   new shape. */
body.has-custom-template .meal-count {
  gap: 0;
}
body.has-custom-template .increaseMealCount,
body.has-custom-template .decreaseMealCount {
  border: none;
  border-radius: 50%;
  /* 2.75rem (44px), not the 2.25rem (36px) this used to be — WCAG 2.5.5's minimum target
     size, and the size style.css's own .checkout-entry-btn already uses. A 36px stepper
     next to a 44px checkout button was an inconsistency this theme introduced, not an
     intentional smaller-touch-target choice. */
  width: 2.75rem;
  height: 2.75rem;
  background: var(--primary-color);
  color: var(--color-on-primary, #fff);
  box-shadow: 0 2px 10px color-mix(in srgb, var(--primary-color) 35%, transparent);
}
body.has-custom-template .increaseMealCount:hover,
body.has-custom-template .decreaseMealCount:hover {
  background: color-mix(in srgb, var(--primary-color) 88%, black);
  color: var(--color-on-primary, #fff);
}
body.has-custom-template .mealCount {
  min-width: 1.75rem;
}

/* ============ BASKET BAR / MODALS — palette + shape only, structure unchanged ============ */
body.has-custom-template .basket-container {
  background: var(--primary-color);
}
body.has-custom-template .basket-full-page,
body.has-custom-template .meal-full-page {
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
@media (min-width: 601px) {
  body.has-custom-template .meal-full-page {
    border-radius: var(--radius-lg);
  }
}
body.has-custom-template .checkout-entry-btn {
  box-shadow: 0 4px 14px color-mix(in srgb, var(--primary-color) 40%, transparent);
}

/* ============ FOOTER BAND ============ */
body.has-custom-template footer.tpl-footer {
  background: color-mix(in srgb, var(--primary-color) 78%, black);
  color: rgba(255, 255, 255, 0.85);
  padding: clamp(28px, 6vw, 44px) 1rem 1.25rem;
  text-align: center;
}
body.has-custom-template .tpl-footer-inner {
  max-width: 640px;
  margin: 0 auto;
}
body.has-custom-template .tpl-footer-brand {
  font-size: clamp(1.3rem, 4vw, 1.6rem);
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.4rem;
}
body.has-custom-template .tpl-footer-address {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  margin: 0.5rem 0;
}
body.has-custom-template .tpl-footer-address svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--color-accent, #c9a96e);
}
body.has-custom-template .tpl-footer-divider {
  width: 48px;
  height: 2px;
  background: rgba(255, 255, 255, 0.2);
  margin: 1rem auto;
  border-radius: 1px;
}
body.has-custom-template footer.tpl-footer .copyRight,
body.has-custom-template footer.tpl-footer .createdBy,
body.has-custom-template footer.tpl-footer .aiTagline {
  color: rgba(255, 255, 255, 0.65);
}
body.has-custom-template footer.tpl-footer .createdBy a {
  color: #fff;
}

/* ============ DARK MODE ============ */
body.has-custom-template.dark {
  --primary-color: #e04050;
  --color-on-primary: #ffffff;
  --color-accent: #d4af37;
  --color-on-accent: #111111;
  --color-background: #000000;
  --color-surface: #1a1a1a;
  --color-foreground: #ffffff;
  --color-muted: #c8c8c8;
  --color-border: #333333;
  color-scheme: dark;
}
body.has-custom-template.dark {
  background-color: var(--color-background);
}
body.has-custom-template.dark .tpl-hero-gradient {
  background: linear-gradient(135deg, #0a0103 0%, #3a0508 60%, #6a0e16 100%);
}
