/* ==========================================================================
   Bake Me A Wish — Base Styles, Typography, Header, Drawer & Modals
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg-canvas);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  line-height: 1.55;
  overflow-x: hidden;
  transition:
    background-color 0.6s var(--ease-editorial),
    color 0.5s var(--ease-editorial);
}

/* Subtle tactile paper / cocoa grain overlay */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9990;
  pointer-events: none;
  opacity: 0.032;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.cursor-aura {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .cursor-aura {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 420px;
    height: 420px;
    margin: -210px 0 0 -210px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    background: radial-gradient(circle, var(--accent-soft) 0%, transparent 68%);
    opacity: 0.72;
    will-change: transform;
  }
}

/* Scroll-reveal utility */
.reveal-target {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.75s var(--ease-editorial),
    transform 0.75s var(--ease-editorial);
}

.reveal-target.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

.scroll-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
  z-index: 510;
  transition: background-color 0.5s var(--ease-editorial);
}

body.is-locked {
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
}

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

section[id] {
  scroll-margin-top: 136px;
}

.container {
  width: min(var(--container-max), calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Mode visibility helper */
[data-show-mode] {
  display: none;
}
body[data-mode="bakery"] [data-show-mode="academy"],
body[data-mode="academy"] [data-show-mode="bakery"] {
  display: none !important;
}
body[data-mode="bakery"] [data-show-mode="bakery"] {
  display: block;
}
body[data-mode="academy"] [data-show-mode="academy"] {
  display: block;
}
body[data-mode="bakery"] .subnav-links[data-show-mode="bakery"],
body[data-mode="academy"] .subnav-links[data-show-mode="academy"] {
  display: flex;
}

/* Typography */
.font-display {
  font-family: var(--font-display);
  letter-spacing: var(--tracking-display);
  font-weight: 500;
  line-height: 1.02;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-kicker);
  color: var(--accent);
}

.kicker::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--accent);
}

.section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: clamp(2rem, 4vw, 3.25rem);
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-hairline);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 4.6vw, 3.85rem);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: var(--tracking-display);
}

.section-title em,
.hero-headline em,
.tunnel-card h3 em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

.hero-headline em {
  color: #E7C896;
}

.section-subtitle {
  max-width: 44ch;
  color: var(--ink-secondary);
  font-size: 0.96rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.85rem 1.55rem;
  border-radius: var(--radius-pill);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition:
    transform 0.35s var(--ease-editorial),
    background-color 0.35s var(--ease-editorial),
    border-color 0.35s var(--ease-editorial),
    color 0.35s var(--ease-editorial),
    box-shadow 0.35s var(--ease-editorial);
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background-color: var(--accent);
  color: var(--accent-ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 12px 28px -10px rgba(0, 0, 0, 0.38);
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--accent-hover);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    0 18px 36px -10px rgba(0, 0, 0, 0.45);
}

.btn-outline {
  border: 1px solid var(--border-strong);
  color: var(--ink-primary);
  background: transparent;
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.btn-sm {
  padding: 0.62rem 1.15rem;
  font-size: 0.78rem;
}

/* ==========================================================================
   Preloader (00 -> 100 BMW Monogram + Fine-Line Whisk)
   ========================================================================== */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background-color: var(--bg-canvas);
  color: var(--ink-primary);
  transition: opacity 0.65s var(--ease-editorial), visibility 0.65s;
}

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

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

.preloader-monogram {
  position: relative;
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
}

.preloader-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.preloader-ring-bg {
  fill: none;
  stroke: var(--border-hairline);
  stroke-width: 1.25;
}

.preloader-ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.75;
  stroke-dasharray: 283;
  stroke-dashoffset: 283;
  transition: stroke-dashoffset 0.12s linear;
}

