/* Paperi — компоненти pp-*. Потребує tokens.css. */
/* Paperi — спільна основа сторінок. Токени дизайн-системи, світла тема. */


* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--surface-100);
  color: var(--ink-900);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 26px;
}

.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

h1, h2, h3, h4 { margin: 0; text-wrap: balance; font-family: var(--font-display); }
p { margin: 0; }
a { color: var(--sora-600); }
a:hover { color: var(--sora-700); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.label { font-family: var(--font-display); font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.muted { color: var(--ink-600); }
.mono { font-family: var(--font-mono); font-size: 13px; line-height: 20px; color: var(--ink-600); }
.nums { font-variant-numeric: tabular-nums; }

/* ---- Кнопки ---- */
.pp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 44px; padding: var(--space-3) var(--space-5);
  border: 1px solid transparent; border-radius: var(--radius-pill);
  font-family: var(--font-display); font-size: 15px; line-height: 20px; font-weight: 700; letter-spacing: 0.01em;
  text-decoration: none; cursor: pointer;
  transition: background-color 150ms ease-out, border-color 150ms ease-out, color 150ms ease-out;
}
.pp-btn--primary { background: var(--sora-300); color: var(--on-sora); }
.pp-btn--primary:hover { background: var(--sora-500); color: var(--on-sora); }
.pp-btn--secondary { background: transparent; border-color: var(--line-500); color: var(--ink-900); }
.pp-btn--secondary:hover { background: var(--surface-200); color: var(--ink-900); }
.pp-btn--sale { background: var(--sakura-300); color: var(--on-sakura); }
.pp-btn--sale:hover { background: var(--sakura-300); color: var(--on-sakura); filter: brightness(0.96); }
.pp-btn--ghost { background: transparent; color: var(--sora-600); padding-inline: var(--space-3); }
.pp-btn--ghost:hover { color: var(--sora-700); text-decoration: underline; }
.pp-btn--lg { min-height: 52px; padding-inline: var(--space-6); font-size: 17px; }
.pp-btn--sm { min-height: 36px; padding: var(--space-2) var(--space-4); font-size: 13px; }
.pp-btn--block { width: 100%; }
.pp-btn:disabled { background: var(--line-200); border-color: transparent; color: var(--ink-600); cursor: not-allowed; }

/* ---- Бейджі й наявність ---- */
.pp-badge {
  display: inline-flex; align-items: center; padding: 3px var(--space-2);
  border-radius: var(--radius-sm); font-family: var(--font-display);
  font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; white-space: nowrap;
}
.pp-badge--new { background: var(--sora-300); color: var(--on-sora); }
.pp-badge--sale { background: var(--sakura-300); color: var(--on-sakura); }
.pp-badge--stock { background: var(--matcha-300); color: var(--on-matcha); }
.pp-badge--last { background: var(--kinari-300); color: var(--on-kinari); }
.pp-badge--limited { background: var(--fuji-300); color: var(--on-fuji); }
.pp-badge--out { background: var(--beni-300); color: var(--on-beni); }

.pp-stock { display: inline-flex; align-items: center; gap: var(--space-1); font-size: 12px; line-height: 18px; }
.pp-stock--in { color: var(--matcha-600); }
.pp-stock--low { color: var(--kinari-700); }
.pp-stock--out { color: var(--beni-600); }
.pp-stock--pre { color: var(--fuji-600); }
.pp-stock__dot { width: 8px; height: 8px; border-radius: var(--radius-pill); background: currentColor; flex: none; }

/* ---- Ціна ---- */
.pp-price { font-family: var(--font-display); font-size: 15px; line-height: 20px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pp-price--lg { font-size: 28px; line-height: 34px; }
.pp-price--sale { color: var(--sakura-600); }
.pp-price__was { margin-left: var(--space-2); font-size: 13px; font-weight: 400; color: var(--ink-600); text-decoration: line-through; }
.pp-price--lg .pp-price__was { font-size: 17px; }

/* ---- Поля ---- */
.pp-field { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.pp-field__label { font-family: var(--font-display); font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.pp-input, .pp-select, .pp-textarea {
  width: 100%; min-height: 44px; padding: var(--space-3) var(--space-4);
  background: var(--surface-card); border: 1px solid var(--line-500); border-radius: var(--radius-md);
  color: var(--ink-900); font-family: var(--font-text); font-size: 16px; line-height: 24px;
}
.pp-textarea { min-height: 88px; resize: vertical; }
.pp-input::placeholder, .pp-textarea::placeholder { color: var(--ink-600); }
.pp-input:focus-visible, .pp-select:focus-visible, .pp-textarea:focus-visible { border-color: var(--sora-600); }
.pp-field__help { font-size: 12px; line-height: 18px; color: var(--ink-600); }
.pp-field--error .pp-input, .pp-field--error .pp-select { border-color: var(--beni-600); border-width: 2px; }
.pp-field--error .pp-field__help { color: var(--beni-600); }

/* ---- Степер ---- */
.pp-stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-500); border-radius: var(--radius-pill); overflow: hidden; background: var(--surface-card); }
.pp-stepper__btn { width: 40px; height: 40px; border: 0; background: transparent; color: var(--ink-900); font-family: var(--font-display); font-size: 18px; font-weight: 700; cursor: pointer; }
.pp-stepper__btn:hover { background: var(--surface-sora); }
.pp-stepper__btn:disabled { color: var(--ink-600); cursor: not-allowed; background: transparent; }
.pp-stepper__value { min-width: 40px; text-align: center; font-family: var(--font-display); font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---- Повідомлення ---- */
.pp-notice { display: flex; gap: var(--space-3); padding: var(--space-4); border-radius: var(--radius-lg); font-size: 14px; line-height: 22px; min-width: 0; }
.pp-notice__mark { flex: none; width: 24px; height: 24px; border-radius: var(--radius-pill); }
.pp-notice__title { display: block; font-family: var(--font-display); font-weight: 700; margin-bottom: 2px; }
.pp-notice--info { background: var(--surface-sora); }
.pp-notice--info .pp-notice__mark { background: var(--sora-300); }
.pp-notice--success { background: var(--surface-matcha); }
.pp-notice--success .pp-notice__mark { background: var(--matcha-300); }
.pp-notice--warn { background: var(--surface-kinari); }
.pp-notice--warn .pp-notice__mark { background: var(--kinari-300); }

/* ---- Картка товару ---- */
.pp-products { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); }
@media (max-width: 1000px) { .pp-products { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.pp-card { display: flex; flex-direction: column; min-width: 0; background: var(--surface-card); border: 1px solid var(--line-200); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); overflow: hidden; }
.pp-card__media { position: relative; aspect-ratio: 1 / 1; background: var(--surface-200); max-width: 100%; }
.pp-card__media svg { width: 100%; height: 100%; display: block; }
.pp-card--out .pp-card__media { opacity: 0.55; }
.pp-card__flags { position: absolute; inset: var(--space-3) var(--space-3) auto auto; display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-1); }
.pp-card__wish { position: absolute; top: var(--space-3); left: var(--space-3); width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: var(--radius-pill); background: var(--surface-card); color: var(--ink-600); box-shadow: var(--shadow-card); cursor: pointer; }
.pp-card__wish svg { width: 18px; height: 18px; }
.pp-card__wish:hover { color: var(--sakura-600); }
.pp-card__wish[aria-pressed="true"] { color: var(--sakura-600); }
.pp-card__wish[aria-pressed="true"] svg { fill: var(--sakura-300); }
.pp-card__body { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4); flex: 1; }
.pp-card__brand { font-family: var(--font-display); font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-600); }
.pp-card__title { font-size: 14px; line-height: 22px; font-weight: 500; font-family: var(--font-text); }
.pp-card__title a { color: inherit; text-decoration: none; }
.pp-card__title a:hover { color: var(--sora-700); text-decoration: underline; }
.pp-card__footer { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-top: auto; padding-top: var(--space-1); }
.pp-card__body .pp-btn { margin-top: var(--space-1); }

