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

:root {
  --ink: #141414;
  --ink-soft: #5b6360;
  --paper: #f6f8f5;
  --panel: #ffffff;
  --line: #e1e6de;
  --brand: #141414;
  --brand-dark: #000000;
  --accent: #238a16;
  --accent-dark: #166010;
  --accent-soft: #e3f3dc;
  --accent-bright: #6fd400;
  --danger: #b3401e;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(17, 20, 28, 0.06);
  --shadow: 0 2px 6px rgba(17, 20, 28, 0.06), 0 10px 28px rgba(17, 20, 28, 0.07);
  --shadow-lg: 0 16px 40px rgba(17, 20, 28, 0.16);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand, .btn, .hero-modern h1 {
  font-family: "Space Grotesk", "Inter", sans-serif;
  letter-spacing: -0.01em;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ---------- header (deep teal) ---------- */
.site-header {
  background: linear-gradient(100deg, #063334 0%, #0e4b4c 55%, #146363 100%);
  border-bottom: 1px solid rgba(111, 212, 0, 0.3);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
  position: sticky; top: 0; z-index: 20;
}
.header-row {
  display: flex; align-items: center; gap: 24px;
  padding: 12px 0;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 1.32rem; font-weight: 700; color: #ffffff; letter-spacing: -0.015em;
}
.brand-mark {
  height: 36px; width: auto; flex: none; display: block;
}
.brand span { color: #bfe0dd; font-weight: 500; }
.brand:hover { text-decoration: none; opacity: 0.88; }

.search-form {
  flex: 1; display: flex; max-width: 480px; align-items: center;
  background: rgba(255, 255, 255, 0.95); border: 1px solid transparent; border-radius: 999px; overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-form:focus-within { box-shadow: 0 0 0 3px rgba(111, 212, 0, 0.3); }
.search-form input {
  flex: 1; min-width: 0; padding: 10px 18px; border: none; background: transparent;
  font-size: 0.91rem; font-family: inherit; color: var(--ink);
}
.search-form input:focus { outline: none; }
.search-form button {
  border: none; margin: 3px; padding: 8px 18px; background: var(--accent); color: white;
  border-radius: 999px; cursor: pointer; font-size: 0.85rem; font-weight: 600;
  transition: background 0.15s;
}
.search-form button:hover { background: var(--accent-dark); }
.header-actions { display: flex; align-items: center; gap: 18px; font-size: 0.9rem; white-space: nowrap; margin-left: auto; }
.header-actions a { color: #d8efec; font-weight: 500; }
.header-actions a:hover { color: var(--accent-bright); text-decoration: none; }
.header-actions .btn, .header-actions .btn:hover { background: var(--accent-bright); border-color: var(--accent-bright); color: #06201f; }
.cart-pill {
  background: rgba(0, 0, 0, 0.28); color: var(--accent-bright); padding: 5px 11px; border-radius: 999px;
  font-weight: 700; font-size: 0.78rem;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block; padding: 11px 22px; border-radius: 999px; border: 1px solid var(--brand);
  background: var(--brand); color: white; font-size: 0.92rem; cursor: pointer; font-weight: 600;
  transition: background 0.15s, border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); text-decoration: none; transform: translateY(-1px); box-shadow: 0 10px 22px rgba(22, 96, 16, 0.22); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn-outline { background: transparent; color: var(--brand); }
.btn-outline:hover { background: var(--brand); color: white; }
.btn-accent, .btn-gold { background: var(--accent); border-color: var(--accent); color: #ffffff; }
.btn-accent:hover, .btn-gold:hover { background: var(--accent-dark); border-color: var(--accent-dark); box-shadow: 0 10px 22px rgba(35, 138, 22, 0.3); }
.btn-block { width: 100%; text-align: center; }
.btn-sm { padding: 7px 16px; font-size: 0.82rem; }

/* ---------- modern hero ---------- */
.hero-modern {
  background:
    radial-gradient(circle at 15% 20%, rgba(111, 212, 0, 0.24), transparent 45%),
    linear-gradient(135deg, var(--brand-dark), #16220f);
  background-size: cover; background-position: center; background-blend-mode: normal;
  color: white; padding: 128px 0 112px; min-height: 500px;
  position: relative; overflow: hidden;
  display: flex; align-items: center;
}
/* Dark scrim drawn in CSS (not inline) so hero text stays legible over ANY
   photo, regardless of how bright/busy it is — this layer is what was
   missing before, since this file wasn't actually on the server yet. */
.hero-modern::before {
  content: "";
  position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(100deg, rgba(6, 12, 5, 0.62) 0%, rgba(6, 12, 5, 0.46) 42%, rgba(6, 12, 5, 0.28) 70%, rgba(6, 12, 5, 0.12) 100%);
}
.hero-modern-inner { max-width: 760px; position: relative; z-index: 1; width: 100%; }
.hero-eyebrow {
  display: inline-block; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent-bright); background: rgba(111, 212, 0, 0.18); padding: 6px 14px; border-radius: 999px;
  margin-bottom: 22px;
}
.hero-modern h1 {
  margin: 0 0 16px; font-size: clamp(2.1rem, 4vw, 3.15rem); font-weight: 700; line-height: 1.12; letter-spacing: -0.02em;
  color: #ffffff; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.55);
}
.hero-modern p {
  margin: 0 0 30px; color: #eef1ea; max-width: 580px; font-size: 1.07rem; line-height: 1.6;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
}

.hero-search { display: flex; max-width: 560px; box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38); border-radius: 999px; overflow: hidden; background: rgba(255, 255, 255, 0.98); }
.hero-search input { flex: 1; min-width: 0; border: none; padding: 16px 22px; font-size: 1rem; font-family: inherit; background: transparent; color: var(--ink); }
.hero-search input:focus { outline: none; }
.hero-search button {
  border: none; padding: 0 28px; background: var(--accent); color: white; font-weight: 700; cursor: pointer;
  font-size: 0.95rem; transition: background 0.15s;
}
.hero-search button:hover { background: var(--accent-dark); }

.hero-trending { margin-top: 22px; font-size: 0.86rem; color: #dfe4da; display: flex; flex-wrap: wrap; gap: 7px; align-items: center; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5); }
.hero-trending > span:first-child { color: #c7cdc0; font-weight: 600; margin-right: 2px; }
.hero-trending .sep { opacity: 0.55; }
.hero-trending a { color: #ffffff; font-weight: 500; }
.hero-trending a:hover { color: var(--accent-bright); text-decoration: none; }

/* ---------- category tiles ---------- */
.section-heading { padding: 44px 0 4px; display: flex; align-items: baseline; justify-content: space-between; }
.section-heading h2 { margin: 0; font-size: 1.4rem; font-weight: 700; }
.section-heading p { margin: 0; color: var(--ink-soft); font-size: 0.88rem; }

.cat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; padding: 20px 0 8px; }
.cat-tile { position: relative; display: block; border-radius: var(--radius); overflow: hidden; aspect-ratio: 5/4; box-shadow: var(--shadow); transition: transform 0.2s ease, box-shadow 0.2s ease; color: inherit; text-decoration: none; }
.cat-tile:hover { text-decoration: none; }
.cat-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.cat-tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.45s ease; }
.cat-tile:hover img { transform: scale(1.08); }
.cat-tile-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 16px;
  background: linear-gradient(180deg, transparent 38%, rgba(0, 0, 0, 0.78) 100%); color: white;
}
.cat-tile-overlay h3 { margin: 0; font-size: 1.02rem; font-weight: 700; }
.cat-tile-overlay span { font-size: 0.78rem; color: #d7ddd4; margin-top: 2px; }

/* ---------- chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 22px 0 8px; }
.chip {
  padding: 7px 15px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel);
  font-size: 0.84rem; color: var(--ink-soft); font-weight: 500; transition: all 0.15s;
}
.chip:hover { border-color: var(--accent); color: var(--ink); text-decoration: none; }
.chip.active { background: var(--brand); color: white; border-color: var(--brand); }
.chip.active:hover { border-color: var(--brand); }

/* ---------- image grid / cards ---------- */
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 22px; padding: 22px 0 52px;
}
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  color: inherit; text-decoration: none;
}
.card:hover { text-decoration: none; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: #cfdccb; }
.card-media { position: relative; overflow: hidden; }
.card-media img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; background: #eee; transition: transform 0.45s ease; }
.card:hover .card-media img { transform: scale(1.07); }
.card-price-badge {
  position: absolute; top: 10px; right: 10px; background: rgba(15, 15, 15, 0.72); color: white; font-weight: 700;
  font-size: 0.73rem; padding: 5px 12px; border-radius: 999px; backdrop-filter: blur(4px);
}
.card-body { padding: 13px 15px 17px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.card-body h3 { margin: 0; font-size: 0.98rem; font-weight: 600; font-family: "Inter", sans-serif; letter-spacing: 0; }
.card-meta { font-size: 0.81rem; color: var(--ink-soft); }
.card-price { margin-top: auto; font-weight: 700; color: var(--accent-dark); padding-top: 4px; }
.badge {
  display: inline-block; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark);
}

.empty-state { padding: 72px 0; text-align: center; color: var(--ink-soft); }

/* ---------- detail ---------- */
.detail-layout { display: grid; grid-template-columns: 1.3fr 1fr; gap: 44px; padding: 36px 0 68px; align-items: start; }
.detail-layout img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); }
.detail-panel { position: sticky; top: 96px; }
.detail-panel h1 { margin: 0 0 6px; font-size: 1.55rem; font-weight: 700; }
.detail-panel .card-meta { margin-bottom: 18px; }
.license-list { display: flex; flex-direction: column; gap: 10px; margin: 18px 0 22px; }
.license-option {
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 13px 15px; cursor: pointer;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  transition: border-color 0.15s, background 0.15s;
}
.license-option:hover { border-color: #b9d3b2; }
.license-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.license-option input { margin-top: 3px; accent-color: var(--accent); }
.license-option .name { font-weight: 600; }
.license-option .desc { font-size: 0.82rem; color: var(--ink-soft); margin-top: 2px; }
.license-option .price { font-weight: 700; white-space: nowrap; font-family: "Space Grotesk", sans-serif; }

.related-title { margin: 8px 0 4px; font-size: 1.15rem; font-weight: 600; }

/* ---------- forms ---------- */
.form-card {
  max-width: 440px; margin: 56px auto; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 34px; box-shadow: var(--shadow);
}
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.86rem; font-weight: 600; margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 0.95rem;
  background: var(--paper); font-family: inherit; transition: border-color 0.15s;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); outline: none; }
.field textarea { resize: vertical; min-height: 90px; }
.checkbox-field { display: flex; align-items: center; gap: 8px; }
.checkbox-field input { width: auto; accent-color: var(--accent); }

/* ---------- flash messages ---------- */
.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 0.89rem; font-weight: 500; }
.flash-success { background: #e7f2ea; color: #1f6440; }
.flash-error { background: #fbe9e4; color: var(--danger); }
.flash-info { background: #eef2fb; color: #2a4d8f; }

/* ---------- tables (cart, orders, admin) ---------- */
table.plain { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
table.plain th, table.plain td { text-align: left; padding: 13px 15px; border-bottom: 1px solid var(--line); font-size: 0.89rem; }
table.plain th { background: #eef3ec; font-weight: 700; color: var(--ink-soft); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; }
table.plain tr:last-child td { border-bottom: none; }
table.plain tbody tr:hover { background: #f8faf7; }
.table-thumb { width: 58px; height: 44px; object-fit: cover; border-radius: 6px; }
.status-pill { padding: 3px 11px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.status-paid { background: #e7f2ea; color: #1f6440; }
.status-pending { background: #fbf3de; color: #8a6416; }
.status-cancelled, .status-failed { background: #fbe9e4; color: var(--danger); }

.page-title { padding: 36px 0 8px; }
.page-title h1 { margin: 0 0 4px; font-size: 1.7rem; font-weight: 700; }
.page-title p { color: var(--ink-soft); margin: 0; }

.section { padding: 24px 0; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin: 20px 0 32px; }
.stat-box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.stat-box .num { font-size: 1.7rem; font-weight: 700; color: var(--accent-dark); font-family: "Space Grotesk", sans-serif; }
.stat-box .label { font-size: 0.81rem; color: var(--ink-soft); margin-top: 2px; }

.admin-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.admin-tabs a { padding: 10px 16px; font-size: 0.9rem; color: var(--ink-soft); border-bottom: 2px solid transparent; font-weight: 500; }
.admin-tabs a:hover { text-decoration: none; color: var(--ink); }
.admin-tabs a.active { color: var(--ink); border-color: var(--accent); font-weight: 700; }

/* ---------- footer ---------- */
.footer { background: var(--brand-dark); color: #c7cdc3; margin-top: 64px; font-size: 0.85rem; }
.footer-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 24px;
  padding: 40px 24px; border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.footer-stats .num { font-size: 1.9rem; font-weight: 700; color: var(--accent-bright); font-family: "Space Grotesk", sans-serif; }
.footer-stats .label { font-size: 0.76rem; color: #9aa398; margin-top: 2px; text-transform: uppercase; letter-spacing: 0.05em; }
.footer-bottom { padding: 26px 24px 32px; }
.footer-bottom .footer-group { color: #767d73; font-size: 0.8rem; margin-top: 4px; }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .header-row { flex-wrap: wrap; row-gap: 10px; }
  .brand { order: 1; }
  .header-actions { order: 2; margin-left: auto; }
  .search-form { order: 3; flex-basis: 100%; max-width: none; }

  .detail-layout { grid-template-columns: 1fr; gap: 24px; }
  .detail-panel { position: static; }

  .hero-modern { padding: 64px 0 56px; min-height: 360px; }
  .hero-trending { row-gap: 4px; }
}
