/* ============================================================
   СЕКТОР 12 — components.css
   Header, footer, кнопки, картки, бейджі, форма, cookie
   ============================================================ */

/* ---------- КНОПКИ ---------- */
.btn {
  --bg: var(--acid);
  --fg: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-head);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: .06em;
  font-size: 1rem;
  padding: 15px 30px;
  background: var(--bg);
  color: var(--fg);
  border: 2px solid var(--bg);
  cursor: pointer;
  transform: skewX(var(--skew));
  transition: transform .18s ease, background .18s ease, color .18s ease;
  position: relative;
}
.btn > * { transform: skewX(7deg); }
.btn:hover { transform: skewX(var(--skew)) translateY(-3px); }
.btn:active { transform: skewX(var(--skew)) translateY(0); }

.btn--ghost {
  --bg: transparent;
  --fg: var(--white);
  border-color: var(--acid);
}
.btn--ghost:hover { background: var(--acid); color: var(--ink); }
.btn--ghost:hover > * { color: var(--ink); }

.btn--block { width: 100%; justify-content: center; }
.btn--lg { padding: 18px 40px; font-size: 1.15rem; }

/* ---------- HEADER ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(10, 10, 10, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 74px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--f-head);
  font-weight: 700;
  font-size: 1.5rem;
  text-transform: uppercase;
  letter-spacing: -.02em;
  flex-shrink: 0;
}
.brand .mark {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: var(--acid);
  color: var(--ink);
  font-weight: 700;
  transform: skewX(var(--skew));
}
.brand .mark span { transform: skewX(7deg); }
.brand b { color: var(--acid); }

.nav {
  display: flex;
  gap: 28px;
  margin-left: auto;
}
.nav a {
  font-family: var(--f-head);
  text-transform: uppercase;
  font-weight: 500;
  letter-spacing: .04em;
  font-size: .98rem;
  color: #e6e6e6;
  position: relative;
  padding: 4px 0;
}
.nav a::after {
  content: '';
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 3px;
  background: var(--acid);
  transition: width .2s ease;
  transform: skewX(var(--skew));
}
.nav a:hover::after, .nav a[aria-current="page"]::after { width: 100%; }
.nav a[aria-current="page"] { color: var(--acid); }

.header-actions { display: flex; align-items: center; gap: 14px; }

.cart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 2px solid var(--line);
  font-family: var(--f-head);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: .05em;
  background: var(--ink-2);
  cursor: pointer;
  transition: border-color .2s;
}
.cart-btn:hover { border-color: var(--acid); }
.cart-count {
  background: var(--acid);
  color: var(--ink);
  font-size: .78rem;
  font-weight: 700;
  min-width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 50%;
}

.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 44px; height: 44px;
  justify-content: center; align-items: center;
  background: var(--ink-2);
  border: 2px solid var(--line);
  cursor: pointer;
}
.burger span {
  width: 22px; height: 2px; background: var(--white);
  transition: .25s;
}
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- БІГУЧА СТРІЧКА (marquee) ---------- */
.ticker {
  background: var(--acid);
  color: var(--ink);
  overflow: hidden;
  white-space: nowrap;
  border-bottom: 1px solid var(--ink);
}
.ticker__track {
  display: inline-block;
  padding: 8px 0;
  font-family: var(--f-head);
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: .85rem;
  animation: ticker 28s linear infinite;
}
.ticker__track span { padding: 0 28px; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- КАРТКА ТОВАРУ ---------- */
.grid-products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 26px;
}
.card {
  position: relative;
  background: var(--ink-2);
  border: 1px solid var(--line);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-6px); border-color: var(--acid); }
.card__media {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--ink-3);
}
.card__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.card:hover .card__media img { transform: scale(1.07); }

