:root {
  --bg: #fff5f8;
  --surface: #ffffff;
  --pink-100: #ffe3ec;
  --pink-200: #ffc9da;
  --pink-400: #f77fa8;
  --pink-500: #f0528a;
  --pink-600: #d63a74;
  --ink: #4a1f33;
  --muted: #94687a;
  --danger: #c62828;
  --radius: 18px;
  --shadow: 0 6px 22px rgba(214, 58, 116, 0.13);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-round: ui-rounded, "Nunito", "Quicksand", "Segoe UI", system-ui, sans-serif;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.5;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
h1, h2, h3 { font-family: var(--font-round); margin: 0; line-height: 1.2; }
.muted { color: var(--muted); }
.spacer { flex: 1; }

/* ---------- buttons and inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 999px; padding: 11px 20px;
  font: 600 0.95rem var(--font); cursor: pointer; text-decoration: none;
  transition: background 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--pink-500); color: #fff; }
.btn-primary:hover { background: var(--pink-600); }
.btn-light { background: #fff; color: var(--pink-600); }
.btn-ghost { background: var(--pink-100); color: var(--pink-600); padding: 8px 14px; font-size: 0.85rem; }
.btn-ghost:hover { background: var(--pink-200); }
.btn-ghost.danger { color: var(--danger); }
.btn-block { width: 100%; }
.btn.disabled, .btn:disabled { opacity: 0.45; pointer-events: none; }
.icon-btn, .link-btn { background: none; border: 0; cursor: pointer; color: inherit; font: inherit; }
.icon-btn { font-size: 1.1rem; padding: 6px 10px; border-radius: 50%; }
.link-btn { text-decoration: underline; padding: 0; }

input[type="text"], input[type="search"], input[type="password"], input[type="number"],
input[type="tel"], input[type="file"], textarea {
  width: 100%; padding: 11px 14px; font: inherit; color: var(--ink);
  background: #fff; border: 1.5px solid var(--pink-200); border-radius: 12px;
}
input:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid var(--pink-400); outline-offset: 2px;
}
label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
label input, label textarea { margin-top: 5px; font-weight: 400; }

/* ---------- shop: hero ---------- */
html { scroll-behavior: smooth; }
.hero {
  position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(120deg, #ff9ec0, #f0528a, #e0447f, #ff8fb4);
  background-size: 300% 300%;
  animation: gradient 14s ease infinite;
  padding: 48px 0 104px;
}
.hero-inner { position: relative; display: grid; gap: 34px; align-items: center; text-align: center; }
.hero-text > * { animation: rise 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.hero-text > :nth-child(2) { animation-delay: 0.12s; }
.hero-text > :nth-child(3) { animation-delay: 0.24s; }
.hero-text > :nth-child(4) { animation-delay: 0.36s; }
.hero-badge {
  display: inline-block; margin: 0 0 12px; padding: 5px 14px;
  background: rgba(255, 255, 255, 0.22); border-radius: 999px; font-size: 0.85rem; font-weight: 600;
}
.hero h1 { font-size: clamp(2.2rem, 7vw, 3.6rem); text-shadow: 0 3px 14px rgba(150, 20, 70, 0.25); }
.tagline { margin: 10px 0 22px; font-size: 1.1rem; opacity: 0.95; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.btn-outline { background: rgba(255, 255, 255, 0.16); color: #fff; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.8); }
.btn-outline:hover { background: rgba(255, 255, 255, 0.28); }

/* Three tilted photos that pop in, then gently bob. */
.hero-pics { position: relative; width: 100%; max-width: 340px; height: 240px; margin: 0 auto; }
.pic {
  position: absolute; width: 52%; aspect-ratio: 1; object-fit: cover;
  border: 6px solid #fff; border-radius: 22px; box-shadow: 0 14px 34px rgba(120, 20, 60, 0.32);
  animation: popIn 0.9s cubic-bezier(0.2, 1.4, 0.4, 1) both, bob 6s ease-in-out infinite;
}
.pic1 { left: 0; top: 10%; rotate: -8deg; z-index: 2; animation-delay: 0.2s, 0s; }
.pic2 { right: 0; top: 0; rotate: 7deg; animation-delay: 0.38s, -2s; }
.pic3 { left: 25%; bottom: 0; rotate: -2deg; z-index: 3; animation-delay: 0.56s, -4s; }

@media (min-width: 820px) {
  .hero { padding-top: 64px; }
  .hero-inner { grid-template-columns: 1.1fr 0.9fr; text-align: left; }
  .hero-actions { justify-content: flex-start; }
  .hero-pics { max-width: 430px; height: 340px; }
}

/* Drifting yarn balls, hearts and flowers behind the hero text. */
.floaties { position: absolute; inset: 0; pointer-events: none; }
.f { position: absolute; font-size: 1.7rem; opacity: 0.5; animation: drift 9s ease-in-out infinite; }
.f1 { left: 4%; top: 14%; }
.f2 { left: 16%; top: 68%; font-size: 1.2rem; animation-delay: -2s; }
.f3 { left: 38%; top: 8%; font-size: 1.3rem; animation-delay: -4s; }
.f4 { left: 52%; top: 62%; font-size: 1.1rem; animation-delay: -1s; }
.f5 { left: 71%; top: 6%; font-size: 1.3rem; animation-delay: -6s; }
.f6 { left: 88%; top: 52%; animation-delay: -3s; }
.f7 { left: 93%; top: 12%; font-size: 1.2rem; animation-delay: -5s; }
.f8 { left: 27%; top: 40%; font-size: 1rem; animation-delay: -7s; }

.wave {
  position: absolute; left: 0; bottom: -1px; width: 200%; height: 56px;
  fill: var(--bg); animation: slideLeft 14s linear infinite;
}

.marquee { overflow: hidden; padding: 12px 0 2px; }
.marquee-track {
  display: flex; width: max-content; white-space: nowrap;
  font: 700 0.95rem var(--font-round); color: var(--pink-500);
  animation: slideLeft 45s linear infinite;
}
.marquee-track span { margin-right: 18px; }
.marquee-track .dot { color: var(--pink-400); }

@keyframes gradient { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes rise { from { opacity: 0; transform: translateY(26px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes popIn { from { opacity: 0; scale: 0.55; } to { opacity: 1; scale: 1; } }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -12px; } }
@keyframes drift { 0%, 100% { translate: 0 0; rotate: -10deg; } 50% { translate: 10px -22px; rotate: 12deg; } }
@keyframes slideLeft { to { transform: translateX(-50%); } }
@keyframes pop { 0% { transform: scale(0.88); } 60% { transform: scale(1.06); } 100% { transform: none; } }
@keyframes bump { 0%, 100% { transform: none; } 35% { transform: scale(1.07); } 65% { transform: scale(0.97); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }
@keyframes dialogIn { from { opacity: 0; transform: translateY(24px) scale(0.94); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes wiggle { 0%, 100% { rotate: -6deg; } 50% { rotate: 6deg; } }

/* Scroll-in: items start invisible and rise when they enter the screen. */
.reveal { opacity: 0; }
.reveal.in { animation: rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both; }

/* ---------- shop: toolbar and grid ---------- */
.toolbar { margin: 24px 0 18px; display: grid; gap: 12px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1.5px solid var(--pink-200); background: #fff; color: var(--pink-600);
  padding: 7px 16px; border-radius: 999px; font: 600 0.88rem var(--font); cursor: pointer;
}
.chip.active { background: var(--pink-500); border-color: var(--pink-500); color: #fff; }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); }
@media (min-width: 700px) { .grid { gap: 22px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); } }

.card {
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: translate 0.25s ease, box-shadow 0.25s ease;
}
.card:hover { translate: 0 -6px; box-shadow: 0 16px 36px rgba(214, 58, 116, 0.24); }
.card-img { aspect-ratio: 1; background: var(--pink-100); display: grid; place-items: center; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.6s ease; }
.card:hover .card-img img { transform: scale(1.08); }
.ctl.pop { animation: pop 0.3s ease; }
.chip { transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s; }
.chip:active { transform: scale(0.94); }

.steps { margin-top: 56px; text-align: center; }
.steps h2 { font-size: 1.6rem; color: var(--pink-600); margin-bottom: 18px; }
.steps-grid { display: grid; gap: 16px; }
@media (min-width: 700px) { .steps-grid { grid-template-columns: repeat(3, 1fr); } }
.step { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 18px; }
.step-icon { display: inline-block; font-size: 2.2rem; animation: wiggle 3s ease-in-out infinite; }
.step h3 { font-size: 1.05rem; margin: 8px 0 4px; }
.step p { margin: 0; color: var(--muted); font-size: 0.92rem; }

.copyright { margin: 14px 0 0; font-size: 0.82rem; font-weight: 600; color: var(--pink-600); }
.placeholder { font-size: 3.2rem; }
.card-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-cat { margin: 0; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--pink-500); }
.card h3 { font-size: 1.05rem; }
.card-desc { margin: 0; font-size: 0.88rem; color: var(--muted); white-space: pre-line; }
.price { margin: auto 0 4px; padding-top: 6px; font: 700 1.1rem var(--font-round); color: var(--pink-600); }

.stepper {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--pink-100); border-radius: 999px; padding: 4px;
}
.stepper button {
  width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: var(--pink-500); color: #fff; font-size: 1.2rem; line-height: 1; cursor: pointer;
}
.stepper span { font-weight: 700; min-width: 28px; text-align: center; }
.stepper.small button { width: 30px; height: 30px; font-size: 1rem; }

.empty { text-align: center; color: var(--muted); padding: 48px 12px; font-size: 1.05rem; }
.footer { text-align: center; color: var(--muted); font-size: 0.88rem; padding: 40px 16px 110px; }

/* ---------- shop: cart ---------- */
.cart-bar {
  position: fixed; left: 0; right: 0; bottom: 18px; margin: 0 auto; z-index: 10;
  animation: slideUp 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  width: min(440px, calc(100% - 32px)); padding: 15px 20px;
  background: var(--pink-600); color: #fff; border: 0; border-radius: 999px;
  font: 700 1rem var(--font); cursor: pointer; box-shadow: 0 10px 28px rgba(214, 58, 116, 0.45);
}
dialog.cart {
  width: min(460px, calc(100% - 24px)); border: 0; border-radius: 22px; padding: 20px;
  color: var(--ink); box-shadow: 0 20px 60px rgba(74, 31, 51, 0.3);
}
dialog.cart::backdrop { background: rgba(74, 31, 51, 0.45); }
.cart-bar.bump { animation: bump 0.4s ease; }
dialog.cart[open] { animation: dialogIn 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.1); }
dialog.cart[open]::backdrop { animation: fadeIn 0.3s ease; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; }
  html { scroll-behavior: auto; }
}
dialog.cart label { margin-top: 12px; }
dialog.cart .btn-block { margin-top: 16px; }
.cart-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cart-items { max-height: 38vh; overflow-y: auto; }
.cart-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--pink-100);
}
.cart-row strong, .cart-row .muted { display: block; }
.cart-row .muted { font-size: 0.85rem; }
.cart-row .stepper { flex: none; width: 112px; }
.cart-total { margin: 12px 0 0; font: 700 1.15rem var(--font-round); color: var(--pink-600); text-align: right; }
.hint { margin: 10px 0 0; font-size: 0.8rem; color: var(--muted); text-align: center; }

/* ---------- admin ---------- */
.admin-bar { background: var(--pink-500); color: #fff; }
.admin-bar a, .admin-bar .link-btn { color: #fff; }
.admin-bar-inner { display: flex; align-items: center; gap: 16px; height: 54px; }
.admin main { padding-top: 20px; padding-bottom: 60px; }
.panel {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; margin-bottom: 20px; display: grid; gap: 14px;
}
.panel.narrow { max-width: 380px; margin: 60px auto; }
.panel h2 { font-size: 1.2rem; }
.form-grid { display: grid; gap: 14px; }
@media (min-width: 640px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.form-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.check { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.check input { margin: 0; width: 18px; height: 18px; accent-color: var(--pink-500); }
.preview { width: 64px; height: 64px; object-fit: cover; border-radius: 12px; }

.item-list { display: grid; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--pink-100); flex-wrap: wrap; }
.item.is-hidden .item-img, .item.is-hidden .item-info { opacity: 0.5; }
.item-img {
  flex: none; width: 56px; height: 56px; border-radius: 12px; overflow: hidden;
  background: var(--pink-100); display: grid; place-items: center; font-size: 1.5rem;
}
.item-img img { width: 100%; height: 100%; object-fit: cover; }
.item-info { flex: 1; min-width: 150px; }
.item-info strong, .item-info .muted { display: block; }
.item-info .muted { font-size: 0.85rem; }
.item-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.msg {
  position: sticky; top: 10px; z-index: 5; margin: 0 0 14px; padding: 11px 16px;
  background: #e7f6ec; color: #1b5e20; border-radius: 12px; font-weight: 600;
}
.msg.error { background: #fdecea; color: var(--danger); }

/* ---------- admin: easy layout ---------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.admin-bar { position: sticky; top: 0; z-index: 6; }
.admin main { padding-top: 14px; }

.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--pink-100); border-radius: 999px; padding: 5px; }
.tab {
  border: 0; border-radius: 999px; padding: 11px 8px; background: none; cursor: pointer;
  font: 700 0.95rem var(--font); color: var(--pink-600); transition: background 0.2s, color 0.2s;
}
.tab.active { background: var(--pink-500); color: #fff; }

/* Search and "Add item" stay on screen while the list scrolls. */
.admin-tools {
  position: sticky; top: 54px; z-index: 5; display: flex; gap: 10px;
  background: var(--bg); padding: 12px 0 10px;
}
.admin-tools input { flex: 1; min-width: 0; }
.admin-tools .btn { flex: none; white-space: nowrap; }
.summary { margin: 10px 2px 6px; font-size: 0.85rem; }

.item-list { display: grid; gap: 12px; }
@media (min-width: 760px) { .item-list { grid-template-columns: 1fr 1fr; } }
.item {
  display: block; padding: 12px; border: 0; background: var(--surface);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.item-main {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 0;
  background: none; border: 0; cursor: pointer; text-align: left; font: inherit; color: inherit;
}
.item-img { width: 68px; height: 68px; border-radius: 14px; }
.item-info { min-width: 0; }
.item-info strong { overflow-wrap: anywhere; }
.badge {
  display: inline-block; margin: 4px 6px 0 0; padding: 2px 9px; border-radius: 999px;
  background: var(--ink); color: #fff; font-size: 0.7rem; font-weight: 700;
}
.badge.soft { background: var(--pink-100); color: var(--pink-600); }
.item-actions { align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--pink-100); }
.item-actions .btn { min-height: 40px; }
.empty-list { text-align: center; padding: 36px 12px; grid-column: 1 / -1; }

/* On/off switch */
.switch { display: flex; align-items: center; gap: 9px; cursor: pointer; color: var(--ink); font-weight: 600; font-size: 0.9rem; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.switch .track {
  flex: none; position: relative; width: 46px; height: 27px; border-radius: 999px;
  background: #d9c3cb; transition: background 0.2s;
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: translate 0.2s;
}
.switch input:checked + .track { background: var(--pink-500); }
.switch input:checked + .track::after { translate: 19px 0; }
.switch input:focus-visible + .track { outline: 3px solid var(--pink-400); outline-offset: 2px; }
.switch.small { font-size: 0.82rem; color: var(--muted); }

/* Add / edit form in a pop-up */
dialog.sheet {
  width: min(520px, calc(100% - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto;
  border: 0; border-radius: 22px; padding: 20px 20px 0; color: var(--ink);
  box-shadow: 0 20px 60px rgba(74, 31, 51, 0.3);
}
dialog.sheet::backdrop { background: rgba(74, 31, 51, 0.45); }
dialog.sheet[open] { animation: dialogIn 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.1); }
dialog.sheet form { display: grid; gap: 13px; }
.photo-pick {
  position: relative; display: grid; place-items: center; height: 190px; overflow: hidden; cursor: pointer;
  background: var(--pink-100); border: 2px dashed var(--pink-400); border-radius: 16px;
}
.photo-pick img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-hint { position: relative; text-align: center; color: var(--pink-600); font-size: 0.95rem; }
.photo-hint.over {
  align-self: end; margin-bottom: 10px; padding: 5px 14px; border-radius: 999px;
  background: rgba(74, 31, 51, 0.72); color: #fff; font-size: 0.8rem;
}
.photo-pick:focus-within { outline: 3px solid var(--pink-400); outline-offset: 2px; }
.type-picks { margin-top: -6px; }
.type-picks .chip { padding: 5px 12px; font-size: 0.8rem; }
.sheet-foot {
  position: sticky; bottom: 0; display: flex; gap: 10px; background: #fff;
  padding: 12px 0 16px; margin-top: 2px;
}
.sheet-foot .btn { flex: 1; min-height: 46px; }
.sheet-foot .btn-primary { flex: 2; }

/* Pop-up message */
.msg {
  position: fixed; top: auto; left: 0; right: 0; bottom: 20px; z-index: 50; margin: 0 auto;
  width: max-content; max-width: calc(100% - 32px); text-align: center;
  box-shadow: 0 8px 24px rgba(74, 31, 51, 0.2); animation: slideUp 0.3s ease;
}

/* ---------- phones ---------- */
.hero h1, .card h3 { overflow-wrap: anywhere; }
.btn { min-height: 42px; }
@media (max-width: 560px) {
  .wrap { padding: 0 12px; }
  .grid { gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-body { padding: 11px; }
  .card h3 { font-size: 0.98rem; }
  .card-desc { font-size: 0.82rem; }
  .card .btn { padding: 10px 8px; font-size: 0.88rem; }
  .hero { padding-top: 36px; }
  .hero-actions .btn { flex: 1 1 100%; }
  .steps { margin-top: 40px; }

  /* Pop-ups become bottom sheets that are easy to reach with a thumb. */
  dialog.cart, dialog.sheet {
    width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 22px 22px 0 0;
    max-height: 92dvh; overflow-y: auto;
  }
  dialog.cart { padding-bottom: 22px; }

  .admin-bar-inner { gap: 12px; font-size: 0.92rem; }
  .admin-tools .btn { padding: 11px 14px; }
  .item-actions .btn { padding: 8px 12px; }
  .panel { padding: 16px; }
  .panel .btn { width: 100%; }
}
@media (max-width: 340px) {
  .grid { grid-template-columns: 1fr; }
}
