/* Brand script only for shop name. Titles/prices stay on system UI fonts (Max-friendly). */
@font-face {
  font-family: "Great Vibes";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/greatvibes-400.ttf") format("truetype");
}

:root {
  /* Dari Flora logo palette: charcoal #343433 + magenta #e42487 on airy white */
  --bg: #f6f3f5;
  --bg-elevated: #fffbfe;
  --ink: #343433;
  --muted: #8a8488;
  --pink: #f2c6db;
  --pink-deep: #b1296f;
  --pink-hot: #e42487;
  --gold: #e42487;
  --gold-soft: #f7d6e6;
  --gold-line: rgba(228, 36, 135, 0.28);
  --gray: #e4dde1;
  --line: rgba(52, 52, 51, 0.08);
  --shadow: 0 16px 40px rgba(52, 52, 51, 0.1);
  --font-display: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-brand: "Great Vibes", "Segoe Script", "Apple Chancery", cursive;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --radius: 16px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; }

.atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 480px at 8% -8%, rgba(228, 36, 135, 0.12), transparent 58%),
    radial-gradient(760px 420px at 100% 0%, rgba(177, 41, 111, 0.1), transparent 52%),
    radial-gradient(600px 380px at 50% 110%, rgba(52, 52, 51, 0.06), transparent 55%),
    linear-gradient(180deg, #fffbfe 0%, var(--bg) 42%, #f0e8ed 100%);
}

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.4;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(228, 36, 135, 0.14) 0 1px, transparent 2px),
    radial-gradient(circle at 80% 18%, rgba(52, 52, 51, 0.1) 0 1px, transparent 2px);
  background-size: 72px 72px, 96px 96px;
}

.app {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: calc(14px + var(--safe-top)) 12px calc(28px + var(--safe-bottom));
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  padding: 4px 2px 14px;
  border-bottom: 1px solid var(--gold-line);
  animation: rise 0.55s ease both;
}

.avail-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  margin: 0 2px 16px;
  padding: 0;
  font-size: 12px;
  line-height: 1.2;
  color: var(--muted);
  animation: rise 0.55s ease both;
  animation-delay: 0.05s;
}

.avail-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.avail-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
}

.avail-dot.in-stock {
  background: #2f9e5f;
}

.avail-dot.made-to-order {
  background: #e0a100;
}

.product-avail {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(255, 251, 254, 0.95), 0 1px 3px rgba(52, 52, 51, 0.25);
  pointer-events: none;
}

.product-avail.in-stock {
  background: #2f9e5f;
}

.product-avail.made-to-order {
  background: #e0a100;
}

.sheet-avail {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.kicker {
  margin: 0 0 4px;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}

.brand {
  margin: 0;
  font-family: var(--font-brand);
  font-weight: 400;
  font-size: clamp(44px, 12vw, 58px);
  line-height: 1.1;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.topbar-side {
  display: grid;
  justify-items: end;
  gap: 8px;
  padding-bottom: 6px;
}

.gold-rule {
  display: block;
  width: 42px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}

.note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 10px;
}

.product {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  animation: rise 0.55s ease both;
}

.photo-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  /* Fallback for WebViews that ignore aspect-ratio on flex children */
  padding-bottom: 100%;
  height: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background-color: #f2c6db;
  background-image:
    linear-gradient(145deg, rgba(228, 36, 135, 0.12), rgba(177, 41, 111, 0.18));
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: 0 10px 24px rgba(47, 46, 50, 0.08);
}

@supports (aspect-ratio: 1 / 1) {
  .photo-wrap {
    height: auto;
    padding-bottom: 0;
  }
}

.photo-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
  pointer-events: none;
  z-index: 1;
}

.photo-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
  display: block;
  opacity: 0;
  transition: transform 0.45s ease, opacity 0.2s ease;
}

.photo-wrap img.is-on {
  opacity: 1;
}

.photo-wrap.has-bg img {
  opacity: 0;
  pointer-events: none;
}

.product:hover .photo-wrap img,
.product:focus-visible .photo-wrap img {
  transform: scale(1.03);
}

.product:hover .photo-wrap.has-bg,
.product:focus-visible .photo-wrap.has-bg {
  transform: scale(1.03);
  transition: transform 0.45s ease;
}

.meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 0 2px;
}

.title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(13px, 3.3vw, 16px);
  font-weight: 600;
  line-height: 1.15;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.price {
  margin: 0;
  color: var(--pink-hot);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.01em;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}

.price-old {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.92em;
  text-decoration: line-through;
}

.price-new {
  color: var(--pink-hot);
  font-weight: 700;
}

.price-new.fresh {
  color: #2f7a5b;
}

.price-new.promo {
  color: #682f4c;
}

.sale-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(228, 36, 135, 0.92);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sale-badge.fresh {
  background: rgba(47, 122, 91, 0.92);
}

.sale-badge.promo {
  background: rgba(104, 47, 76, 0.94);
}

.body .price {
  font-size: 18px;
  gap: 10px;
}

.body .price-old {
  font-size: 15px;
}

.empty {
  text-align: center;
  padding: 64px 16px;
  animation: rise 0.5s ease both;
}

.empty-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
}

.empty-text {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.empty[hidden],
.sheet[hidden],
.toast[hidden] {
  display: none !important;
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  align-items: end;
}

.backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(47, 46, 50, 0.42);
  backdrop-filter: blur(5px);
  animation: fade 0.25s ease;
}

.panel {
  position: relative;
  width: 100%;
  background: linear-gradient(180deg, #fffcfb, #f7f2f4);
  border-radius: 26px 26px 0 0;
  box-shadow: var(--shadow);
  max-height: min(94dvh, 860px);
  overflow: auto;
  padding-bottom: calc(18px + var(--safe-bottom));
  animation: sheetUp 0.35s cubic-bezier(0.2, 0.85, 0.2, 1);
}

.carousel {
  position: relative;
  width: 100%;
  margin-inline: 0;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #2f2e32;
  border-radius: 26px 26px 0 0;
}

.carousel img {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover !important;
  object-position: center;
  display: block;
}

.nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(250, 248, 249, 0.9);
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(47, 46, 50, 0.12);
}

.nav.prev { left: 12px; }
.nav.next { right: 12px; }

.dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
}

.dots span.on {
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(228, 36, 135, 0.28);
}

.body {
  padding: 16px 20px 8px;
}

.sheet-kicker {
  margin: 0 0 6px;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}

.body h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(30px, 8vw, 36px);
  line-height: 1.02;
  font-weight: 600;
}

.body .price {
  margin: 8px 0 0;
  font-size: 18px;
  color: var(--pink-hot);
}

.desc {
  margin: 12px 0 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.btn {
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 15px 18px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, var(--pink-deep), var(--pink-hot));
  box-shadow: 0 12px 28px rgba(228, 36, 135, 0.28);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.btn:active {
  transform: scale(0.985);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 40;
  background: var(--ink);
  color: #fff;
  padding: 11px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow);
  animation: toastIn 0.28s ease;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sheetUp {
  from { opacity: 0.7; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@media (min-width: 640px) {
  .grid { gap: 18px 14px; }
  .photo-wrap { border-radius: 18px; }
}