.badge {
  position: absolute;
  top: 14px; left: -4px;
  font-family: var(--f-head);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: .08em;
  font-size: .8rem;
  padding: 5px 16px;
  transform: skewX(var(--skew)) rotate(-3deg);
  z-index: 2;
}
.badge--sale { background: var(--red); color: #fff; }
.badge--new { background: var(--acid); color: var(--ink); }
.badge--hit { background: var(--white); color: var(--ink); }
.badge span { display: inline-block; transform: skewX(7deg); }

.card__body { padding: 18px 18px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card__cat {
  font-family: var(--f-head);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .72rem;
  color: var(--acid);
}
.card__title {
  font-family: var(--f-head);
  text-transform: uppercase;
  font-size: 1.2rem;
  line-height: 1.05;
}
.card__title a:hover { color: var(--acid); }
.card__price-row { margin-top: auto; display: flex; align-items: baseline; gap: 10px; }
.price { font-family: var(--f-head); font-size: 1.5rem; font-weight: 700; }
.price--old { font-size: 1rem; color: var(--grey-2); text-decoration: line-through; font-weight: 400; }
.card__btn {
  margin-top: 6px;
  font-family: var(--f-head);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: .05em;
  background: var(--ink-3);
  border: 2px solid var(--line);
  color: var(--white);
  padding: 11px;
  cursor: pointer;
  transition: .2s;
}
.card__btn:hover { background: var(--acid); color: var(--ink); border-color: var(--acid); }

/* ---------- SECTION HEAD ---------- */
.section { padding: clamp(56px, 9vw, 110px) 0; position: relative; }
.section--alt { background: var(--ink-2); }
.sec-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}
.sec-head h2 span { color: var(--acid); }
.sec-head .link {
  font-family: var(--f-head);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--acid);
  border-bottom: 2px solid var(--acid);
  padding-bottom: 2px;
}

/* ---------- FOOTER ---------- */
.site-footer {
  background: var(--ink-2);
  border-top: 4px solid var(--acid);
  padding-top: 64px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 40px;
  padding-bottom: 48px;
}
.footer-grid h4 {
  font-size: 1.1rem;
  margin-bottom: 18px;
  color: var(--acid);
  letter-spacing: .04em;
}
.footer-grid ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-grid a, .footer-grid li { color: var(--grey); font-size: .95rem; }
.footer-grid a:hover { color: var(--acid); }
.footer-about p { color: var(--grey); font-size: .95rem; margin-top: 14px; }
.social { display: flex; gap: 12px; margin-top: 18px; }
.social a {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  font-family: var(--f-head);
  font-weight: 700;
  transition: .2s;
}
.social a:hover { background: var(--acid); color: var(--ink); border-color: var(--acid); }
.pay-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.pay-row span {
  font-family: var(--f-head);
  font-size: .72rem;
  letter-spacing: .08em;
  border: 1px solid var(--line);
  padding: 5px 10px;
  color: var(--grey);
}
.footer-bottom {
  border-top: 1px solid var(--line);
  padding: 22px 0;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  font-size: .85rem;
  color: var(--grey-2);
}
.footer-bottom a { color: var(--grey); }
.footer-bottom a:hover { color: var(--acid); }

/* ---------- COOKIE ---------- */
.cookie {
  position: fixed;
  left: 16px; right: 16px; bottom: 16px;
  z-index: 120;
  background: var(--ink-3);
  border: 1px solid var(--acid);
  border-left: 6px solid var(--acid);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  max-width: 920px;
  margin-inline: auto;
  box-shadow: var(--shadow);
}
.cookie p { font-size: .9rem; flex: 1; min-width: 240px; }
.cookie p a { color: var(--acid); text-decoration: underline; }
.cookie__btns { display: flex; gap: 10px; flex-wrap: wrap; }
.cookie .btn { padding: 10px 20px; font-size: .9rem; }
.cookie[hidden] { display: none; }

/* ---------- ФОРМА ---------- */
.field { margin-bottom: 20px; }
.field label {
  display: block;
  font-family: var(--f-head);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .85rem;
  margin-bottom: 8px;
  color: #e8e8e8;
}
.field label .req { color: var(--acid); }
.field input, .field textarea, .field select {
  width: 100%;
  background: var(--ink-3);
  border: 2px solid var(--line);
  color: var(--white);
  padding: 13px 15px;
  font-family: var(--f-body);
  font-size: 1rem;
  transition: border-color .2s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--acid);
}
.field textarea { resize: vertical; min-height: 130px; }
.field .err {
  color: var(--red);
  font-size: .82rem;
  margin-top: 6px;
  display: none;
}
.field.invalid input, .field.invalid textarea { border-color: var(--red); }
.field.invalid .err { display: block; }
.form-note {
  margin-top: 14px; font-size: .85rem; color: var(--grey);
}
.form-success {
  background: rgba(212, 255, 0, .12);
  border: 1px solid var(--acid);
  color: var(--acid);
  padding: 14px 18px;
  font-family: var(--f-head);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 20px;
  display: none;
}
.form-success.show { display: block; }