.preloader-brand {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.preloader-logo {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.preloader-meta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.preloader-count {
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  font-weight: 600;
}

/* ==========================================================================
   600ms Radial Clip-Path Mode Morph Curtain
   ========================================================================== */
.mode-curtain {
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
  opacity: 0;
  clip-path: circle(0% at var(--tx, 50%) var(--ty, 42px));
}

.mode-curtain.is-animating {
  opacity: 1;
  animation: radialMorphSweep 620ms var(--ease-editorial) forwards;
}

@keyframes radialMorphSweep {
  0% {
    clip-path: circle(0% at var(--tx, 50%) var(--ty, 42px));
    opacity: 0.96;
  }
  58% {
    clip-path: circle(150% at var(--tx, 50%) var(--ty, 42px));
    opacity: 0.96;
  }
  100% {
    clip-path: circle(150% at var(--tx, 50%) var(--ty, 42px));
    opacity: 0;
  }
}

body.is-morphing main {
  transform: scale(0.985);
  transition: transform 0.6s var(--ease-editorial);
}

main {
  transition: transform 0.6s var(--ease-editorial);
}

/* ==========================================================================
   Persistent Master Header + Tactile Mode Switch
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 500;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-hairline);
  transition:
    background-color 0.6s var(--ease-editorial),
    border-color 0.5s var(--ease-editorial);
}

.header-main {
  height: var(--header-height);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  justify-self: start;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #ffffff;
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand-loc {
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-muted);
}

/* Master Dual-Mode Toggle */
.mode-switch {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: background-color 0.5s var(--ease-editorial), border-color 0.5s;
}

.mode-switch-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  border-radius: var(--radius-pill);
  background: var(--accent);
  transition:
    transform 0.5s var(--ease-editorial),
    background-color 0.5s var(--ease-editorial);
}

body[data-mode="academy"] .mode-switch-thumb {
  transform: translateX(100%);
}

.mode-btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.5rem 1.15rem;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-secondary);
  transition: color 0.35s ease;
  white-space: nowrap;
}

.mode-btn.is-active {
  color: var(--accent-ink);
}

.mode-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1px solid currentColor;
  transition: background-color 0.35s ease;
}

.mode-btn.is-active .mode-dot {
  background-color: currentColor;
}

/* Header Actions */
.header-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.icon-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.52rem 0.95rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-hairline);
  background: var(--bg-elevated);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ink-primary);
  transition: border-color 0.3s ease, background-color 0.4s ease, transform 0.3s;
}

.icon-pill:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.icon-pill--wa {
  border-color: rgba(37, 211, 102, 0.45);
  color: #1c8c47;
}

.wa-label-mobile {
  display: none;
}

body[data-mode="academy"] .icon-pill--wa {
  color: #6ee7a0;
  border-color: rgba(110, 231, 160, 0.4);
}

.bag-count {
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.68rem;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
}

/* Dynamic Sub-Nav Bar */
.header-subnav {
  border-top: 1px solid var(--border-hairline);
  padding: 0.55rem 0;
}

.subnav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 3vw, 2.5rem);
  overflow-x: auto;
  scrollbar-width: none;
}

.subnav-links::-webkit-scrollbar {
  display: none;
}

.subnav-link {
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-secondary);
  white-space: nowrap;
  position: relative;
  padding-block: 0.2rem;
  transition: color 0.3s ease;
}

.subnav-link:hover {
  color: var(--accent);
}

/* Mobile Floating Mode Pill */
.mobile-mode-pill {
  display: none;
}

@media (max-width: 860px) {
  .header-main {
    grid-template-columns: 1fr auto;
    height: 66px;
  }
  .site-header .mode-switch {
    display: none;
  }
  .brand-lockup {
    gap: 0.55rem;
  }
  .brand-mark {
    width: 30px;
    height: 30px;
    font-size: 0.78rem;
  }
  .brand-name {
    font-size: 0.94rem;
    white-space: nowrap;
  }
  .brand-loc {
    display: none;
  }
  .header-actions {
    gap: 0.3rem;
  }
  .icon-pill {
    padding: 0.36rem 0.54rem;
    font-size: 0.69rem;
    white-space: nowrap;
  }
  .wa-label-desktop,
  .hide-xs {
    display: none;
  }
  .wa-label-mobile {
    display: inline;
  }
  .subnav-links {
    justify-content: flex-start;
    padding-inline: 1rem;
    gap: 1.25rem;
  }
  .mobile-mode-pill {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 490;
    display: inline-block;
    border-radius: var(--radius-pill);
  }
  .mobile-mode-pill .mode-switch {
    box-shadow: 0 18px 40px -8px rgba(0, 0, 0, 0.42);
  }
}

