/* Bubustar public page. Mobile first, logical properties for RTL/LTR. */
:root {
  --milk: #FAF3E6; --wool: #FFFCF5;
  --cocoa: #5A3A26; --cocoa-2: #7D5C47;
  --honey: #E8B53A; --honey-soft: #F7E6B8;
  --stitch: #DCC6A6; --danger: #A33A2A;
  --wa: #1E8E4F; --wa-dark: #156B3A;
  --disabled-bg: #E4DACB; --disabled-fg: #6E5D50;
  --font: "Baloo Bhaijaan 2", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --gutter: 20px;
  --max: 1080px;
  --bar-h: 84px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--milk);
  color: var(--cocoa);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--wa-dark); text-underline-offset: 3px; }
a:hover { color: var(--cocoa); }
h1, h2, p { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--cocoa); outline-offset: 2px; }

.wrap, .site-header, .footer-in {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}

/* Header */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-top: calc(12px + env(safe-area-inset-top));
  padding-bottom: 12px;
}
.brand {
  display: flex; align-items: center; gap: 6px; min-height: 44px;
  color: var(--cocoa); text-decoration: none;
  font-weight: 800; font-size: 27px; line-height: 1;
}
.brand:hover { color: var(--cocoa); }
.brand-star { fill: var(--honey); stroke: var(--honey); stroke-width: 8; stroke-linejoin: round; }
.lang-btn {
  min-height: 44px; padding: 0 18px; border-radius: 999px;
  border: 1.5px solid var(--stitch); background: var(--wool);
  font-weight: 700; font-size: 15px; cursor: pointer;
}
.lang-btn:hover { border-color: var(--cocoa-2); }

/* Product area */
.wrap { padding-top: 4px; }
.product { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-items: start; padding-bottom: 36px; }

.frame {
  position: relative; background: var(--wool); border-radius: 34px; padding: 8px;
  box-shadow: 0 0 0 1.5px #EADBC4, 0 22px 40px -28px rgba(90, 58, 38, .45);
}
.photo {
  position: relative; aspect-ratio: 1 / 1; border-radius: 26px; overflow: hidden;
  background: var(--honey-soft); display: grid; place-items: center;
}
.photo img {
  position: absolute; inset: 0; display: block; width: 100%; height: 100%;
  object-fit: cover; transition: opacity .17s ease;
}
.photo.is-fading img { opacity: .15; }
.photo-empty { display: none; width: 44%; fill: var(--honey); stroke: var(--honey); stroke-width: 8; stroke-linejoin: round; }
.photo.is-empty .photo-empty { display: block; }
.hem {
  position: absolute; inset: 12px; border: 1.5px dashed rgba(255, 252, 245, .9);
  border-radius: 18px; pointer-events: none;
}
.photo.is-empty .hem { border-color: rgba(220, 198, 166, .9); }
.badge {
  position: absolute; top: 24px; inset-inline-start: 24px; z-index: 1;
  transform: rotate(5deg);
  background: var(--honey); color: var(--cocoa);
  font-weight: 700; font-size: 15px; line-height: 1;
  padding: 10px 16px 9px; border-radius: 999px;
  outline: 1.5px dashed rgba(90, 58, 38, .38); outline-offset: -5px;
  box-shadow: 0 3px 0 rgba(90, 58, 38, .15);
}
[dir="ltr"] .badge { transform: rotate(-5deg); }