/* ============================================================
   КОШИК — drawer, тост, дрібний лічильник кількості
   ============================================================ */
.cart-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .6);
  z-index: 130;
  opacity: 0; visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}
.cart-backdrop.show { opacity: 1; visibility: visible; }

.cart-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(440px, 92vw);
  background: var(--ink-2);
  border-left: 4px solid var(--acid);
  z-index: 140;
  display: flex;
  flex-direction: column;
  transform: translateX(105%);
  transition: transform .32s cubic-bezier(.4, 0, .2, 1);
  box-shadow: var(--shadow);
}
.cart-drawer.open { transform: translateX(0); }
.cart-drawer__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.cart-drawer__head h3 { font-size: 1.4rem; }
.cart-drawer__close {
  background: var(--ink-3); border: 2px solid var(--line); color: #fff;
  width: 40px; height: 40px; cursor: pointer; font-size: 1.1rem;
  transition: .2s;
}
.cart-drawer__close:hover { background: var(--acid); color: var(--ink); border-color: var(--acid); }
.cart-drawer__list { flex: 1; overflow-y: auto; padding: 14px 24px; }

.cart-line {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.cart-line__img { width: 72px; height: 90px; border: 1px solid var(--line); overflow: hidden; background: var(--ink-3); }
.cart-line__img img { width: 100%; height: 100%; object-fit: cover; }
.cart-line__body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cart-line__name {
  font-family: var(--f-head); text-transform: uppercase; font-weight: 600;
  font-size: 1rem; line-height: 1.1;
}
.cart-line__name:hover { color: var(--acid); }
.cart-line__meta { font-size: .78rem; color: var(--grey); }
.cart-line__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
.cart-line__price { font-family: var(--f-head); font-weight: 700; font-size: 1.05rem; color: var(--acid); }
.cart-line__del {
  background: none; border: none; color: var(--grey-2); cursor: pointer;
  font-size: 1rem; padding: 2px 4px; transition: color .2s;
}
.cart-line__del:hover { color: var(--red); }

.qty--sm { border-width: 2px; }
.qty--sm button { width: 30px; height: 30px; font-size: 1rem; }
.qty--sm input { width: 36px; font-size: .95rem; }

.cart-empty { text-align: center; padding: 50px 10px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.cart-empty p { font-family: var(--f-head); text-transform: uppercase; letter-spacing: .05em; color: var(--grey); }

.cart-drawer__foot { flex-shrink: 0; padding: 20px 24px; border-top: 1px solid var(--line); background: var(--ink-3); }
.cart-drawer__total { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.cart-drawer__total span { font-family: var(--f-head); text-transform: uppercase; letter-spacing: .05em; color: var(--grey); }
.cart-drawer__total b { font-family: var(--f-head); font-size: 1.8rem; color: var(--acid); }
.cart-drawer__continue {
  display: block; text-align: center; margin-top: 12px;
  font-family: var(--f-head); text-transform: uppercase; letter-spacing: .05em;
  font-size: .85rem; color: var(--grey);
}
.cart-drawer__continue:hover { color: var(--acid); }
body.cart-open { overflow: hidden; }

/* ---------- ТОСТ ---------- */
.cart-toast {
  position: fixed;
  right: 20px; bottom: 20px;
  z-index: 150;
  background: var(--ink-3);
  border: 1px solid var(--acid);
  border-left: 6px solid var(--acid);
  padding: 14px 18px;
  display: flex; align-items: center; gap: 12px;
  max-width: 360px;
  box-shadow: var(--shadow);
  transform: translateY(140%);
  opacity: 0;
  transition: transform .3s ease, opacity .3s ease;
  font-size: .92rem;
}
.cart-toast.show { transform: translateY(0); opacity: 1; }
.cart-toast__ic {
  width: 26px; height: 26px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--acid); color: var(--ink);
  font-weight: 700; transform: skewX(var(--skew));
}
.cart-toast__view {
  margin-left: auto; flex-shrink: 0;
  background: none; border: 2px solid var(--acid); color: var(--acid);
  font-family: var(--f-head); text-transform: uppercase; letter-spacing: .04em;
  padding: 6px 12px; cursor: pointer; font-size: .8rem;
  transform: skewX(var(--skew)); transition: .2s;
}
.cart-toast__view:hover { background: var(--acid); color: var(--ink); }
@media (max-width: 540px) {
  .cart-toast { left: 16px; right: 16px; max-width: none; }
}
