/* ============================================================
   BALGINI — base: reset, typography, buttons, fields, layout
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--fs-base);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* clip instead of hidden: hidden turns the body into a scroll container
     and silently breaks position: sticky (PDP pinfo, cart summary) */
  overflow-x: hidden;
  overflow-x: clip;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

input,
select,
textarea {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
  font-weight: 400;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

hr {
  margin: 0;
  border: 0;
  border-top: 1px solid var(--border);
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.container--narrow {
  max-width: var(--container-narrow);
}

/* ---------- typography helpers ---------- */

.overline {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--accent);
}

.overline--muted {
  color: var(--text-muted);
}

.overline--light {
  color: rgba(255, 255, 255, 0.9);
}

.display {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.14;
  letter-spacing: 0;
}

.display--xl {
  font-size: var(--fs-h1);
}

.display--lg {
  font-size: var(--fs-h2);
}

.display--md {
  font-size: var(--fs-h3);
}

.text-muted {
  color: var(--text-muted);
}

.caps-link {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  color: var(--accent);
  transition: color var(--dur) var(--ease);
}

.caps-link:hover {
  color: var(--accent-hover);
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: var(--fs-base);
  font-weight: 500;
  letter-spacing: 0.01em;
  text-align: center;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease),
    border-color var(--dur) var(--ease), opacity var(--dur) var(--ease);
}

.btn--primary {
  background: var(--text);
  color: var(--text-inverse);
}

.btn--primary:hover {
  background: var(--accent);
}

.btn--accent {
  background: var(--accent);
  color: var(--on-accent);
}

.btn--accent:hover {
  background: var(--accent-hover);
}

.btn--ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}

.btn--ghost:hover {
  border-color: var(--text);
}

.btn--block {
  width: 100%;
}

.btn--caps {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  background: var(--disabled-bg);
  color: var(--disabled-ink);
  cursor: not-allowed;
}

/* ---------- icon button ---------- */

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: inherit;
  transition: color var(--dur) var(--ease), opacity var(--dur) var(--ease);
}

.icon-btn:hover {
  color: var(--accent);
}

.icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon--sm {
  width: 18px;
  height: 18px;
}

/* ---------- badge ---------- */

.badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 10px;
  font-weight: 600;
  line-height: 17px;
  text-align: center;
}

.has-badge {
  position: relative;
}

/* ---------- fields (floating label, 12storeez style) ---------- */

.field {
  position: relative;
  display: block;
  min-height: 54px;
  padding: 18px 14px 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--dur) var(--ease);
}

.field:hover {
  border-color: var(--border-strong);
}

.field:focus-within {
  border-color: var(--accent);
}

.field__label {
  position: absolute;
  top: 7px;
  left: 14px;
  font-size: var(--fs-micro);
  letter-spacing: 0.02em;
  color: var(--text-muted);
  pointer-events: none;
}

.field__control {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: var(--fs-body);
}

.field__control::placeholder {
  color: var(--text-muted);
}

.field--select::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -5px;
  border-right: 1.2px solid var(--text-muted);
  border-bottom: 1.2px solid var(--text-muted);
  transform: rotate(45deg);
  pointer-events: none;
}

.field--select select {
  appearance: none;
  padding-right: 24px;
  cursor: pointer;
}

/* ---------- section shell ---------- */

.section {
  padding: 96px 0 0;
}

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

/* ---------- page chrome (shared by catalog / product) ---------- */

.page {
  padding-top: var(--header-h);
}

.page--header-solid {
  background: var(--surface);
  border-bottom-color: var(--border);
}

.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 18px 0 0;
  font-size: var(--fs-small);
  color: var(--text-muted);
}

.breadcrumbs a:hover {
  color: var(--accent);
}

.breadcrumbs span[aria-hidden="true"] {
  color: var(--border-strong);
}

.breadcrumbs [aria-current="page"] {
  color: var(--text);
}

.page__title {
  margin-top: 14px;
}

.page__lead {
  margin-top: 8px;
  max-width: 620px;
  color: var(--text-muted);
}

@media (max-width: 1024px) {
  .section {
    padding-top: 52px;
  }

  .section__head {
    margin-bottom: 18px;
  }
}