.details { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.titles { display: flex; flex-direction: column; gap: 6px; }
h1 { font-weight: 800; font-size: 34px; line-height: 1.2; text-wrap: balance; }
.tagline { color: var(--cocoa-2); }
.price-line { margin-top: 4px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price-from { font-weight: 600; color: var(--cocoa-2); }
.price { font-weight: 800; font-size: 30px; line-height: 1.2; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label b { font-weight: 700; }
.field-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.guide-link { font-weight: 600; font-size: 15px; min-height: 44px; display: flex; align-items: center; }

/* Star swatches */
.swatches { display: flex; flex-wrap: wrap; gap: 4px; margin-inline-start: -6px; }
.swatch {
  width: 56px; height: 56px; padding: 0; border: 0; background: transparent;
  border-radius: 14px; cursor: pointer; display: grid; place-items: center;
  transition: transform .15s ease;
}
.swatch:hover { transform: scale(1.07); }
.swatch:focus-visible { outline: 3px solid var(--cocoa); outline-offset: 0; }
.swatch svg { overflow: visible; }
.swatch use { stroke-linejoin: round; }
.sw-ring { fill: none; stroke: transparent; stroke-width: 22; transition: stroke .15s; }
.sw-gap { fill: none; stroke: transparent; stroke-width: 12; }
.sw-fill { stroke-width: 4; }
.swatch[aria-checked="true"] .sw-ring { stroke: var(--cocoa); }
.swatch[aria-checked="true"] .sw-gap { stroke: var(--milk); }
.swatch[aria-disabled="true"] { opacity: .35; cursor: not-allowed; }
.swatch[aria-disabled="true"]:hover { transform: none; }

/* Size chips */
.chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.chip {
  min-height: 60px; padding: 8px 6px; border-radius: 16px;
  border: 2px solid var(--stitch); background: var(--wool);
  cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; transition: background .15s, border-color .15s;
}
.chip:hover { border-color: var(--cocoa-2); }
.chip[aria-checked="true"] { background: var(--honey-soft); border-color: var(--cocoa); }
.chip-name { font-weight: 700; font-size: 17px; line-height: 1.3; }
.chip-age { font-weight: 600; font-size: 14px; line-height: 1.3; color: var(--cocoa-2); }
.needs-pick .chip { border-color: var(--danger); }

/* Order */
.order { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.wa-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 58px; padding: 0 20px; border: 0; border-radius: 999px;
  background: var(--wa); color: #fff; text-decoration: none;
  font-weight: 700; font-size: 19px; cursor: pointer;
  box-shadow: 0 4px 0 var(--wa-dark);
  transition: transform .08s ease, box-shadow .08s ease;
}
.wa-btn:hover { color: #fff; }
.wa-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--wa-dark); }
.wa-btn:focus-visible { outline: 3px solid var(--cocoa); outline-offset: 3px; }
.wa-btn:disabled { background: var(--disabled-bg); color: var(--disabled-fg); box-shadow: none; cursor: not-allowed; transform: none; }
.wa-btn svg { flex: none; }
.hint { font-size: 15px; line-height: 1.55; color: var(--cocoa-2); text-align: center; text-wrap: pretty; }
.hint.is-error { color: var(--danger); font-weight: 600; }

/* Sections */
.block { border-top: 2px dashed var(--stitch); padding: 32px 0; display: flex; flex-direction: column; gap: 16px; }
h2 { font-weight: 800; font-size: 28px; line-height: 1.25; }
.desc { max-width: 62ch; white-space: pre-line; text-wrap: pretty; }
.muted { color: var(--cocoa-2); max-width: 62ch; text-wrap: pretty; }

.features {
  list-style: none; margin: 0; padding: 0; display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 14px 28px;
}
.features li { display: flex; align-items: center; gap: 14px; }
.feat-icon {
  flex: none; width: 52px; height: 52px; border-radius: 50%; background: var(--honey-soft);
  display: grid; place-items: center; font-size: 24px; line-height: 1;
}

.size-table { background: var(--wool); border: 1.5px solid var(--stitch); border-radius: 20px; overflow: hidden; }
.st-row { display: grid; grid-template-columns: var(--cols, minmax(0, 1fr)); border-top: 1.5px dashed var(--stitch); font-size: 15px; line-height: 1.45; }
.st-row > div { padding: 12px; overflow-wrap: anywhere; }
.st-head { background: var(--honey-soft); border-top: 0; font-weight: 700; }
.st-head > div { padding: 10px 12px; }
.strong { font-weight: 700; }

.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; max-width: 62ch; }
.steps li { display: flex; align-items: flex-start; gap: 14px; }
.step-n {
  flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--honey);
  font-weight: 800; font-size: 19px; line-height: 1; display: grid; place-items: center;
}
.steps li > span:last-child { padding-top: 6px; text-wrap: pretty; }

/* Footer */
.site-footer { border-top: 2px dashed var(--stitch); }
.footer-in {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  padding-top: 18px; padding-bottom: calc(18px + var(--bar-h) + env(safe-area-inset-bottom));
  font-size: 15px;
}
.copy { color: var(--cocoa-2); font-weight: 600; }
.footer-wa { font-weight: 700; min-height: 44px; display: flex; align-items: center; }

