:root {
  --cream: #faf4e8;
  --paper: #fffdf8;
  --navy: #1d2b4f;
  --navy-deep: #14203d;
  --pink: #f0539b;
  --pink-soft: #ffd9ea;
  --gold: #d9a441;
  --ink: #2a2a33;
  --muted: #6b6f80;
  --green: #2e8b57;
  --red: #c0392b;
  --radius: 14px;
  --shadow: 0 4px 18px rgba(29, 43, 79, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Nunito', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

a { color: var(--navy); }

.script { font-family: 'Lobster Two', cursive; }

/* ---------- header ---------- */
.site-header {
  background: var(--navy);
  color: #fff;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.site-header img.logo {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--pink);
  background: #fff;
}
.site-header .title {
  font-family: 'Lobster Two', cursive;
  font-size: 1.9rem;
  color: #fff;
  text-decoration: none;
  line-height: 1.1;
}
.site-header .title em {
  font-style: normal;
  color: var(--pink);
}
.site-header .tagline {
  font-size: 0.85rem;
  color: #c9d2ea;
  width: 100%;
  margin: -4px 0 0 68px;
}
.site-header nav {
  margin-left: auto;
  display: flex;
  gap: 16px;
  align-items: center;
}
.site-header nav a {
  color: #e8ecf7;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
}
.site-header nav a:hover { color: var(--pink); }

.container { max-width: 1060px; margin: 0 auto; padding: 24px 18px 64px; }

/* ---------- shop grid ---------- */
.hero {
  text-align: center;
  padding: 26px 10px 10px;
}
.hero h1 {
  font-family: 'Lobster Two', cursive;
  color: var(--navy);
  font-size: 2.3rem;
  margin: 0 0 4px;
}
.hero p { color: var(--muted); margin: 0; }

.grid {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 20px;
}
.card {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.12s ease;
}
.card:hover { transform: translateY(-3px); }
.card .photo {
  aspect-ratio: 1 / 1;
  background: var(--pink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.card .photo img { width: 100%; height: 100%; object-fit: cover; }
.card .photo .no-photo { color: var(--pink); font-size: 2.2rem; }
.card .info { padding: 12px 14px 14px; }
.card .info h3 { margin: 0 0 4px; font-size: 1.02rem; color: var(--navy); }
.card .price { font-weight: 800; color: var(--pink); font-size: 1.05rem; }

.ribbon {
  position: absolute;
  top: 12px;
  left: -6px;
  background: var(--red);
  color: #fff;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  padding: 4px 14px;
  border-radius: 0 6px 6px 0;
  box-shadow: var(--shadow);
}
.ribbon.gifted { background: var(--green); }

.empty-note {
  text-align: center;
  color: var(--muted);
  padding: 60px 0;
  font-size: 1.05rem;
}

/* ---------- item page ---------- */
.item-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-top: 20px;
}
@media (max-width: 760px) { .item-layout { grid-template-columns: 1fr; } }

.gallery .main {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--pink-soft);
  box-shadow: var(--shadow);
  aspect-ratio: 1 / 1;
}
.gallery .main img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.gallery .thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.gallery .thumbs img {
  width: 64px; height: 64px; object-fit: cover;
  border-radius: 8px; cursor: pointer; border: 2px solid transparent;
}
.gallery .thumbs img.active { border-color: var(--pink); }

.item-detail h1 { font-family: 'Lobster Two', cursive; color: var(--navy); margin: 0 0 6px; font-size: 2rem; }
.item-detail .price { font-size: 1.7rem; font-weight: 800; color: var(--pink); margin: 0 0 14px; }
.item-detail .desc { white-space: pre-wrap; color: var(--ink); }
.status-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
}
.status-badge.sold { background: #fdecea; color: var(--red); }
.status-badge.gifted { background: #e8f6ee; color: var(--green); }

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-block;
  background: var(--pink);
  color: #fff;
  border: 0;
  border-radius: 999px;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  padding: 12px 30px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s;
}
.btn:hover { filter: brightness(0.92); }
.btn.secondary { background: var(--navy); }
.btn.ghost { background: transparent; color: var(--navy); border: 2px solid var(--navy); }
.btn.danger { background: var(--red); }
.btn.small { padding: 7px 16px; font-size: 0.85rem; }
.btn:disabled { opacity: 0.55; cursor: wait; }

.form-card {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  max-width: 430px;
  margin: 48px auto;
}
.form-card h1 { font-family: 'Lobster Two', cursive; color: var(--navy); margin: 0 0 18px; text-align: center; }

label { display: block; font-weight: 700; color: var(--navy); margin: 14px 0 4px; font-size: 0.92rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #e3ddcf;
  border-radius: 10px;
  font-family: inherit;
  font-size: 1rem;
  background: #fff;
  color: var(--ink);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--pink); }
textarea { min-height: 110px; resize: vertical; }

.error-msg { color: var(--red); font-weight: 700; margin-top: 12px; min-height: 1.4em; }
.ok-msg { color: var(--green); font-weight: 700; margin-top: 12px; min-height: 1.4em; }

.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 30px 0 40px;
}

