/* ============================================================
   PODSTORE — theme main.css (port từ mockups Phase 4 + styles trang)
   ============================================================ */

:root {
  --bg: #ffffff;
  --surface: #f6f6f6;
  --surface-2: #efefef;
  --text: #1a1a1a;
  --text-muted: #6b6b6b;
  --border: #e5e5e5;
  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --accent-soft: #f3eefe;
  --sale: #c22f22;
  --success: #1a7f37;
  --warning: #b45309;
  --dark: #161616;

  --fs-hero: 2rem;
  --fs-h1: 1.5rem;
  --fs-h2: 1.25rem;
  --fs-h3: 1.0625rem;
  --fs-body: 1rem;
  --fs-sm: 0.875rem;
  --fs-xs: 0.75rem;
  --lh: 1.5;

  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px;

  --r-sm: 6px;  --r-md: 10px; --r-lg: 14px; --r-full: 999px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.12);

  --container: 1200px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: var(--fs-body);
  line-height: var(--lh);
  color: var(--text);
  background: var(--bg);
}

img { max-width: 100%; display: block; }
a { color: var(--text); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; }
button { font: inherit; cursor: pointer; }
h1, h2, h3 { line-height: 1.25; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--sp-4); }

/* ---------- Header ---------- */
.topbar {
  background: var(--dark); color: #fff; font-size: var(--fs-xs);
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--sp-2) var(--sp-4);
}
.topbar a { color: #fff; }
.topbar-right { display: flex; gap: var(--sp-4); }

.site-header { border-bottom: 1px solid var(--border); background: var(--bg); }
.site-header .row {
  display: flex; align-items: center; gap: var(--sp-4);
  padding: var(--sp-4) 0;
}
.logo { font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em; }
.logo span { color: var(--accent); }

.search {
  flex: 1; display: flex; border: 1px solid var(--border);
  border-radius: var(--r-full); overflow: hidden; background: var(--surface);
}
.search input {
  flex: 1; border: 0; background: transparent; padding: var(--sp-3) var(--sp-5);
  font: inherit; outline: none;
}
.search button {
  border: 0; background: var(--accent); color: #fff;
  padding: 0 var(--sp-5); font-weight: 600; font-size: var(--fs-sm);
}
.header-actions { display: flex; gap: var(--sp-3); align-items: center; }
.icon-btn {
  border: 1px solid var(--border); background: var(--bg); border-radius: var(--r-full);
  width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.15rem; position: relative;
}
.icon-btn .badge-count {
  position: absolute; top: -5px; right: -5px; background: var(--sale); color: #fff;
  font-size: 10px; font-weight: 700; min-width: 18px; height: 18px; border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}

.nav {
  display: flex; gap: var(--sp-6); overflow-x: auto; padding: 0 var(--sp-4) var(--sp-3);
  font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted);
}
.nav a:hover { color: var(--text); text-decoration: none; }

/* ---------- Breadcrumb ---------- */
.breadcrumb { font-size: var(--fs-xs); color: var(--text-muted); padding: var(--sp-4) 0; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb .sep { margin: 0 var(--sp-1); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  border-radius: var(--r-md); font-weight: 700; font-size: var(--fs-body);
  padding: var(--sp-3) var(--sp-6); border: 1px solid transparent; transition: all .15s;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; width: 100%; }
.btn-primary:hover { background: var(--accent-hover); text-decoration: none; }
.btn-outline { background: var(--bg); border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--text); text-decoration: none; }
.btn-lg { padding: var(--sp-4) var(--sp-8); font-size: 1.0625rem; }
.btn-hero-ghost { background: var(--bg); border-color: var(--border); color: var(--text); }
.btn-hero-ghost:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ---------- Pill ---------- */
.pills { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.pill {
  border: 1px solid var(--border); background: var(--bg); border-radius: var(--r-full);
  min-width: 44px; padding: var(--sp-2) var(--sp-4); font-size: var(--fs-sm); font-weight: 600;
}
.pill.active { border-color: var(--text); background: var(--text); color: #fff; }
.pill:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- Badge ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--sale); color: #fff; font-size: var(--fs-xs); font-weight: 700;
  padding: 2px 8px; border-radius: var(--r-full);
}
.badge-soft { background: var(--accent-soft); color: var(--accent); }

/* ---------- Card ---------- */
.card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; transition: box-shadow .15s, transform .15s; }
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); text-decoration: none; }
.card .thumb { aspect-ratio: 1; background: var(--surface); position: relative; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .badge { position: absolute; top: var(--sp-2); left: var(--sp-2); }
.card .body { padding: var(--sp-3) var(--sp-4) var(--sp-4); }
.card .title { font-weight: 600; font-size: var(--fs-sm); }
.card .artist { color: var(--text-muted); font-size: var(--fs-xs); }
.card .price-row { display: flex; align-items: baseline; gap: var(--sp-2); margin-top: var(--sp-2); }
.card .price { font-weight: 700; font-size: var(--fs-body); }
.card .price.old { color: var(--text-muted); text-decoration: line-through; font-size: var(--fs-sm); font-weight: 400; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-4); }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(4, 1fr); } }