/* Mobile sticky order bar: shown while the main order button is off screen */
.order-bar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 10;
  background: var(--wool); border-top: 2px dashed var(--stitch);
  transform: translateY(110%); visibility: hidden;
  transition: transform .22s ease, visibility 0s linear .22s;
}
.order-bar.is-visible { transform: none; visibility: visible; transition: transform .22s ease, visibility 0s; }
.order-bar-in {
  max-width: 560px; margin: 0 auto; display: flex; align-items: center; gap: 14px;
  padding: 12px max(var(--gutter), env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
}
.bar-price { flex: none; display: flex; flex-direction: column; line-height: 1.15; }
.bar-price-label { font-size: 13px; font-weight: 600; color: var(--cocoa-2); }
.bar-price-value { font-weight: 800; font-size: 26px; white-space: nowrap; }
.wa-btn-bar { flex: 1; min-height: 56px; font-size: 18px; gap: 8px; padding: 0 14px; }

/* Desktop floating button: shown after scrolling past the order button */
.fab {
  position: fixed; z-index: 10; display: none;
  bottom: calc(18px + env(safe-area-inset-bottom)); inset-inline-end: 18px;
  width: 60px; height: 60px; border-radius: 50%; background: var(--wa); color: #fff;
  place-items: center;
  box-shadow: 0 4px 0 var(--wa-dark), 0 10px 24px -8px rgba(21, 107, 58, .55);
  opacity: 0; transform: translateY(16px); pointer-events: none; visibility: hidden;
  transition: opacity .22s ease, transform .22s ease, visibility 0s linear .22s;
}
.fab:hover { color: #fff; }
.fab:active { box-shadow: 0 1px 0 var(--wa-dark); transform: translateY(3px); }
.fab.is-visible { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition: opacity .22s ease, transform .22s ease, visibility 0s; }
.fab:focus-visible { outline: 3px solid var(--cocoa); outline-offset: 3px; }

/* Order form: bottom sheet on mobile, centred card on desktop */
.sheet {
  width: 100%; max-width: 480px; max-height: 92vh; max-height: 92dvh;
  margin: auto auto 0; padding: 0; border: 0; border-radius: 28px 28px 0 0;
  background: var(--wool); color: var(--cocoa); overflow-y: auto; overscroll-behavior: contain;
}
.sheet::backdrop { background: rgba(90, 58, 38, .45); }
.sheet-in {
  padding: 16px max(var(--gutter), env(safe-area-inset-right)) calc(18px + env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
  display: flex; flex-direction: column; gap: 14px;
}
.sheet-handle { width: 44px; height: 5px; border-radius: 3px; background: var(--stitch); align-self: center; }
.od-view { display: flex; flex-direction: column; gap: 14px; }
.sheet h2 { font-size: 26px; }
.od-summary {
  display: flex; align-items: center; gap: 12px; padding: 10px;
  border: 1.5px solid var(--stitch); border-radius: 18px; background: var(--milk);
}
.od-summary img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; flex: none; }
.od-sum-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.od-sum-text b { font-weight: 700; overflow-wrap: anywhere; }
.od-sum-text span { font-size: 14px; color: var(--cocoa-2); overflow-wrap: anywhere; }
.od-price { flex: none; font-weight: 800; font-size: 20px; white-space: nowrap; }
.od-field { display: flex; flex-direction: column; gap: 4px; font-weight: 700; font-size: 15px; }
.od-field input {
  width: 100%; min-height: 52px; padding: 10px 14px;
  border: 1.5px solid var(--stitch); border-radius: 14px; background: var(--milk);
  font: inherit; font-size: 17px; font-weight: 400; color: var(--cocoa);
}
.od-field input[dir="ltr"] { text-align: left; }
.od-field input:focus-visible { outline: 3px solid var(--honey); outline-offset: 1px; border-color: var(--cocoa); }
.od-field input[aria-invalid="true"] { border-color: var(--danger); }
.od-help { font-size: 13px; font-weight: 400; color: var(--cocoa-2); }
.od-error { color: var(--danger); font-weight: 600; font-size: 15px; }
.od-text-btn {
  min-height: 48px; border: 0; background: transparent; cursor: pointer;
  font-weight: 700; color: var(--cocoa-2);
}
.od-text-btn:hover { color: var(--cocoa); }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.od-done { align-items: center; text-align: center; padding-top: 6px; }
.od-done h2:focus { outline: none; }
.od-done-icon { width: 76px; height: 76px; border-radius: 50%; background: var(--honey-soft); display: grid; place-items: center; }
.od-no { font-weight: 800; font-size: 18px; background: var(--honey-soft); padding: 4px 16px; border-radius: 999px; }
.od-done-text { max-width: 36ch; text-wrap: pretty; }
.od-wa { font-weight: 700; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.od-close { align-self: stretch; }

@media (max-width: 359px) {
  :root { --gutter: 14px; }
  h1 { font-size: 30px; }
  .chips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bar-price-value { font-size: 22px; }
  .wa-btn-bar { font-size: 16px; }
}

@media (min-width: 600px) {
  .site-header { padding-top: calc(16px + env(safe-area-inset-top)); }
  h1 { font-size: 38px; }
}

@media (min-width: 860px) {
  :root { --gutter: 40px; --bar-h: 0px; }
  .site-header { padding-top: calc(20px + env(safe-area-inset-top)); padding-bottom: 20px; }
  .wrap { padding-top: 12px; }
  .product { grid-template-columns: minmax(0, 52fr) minmax(0, 48fr); gap: 56px; }
  .photo-col { position: sticky; top: 20px; }
  .details { padding-top: 12px; }
  h1 { font-size: 44px; }
  .footer-in { padding-top: 20px; padding-bottom: 28px; }
  .order-bar { display: none; }
  .fab { display: grid; }
  .sheet { margin: auto; border-radius: 28px; }
  .sheet-handle { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
