/* Bakery Module - Public Page Styles
   Prefix: bk- to avoid conflicts with other modules. */
/* ── Theme Studio bridge ──────────────────────────────────────────────
   Bakery's palette is light-on-light, and so is the hospitality starter
   palette every bakery tenant is seeded with (starter.rs, primary #7c2d12
   on background #fffaf3). Same polarity, so these can follow the tenant
   directly without any contrast risk — unlike coffee.css, which is a
   committed dark design and needs the tinting approach instead.

   Each literal below stays as the var() fallback, so a page rendered with
   no Theme Studio block at all looks exactly as it does today.

   --bk-secondary, --bk-muted and --bk-shadow have no Theme Studio
   equivalent and stay fixed; --bk-border and --bk-surface-soft are mixed
   from the tenant's own colours so they track a palette change rather
   than staying orange against it. Both are declared twice: a plain value
   first, then the derived one for browsers with color-mix(). */
:root {
  --bk-primary: var(--luperiq-primary, #b45309);
  --bk-secondary: #f59e0b;
  --bk-accent: var(--luperiq-accent, #ec4899);
  --bk-bg: var(--luperiq-background, #fff7ed);
  --bk-surface: var(--luperiq-surface, #ffffff);
  --bk-text: var(--luperiq-text, #2f241c);
  --bk-muted: #7c5f46;
  --bk-radius: var(--luperiq-radius, 8px);
  --bk-shadow: 0 10px 28px rgba(146, 64, 14, 0.12);

  --bk-surface-soft: #fffbeb;
  --bk-surface-soft: color-mix(in srgb, var(--luperiq-surface, #ffffff) 88%, var(--luperiq-accent, #f59e0b));

  --bk-border: #fed7aa;
  --bk-border: color-mix(in srgb, var(--luperiq-primary, #b45309) 28%, transparent);
}

body:has(.bk-hero) .liq-cart-icon,
body:has(.bk-cart-section) .liq-cart-icon,
body:has(.bk-custom-section) .liq-cart-icon,
body:has(.bk-success-section) .liq-cart-icon,
body:has(.bk-hero) [data-open-cart],
body:has(.bk-cart-section) [data-open-cart],
body:has(.bk-custom-section) [data-open-cart],
body:has(.bk-success-section) [data-open-cart],
body:has(.bk-hero) .cart-fab,
body:has(.bk-cart-section) .cart-fab,
body:has(.bk-custom-section) .cart-fab,
body:has(.bk-success-section) .cart-fab,
body:has(.bk-cart-section) #lqFoodFloatingCart {
  display: none !important;
}

body:has(.bk-cart-section) .liq-support-fab,
body:has(.bk-custom-section) .liq-support-fab {
  border-radius: var(--bk-radius);
  display: flex !important;
  height: auto;
  justify-self: center;
  left: auto !important;
  margin: 24px auto 0;
  min-height: 48px;
  padding: 12px 18px;
  position: static !important;
  right: auto !important;
  width: auto;
}

body:has(.bk-cart-section) .liq-support-panel,
body:has(.bk-custom-section) .liq-support-panel {
  bottom: calc(170px + env(safe-area-inset-bottom, 0px)) !important;
  left: 14px !important;
  right: 14px !important;
}

.bk-hero {
  background: linear-gradient(135deg, #7c2d12 0%, #b45309 55%, #f59e0b 100%);
  color: #fff;
  padding: 54px 20px;
  text-align: center;
}

.bk-hero .container,
.bk-specials-banner .container,
.bk-section-nav .container,
.bk-category-section .container,
.bk-order-page,
.bk-gallery-page,
.bk-cake-page {
  max-width: 1120px;
  margin: 0 auto;
}

.bk-hero h1 {
  color: #fff;
  font-size: 2.4rem;
  line-height: 1.15;
  margin: 0 0 12px;
}

.bk-hero p {
  color: #fff7ed;
  font-size: 1.05rem;
  margin: 0;
}

.bk-specials-banner {
  background: var(--bk-surface-soft);
  border-bottom: 1px solid var(--bk-border);
  padding: 28px 20px;
}

.bk-specials-banner h2,
.bk-category-section h2 {
  color: var(--bk-text);
  margin: 0 0 18px;
}

.bk-specials-row,
.bk-product-grid,
.bk-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.bk-special-card,
.bk-product-card,
.bk-order-card,
.bk-gallery-card,
.bk-cake-card {
  background: var(--bk-surface);
  border: 1px solid var(--bk-border);
  border-radius: var(--bk-radius);
  box-shadow: var(--bk-shadow);
  overflow: hidden;
}

.bk-special-card {
  padding: 18px;
}

.bk-special-card h3,
.bk-product-name {
  color: var(--bk-text);
  font-weight: 800;
}

.bk-special-price,
.bk-product-price {
  color: var(--bk-primary);
  font-weight: 800;
}

.bk-section-nav {
  background: #fff;
  border-bottom: 1px solid var(--bk-border);
  padding: 14px 20px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.bk-section-nav .container {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.bk-section-pill {
  border: 1px solid var(--bk-border);
  border-radius: 999px;
  color: var(--bk-primary);
  flex: 0 0 auto;
  font-weight: 700;
  padding: 8px 14px;
  text-decoration: none;
}

.bk-category-section {
  background: #fff;
  padding: 34px 20px;
}

.bk-cat-desc,
.bk-product-desc,
.bk-cake-card p {
  color: var(--bk-muted);
  line-height: 1.6;
}

.bk-product-img,
.bk-gallery-card img {
  display: block;
  height: 190px;
  object-fit: cover;
  width: 100%;
}

.bk-product-body {
  padding: 18px;
}

.bk-product-header {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 8px;
}

.bk-product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 8px;
}

.bk-allergen,
.bk-badge,
.bk-lead-time {
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 9px;
}

.bk-allergen {
  background: #fee2e2;
  color: #991b1b;
}

.bk-dietary,
.bk-badge {
  background: #dcfce7;
  color: #166534;
}

.bk-lead-time {
  background: #fef3c7;
  color: #92400e;
}

.bk-order-page,
.bk-gallery-page,
.bk-cake-page {
  padding: 34px 20px;
}

.bk-order-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) 340px;
}

.bk-order-card {
  padding: 18px;
}

.bk-order-card button,
.bk-add-btn,
.bk-submit-btn {
  background: var(--bk-primary);
  border: 0;
  border-radius: var(--bk-radius);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  padding: 12px 16px;
}

.bk-product-actions {
  margin-top: 14px;
}

.bk-add-btn {
  width: 100%;
}

.bk-cart-section {
  padding: 34px 20px;
}

.bk-cart-section .container {
  max-width: 760px;
  margin: 0 auto;
}

.bk-cart-empty,
.bk-cart-items,
.bk-cart-summary,
.bk-cart-pickup,
.bk-cart-guest-info,
.bk-cart-payment {
  background: var(--bk-surface);
  border: 1px solid var(--bk-border);
  border-radius: var(--bk-radius);
  box-shadow: var(--bk-shadow);
  margin-bottom: 18px;
  padding: 18px;
}

.bk-cart-empty {
  text-align: center;
}

.bk-cart-item {
  align-items: center;
  border-bottom: 1px solid var(--bk-border);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 12px 0;
}

.bk-cart-item:last-child {
  border-bottom: 0;
}

.bk-cart-item-name {
  color: var(--bk-text);
  font-weight: 800;
}

.bk-cart-item-price {
  color: var(--bk-primary);
  font-weight: 800;
  margin-top: 4px;
}

.bk-cart-item-qty {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.bk-cart-item-info {
  min-width: 0;
}

.bk-cart-item-qty button,
.bk-cart-item-remove {
  background: var(--bk-surface-soft);
  border: 1px solid var(--bk-border);
  border-radius: var(--bk-radius);
  color: var(--bk-primary);
  cursor: pointer;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 38px;
  min-width: 38px;
  padding: 8px 12px;
  text-align: center;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

.bk-cart-item-qty button:hover,
.bk-cart-item-remove:hover {
  background: #fff3e0;
  border-color: #fdba74;
}

.bk-cart-item-qty button:active,
.bk-cart-item-remove:active {
  transform: scale(0.98);
}

.bk-cart-item-qty span {
  color: var(--bk-text);
  font-weight: 800;
  min-width: 24px;
  text-align: center;
}

.bk-cart-item-remove {
  justify-self: end;
  min-width: 88px;
}

.bk-cart-line {
  align-items: center;
  border-bottom: 1px solid var(--bk-border);
  color: var(--bk-text);
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
}

.bk-cart-line:last-child {
  border-bottom: 0;
}

.bk-cart-total {
  font-size: 1.1rem;
  font-weight: 900;
}

.bk-payment-option {
  align-items: flex-start;
  border: 1px solid var(--bk-border);
  border-radius: var(--bk-radius);
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  padding: 12px;
}

.bk-payment-option input {
  accent-color: var(--bk-primary);
  flex-shrink: 0;
  margin-top: 4px;
}

.bk-payment-option span {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
}

.bk-payment-option strong {
  color: var(--bk-text);
  display: block;
  line-height: 1.35;
}

.bk-payment-option small {
  color: var(--bk-muted);
  display: block;
  line-height: 1.4;
  margin-top: 3px;
}

.bk-payment-option-disabled {
  opacity: 0.62;
}

.bk-order-summary {
  background: var(--bk-surface-soft);
  border: 1px solid var(--bk-border);
  border-radius: var(--bk-radius);
  padding: 18px;
  position: sticky;
  top: 78px;
}

.bk-empty {
  color: var(--bk-muted);
  padding: 24px;
  text-align: center;
}

@media (max-width: 720px) {
  .bk-hero {
    padding: 42px 18px;
  }

  .bk-hero h1 {
    font-size: 2rem;
  }

  .bk-product-grid,
  .bk-specials-row,
  .bk-gallery-grid,
  .bk-order-layout {
    grid-template-columns: 1fr;
  }

  .bk-order-summary {
    position: static;
  }

  .bk-product-header {
    display: block;
  }

  .bk-cart-item {
    grid-template-columns: 1fr;
  }

  .bk-cart-item-qty {
    justify-content: flex-start;
  }

  .bk-cart-item-remove {
    justify-self: start;
  }

  .bk-payment-option {
    gap: 12px;
  }
}

/* ── Custom Cakes: Hero Variant, Form Wrap, Info Panel (undefined-class fix) */
.bk-hero.bk-hero-sm {
  padding: 34px 20px;
}

.bk-hero.bk-hero-sm h1 {
  font-size: 1.9rem;
}

.bk-custom-form-wrap {
  background: var(--bk-surface);
  border: 1px solid var(--bk-border);
  border-radius: var(--bk-radius);
  box-shadow: var(--bk-shadow);
  padding: 28px;
}

.bk-custom-form-wrap h3 {
  color: var(--bk-text);
  margin-bottom: 16px;
}

.bk-custom-info {
  background: var(--bk-surface-soft);
  border: 1px solid var(--bk-border);
  border-radius: var(--bk-radius);
  padding: 24px;
  margin-top: 24px;
}

.bk-custom-info h3 {
  color: var(--bk-text);
  margin-bottom: 12px;
}

.bk-custom-info h4 {
  color: var(--bk-primary);
  margin: 20px 0 8px;
}

.bk-custom-info ul {
  padding-left: 20px;
  color: var(--bk-muted);
  line-height: 1.8;
}

.bk-custom-info li {
  margin-bottom: 4px;
}

.bk-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.bk-price-estimate {
  align-items: center;
  background: var(--bk-surface-soft);
  border: 1px solid var(--bk-border);
  border-radius: var(--bk-radius);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 14px 18px;
}

.bk-price-estimate strong {
  color: var(--bk-text);
}

/* ── Gallery: Section, Info, Placeholder, Active Filter, CTA ────────────── */
.bk-gallery-section {
  padding: 34px 20px;
}

.bk-gallery-info {
  padding: 14px 16px;
}

.bk-gallery-info h3 {
  color: var(--bk-text);
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 4px;
}

.bk-gallery-info p {
  color: var(--bk-muted);
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 0;
}

.bk-gallery-placeholder {
  align-items: center;
  background: var(--bk-surface-soft);
  color: var(--bk-border);
  display: flex;
  font-size: 2.4rem;
  height: 190px;
  justify-content: center;
  width: 100%;
}

.bk-section-pill.bk-active {
  background: var(--bk-primary);
  border-color: var(--bk-primary);
  color: #fff;
}

.bk-cta {
  background: var(--bk-surface-soft);
  border: 1px solid var(--bk-border);
  border-radius: var(--bk-radius);
  margin: 8px 0 34px;
  padding: 40px 24px;
  text-align: center;
}

.bk-cta h2 {
  color: var(--bk-text);
  margin-bottom: 10px;
}

.bk-cta p {
  color: var(--bk-muted);
  margin: 0 auto 20px;
  max-width: 520px;
}

/* ── Order Success (undefined-class fix) ─────────────────────────────────  */
.bk-success-icon {
  color: var(--bk-primary);
  display: block;
  font-size: 3.6rem;
  margin-bottom: 16px;
}

.bk-success-msg {
  color: var(--bk-muted);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 8px;
}

.bk-success-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
}

/* ── Menu: Empty State + Featured Modifier ───────────────────────────────  */
.bk-empty-section {
  background: #fff;
  padding: 34px 20px;
}

.bk-product-card.bk-featured {
  border-color: var(--bk-accent);
  border-width: 2px;
  box-shadow: 0 0 0 1px var(--bk-accent), var(--bk-shadow);
}

/* ── Responsive (undefined-class fix) ─────────────────────────────────── */
@media (max-width: 720px) {
  .bk-form-row {
    grid-template-columns: 1fr;
  }

  .bk-hero.bk-hero-sm {
    padding: 28px 18px;
  }

  .bk-hero.bk-hero-sm h1 {
    font-size: 1.6rem;
  }

  .bk-custom-form-wrap,
  .bk-custom-info {
    padding: 20px;
  }

  .bk-price-estimate {
    padding: 12px 14px;
  }

  .bk-cta {
    padding: 28px 18px;
  }
}
