@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #f6f4f0;
  --surface: #ffffff;
  --text: #1a1a1f;
  --muted: #71717a;
  --border: #eae7e1;
  --accent: #2f6fed;
  --accent-dark: #1d51c2;
  --accent-soft: #e8f0fe;
  --navy: #14171f;
  --navy-soft: #23273a;
  --success: #16a34a;
  --success-soft: #e8f8ee;
  --warning: #d97706;
  --warning-soft: #fef3e2;
  --danger: #dc2626;
  --danger-soft: #fdeaea;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(20, 20, 30, 0.05), 0 1px 1px rgba(20, 20, 30, 0.03);
  --shadow-md: 0 10px 30px -12px rgba(20, 20, 30, 0.18);
  --shadow-lg: 0 24px 48px -16px rgba(20, 20, 30, 0.28);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 10% -10%, rgba(47, 111, 237, 0.08), transparent 40%),
    radial-gradient(circle at 90% 0%, rgba(20, 23, 31, 0.06), transparent 35%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: 'Poppins', 'Inter', sans-serif;
  letter-spacing: -0.01em;
  margin: 0 0 .5rem;
}

h1 { font-size: 1.9rem; font-weight: 800; }
h2 { font-size: 1.3rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }

a { color: inherit; }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.75rem;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--navy);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: .5rem;
  letter-spacing: -0.02em;
}

.brand::before {
  content: "W";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  box-shadow: var(--shadow-sm);
}

.site-header nav { display: flex; align-items: center; gap: .3rem; }

.site-header nav a {
  margin-left: .3rem;
  padding: .5rem .9rem;
  border-radius: 999px;
  color: var(--navy);
  text-decoration: none;
  font-weight: 600;
  font-size: .92rem;
  transition: background .15s ease, color .15s ease;
}

.site-header nav a:hover { background: var(--accent-soft); color: var(--accent-dark); }

.container { max-width: 1080px; margin: 0 auto; padding: 2rem 1.5rem 3rem; }

/* ---------- hero ---------- */

.hero {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 2.6rem 2rem;
  margin-bottom: 2rem;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-soft) 100%);
  color: #fff;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 85% 20%, rgba(47, 111, 237, 0.35), transparent 45%),
    radial-gradient(circle at 10% 100%, rgba(255, 255, 255, 0.08), transparent 40%);
  pointer-events: none;
}

.hero-eyebrow {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(47, 111, 237, 0.15);
  padding: .3rem .7rem;
  border-radius: 999px;
  margin-bottom: .9rem;
  position: relative;
}

.hero h1 {
  position: relative;
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  margin-bottom: .4rem;
  max-width: 30ch;
}

.hero p {
  position: relative;
  color: rgba(255, 255, 255, 0.75);
  max-width: 46ch;
  margin: 0;
  font-size: .98rem;
}

/* ---------- grid / cards ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.4rem;
}

.card {
  position: relative;
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.card .media {
  position: relative;
  height: 170px;
  background: linear-gradient(135deg, #f0eee9, #e4e1da);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.card .media img { width: 100%; height: 100%; object-fit: cover; display: block; }

.card .media .placeholder-icon {
  font-size: 2.2rem;
  opacity: .35;
}

.card-body { padding: 1.1rem 1.15rem 1.25rem; }
.card h3 { margin: 0 0 .5rem; font-size: 1.05rem; }

.price { font-size: 1.35rem; font-weight: 800; margin: .3rem 0; font-family: 'Poppins', sans-serif; }
.price-tag .price { font-size: 2rem; }
.muted { color: var(--muted); font-weight: 500; font-size: .82rem; }

/* ---------- badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .74rem;
  font-weight: 700;
  padding: .3rem .65rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.badge-available { background: var(--success-soft); color: var(--success); }
.badge-reserved { background: var(--warning-soft); color: var(--warning); }
.badge-sold { background: #eef0f4; color: #52596b; }

.card .badge { position: absolute; top: .8rem; left: .8rem; background: rgba(255,255,255,0.92); box-shadow: var(--shadow-sm); }
.card .badge-available { color: var(--success); }

.card-meta { display: flex; align-items: center; justify-content: space-between; margin-top: .6rem; }

/* ---------- product detail ---------- */

.product-detail {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 2.4rem;
  align-items: start;
}

