/* ============================================================
   Divyalalan — design system
   Inspired by ogslimes.com: clean white canvas, bold friendly
   type, playful pastel accents, rounded cards, sparkle details.
   ============================================================ */

:root {
  --bg: #fffdfa;
  --surface: #ffffff;
  --ink: #1b1b1f;
  --muted: #71717a;
  --line: #ececec;

  --mint: #baecd4;
  --lavender: #ddd2ff;
  --pink: #ffd3e4;
  --sky: #c9e6ff;
  --butter: #ffe9a8;

  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-pill: 999px;
  --shadow-sm: 0 2px 10px rgba(27, 27, 31, 0.06);
  --shadow-md: 0 10px 30px rgba(27, 27, 31, 0.1);

  --font-display: 'Fredoka', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* Keep anchored sections (#products, #contact…) clear of the sticky header */
section[id] { scroll-margin-top: 5rem; }

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

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
}

a { color: inherit; }

.container {
  width: min(1180px, 100% - 2.5rem);
  margin-inline: auto;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  padding: 0.6rem 1.5rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  background: var(--surface);
  color: var(--ink);
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #333; }
.btn-mint { background: var(--mint); }
.btn-danger { border-color: #d64550; color: #d64550; }
.btn-danger:hover { background: #fdeef0; }
.btn-sm { padding: 0.35rem 1rem; font-size: 0.85rem; border-width: 1.5px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- Announcement bar ---------- */
.announce {
  background: var(--ink);
  color: #fff;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.5rem 1rem;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 253, 250, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.8rem;
}
.logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.5rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.logo-cube {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--lavender), var(--pink) 55%, var(--butter));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}
.main-nav { display: flex; gap: 1.6rem; }
.main-nav a {
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--muted);
  transition: color 0.15s ease;
}
.main-nav a:hover { color: var(--ink); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 5.5rem 1rem 5rem;
}
.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  pointer-events: none;
}
.hero-blob.b1 { width: 320px; height: 320px; background: var(--lavender); top: -80px; left: -60px; }
.hero-blob.b2 { width: 280px; height: 280px; background: var(--pink); bottom: -100px; right: -40px; }
.hero-blob.b3 { width: 220px; height: 220px; background: var(--mint); top: 30%; right: 18%; }
.hero-kicker {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}
.hero h1 {
  position: relative;
  font-size: clamp(2.3rem, 6vw, 4rem);
  max-width: 18ch;
  margin-inline: auto;
}
.hero h1 .hl {
  background: linear-gradient(120deg, var(--mint) 0%, var(--sky) 100%);
  border-radius: 0.35em;
  padding: 0 0.18em;
}
.hero p {
  position: relative;
  max-width: 46ch;
  margin: 1rem auto 2rem;
  color: var(--muted);
  font-size: 1.1rem;
}

/* ---------- Section headings ---------- */
.section { padding: 4rem 0; }
.section-head { text-align: center; margin-bottom: 2.2rem; }
.section-head h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
.section-head p { color: var(--muted); margin: 0; }

/* ---------- Category filter chips ---------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 2rem;
}
.chip {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.88rem;
  border: 1.5px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-pill);
  padding: 0.4rem 1.1rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.chip:hover { border-color: var(--ink); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- Product grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
@media (max-width: 980px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 0.9rem; } }
@media (max-width: 380px) { .grid { grid-template-columns: 1fr; } }

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.card-img {
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, #f6f2ff, #fdf1f6);
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-img .placeholder { font-size: 3rem; opacity: 0.45; }
.card-body { padding: 0.9rem 1.1rem 1.2rem; }
.card-name { font-weight: 800; font-size: 1rem; margin: 0 0 0.15rem; }
.card-cat {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 0.3rem;
}
.card-price { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; margin: 0; }

.badge {
  position: absolute;
  top: 0.8rem;
  left: 0.8rem;
  z-index: 1;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--radius-pill);
  padding: 0.25rem 0.75rem;
}
.badge-new { background: var(--butter); color: #6b5200; }
.badge-sold-out { background: #e7e7ea; color: var(--muted); }
.card.is-sold-out .card-img img { filter: grayscale(0.7); opacity: 0.75; }

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 4rem 1rem;
  font-size: 1.1rem;
}

/* ---------- Product detail modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(27, 27, 31, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  max-width: 880px;
  width: 100%;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-md);
}
.modal-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 2;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
}
.detail { display: grid; grid-template-columns: 1fr 1fr; }
@media (max-width: 720px) { .detail { grid-template-columns: 1fr; } }
.detail-gallery { position: relative; background: linear-gradient(135deg, #f6f2ff, #fdf1f6); }
.detail-gallery .main {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.detail-gallery .main img { width: 100%; height: 100%; object-fit: cover; }
.detail-gallery .placeholder { font-size: 5rem; opacity: 0.45; }
.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-sm);
  font-size: 1.1rem;
  cursor: pointer;
}
.gallery-nav.prev { left: 0.75rem; }
.gallery-nav.next { right: 0.75rem; }
.gallery-thumbs {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  overflow-x: auto;
}
.gallery-thumbs img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid transparent;
}
.gallery-thumbs img.active { border-color: var(--ink); }
.detail-info { padding: 2rem 1.8rem; }
.detail-info .badge { position: static; display: inline-block; margin-bottom: 0.8rem; }
.detail-info h2 { font-size: 1.7rem; margin-bottom: 0.2rem; }
.detail-cat {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.detail-price { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; margin: 0.8rem 0; }
.detail-desc { color: var(--muted); white-space: pre-line; }
.detail-note {
  margin-top: 1.5rem;
  background: var(--bg);
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ---------- About / Contact ---------- */
.about-band {
  background: linear-gradient(120deg, #f3fbf7, #f6f2ff 50%, #fdf1f6);
  border-block: 1px solid var(--line);
}
.about-band .container {
  text-align: center;
  padding: 3.5rem 1rem;
  max-width: 720px;
}
.about-band p { color: var(--muted); font-size: 1.05rem; }

.contact-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  max-width: 860px;
  margin-inline: auto;
}
@media (max-width: 720px) { .contact-cards { grid-template-columns: 1fr; } }
.contact-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  text-align: center;
  padding: 1.8rem 1.2rem;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.contact-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.contact-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  margin: 0 auto 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}