/* ---------- admin ---------- */
.admin-tabs {
  display: flex;
  gap: 6px;
  margin: 18px 0;
  flex-wrap: wrap;
}
.admin-tabs button {
  background: transparent;
  border: 0;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.97rem;
  color: var(--muted);
  padding: 9px 18px;
  border-radius: 999px;
  cursor: pointer;
}
.admin-tabs button.active { background: var(--navy); color: #fff; }

.admin-panel {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.admin-item-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid #efe9da;
}
.admin-item-row:last-child { border-bottom: 0; }
.admin-item-row img.thumb {
  width: 58px; height: 58px; object-fit: cover; border-radius: 10px; background: var(--pink-soft);
}
.admin-item-row .no-thumb {
  width: 58px; height: 58px; border-radius: 10px; background: var(--pink-soft);
  display: flex; align-items: center; justify-content: center; color: var(--pink); font-size: 1.4rem;
}
.admin-item-row .meta { flex: 1; min-width: 0; }
.admin-item-row .meta .t { font-weight: 800; color: var(--navy); }
.admin-item-row .meta .p { color: var(--muted); font-size: 0.9rem; }
.admin-item-row select { width: auto; padding: 6px 8px; font-size: 0.88rem; }

.upload-thumbs { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.upload-thumbs .ut {
  position: relative; width: 86px;
}
.upload-thumbs img { width: 86px; height: 86px; object-fit: cover; border-radius: 10px; display: block; }
.upload-thumbs .x {
  position: absolute; top: -7px; right: -7px;
  background: var(--red); color: #fff; border: 0; border-radius: 50%;
  width: 22px; height: 22px; font-weight: 800; cursor: pointer; line-height: 1;
}
.upload-thumbs .star {
  position: absolute; bottom: 4px; left: 4px;
  background: rgba(255,255,255,0.92); border: 0; border-radius: 6px;
  font-size: 0.72rem; padding: 2px 6px; cursor: pointer; font-weight: 700; color: var(--navy);
}

table.admin-table { width: 100%; border-collapse: collapse; }
table.admin-table th { text-align: left; color: var(--muted); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.05em; padding: 8px 6px; }
table.admin-table td { padding: 10px 6px; border-top: 1px solid #efe9da; }

.hint { color: var(--muted); font-size: 0.86rem; margin-top: 4px; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 6px 0 2px; }
.swatch {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid #e3ddcf; cursor: pointer; padding: 0;
}
.swatch.sel { border-color: var(--navy); box-shadow: 0 0 0 2px #fff inset; }
.swatches input[type="color"] {
  width: 36px; height: 36px; border: 3px solid #e3ddcf; border-radius: 50%;
  background: none; cursor: pointer; padding: 0;
}

.share-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(20, 32, 61, 0.55);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.share-overlay[hidden] { display: none; }
.share-panel {
  background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px; max-width: 520px; width: 100%; max-height: 90vh; overflow-y: auto;
}
.share-panel textarea { font-size: 0.92rem; }
.share-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.section-title { font-family: 'Lobster Two', cursive; color: var(--navy); font-size: 1.4rem; margin: 0 0 10px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .row2 { grid-template-columns: 1fr; } }