.product-media {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(135deg, #f0eee9, #e4e1da);
  box-shadow: var(--shadow-sm);
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-media .placeholder-icon { font-size: 3.5rem; opacity: .3; }

.product-info { position: sticky; top: 5.5rem; }

.product-info > p { color: var(--muted); }

@media (max-width: 800px) {
  .product-detail { grid-template-columns: 1fr; }
  .product-info { position: static; }
}

.status {
  margin-top: 1rem;
  padding: .9rem 1.1rem;
  background: #fbfaf8;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--muted);
  font-weight: 500;
}

/* ---------- buy box ---------- */

.buy-box {
  margin-top: 1rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.buy-box h2 { display: flex; align-items: center; gap: .5rem; }
.buy-box h2::before { content: "🛒"; font-size: 1.1rem; }

.buy-box > .muted { display: block; margin-bottom: 1.1rem; line-height: 1.5; }

form label {
  display: block;
  margin-bottom: 1rem;
  font-size: .84rem;
  font-weight: 600;
  color: var(--navy);
}

form input, form textarea {
  width: 100%;
  padding: .7rem .8rem;
  margin-top: .4rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .98rem;
  font-family: inherit;
  background: #fbfaf8;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

form input:focus, form textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

form input[type="file"] {
  padding: .5rem;
  background: #fbfaf8;
  cursor: pointer;
}

#image_preview:not([hidden]) {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin: -.4rem 0 1rem;
  border: 1px solid var(--border);
}

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  border: none;
  padding: .8rem 1.4rem;
  border-radius: var(--radius-sm);
  font-size: .98rem;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 8px 18px -6px rgba(47, 111, 237, 0.55);
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
  width: 100%;
}

.admin-header .button, .site-header .button { width: auto; }

.button-small {
  width: auto;
  padding: .4rem .8rem;
  font-size: .82rem;
  box-shadow: none;
  background: var(--navy);
}
.button-small:hover { box-shadow: none; background: var(--navy-soft); }

.button-outline {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--border);
  box-shadow: none;
}
.button-outline:hover { background: #fbfaf8; box-shadow: none; }

.button-danger { background: var(--danger); }
.button-danger:hover { background: #b91c1c; box-shadow: none; }

.row-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.row-actions form { display: inline; }

.radio-group { display: flex; gap: 1.2rem; margin: -.4rem 0 1.2rem; }
.radio-option { display: flex !important; align-items: center; gap: .4rem; font-weight: 500 !important; color: var(--text) !important; }
.radio-option input { width: auto; margin: 0; }

button:hover, .button:hover { transform: translateY(-1px); box-shadow: 0 12px 22px -6px rgba(47, 111, 237, 0.6); }
button:active, .button:active { transform: translateY(0); }
button:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

.error { color: var(--danger); font-size: .85rem; min-height: 1.2em; font-weight: 600; }

/* ---------- flash ---------- */

.flash {
  display: flex;
  align-items: center;
  gap: .6rem;
  background: var(--warning-soft);
  border: 1px solid #fcd9a0;
  color: #7c4a03;
  padding: .8rem 1.1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.3rem;
  font-weight: 600;
  font-size: .92rem;
}

.flash::before { content: "⚡"; }
.flash p { margin: 0; }

/* ---------- admin ---------- */

.admin-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.admin-header h1 { flex: 1 1 auto; margin: 0; }
.admin-header a:not(.button) { color: var(--muted); font-weight: 600; text-decoration: none; font-size: .9rem; }
.admin-header a:not(.button):hover { color: var(--danger); }

.admin-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.admin-table { width: 100%; border-collapse: collapse; }

.admin-table th {
  text-align: left;
  padding: .9rem 1.1rem;
  background: #fbfaf8;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.admin-table td {
  text-align: left;
  padding: .85rem 1.1rem;
  border-bottom: 1px solid var(--border);
  font-size: .92rem;
}

.admin-table tr:last-child td { border-bottom: none; }
.admin-table tbody tr { transition: background .12s ease; }
.admin-table tbody tr:hover { background: #fbfaf8; }
.admin-table a { font-weight: 700; text-decoration: none; color: var(--navy); }
.admin-table a:hover { color: var(--accent-dark); }

/* ---------- forms / narrow cards ---------- */

.narrow-form {
  max-width: 460px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

.form-page-title { text-align: center; margin-bottom: 1.6rem; }

/* ---------- pay page ---------- */

.order-card {
  max-width: 480px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.order-card .price { font-size: 2.1rem; margin: 1rem 0 1.4rem; }

/* ---------- empty state ---------- */

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-lg);
  color: var(--muted);
  background: var(--surface);
}

.empty-state a { color: var(--accent-dark); font-weight: 700; text-decoration: none; }

/* ---------- footer ---------- */

.site-footer {
  text-align: center;
  color: var(--muted);
  padding: 2.5rem 0 1.5rem;
  font-size: .82rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

/* ---------- responsive ---------- */

@media (max-width: 700px) {
  .site-header { padding: .85rem 1.1rem; }
  .container { padding: 1.5rem 1rem 2.5rem; }
  .hero { padding: 1.8rem 1.3rem; }
  .narrow-form, .order-card { padding: 1.4rem; }
}