.contact-card h3 { font-size: 1.05rem; margin-bottom: 0.15rem; }
.contact-card p { margin: 0; color: var(--muted); font-size: 0.92rem; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: #d4d4d8;
  text-align: center;
  padding: 2.2rem 1rem;
  font-size: 0.9rem;
}
.site-footer .sparkle { color: var(--butter); }
.site-footer a { color: #fff; text-decoration: none; font-weight: 700; }

/* ============================================================
   Admin
   ============================================================ */
.admin-wrap { min-height: 70vh; padding: 3rem 0 4rem; }

.login-card {
  max-width: 400px;
  margin: 4rem auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 2.2rem 2rem;
  text-align: center;
}
.login-card h1 { font-size: 1.6rem; }
.login-card p { color: var(--muted); margin-top: 0; }

.field { text-align: left; margin-bottom: 1rem; }
.field label {
  display: block;
  font-weight: 800;
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
}
.field input,
.field textarea,
.field select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.85rem;
  background: var(--surface);
  color: var(--ink);
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--ink);
}
.field textarea { resize: vertical; min-height: 110px; }

.form-error {
  color: #d64550;
  font-size: 0.9rem;
  font-weight: 700;
  min-height: 1.3em;
  margin: 0.4rem 0 0.8rem;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.6rem;
}
.admin-toolbar h1 { margin: 0; font-size: 1.7rem; }
.admin-toolbar .actions { display: flex; gap: 0.6rem; }

