/* Alaga base + component kit. Pages should reuse these classes for visual
   consistency. All colours come from tokens.css. */

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--c-ink);
  background: var(--c-bg);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img, svg, video { max-width: 100%; display: block; height: auto; }
a { color: var(--c-primary-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea, button { font: inherit; color: inherit; }
main { flex: 1 0 auto; }
:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- typography ---------- */
h1, h2, h3, h4, h5 { font-family: var(--font-head); font-weight: var(--fw-bold); line-height: 1.12; letter-spacing: -0.01em; color: var(--c-ink); }
h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }
p { color: var(--c-ink); }
.lead { font-size: 1.15rem; color: var(--c-ink-2); line-height: 1.6; }
.muted { color: var(--c-ink-3); }
small, .small { font-size: 0.85rem; }
.eyebrow { font-family: var(--font-head); font-weight: var(--fw-semi); text-transform: uppercase; letter-spacing: 0.09em; font-size: 0.78rem; color: var(--c-accent-ink); }

/* ---------- layout ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 20px; }
.container-narrow { max-width: 780px; }
.section { padding-block: clamp(38px, 6vw, 72px); }
.section-sm { padding-block: 32px; }
.band { background: var(--c-bg-2); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 12px; align-items: center; }
.row-wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.center { text-align: center; }
.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-products { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.grid-cats { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
@media (max-width: 860px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-products { grid-template-columns: repeat(2, 1fr); } .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: var(--r-pill); border: 1.5px solid transparent;
  font-weight: var(--fw-semi); font-size: 0.95rem; line-height: 1; text-decoration: none;
  transition: transform var(--t), background var(--t), border-color var(--t), box-shadow var(--t);
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-ink); color: #fff; }
.btn-accent { background: var(--c-accent); color: #fff; }
.btn-accent:hover { background: var(--c-accent-ink); color: #fff; }
.btn-dark { background: var(--c-ink); color: #fff; }
.btn-dark:hover { background: #000; color: #fff; }
.btn-outline { background: transparent; border-color: var(--c-line-2); color: var(--c-ink); }
.btn-outline:hover { border-color: var(--c-ink); background: var(--c-surface); }
.btn-ghost { background: transparent; color: var(--c-primary-ink); padding-inline: 8px; }
.btn-ghost:hover { background: var(--c-primary-soft); }
.btn-sm { padding: 8px 13px; font-size: 0.86rem; }
.btn-lg { padding: 14px 24px; font-size: 1.02rem; }
.btn-block { display: flex; width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: 0.5; pointer-events: none; }

/* ---------- badges / pills ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: var(--r-pill); font-size: 0.74rem; font-weight: var(--fw-semi); letter-spacing: 0.02em; }
.badge-accent { background: var(--c-accent); color: #fff; }
.badge-sale { background: var(--c-danger); color: #fff; }
.badge-featured { background: var(--c-gold); color: #3a2a06; }
.badge-new { background: var(--c-primary); color: #fff; }
.badge-muted { background: var(--c-bg-2); color: var(--c-ink-2); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: var(--r-pill); font-size: 0.78rem; font-weight: var(--fw-semi); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: 0.9; }
.pill-ok { background: var(--c-ok-soft); color: var(--c-ok); }
.pill-warn { background: var(--c-warn-soft); color: var(--c-warn); }
.pill-danger { background: var(--c-danger-soft); color: var(--c-danger); }
.pill-info { background: var(--c-info-soft); color: #2c5772; }
.pill-muted { background: var(--c-bg-2); color: var(--c-ink-3); }

/* ---------- cards ---------- */
.card { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.card-body { padding: 20px; }
.card-pad { padding: clamp(18px, 3vw, 30px); }

/* ---------- product card ---------- */
.product-card { position: relative; display: flex; flex-direction: column; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r); overflow: hidden; transition: box-shadow var(--t), transform var(--t), border-color var(--t); }
.product-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); border-color: var(--c-line-2); }
.product-card__media { position: relative; aspect-ratio: 1 / 1; background: var(--c-bg-2); overflow: hidden; }
.product-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 300ms ease; }
.product-card:hover .product-card__media img { transform: scale(1.04); }
.product-card__tags { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.product-card__body { padding: 13px 14px 15px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-card__brand { font-size: 0.74rem; color: var(--c-ink-3); text-transform: uppercase; letter-spacing: 0.04em; }
.product-card__title { font-family: var(--font-body); font-weight: var(--fw-semi); font-size: 0.96rem; line-height: 1.3; color: var(--c-ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card__title a { color: inherit; }
.product-card__title a:hover { color: var(--c-primary-ink); text-decoration: none; }
.product-card__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* ---------- price ---------- */
.price { font-family: var(--font-head); font-weight: var(--fw-bold); font-size: 1.08rem; color: var(--c-ink); }
.price--old { font-family: var(--font-body); font-weight: var(--fw-normal); font-size: 0.85rem; color: var(--c-ink-3); text-decoration: line-through; margin-left: 6px; }
.price-lg { font-size: 1.7rem; }

/* ---------- forms ---------- */
.field { display: block; margin-bottom: 16px; }
.field > label { display: block; font-weight: var(--fw-semi); font-size: 0.9rem; margin-bottom: 6px; }
.field .hint { font-size: 0.82rem; color: var(--c-ink-3); margin-top: 5px; }
.field .req { color: var(--c-danger); }
.input, input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="password"], input[type="search"], select, textarea {
  width: 100%; padding: 11px 13px; background: var(--c-surface);
  border: 1.5px solid var(--c-line-2); border-radius: var(--r-sm); font-size: 0.96rem; transition: border-color var(--t), box-shadow var(--t);
}
textarea { min-height: 96px; resize: vertical; }
.input:focus, input:focus, select:focus, textarea:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-soft); }
.field--error .input, .field--error input, .field--error select, .field--error textarea { border-color: var(--c-danger); }
.field--error .hint { color: var(--c-danger); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: 9px; font-size: 0.94rem; }
.check input { width: auto; }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--c-line); border-radius: var(--r); background: var(--c-surface); }
table.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--c-line); vertical-align: middle; }
.table th { font-family: var(--font-head); font-weight: var(--fw-semi); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--c-ink-3); background: var(--c-bg-2); }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--c-bg); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- misc ---------- */
.divider { height: 1px; background: var(--c-line); border: 0; margin-block: 24px; }
.breadcrumb { font-size: 0.85rem; color: var(--c-ink-3); margin-bottom: 18px; }
.breadcrumb a { color: var(--c-ink-2); }
.empty-state { text-align: center; padding: 60px 20px; color: var(--c-ink-3); }
.empty-state h3 { color: var(--c-ink-2); margin-bottom: 10px; }
.flash { padding: 13px 16px; border-radius: var(--r); margin-bottom: 18px; font-size: 0.94rem; }
.flash-ok { background: var(--c-ok-soft); color: var(--c-primary-ink); }
.flash-err { background: var(--c-danger-soft); color: var(--c-danger); }
.flash-info { background: var(--c-info-soft); color: #2c5772; }
.tag-note { background: var(--c-warn-soft); color: var(--c-warn); border-radius: var(--r); padding: 12px 15px; font-size: 0.88rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.hide { display: none !important; }
