/* ==========================================================================
   YY Studio — Comic & Illustration Agency Store
   Theme: simple, neat, light warm yellow
   ========================================================================== */

:root {
  /* Warm yellow palette */
  --bg:            #fffdf5;
  --bg-soft:       #fdf6e3;
  --bg-card:       #ffffff;
  --yellow:        #ffd54a;
  --yellow-deep:   #f4b400;
  --yellow-soft:   #fff2c2;
  --ink:           #2f2a22;
  --ink-soft:      #6b6355;
  --line:          #efe6cf;
  --accent:        #e58a2b;
  --success:       #3f9d5a;
  --danger:        #d9534f;
  --info:          #3a63c9;
  --admin-ink:     #241f18;
  --admin-side:    #2c261d;

  --radius:   14px;
  --radius-sm:10px;
  --shadow:   0 4px 18px rgba(180, 150, 40, 0.10);
  --shadow-lg:0 10px 34px rgba(180, 150, 40, 0.16);
  --maxw:     1140px;
  --font:     "Poppins", "Segoe UI", system-ui, -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--yellow-deep); outline-offset: 3px; }

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 80;
  background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 999px;
}
.skip-link:focus { top: 12px; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

h1, h2, h3 { line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; }
.section-title { font-size: 1.7rem; margin-bottom: 4px; }
.section-sub { color: var(--ink-soft); margin-bottom: 28px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border: none; border-radius: 999px;
  font-family: var(--font); font-size: 0.95rem; font-weight: 600;
  cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary { background: var(--yellow-deep); color: #3a2c00; }
.btn-primary:hover:not(:disabled) { background: var(--yellow); box-shadow: var(--shadow); }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover:not(:disabled) { border-color: var(--yellow-deep); background: var(--yellow-soft); }
.btn-danger { background: #fdecec; color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: #f8d4d3; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 253, 245, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px; gap: 20px; position: relative;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.25rem; letter-spacing: -0.02em; }
.brand .mark {
  width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center;
  overflow: hidden; flex-shrink: 0;
  background: transparent;
}
.brand .mark img {
  width: 100%; height: 100%;
  object-fit: contain; display: block;
}
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a { font-size: 0.95rem; color: var(--ink-soft); font-weight: 500; transition: color .15s; }
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-actions { display: flex; align-items: center; gap: 14px; }
.icon-btn { position: relative; display: inline-flex; align-items: center; gap: 6px; font-size: 0.9rem; color: var(--ink-soft); font-weight: 500; }
.icon-btn:hover { color: var(--ink); }
.icon-btn.is-user { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-count {
  position: absolute; top: -8px; right: -10px; min-width: 18px; height: 18px;
  padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff;
  font-size: 0.68rem; font-weight: 700; display: grid; place-items: center;
}
.nav-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--ink); }

/* ---------- Hero ---------- */
.hero {
  background: radial-gradient(1200px 500px at 80% -10%, var(--yellow-soft), transparent),
              linear-gradient(180deg, var(--bg-soft), var(--bg));
  padding: 70px 0 80px;
}
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 40px; align-items: center; }
.hero h1 { font-size: 2.9rem; margin-bottom: 16px; }
.hero .lead { font-size: 1.12rem; color: var(--ink-soft); margin-bottom: 26px; max-width: 520px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-art {
  aspect-ratio: 4/3; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--yellow), var(--yellow-soft));
  box-shadow: var(--shadow-lg); display: grid; place-items: center;
  font-size: 4rem; position: relative; overflow: hidden;
}
.hero-art img { width: 100%; height: 100%; object-fit: cover; }
.hero-art span { filter: drop-shadow(0 6px 10px rgba(0,0,0,.12)); }
.pill { display: inline-block; padding: 6px 14px; border-radius: 999px; background: var(--yellow-soft); color: var(--accent); font-weight: 600; font-size: 0.82rem; margin-bottom: 18px; }
.pill-inline { margin: 0; padding: 3px 9px; font-size: 0.68rem; }
.page-hero {
  background: linear-gradient(180deg, var(--bg-soft), var(--bg));
  padding: 40px 0 28px;
  border-bottom: 1px solid var(--line);
}
.page-hero h1 { font-size: 2.15rem; margin-bottom: 8px; }
.page-hero .lead { margin-bottom: 0; max-width: 640px; color: var(--ink-soft); }
.crumb { color: var(--ink-soft); font-size: 0.9rem; margin-bottom: 22px; }
.crumb a { color: var(--accent); font-weight: 600; }
.crumb a:hover { text-decoration: underline; }

/* ---------- Brand cards (Mail Club etc.) ---------- */
.brand-card {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s;
}
.brand-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.brand-card .emoji { font-size: 2.4rem; margin-bottom: 12px; }
.brand-card h3 { font-size: 1.4rem; margin-bottom: 8px; }
.brand-card p { color: var(--ink-soft); margin-bottom: 18px; }

/* ---------- Product grid ---------- */
.shop { padding: 56px 0 80px; }
.shop-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 12px; margin-bottom: 28px; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 24px; }
.product-card {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s;
  display: flex; flex-direction: column;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.product-thumb {
  aspect-ratio: 1/1; display: grid; place-items: center; font-size: 3.4rem;
  background: linear-gradient(135deg, var(--yellow-soft), var(--bg-soft));
}
.product-body { padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.product-brand { font-size: 0.72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); font-weight: 700; }
.product-name { font-size: 1.02rem; font-weight: 600; }
.product-name:hover { color: var(--accent); }
.product-desc { font-size: 0.85rem; color: var(--ink-soft); flex: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.product-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.price { font-weight: 700; font-size: 1.05rem; }
.oos-label {
  font-size: 0.78rem; font-weight: 600; color: var(--ink-soft);
  white-space: nowrap;
}
.qty-card {
  margin: 0; height: 34px; flex-shrink: 0;
  background: var(--bg-soft); border-color: var(--line);
}
.qty-card button {
  width: 30px; height: 34px; font-size: 1rem; font-weight: 700;
  color: var(--ink); line-height: 1;
}
.qty-card button:disabled { opacity: .4; cursor: not-allowed; }
.qty-card button:hover:not(:disabled) { background: var(--yellow-soft); }
.qty-card .qty-val {
  min-width: 26px; padding: 0 2px; text-align: center;
  font-weight: 700; font-size: 0.9rem; line-height: 34px;
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Product detail ---------- */
.pdp { padding: 44px 0 80px; }
.pdp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 46px; align-items: start; }
.pdp-gallery-wrap { min-width: 0; }
.pdp-gallery { display: flex; flex-direction: column; gap: 12px; }
.pdp-media { aspect-ratio: 1/1; border-radius: var(--radius); display: grid; place-items: center; font-size: 8rem; background: linear-gradient(135deg, var(--yellow-soft), var(--bg-soft)); box-shadow: var(--shadow); overflow: hidden; position: relative; }
.pdp-media img { width: 100%; height: 100%; object-fit: cover; }
.pdp-main #pdpMainImg { display: block; }
.pdp-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border: none; border-radius: 50%;
  background: rgba(255,255,255,.88); color: var(--ink); font-size: 1.4rem; line-height: 1;
  cursor: pointer; box-shadow: var(--shadow); display: grid; place-items: center;
  opacity: 0; transition: opacity .15s, background .15s;
}
.pdp-gallery:hover .pdp-nav, .pdp-nav:focus-visible { opacity: 1; }
.pdp-nav-prev { left: 10px; }
.pdp-nav-next { right: 10px; }
.pdp-nav:hover { background: #fff; }
.pdp-thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.pdp-thumb {
  width: 72px; height: 72px; padding: 0; border: 2px solid transparent; border-radius: 12px;
  overflow: hidden; cursor: pointer; background: var(--bg-soft); flex-shrink: 0;
}
.pdp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pdp-thumb.is-active { border-color: var(--accent); }
.pdp-thumb:hover { border-color: var(--yellow-deep); }
.pdp-gallery.single .pdp-thumbs { display: none; }
.pdp-info h1 { font-size: 2rem; margin: 8px 0 10px; }
.pdp-price { font-size: 1.6rem; font-weight: 700; margin: 14px 0 18px; }
.pdp-desc { color: var(--ink-soft); margin-bottom: 24px; }
.related { margin-top: 64px; padding-top: 36px; border-top: 1px solid var(--line); }
.related-title { font-size: 1.35rem; margin: 0 0 22px; }
.related-grid { margin-top: 0; }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; margin-bottom: 20px; }
.qty button { width: 40px; height: 42px; border: none; background: transparent; font-size: 1.1rem; cursor: pointer; color: var(--ink); }
.qty button:hover { background: var(--yellow-soft); }
.qty input { width: 46px; height: 42px; border: none; text-align: center; font-family: var(--font); font-size: 1rem; background: transparent; }
.pdp-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 30px; }
.meta-list { border-top: 1px solid var(--line); padding-top: 20px; display: grid; gap: 8px; }
.meta-list .row { display: flex; gap: 10px; font-size: 0.9rem; color: var(--ink-soft); }
.meta-list .row strong { color: var(--ink); min-width: 90px; }