.admin-list { display: flex; flex-direction: column; gap: 0.8rem; }
.admin-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.7rem 1rem;
}
.admin-row .thumb {
  width: 58px;
  height: 58px;
  flex: none;
  border-radius: 12px;
  object-fit: cover;
  background: linear-gradient(135deg, #f6f2ff, #fdf1f6);
  display: flex;
  align-items: center;
  justify-content: center;
}
.admin-row .info { flex: 1; min-width: 0; }
.admin-row .info .name { font-weight: 800; }
.admin-row .info .meta { font-size: 0.85rem; color: var(--muted); }
.admin-row .row-actions { display: flex; gap: 0.5rem; flex: none; }

.pill {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--radius-pill);
  padding: 0.15rem 0.6rem;
  vertical-align: middle;
}
.pill-new { background: var(--butter); color: #6b5200; }
.pill-sold-out { background: #e7e7ea; color: var(--muted); }
.pill-featured { background: var(--lavender); color: #4a3a80; }

/* Admin product form modal */
.form-modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem 1.8rem;
  position: relative;
}
.form-modal h2 { font-size: 1.4rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.form-grid .span-2 { grid-column: 1 / -1; }
.checkbox-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 1rem;
}
.checkbox-field input { width: 18px; height: 18px; }

.img-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0.6rem 0 1rem;
}
.img-previews .preview {
  position: relative;
  width: 76px;
  height: 76px;
}
.img-previews img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
}
.img-previews .remove {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: var(--ink);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  line-height: 1;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.2rem;
}

/* Toast */
.toast {
  position: fixed;
  bottom: calc(1.25rem + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100vw - 2rem);
  text-align: center;
  z-index: 200;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  font-size: 0.92rem;
  border-radius: var(--radius-pill);
  padding: 0.7rem 1.5rem;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }
.toast.error { background: #d64550; }

.loading {
  text-align: center;
  color: var(--muted);
  padding: 3rem 1rem;
}

/* ============================================================
   Mobile refinements (phone screens)
   ============================================================ */
@media (max-width: 720px) {
  .container { width: calc(100% - 1.9rem); }

  section[id] { scroll-margin-top: 6.5rem; }

  .announce { font-size: 0.72rem; padding: 0.45rem 0.75rem; }

  /* Header: logo + Login stay on the top row, nav gets its own row */
  .site-header .container { flex-wrap: wrap; row-gap: 0.3rem; padding-block: 0.6rem; }
  .logo { font-size: 1.15rem; gap: 0.4rem; }
  .logo-cube { width: 24px; height: 24px; border-radius: 7px; font-size: 0.8rem; }
  .main-nav { order: 3; width: 100%; justify-content: center; gap: 1.4rem; }
  .main-nav a { font-size: 0.9rem; }

  .hero { padding: 3.2rem 1.25rem 3rem; }
  .hero p { font-size: 1rem; }
  .hero-blob.b1 { width: 220px; height: 220px; }
  .hero-blob.b2 { width: 200px; height: 200px; }
  .hero-blob.b3 { width: 150px; height: 150px; }

  .section { padding: 2.75rem 0; }
  .section-head { margin-bottom: 1.5rem; }

  .chips { gap: 0.45rem; margin-bottom: 1.5rem; }

  .card-body { padding: 0.7rem 0.85rem 0.95rem; }
  .card-name { font-size: 0.92rem; }
  .card-price { font-size: 0.98rem; }
  .card-cat { font-size: 0.68rem; }
  .badge { top: 0.6rem; left: 0.6rem; font-size: 0.65rem; padding: 0.2rem 0.6rem; }

  /* Modals slide up as bottom sheets */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal,
  .form-modal {
    border-radius: 22px 22px 0 0;
    max-height: 92vh;
    max-height: 92dvh;
  }
  .form-modal { padding: 1.5rem 1.25rem 2rem; }
  .detail-info { padding: 1.5rem 1.25rem 2rem; }
  .detail-info h2 { font-size: 1.4rem; }
  .gallery-nav { width: 42px; height: 42px; }

  /* 16px inputs stop iOS Safari from zooming in when a field is focused */
  .field input,
  .field textarea,
  .field select { font-size: 1rem; }

  .admin-toolbar h1 { font-size: 1.4rem; }
  .admin-row { flex-wrap: wrap; }
  .admin-row .info { flex: 1 1 10rem; }
  .login-card { margin: 2.5rem auto; padding: 1.8rem 1.4rem; }
}