/* ==========================================================================
   Slide-Over Unified Bag & Enrollment Drawer
   ========================================================================== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 800;
  background: rgba(14, 10, 8, 0.58);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s;
}

.drawer-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 810;
  width: min(490px, 100vw);
  background: var(--bg-canvas);
  color: var(--ink-primary);
  border-left: 1px solid var(--border-hairline);
  display: flex;
  flex-direction: column;
  transform: translateX(102%);
  transition: transform 0.52s var(--ease-editorial), background-color 0.5s;
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.28);
}

.cart-drawer.is-open {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.35rem 1.5rem;
  border-bottom: 1px solid var(--border-hairline);
}

.drawer-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
}

.drawer-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-hairline);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  transition: border-color 0.25s, background-color 0.25s;
}

.drawer-close:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.35rem 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.drawer-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-hairline);
  margin-bottom: 0.65rem;
}

.cart-item {
  display: grid;
  grid-template-columns: 62px 1fr auto;
  gap: 0.85rem;
  align-items: center;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border-hairline);
}

.cart-thumb {
  width: 62px;
  height: 62px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-surface);
}

.cart-item-title {
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.3;
}

.cart-item-meta {
  font-size: 0.75rem;
  color: var(--ink-secondary);
  margin-top: 0.15rem;
}

.qty-control {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.45rem;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-pill);
  padding: 0.15rem 0.5rem;
  font-size: 0.76rem;
}

.qty-control button {
  padding: 0.1rem 0.3rem;
  font-weight: 700;
}

.cart-item-price {
  text-align: right;
  font-weight: 600;
  font-size: 0.9rem;
}

.cart-remove {
  display: block;
  margin-left: auto;
  margin-top: 0.25rem;
  font-size: 0.7rem;
  color: var(--ink-muted);
  text-decoration: underline;
}

.gate-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.gate-title {
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pincode-row {
  display: flex;
  gap: 0.5rem;
}

.field-input, .field-select, .field-textarea {
  width: 100%;
  padding: 0.68rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hairline);
  background: var(--bg-elevated);
  font-size: 0.86rem;
  transition: border-color 0.25s;
}

.field-input:focus, .field-select:focus, .field-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.mini-chip {
  font-size: 0.7rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-hairline);
  background: var(--bg-elevated);
  color: var(--ink-secondary);
  transition: border-color 0.2s, color 0.2s;
}

.mini-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.status-banner {
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  line-height: 1.4;
  border: 1px solid var(--border-hairline);
  background: var(--bg-elevated);
}

.status-banner.is-success {
  border-color: rgba(70, 140, 92, 0.45);
  background: rgba(70, 140, 92, 0.1);
}

.status-banner.is-warn {
  border-color: rgba(184, 107, 82, 0.55);
  background: rgba(184, 107, 82, 0.13);
}

.drawer-foot {
  padding: 1.15rem 1.5rem 1.35rem;
  border-top: 1px solid var(--border-hairline);
  background: var(--bg-elevated);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.86rem;
  color: var(--ink-secondary);
}

.summary-total {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  padding-top: 0.4rem;
  border-top: 1px dashed var(--border-hairline);
}

/* ==========================================================================
   Modals (Search, Syllabus, Razorpay Checkout, Delivery Info, Studio Admin)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 950;
  background: rgba(12, 9, 7, 0.7);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 1.25rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s;
}

.modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  width: min(680px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg-canvas);
  color: var(--ink-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: clamp(1.35rem, 3vw, 2.2rem);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.45);
  position: relative;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border-hairline);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 600;
  line-height: 1.1;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 1100;
  background: var(--ink-primary);
  color: var(--bg-canvas);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
  transform: translateY(130%);
  opacity: 0;
  transition: transform 0.4s var(--ease-editorial), opacity 0.35s;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 860px) {
  .toast {
    bottom: 5rem;
    right: 1rem;
    left: 1rem;
    text-align: center;
  }
}