/* Socials */
.socials { display: flex; align-items: center; gap: 12px; margin-top: 22px; }
.socials span.label { font-size: 0.85rem; color: var(--ink-soft); }
.social-btn {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--yellow-soft); color: var(--accent); transition: transform .12s, background .15s;
}
.social-btn:hover { transform: translateY(-2px); background: var(--yellow); color: #3a2c00; }
.social-btn svg { width: 20px; height: 20px; }

/* ---------- Cart ---------- */
.cart-page { padding: 44px 0 80px; }
.cart-layout { display: grid; grid-template-columns: 1.6fr 1fr; gap: 34px; align-items: start; }
.cart-items { display: flex; flex-direction: column; gap: 14px; }
.cart-row {
  display: grid; grid-template-columns: 74px 1fr auto; gap: 16px; align-items: center;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px;
}
.qty-compact { margin: 10px 0 0; }
.cart-row .thumb { width: 74px; height: 74px; border-radius: var(--radius-sm); display: grid; place-items: center; font-size: 2rem; background: linear-gradient(135deg, var(--yellow-soft), var(--bg-soft)); overflow: hidden; }
.cart-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-row .info h4 { font-size: 1rem; }
.cart-row .info small { color: var(--ink-soft); }
.cart-row .right { text-align: right; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.link-danger { color: var(--danger); font-size: 0.8rem; background: none; border: none; cursor: pointer; }
.summary { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); position: sticky; top: 90px; }
.summary h3 { margin-bottom: 16px; }
.summary .line { display: flex; justify-content: space-between; padding: 8px 0; color: var(--ink-soft); }
.summary .total { display: flex; justify-content: space-between; padding: 14px 0 18px; font-size: 1.2rem; font-weight: 700; color: var(--ink); border-top: 1px solid var(--line); margin-top: 6px; }
.empty-state { text-align: center; padding: 70px 20px; color: var(--ink-soft); }
.empty-state.compact { padding: 48px 16px; background: var(--bg-card); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty-state .big { font-size: 3rem; margin-bottom: 12px; }
.empty-state h2 { color: var(--ink); margin-bottom: 6px; }
.empty-state .actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

.alert {
  border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 20px;
  border: 1px solid var(--line); background: var(--bg-card);
}
.alert strong { display: block; margin-bottom: 2px; }
.alert p { color: var(--ink-soft); font-size: 0.92rem; }
.alert-success { background: #eef8f1; border-color: #c9e6d2; }
.alert-warning { background: var(--yellow-soft); border-color: #f0d48a; }
.alert-info { background: #eef2fb; border-color: #cdd7f3; }

/* ---------- Auth / forms ---------- */
.auth-wrap { max-width: 420px; margin: 60px auto; }
.card {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 34px; box-shadow: var(--shadow);
}
.card h1 { font-size: 1.6rem; margin-bottom: 6px; }
.card .muted { color: var(--ink-soft); margin-bottom: 24px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.95rem; background: var(--bg); transition: border .15s; color: var(--ink);
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--yellow-deep); background: #fff; }
.field .hint { display: block; margin-top: 6px; font-size: 0.78rem; color: var(--ink-soft); font-weight: 400; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 0.92rem; font-weight: 600; }
.check input { width: 18px; height: 18px; accent-color: var(--yellow-deep); }
.auth-alt { text-align: center; margin-top: 18px; font-size: 0.9rem; color: var(--ink-soft); }
.auth-alt a { color: var(--accent); font-weight: 600; }
.tabs { display: flex; gap: 6px; background: var(--bg-soft); padding: 5px; border-radius: 999px; margin-bottom: 24px; }
.tabs button { flex: 1; padding: 9px; border: none; border-radius: 999px; background: transparent; cursor: pointer; font-family: var(--font); font-weight: 600; color: var(--ink-soft); }
.tabs button.active { background: #fff; color: var(--ink); box-shadow: var(--shadow); }

/* ---------- Account ---------- */
.account { padding: 44px 0 80px; }
.account-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 30px; }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, var(--yellow), var(--yellow-deep)); display: grid; place-items: center; font-weight: 700; font-size: 1.3rem; color: #3a2c00; }
.acct-user { display: flex; align-items: center; gap: 14px; }
.order {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.order-top { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.order-top .oid { font-weight: 700; }
.order-top small { color: var(--ink-soft); }
.badge { padding: 4px 12px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; }
.badge.shipped, .badge.paid { background: #e5f4ea; color: var(--success); }
.badge.processing, .badge.pending { background: var(--yellow-soft); color: var(--accent); }
.badge.delivered { background: #e8eefb; color: var(--info); }
.badge.cancelled, .badge.failed { background: #fdecec; color: var(--danger); }
.badge.hidden { background: #f3f0e8; color: var(--ink-soft); }
.badge.live { background: #e5f4ea; color: var(--success); }
.order-items { color: var(--ink-soft); font-size: 0.9rem; }
.order-foot { display: flex; justify-content: space-between; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 0.9rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-soft); border-top: 1px solid var(--line); padding: 44px 0 28px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 30px; margin-bottom: 28px; }
.footer-grid h4 { font-size: 0.95rem; margin-bottom: 12px; }
.footer-grid a, .footer-grid p { display: block; color: var(--ink-soft); font-size: 0.9rem; margin-bottom: 8px; }
.footer-grid a:hover { color: var(--ink); }
.staff-link { font-size: 0.82rem !important; opacity: .8; }
.footer-bottom { text-align: center; color: var(--ink-soft); font-size: 0.85rem; border-top: 1px solid var(--line); padding-top: 20px; }
.footer-socials { display: flex; gap: 10px; margin-top: 10px; }

/* ---------- Toast (add-to-cart popup: show → brief hold → fade out) ---------- */
.toast {
  position: fixed;
  top: 78px;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: var(--bg-card);
  color: var(--ink);
  border: 1.5px solid var(--yellow-deep);
  box-shadow: var(--shadow-lg);
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease, transform .35s ease;
  z-index: 120;
  max-width: min(92vw, 440px);
  text-align: center;
  line-height: 1.35;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Mail Club ---------- */
.mail-club { padding: 40px 0 80px; }
.mail-current { margin-bottom: 48px; max-width: 760px; }
.mail-current-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.mail-month-label { font-size: 0.85rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.mail-pack-list { margin: 0 0 14px 1.1em; color: var(--ink-soft); line-height: 1.7; }
.mail-price-note { font-size: 0.9rem; color: var(--ink-soft); margin: 0; }
.mail-photo-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0 0 18px;
}
.mail-photo {
  margin: 0;
  border-radius: var(--radius-sm, 12px);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  aspect-ratio: 1 / 1;
}
.mail-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.mail-archive { margin-top: 8px; }
.mail-archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 24px;
  margin-top: 20px;
}
.mail-archive-card {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.mail-archive-card .product-meta,
.mail-archive-card h3,
.mail-archive-card p {
  padding-left: 18px;
  padding-right: 18px;
}
.mail-archive-card .product-meta { margin-top: 14px; }
.mail-archive-card h3 { font-size: 1.15rem; margin-bottom: 8px; }
.mail-archive-card p { color: var(--ink-soft); margin-bottom: 18px; }
.mail-archive-card .emoji { font-size: 2rem; margin-bottom: 10px; padding: 18px 18px 0; }
.mail-card-media {
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, var(--yellow-soft), var(--bg-soft));
  overflow: hidden;
}
.mail-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.mail-card-placeholder {
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--line);
}
.mail-soon-label {
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-size: 0.95rem;
  padding: 10px 14px;
  border: 1.5px dashed var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.55);
}
.mail-coming-soon { opacity: .92; }
@media (max-width: 640px) {
  .mail-photo-gallery { grid-template-columns: 1fr; }
}

/* ---------- Responsive ---------- */
/* ---------- Tables / toolbars ---------- */
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.toolbar .search { flex: 1; min-width: 200px; }
.toolbar input, .toolbar select {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.92rem; background: #fff;
}
.toolbar select { width: auto; min-width: 140px; }
.table-wrap {
  overflow-x: auto; background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
table.data { width: 100%; border-collapse: collapse; min-width: 640px; }
table.data th, table.data td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); background: var(--bg-soft); }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: #fffaf0; }
table.data .thumb {
  width: 44px; height: 44px; border-radius: 10px; background: var(--yellow-soft);
  display: grid; place-items: center; overflow: hidden; font-size: 1.2rem;
}
table.data .thumb img { width: 100%; height: 100%; object-fit: cover; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.row-link { color: var(--accent); font-weight: 600; font-size: 0.88rem; background: none; border: none; cursor: pointer; font-family: var(--font); }
.row-link:hover { text-decoration: underline; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 28px; }
.stat-card {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 18px 16px; box-shadow: var(--shadow);
}
.stat-card .label { font-size: 0.78rem; color: var(--ink-soft); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.stat-card .value { font-size: 1.7rem; font-weight: 700; margin-top: 4px; letter-spacing: -0.03em; }
.stat-card .note { font-size: 0.8rem; color: var(--ink-soft); margin-top: 4px; }

.form-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 22px; align-items: start; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.muted { color: var(--ink-soft); }

/* ---------- Admin ---------- */
.admin-body { background: #f7f3e8; }
.admin-shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.admin-side {
  background: var(--admin-side); color: #f8f1dc; padding: 22px 16px;
  display: flex; flex-direction: column; gap: 22px;
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  z-index: 40;
}
.admin-side .brand { color: #fffdf5; }
.admin-side .brand .mark { font-size: 0.85rem; }
.admin-kicker { font-size: 0.72rem; letter-spacing: .12em; text-transform: uppercase; color: #c9b48a; margin-top: -12px; }
.admin-nav { display: flex; flex-direction: column; gap: 6px; }
.admin-nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  color: #e8d9b4; font-weight: 600; font-size: 0.92rem;
}
.admin-nav a:hover, .admin-nav a.active { background: rgba(255,213,74,.16); color: #fffdf5; }
.admin-side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.admin-side-foot a, .admin-side-foot button {
  color: #c9b48a; background: none; border: none; text-align: left; cursor: pointer;
  font-family: var(--font); font-size: 0.85rem;
}
.admin-side-foot a:hover, .admin-side-foot button:hover { color: #fffdf5; }
.admin-content { min-width: 0; }
.admin-top {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  padding: 26px 28px 8px; flex-wrap: wrap;
}
.admin-top h1 { font-size: 1.55rem; }
.admin-main { padding: 12px 28px 40px; }
.admin-login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.cell-user { display: flex; flex-direction: column; }
.cell-user small { color: var(--ink-soft); }
.conn-badge {
  display: inline-block; margin-top: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 700;
}
.conn-badge.on { background: #e5f4ea; color: var(--success); }
.conn-badge.off { background: var(--yellow-soft); color: var(--accent); }
.upload-box {
  display: flex; gap: 14px; align-items: center; padding: 12px; border: 1.5px dashed var(--line);
  border-radius: var(--radius-sm); background: var(--bg-soft); cursor: pointer; margin-bottom: 10px;
}
.upload-box:hover { border-color: var(--yellow-deep); background: #fff; }
.upload-preview {
  width: 72px; height: 72px; border-radius: 12px; background: var(--yellow-soft);
  display: grid; place-items: center; overflow: hidden; font-size: 1.6rem; flex-shrink: 0;
}
.upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.form-error { color: var(--danger); font-size: 0.88rem; font-weight: 600; margin-bottom: 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .stat-grid, .form-grid, .field-row { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .hero-grid, .pdp-grid, .cart-layout, .footer-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2.2rem; }
  .summary { position: static; }
  .nav-links { position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; background: var(--bg); border-bottom: 1px solid var(--line); padding: 16px 22px; gap: 16px; display: none; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .cart-row { grid-template-columns: 64px 1fr; }
  .cart-row .right { grid-column: 2; text-align: left; align-items: flex-start; flex-direction: row; justify-content: space-between; width: 100%; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: sticky; top: 0; z-index: 40; padding: 14px 16px; gap: 12px; height: auto; max-height: none; overflow-y: visible; }
  .admin-nav { flex-direction: row; flex-wrap: wrap; }
  .admin-side-foot { margin-top: 0; flex-direction: row; gap: 16px; }
  .admin-top, .admin-main { padding-left: 16px; padding-right: 16px; }
}