/* ---------- Trust ---------- */
.trust {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-4);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: var(--sp-6); margin: var(--sp-8) 0;
}
@media (min-width: 768px) { .trust { grid-template-columns: repeat(4, 1fr); } }
.trust .t { text-align: center; font-size: var(--fs-xs); color: var(--text-muted); }
.trust .t b { display: block; color: var(--text); font-size: var(--fs-sm); margin-bottom: 2px; }
.trust svg { margin: 0 auto var(--sp-2); color: var(--accent); }

/* ---------- Tags ---------- */
.tag-cloud { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.tag {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-full);
  padding: var(--sp-2) var(--sp-4); font-size: var(--fs-xs); color: var(--text-muted);
}
.tag:hover { border-color: var(--text); color: var(--text); text-decoration: none; }
.tag.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.tag-row { display: flex; align-items: baseline; gap: var(--sp-3); margin-top: var(--sp-4); flex-wrap: wrap; }
.tag-row > b { font-size: var(--fs-sm); }

/* ---------- Footer ---------- */
.site-footer { background: var(--dark); color: #cfcfcf; margin-top: var(--sp-12); }
.site-footer .cols {
  display: grid; gap: var(--sp-8); padding: var(--sp-12) var(--sp-4);
  grid-template-columns: 1fr 1fr;
}
@media (min-width: 768px) { .site-footer .cols { grid-template-columns: repeat(4, 1fr); } }
.site-footer h4 { color: #fff; margin-bottom: var(--sp-4); font-size: var(--fs-sm); }
.site-footer a { color: #cfcfcf; display: block; margin-bottom: var(--sp-2); font-size: var(--fs-sm); }
.site-footer a:hover { color: #fff; text-decoration: none; }
.copyright { border-top: 1px solid #2a2a2a; padding: var(--sp-4); text-align: center; font-size: var(--fs-xs); color: #8f8f8f; }

/* ---------- Home: hero / cats / banner ---------- */
.hero { display: grid; gap: var(--sp-8); align-items: center; padding: var(--sp-10) 0 var(--sp-6); }
@media (min-width: 768px) { .hero { grid-template-columns: 1.3fr .7fr; } }
.hero .copy h1 { font-size: var(--fs-hero); font-weight: 800; letter-spacing: -.02em; }
@media (min-width: 768px) { .hero .copy h1 { --fs-hero: 2.6rem; } }
.hero .copy p { color: var(--text-muted); margin-top: var(--sp-4); max-width: 480px; }
.hero .cta-row { display: flex; gap: var(--sp-3); margin-top: var(--sp-6); flex-wrap: wrap; }
.hero .cta-row .btn { width: auto; }
.hero .art img { border-radius: var(--r-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 320px; margin: 0 auto; }

.cats { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-4); }
@media (min-width: 768px) { .cats { grid-template-columns: repeat(4, 1fr); } }
.cat {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: var(--sp-5) var(--sp-4);
}
.cat:hover { border-color: var(--accent); text-decoration: none; }
.cat .ico { font-size: 1.5rem; }
.cat .nm { font-weight: 700; margin-top: var(--sp-2); }
.cat .ct { color: var(--accent); font-size: var(--fs-xs); font-weight: 600; }

.banner {
  display: flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap;
  background: var(--accent-soft); border: 1px solid var(--accent);
  border-radius: var(--r-lg); padding: var(--sp-6);
  margin: var(--sp-8) 0;
}
.banner b { color: var(--accent-hover); font-size: 1.0625rem; }
.banner .sub { color: var(--text-muted); font-size: var(--fs-sm); margin-top: 2px; }
.banner .btn { width: auto; }

/* ---------- Catalog ---------- */
.catalog { display: grid; gap: var(--sp-8); }
@media (min-width: 960px) { .catalog { grid-template-columns: 220px 1fr; align-items: start; } }
.filters { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--sp-5); }
.filters .grp + .grp { margin-top: var(--sp-6); }
.filters h3 { font-size: var(--fs-sm); font-weight: 800; margin-bottom: var(--sp-3); }
.filters .tag { display: inline-block; }
.sort-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-4); }
.result-count { color: var(--text-muted); font-size: var(--fs-sm); }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: var(--sp-8); }
.pager .btn { width: auto; }

/* ---------- Product page ---------- */
.pd { display: grid; gap: var(--sp-8); }
@media (min-width: 960px) { .pd { grid-template-columns: 1fr 1fr; align-items: start; } }

.gallery { display: flex; gap: var(--sp-4); }
.g-strip { display: flex; flex-direction: column; gap: var(--sp-2); }
.g-thumb {
  width: 72px; height: 72px; border-radius: var(--r-sm); overflow: hidden;
  border: 1px solid var(--border); cursor: pointer; background: var(--surface);
}
.g-thumb img { width: 100%; height: 100%; object-fit: cover; }
.g-thumb.active { border-color: var(--text); box-shadow: var(--shadow-sm); }
.g-main {
  flex: 1; border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); overflow: hidden;
}
.g-main img { width: 100%; height: 100%; object-fit: cover; }
img.is-transparent { background: repeating-conic-gradient(var(--surface-2) 0 25%, #fff 0 50%) 0 0/16px 16px; }

.info h1 { font-size: var(--fs-h1); font-weight: 800; }
.info .artist { color: var(--text-muted); font-size: var(--fs-sm); margin-top: var(--sp-1); }
.price-block { display: flex; align-items: baseline; gap: var(--sp-3); margin-top: var(--sp-5); }
.price-block .now { font-size: 1.75rem; font-weight: 800; color: var(--sale); }
.price-block .was { color: var(--text-muted); text-decoration: line-through; font-size: var(--fs-sm); }

.opt { margin-top: var(--sp-6); }
.opt-label { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: var(--fs-sm); margin-bottom: var(--sp-3); }
.opt-label .link { color: var(--accent); font-weight: 600; font-size: var(--fs-xs); cursor: pointer; }

.styles { display: flex; gap: var(--sp-3); overflow-x: auto; }
.style-card {
  flex: 0 0 130px; border: 1px solid var(--border); border-radius: var(--r-md);
  padding: var(--sp-2); text-align: center; background: var(--bg);
}
.style-card.active { border-color: var(--accent); }
.style-card .th { border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.style-card .th img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.style-card .nm { font-size: var(--fs-xs); font-weight: 700; margin-top: var(--sp-2); }
.style-card .pr { font-size: var(--fs-xs); color: var(--text-muted); }

.color-dots { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.color-dot {
  width: 32px; height: 32px; border-radius: var(--r-full);
  border: 2px solid #fff; outline: 1px solid var(--border); padding: 0;
}
.color-dot.active { outline: 2px solid var(--text); }

.design-note {
  margin-top: var(--sp-5); background: #fef9c3; border: 1px solid #fde047;
  border-radius: var(--r-sm); padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-xs); color: #713f12;
}

.add-wrap { margin-top: var(--sp-6); }
.returns-line { margin-top: var(--sp-3); font-size: var(--fs-xs); color: var(--text-muted); text-align: center; }

.block h2 { font-size: var(--fs-h2); font-weight: 800; margin-bottom: var(--sp-4); }
.features { list-style: disc; padding-left: var(--sp-5); color: var(--text-muted); font-size: var(--fs-sm); }
.features li { margin-bottom: var(--sp-2); }
.also { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-4); }
@media (min-width: 640px) { .also { grid-template-columns: repeat(4, 1fr); } }

/* ---------- Mini cart drawer ---------- */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: none; z-index: 49; }
.scrim.open { display: block; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 100%);
  background: var(--bg); box-shadow: var(--shadow-lg); transform: translateX(100%);
  transition: transform .25s ease; display: flex; flex-direction: column; z-index: 50;
}
.drawer.open { transform: translateX(0); }
.drawer .head { display: flex; justify-content: space-between; align-items: center; padding: var(--sp-4) var(--sp-6); border-bottom: 1px solid var(--border); font-weight: 800; }
.drawer .body { flex: 1; overflow-y: auto; padding: var(--sp-4) var(--sp-6); }
.drawer .foot { padding: var(--sp-4) var(--sp-6); border-top: 1px solid var(--border); }
.drawer-item { display: flex; gap: var(--sp-3); padding: var(--sp-3) 0; border-bottom: 1px solid var(--border); }
.drawer-item img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--r-sm); }
.drawer-item .t { font-size: var(--fs-xs); font-weight: 600; }
.drawer-item .v { font-size: var(--fs-xs); color: var(--text-muted); }
.drawer-item .p { margin-left: auto; font-weight: 700; font-size: var(--fs-sm); white-space: nowrap; }
.sum-row { display: flex; justify-content: space-between; font-size: var(--fs-sm); padding: var(--sp-2) 0; color: var(--text-muted); }
.sum-row.total { font-size: var(--fs-body); font-weight: 800; color: var(--text); border-top: 1px solid var(--border); margin-top: var(--sp-2); padding-top: var(--sp-4); }
.drawer-close { border: 0; background: none; font-size: 1.1rem; color: var(--text-muted); }

/* ---------- Utility ---------- */
.mt-2 { margin-top: var(--sp-2); } .mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); } .mt-6 { margin-top: var(--sp-6); }
.mt-8 { margin-top: var(--sp-8); } .mt-10 { margin-top: var(--sp-10); }
.muted { color: var(--text-muted); }
.price-sale { color: var(--sale); font-weight: 800; }
.section-title { font-size: var(--fs-h2); font-weight: 800; margin-bottom: var(--sp-4); }
