/* ============================================================
   BABY REGISTRY — Stylesheet
   Font: Playfair Display + DM Sans (Google Fonts)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;1,400&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500&display=swap');

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --rose:       #f9e8ea;
  --rose-light: #fdf0f2;
  --rose-mid:   #e8a0aa;
  --rose-dark:  #c0606e;
  --rose-deep:  #8b3a45;
  --cream:      #fdf8f4;
  --cream-dark: #f5ede6;
  --sage:       #eaf2ea;
  --sage-dark:  #5a7a5a;
  --text:       #2a1f22;
  --text-muted: #7a6568;
  --text-light: #b09598;
  --white:      #ffffff;
  --border:     #ecdde0;
  --border-mid: #dfc8cc;
  --success:    #4a8c5c;
  --success-bg: #eaf5ee;
  --danger:     #c0392b;
  --danger-bg:  #fce8e6;
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --shadow-sm:  0 2px 8px rgba(42,31,34,.06);
  --shadow-md:  0 4px 20px rgba(42,31,34,.10);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: 'Playfair Display', serif; font-weight: 400; }
a { color: inherit; }
img { display: block; }
button { cursor: pointer; font-family: 'DM Sans', sans-serif; border: none; }
input, textarea, select { font-family: 'DM Sans', sans-serif; }

/* ── Nav ──────────────────────────────────────────────────── */
.nav {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.nav-logo {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  color: var(--rose-deep);
  letter-spacing: -.01em;
}
.nav-logo span { font-style: italic; color: var(--rose-dark); }
.nav-link {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  transition: all .2s;
  background: transparent;
}
.nav-link:hover { background: var(--rose); border-color: var(--rose-mid); color: var(--rose-deep); }

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 48px 24px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -60px; left: -60px;
  width: 220px; height: 220px;
  background: var(--rose-light);
  border-radius: 50%;
  opacity: .6;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -80px; right: -40px;
  width: 200px; height: 200px;
  background: var(--rose-light);
  border-radius: 50%;
  opacity: .5;
}
.hero-inner { position: relative; z-index: 1; max-width: 480px; margin: 0 auto; }
.hero-badge {
  display: inline-block;
  background: var(--rose);
  color: var(--rose-deep);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 5px 16px;
  border-radius: 20px;
  margin-bottom: 16px;
  font-weight: 500;
}
.hero h1 { font-size: clamp(28px, 6vw, 40px); color: var(--text); line-height: 1.15; margin-bottom: 12px; }
.hero h1 em { color: var(--rose-dark); font-style: italic; }
.hero p { font-size: 15px; color: var(--text-muted); line-height: 1.65; }
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-top: 28px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.hero-stat {
  flex: 1;
  padding: 14px 8px;
  text-align: center;
  border-right: 1px solid var(--border);
}
.hero-stat:last-child { border-right: none; }
.hero-stat-num { font-family: 'Playfair Display', serif; font-size: 26px; color: var(--rose-deep); line-height: 1; }
.hero-stat-label { font-size: 11px; color: var(--text-light); margin-top: 4px; }

/* ── Main Grid Layout ─────────────────────────────────────── */
.main { max-width: 900px; margin: 0 auto; padding: 32px 20px 60px; }
.section-label {
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-light);
  font-weight: 500;
  margin-bottom: 16px;
}

/* ── Item Grid ────────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

/* ── Item Card ────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  position: relative;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--rose-mid); }
.card.claimed { opacity: .55; cursor: not-allowed; }
.card.claimed:hover { transform: none; box-shadow: none; border-color: var(--border); }

.card-img-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--rose-light);
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.card:hover .card-img-wrap img { transform: scale(1.04); }
.card-emoji {
  font-size: 48px;
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--rose) 0%, #fde8ec 100%);
}

.card-claimed-badge {
  position: absolute;
  top: 10px; right: 10px;
  background: rgba(42,31,34,.72);
  color: white;
  font-size: 10px;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 500;
  backdrop-filter: blur(4px);
}

.card-body { padding: 14px 14px 16px; }
.card-name { font-size: 13px; font-weight: 500; color: var(--text); line-height: 1.35; margin-bottom: 6px; }
.card-price { font-family: 'Playfair Display', serif; font-size: 16px; color: var(--rose-dark); }
.card-claimer { font-size: 11px; color: var(--text-light); margin-top: 5px; }

/* ── Loading / Empty ──────────────────────────────────────── */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 15px;
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; }

.skeleton {
  background: linear-gradient(90deg, var(--cream-dark) 25%, var(--cream) 50%, var(--cream-dark) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ── Modal / Bottom Sheet ─────────────────────────────────── */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(42,31,34,.5);
  z-index: 200;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(2px);
  padding: 0;
}
.overlay.open { display: flex; animation: fadeIn .2s; }
@keyframes fadeIn { from{opacity:0} to{opacity:1} }

.sheet {
  background: var(--white);
  border-radius: 24px 24px 0 0;
  padding: 8px 24px 40px;
  width: 100%;
  max-width: 520px;
  animation: slideUp .28s cubic-bezier(.32,.72,0,1);
  max-height: 92vh;
  overflow-y: auto;
}
@keyframes slideUp { from{transform:translateY(100%)} to{transform:translateY(0)} }

.sheet-handle {
  width: 40px; height: 4px;
  background: var(--border-mid);
  border-radius: 2px;
  margin: 12px auto 20px;
}

.sheet-product {
  display: flex;
  gap: 14px;
  background: var(--rose-light);
  border: 1px solid var(--rose);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 24px;
}
.sheet-product-thumb {
  width: 68px; height: 68px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--white);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
}
.sheet-product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sheet-product-info { flex: 1; }
.sheet-product-name { font-weight: 500; font-size: 15px; color: var(--text); margin-bottom: 3px; }
.sheet-product-price { font-family: 'Playfair Display', serif; font-size: 17px; color: var(--rose-dark); }
.sheet-product-link { font-size: 12px; color: var(--rose-deep); text-decoration: none; display: inline-block; margin-top: 4px; }
.sheet-product-link:hover { text-decoration: underline; }

