/* =========================================================
   DIGITAMA - DESIGN SYSTEM
   Palette: ink navy + jade teal (brand) + rose (promo/urgency)
   Type: Space Grotesk (display) / Inter (body) / JetBrains Mono (data)
   ========================================================= */

:root {
  --ink: #12131c;
  --ink-soft: #1c1e2b;
  --surface: #f5f6fa;
  --card: #ffffff;
  --primary: #0e7c66;
  --primary-dark: #0a5c4c;
  --primary-light: #e4f5f1;
  --accent: #e63969;
  --accent-light: #fde8ee;
  --text: #1f2430;
  --text-muted: #6b7280;
  --border: #e5e7ef;
  --success: #16a34a;
  --success-light: #e7f8ed;
  --warning: #d97706;
  --warning-light: #fef3e0;
  --danger: #dc2626;
  --danger-light: #fdeaea;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 2px 10px rgba(18, 19, 28, 0.06);
  --shadow-md: 0 8px 24px rgba(18, 19, 28, 0.1);
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--surface);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 .5rem;
  letter-spacing: -0.01em;
}
p { margin: 0 0 1rem; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

.container { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--text-muted); }
.text-center { text-align: center; }
.hidden { display: none !important; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 20px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 14.5px; background: var(--card); color: var(--text);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #c92c58; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-outline-white { background: transparent; border-color: rgba(255,255,255,.4); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-danger { background: var(--danger); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; }
.form-control {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 15px; font-family: inherit; background: #fff; color: var(--text);
}
.form-control:focus { border-color: var(--primary); outline: none; }
textarea.form-control { resize: vertical; min-height: 110px; }
.form-hint { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }
.form-row { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

/* ---------- Alerts / Flash ---------- */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; }
.alert-success { background: var(--success-light); color: #0f5c2c; }
.alert-error { background: var(--danger-light); color: #8f1d1d; }
.alert-warning { background: var(--warning-light); color: #7c4a06; }

/* ---------- Badges / chips ---------- */
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.badge-discount { background: var(--accent); color: #fff; }
.badge-status { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-pending_payment, .badge-pending { background: var(--warning-light); color: var(--warning); }
.badge-payment_review { background: #e6effe; color: #2452c9; }
.badge-paid, .badge-active, .badge-approved, .badge-completed { background: var(--success-light); color: var(--success); }
.badge-rejected, .badge-cancelled, .badge-banned { background: var(--danger-light); color: var(--danger); }
.chip {
  display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono);
  font-size: 10.5px; padding: 3px 8px; border-radius: 6px; background: var(--ink);
  color: #a9f0dd; letter-spacing: .02em;
}
.chip-delivery { background: var(--primary-light); color: var(--primary-dark); }

/* ---------- Header ---------- */
.topbar { background: var(--ink); color: #c7c9d9; font-size: 12.5px; }
.topbar .container { display: flex; justify-content: space-between; align-items: center; height: 34px; }
.topbar a { opacity: .9; }
.topbar a:hover { opacity: 1; color: #fff; }
.topbar-links { display: flex; gap: 18px; }

.site-header { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40; }
.site-header .container { display: flex; align-items: center; gap: 20px; height: 68px; }
.logo { font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--primary-dark); white-space: nowrap; }
.logo span { color: var(--accent); }
.search-form { flex: 1; display: flex; }
.search-form input {
  flex: 1; border: 2px solid var(--primary); border-right: none; border-radius: 999px 0 0 999px;
  padding: 10px 16px; font-size: 14.5px; font-family: inherit;
}
.search-form input:focus { outline: none; }
.search-form button {
  border: 2px solid var(--primary); background: var(--primary); color: #fff; padding: 0 20px;
  border-radius: 0 999px 999px 0; font-weight: 600;
}
.header-icons { display: flex; align-items: center; gap: 18px; white-space: nowrap; }
.icon-link { position: relative; display: flex; flex-direction: column; align-items: center; font-size: 11px; color: var(--text-muted); gap: 2px; }
.icon-link .glyph { font-size: 21px; }
.icon-link:hover { color: var(--primary); }
.cart-count {
  position: absolute; top: -4px; right: -8px; background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 700; border-radius: 999px; padding: 1px 5px; min-width: 16px; text-align: center;
}
.mobile-menu-btn { display: none; background: none; border: none; font-size: 24px; }

@media (max-width: 860px) {
  .site-header .container { height: 58px; gap: 10px; flex-wrap: wrap; }
  .search-form { order: 3; flex-basis: 100%; margin-bottom: 8px; }
  .topbar { display: none; }
}

/* ---------- Category pills / rail ---------- */
.category-rail { background: #fff; border-bottom: 1px solid var(--border); }
.category-rail .container { display: flex; gap: 22px; overflow-x: auto; padding: 10px 16px; scrollbar-width: none; }
.category-rail .container::-webkit-scrollbar { display: none; }
.cat-pill { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; color: var(--text-muted); flex-shrink: 0; }
.cat-pill .ico { font-size: 20px; }
.cat-pill:hover { color: var(--primary); }

/* ---------- Hero / promo strip ---------- */
.promo-strip { background: linear-gradient(135deg, var(--ink) 0%, #1f2340 100%); padding: 22px 0; }
.promo-scroller { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; }
.promo-scroller::-webkit-scrollbar { display: none; }
.promo-card {
  scroll-snap-align: start; flex: 0 0 auto; width: min(340px, 82vw); border-radius: var(--radius);
  padding: 22px; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff; display: flex; flex-direction: column; justify-content: space-between; min-height: 130px;
}
.promo-card.rose { background: linear-gradient(135deg, var(--accent) 0%, #a72649 100%); }
.promo-card .eyebrow { font-family: var(--font-mono); font-size: 11px; opacity: .85; text-transform: uppercase; letter-spacing: .06em; }
.promo-card h3 { color: #fff; font-size: 21px; margin: 6px 0 10px; }

/* ---------- Category grid (homepage) ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (min-width: 640px) { .cat-grid { grid-template-columns: repeat(8, 1fr); } }
.cat-tile {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 6px; text-align: center; font-size: 12px; font-weight: 600; color: var(--text);
  transition: border-color .12s ease, transform .12s ease;
}
.cat-tile:hover { border-color: var(--primary); transform: translateY(-2px); }
.cat-tile .ico { font-size: 24px; display: block; margin-bottom: 6px; }

/* ---------- Section heading ---------- */
.section { padding: 28px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.section-head h2 { font-size: 19px; }
.section-head .see-all { font-size: 13px; font-weight: 600; color: var(--primary); }

/* ---------- Product grid & card ---------- */
.product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 560px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 860px) { .product-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1080px) { .product-grid { grid-template-columns: repeat(5, 1fr); } }

.product-card {
  background: #fff; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border);
  display: flex; flex-direction: column; transition: box-shadow .15s ease, transform .15s ease;
}
.product-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.product-thumb { position: relative; aspect-ratio: 1 / 1; background: var(--surface); overflow: hidden; }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-thumb .badge-discount { position: absolute; top: 8px; left: 8px; }
.wishlist-btn {
  position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,.92); border: none; display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.wishlist-btn.active { color: var(--accent); }
.product-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-title {
  font-size: 13.5px; font-weight: 500; line-height: 1.35; height: 2.7em; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.product-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.product-price { font-family: var(--font-mono); font-weight: 700; color: var(--accent); font-size: 15px; }
.product-price .old { font-family: var(--font-body); font-weight: 400; color: var(--text-muted); text-decoration: line-through; font-size: 12px; margin-left: 6px; }
.product-meta { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; color: var(--text-muted); }
.product-store { font-size: 11px; color: var(--text-muted); }

/* ---------- Filters sidebar ---------- */
.catalog-layout { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start; }
@media (max-width: 860px) { .catalog-layout { grid-template-columns: 1fr; } }
.filters { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; position: sticky; top: 80px; }
.filters h4 { font-size: 13.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-bottom: 10px; }
.filter-group { margin-bottom: 18px; }
.filter-option { display: flex; align-items: center; gap: 8px; font-size: 13.5px; padding: 4px 0; }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.sort-select { padding: 8px 12px; border-radius: var(--radius-sm); border: 1.5px solid var(--border); font-size: 13.5px; }

/* ---------- Cards / panels (generic) ---------- */
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.card + .card { margin-top: 14px; }

/* ---------- Tables (dashboards) ---------- */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data-table th, table.data-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data-table th { color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
table.data-table tr:hover td { background: var(--surface); }

/* ---------- Dashboard layout ---------- */
.dash-layout { display: grid; grid-template-columns: 220px 1fr; gap: 22px; }
@media (max-width: 860px) { .dash-layout { grid-template-columns: 1fr; } }
.dash-nav { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; height: fit-content; }
.dash-nav a { display: block; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; color: var(--text); margin-bottom: 2px; }
.dash-nav a:hover { background: var(--surface); }
.dash-nav a.active { background: var(--primary-light); color: var(--primary-dark); font-weight: 700; }
.dash-nav .group-label { font-size: 11px; text-transform: uppercase; color: var(--text-muted); padding: 12px 12px 4px; letter-spacing: .05em; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.stat-card .num { font-family: var(--font-display); font-size: 24px; font-weight: 700; }
.stat-card .label { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

/* ---------- Product detail ---------- */
.pdp-layout { display: grid; grid-template-columns: 380px 1fr; gap: 30px; }
@media (max-width: 860px) { .pdp-layout { grid-template-columns: 1fr; } }
.pdp-gallery img { border-radius: var(--radius); border: 1px solid var(--border); aspect-ratio: 1/1; object-fit: cover; width: 100%; }
.pdp-price-box { background: var(--surface); border-radius: var(--radius); padding: 16px 18px; margin: 14px 0; }
.pdp-price { font-family: var(--font-mono); font-size: 28px; font-weight: 700; color: var(--accent); }
.star-rating { color: #f5a623; letter-spacing: 1px; font-size: 13px; }
.qty-stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--border); border-radius: 999px; overflow: hidden; }
.qty-stepper button { width: 34px; height: 34px; background: #fff; border: none; font-size: 16px; }
.qty-stepper input { width: 42px; text-align: center; border: none; font-size: 14px; }
.review-item { padding: 14px 0; border-bottom: 1px solid var(--border); }
.review-item:last-child { border-bottom: none; }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state .ico { font-size: 42px; margin-bottom: 12px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #b7b9ca; margin-top: 40px; padding: 40px 0 20px; }
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-bottom: 28px; }
@media (max-width: 700px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
.footer-grid h5 { color: #fff; font-size: 13px; margin-bottom: 10px; }
.footer-grid a { display: block; font-size: 13px; padding: 4px 0; color: #9698ac; }
.footer-grid a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #2a2c3d; padding-top: 16px; font-size: 12.5px; text-align: center; color: #74768c; }

/* ---------- Auth pages ---------- */
.auth-wrap { max-width: 420px; margin: 40px auto; }
.auth-wrap .card { padding: 28px 24px; }
.auth-wrap h1 { font-size: 22px; text-align: center; }
.auth-switch { text-align: center; font-size: 13.5px; margin-top: 14px; }

/* ---------- Steps (checkout) ---------- */
.steps { display: flex; gap: 8px; margin-bottom: 20px; }
.steps .step { flex: 1; text-align: center; font-size: 12px; font-weight: 600; color: var(--text-muted); padding-bottom: 8px; border-bottom: 3px solid var(--border); }
.steps .step.active { color: var(--primary); border-color: var(--primary); }
.steps .step.done { color: var(--success); border-color: var(--success); }

/* ---------- Utility ---------- */
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.mt-0{margin-top:0}.mt-1{margin-top:8px}.mt-2{margin-top:16px}.mt-3{margin-top:24px}
.mb-0{margin-bottom:0}.mb-1{margin-bottom:8px}.mb-2{margin-bottom:16px}.mb-3{margin-bottom:24px}