.pp-variants { display: flex; align-items: center; gap: var(--space-2); font-size: 12px; line-height: 18px; color: var(--ink-600); min-width: 0; }
.pp-variants__dots { display: flex; gap: 3px; flex: none; }
.pp-variants__dot { width: 11px; height: 11px; border-radius: var(--radius-pill); border: 1px solid var(--line-200); }

/* ---- Шапка ---- */
.promo { background: var(--surface-sora); font-size: 13px; line-height: 20px; }
.promo > .wrap { padding-block: 10px; text-align: center; }
.promo strong { font-family: var(--font-display); }

.pp-header { background: var(--surface-100); border-bottom: 1px solid var(--line-200); }
.pp-header > .wrap { display: flex; align-items: center; gap: var(--space-5); padding-block: var(--space-3); }
.pp-logo { font-family: var(--font-display); font-size: 26px; line-height: 30px; font-weight: 800; letter-spacing: -0.01em; color: var(--sora-600); text-decoration: none; }
.pp-nav { display: flex; align-items: center; gap: var(--space-5); flex: 1; min-width: 0; }
.pp-nav a { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--ink-900); text-decoration: none; padding-block: var(--space-2); border-bottom: 2px solid transparent; }
.pp-nav a:hover { color: var(--sora-700); }
.pp-nav a[aria-current="page"] { border-bottom-color: var(--sora-300); }
.pp-actions { display: flex; align-items: center; gap: var(--space-1); margin-left: auto; }
.pp-iconbtn { display: inline-flex; align-items: center; justify-content: center; position: relative; width: 44px; height: 44px; border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--ink-900); cursor: pointer; text-decoration: none; }
.pp-iconbtn:hover { background: var(--surface-sora); color: var(--ink-900); }
.pp-iconbtn svg { width: 24px; height: 24px; }
.pp-iconbtn__count { position: absolute; top: 2px; right: 0; min-width: 18px; padding: 0 4px; border-radius: var(--radius-pill); background: var(--sakura-300); color: var(--on-sakura); font-family: var(--font-display); font-size: 11px; line-height: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pp-iconbtn.burger { display: none; }
@media (max-width: 900px) { .pp-nav { display: none; } .pp-iconbtn.burger { display: inline-flex; } }

/* ---- Хлібні крихти й заголовок ---- */
.crumbs { font-size: 13px; line-height: 20px; color: var(--ink-600); padding-block: var(--space-4) 0; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.page-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-3) var(--space-4); padding-block: var(--space-3) var(--space-5); }
.page-head h1 { font-size: 32px; line-height: 36px; font-weight: 700; }

/* ---- Футер ---- */
.footer { background: var(--surface-200); border-top: 1px solid var(--line-200); margin-top: var(--space-8); }
.footer > .wrap { padding-block: var(--space-7); display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: var(--space-6); }
.footer h3 { font-size: 13px; line-height: 18px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-600); margin-bottom: var(--space-3); }
.footer ul { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space-2); font-size: 14px; line-height: 22px; }
.footer a { text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.footer__brand p { margin-top: var(--space-3); font-size: 14px; line-height: 22px; color: var(--ink-600); max-width: 34ch; }
.footer__legal { border-top: 1px solid var(--line-200); }
.footer__legal > .wrap { padding-block: var(--space-4); display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-5); justify-content: space-between; font-size: 12px; line-height: 18px; color: var(--ink-600); }
@media (max-width: 860px) { .footer > .wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .footer > .wrap { grid-template-columns: minmax(0, 1fr); } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