.sheet h2 { font-size: 22px; margin-bottom: 6px; }
.sheet .sheet-sub { font-size: 14px; color: var(--text-muted); margin-bottom: 22px; line-height: 1.5; }

/* ── Form ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; color: var(--text-muted); font-weight: 500; margin-bottom: 7px; letter-spacing: .03em; }
.form-input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  background: var(--cream);
  transition: border .2s, box-shadow .2s;
  outline: none;
  appearance: none;
}
.form-input:focus { border-color: var(--rose-mid); box-shadow: 0 0 0 3px rgba(192,96,110,.12); background: var(--white); }
.form-textarea { resize: vertical; min-height: 90px; line-height: 1.55; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: all .18s;
  border: none;
  cursor: pointer;
}
.btn-primary { background: var(--rose-dark); color: white; }
.btn-primary:hover { background: var(--rose-deep); transform: translateY(-1px); }
.btn-primary:disabled { background: var(--text-light); cursor: not-allowed; transform: none; }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 8px; }
.btn-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid #f5c0bc; }
.btn-danger:hover { background: #f8d5d2; }

/* ── Success View ─────────────────────────────────────────── */
.success-view { text-align: center; padding: 16px 0 8px; }
.success-icon {
  width: 72px; height: 72px;
  background: var(--success-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 32px;
}
.success-view h2 { font-size: 24px; margin-bottom: 10px; }
.success-view p { font-size: 14px; color: var(--text-muted); line-height: 1.65; max-width: 320px; margin: 0 auto; }
.success-view .note { font-size: 12px; color: var(--text-light); margin-top: 14px; }

/* ── Toast ────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: white;
  padding: 10px 22px;
  border-radius: 10px;
  font-size: 13px;
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
}
.toast.show { opacity: 1; }

/* ── Admin Page ───────────────────────────────────────────── */
.admin-wrap { max-width: 680px; margin: 0 auto; padding: 32px 20px 60px; }
.admin-header { margin-bottom: 28px; }
.admin-header h1 { font-size: 30px; margin-bottom: 6px; }
.admin-header p { font-size: 14px; color: var(--text-muted); }
.admin-header .btn-logout { font-size: 13px; color: var(--text-muted); border: 1px solid var(--border); background: transparent; padding: 6px 14px; border-radius: 20px; margin-top: 14px; }
.admin-header .btn-logout:hover { background: var(--danger-bg); color: var(--danger); border-color: #f5c0bc; }

.config-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
}
.config-section h3 { font-size: 16px; font-weight: 500; margin-bottom: 16px; font-family: 'DM Sans', sans-serif; display: flex; align-items: center; gap: 8px; }
.config-section h3 .sec-icon { font-size: 18px; }
.note-box {
  background: var(--sage);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 12px;
  color: var(--sage-dark);
  line-height: 1.6;
  margin-top: 12px;
}
.note-box code { background: rgba(0,0,0,.08); padding: 1px 5px; border-radius: 4px; font-size: 11px; }

.admin-item-list { display: flex; flex-direction: column; gap: 10px; }
.admin-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  gap: 14px;
  align-items: center;
}
.admin-item-thumb {
  width: 52px; height: 52px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--rose-light);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.admin-item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.admin-item-info { flex: 1; min-width: 0; }
.admin-item-name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-item-price { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.admin-item-status { font-size: 11px; margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.admin-item-status.available { color: var(--success); }
.admin-item-status.claimed { color: var(--rose-dark); }
.admin-item-claimer { font-size: 11px; color: var(--text-light); margin-top: 2px; }
.admin-actions { display: flex; gap: 6px; flex-shrink: 0; }
.btn-icon-sm {
  width: 34px; height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .18s;
  color: var(--text-muted);
}
.btn-icon-sm:hover { background: var(--rose-light); border-color: var(--rose-mid); color: var(--rose-deep); }
.btn-icon-sm.del:hover { background: var(--danger-bg); border-color: #f5c0bc; color: var(--danger); }

/* ── Login page ───────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--cream);
}
.login-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.login-card .logo { font-size: 32px; margin-bottom: 16px; }
.login-card h2 { font-size: 24px; margin-bottom: 6px; }
.login-card p { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; }
.login-error { font-size: 13px; color: var(--danger); margin-top: 10px; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 600px) {
  .hero { padding: 36px 20px 28px; }
  .main { padding: 24px 16px 48px; }
  .grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
  .sheet { padding: 8px 18px 32px; }
  .nav { padding: 0 16px; }
  .nav-logo { font-size: 17px; }
}
@media (max-width: 360px) {
  .grid { grid-template-columns: 1fr; }
}
