/* ============================================================
   Cart drawer + checkout
   ============================================================ */

.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(3, 3, 4, 0.65);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-fast) var(--ease), visibility var(--dur-fast) var(--ease);
}
.drawer-overlay.is-open { opacity: 1; visibility: visible; }

.drawer {
  position: fixed;
  top: 0; right: 0;
  z-index: 1001;
  width: min(460px, 94vw);
  height: 100svh;
  background: var(--bg-elevated);
  border-left: 1px solid var(--line-bright);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--dur) var(--ease);
  will-change: transform;
}
.drawer.is-open { transform: translateX(0); }

.drawer__step { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.drawer__step[hidden] { display: none; }

.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.3rem var(--gutter);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.drawer__head .link { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; }
.drawer__close {
  font-size: 1.1rem;
  line-height: 1;
  color: var(--ink-dim);
  transition: color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.drawer__close:hover { color: var(--ink); transform: rotate(90deg); }

.drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem var(--gutter);
}

/* ---- строка товара ---- */
.cart-line {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
}
.cart-line__img {
  width: 64px; height: 80px;
  object-fit: cover;
  background: var(--bg-deep);
  filter: grayscale(1) contrast(1.05);
  border: 1px solid var(--line);
}
.cart-line__main { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.cart-line__name { font-weight: 600; font-size: 0.92rem; line-height: 1.2; }
.cart-line__code { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.12em; color: var(--ink-faint); }
.cart-line__ctrl { display: flex; align-items: center; gap: 0.8rem; margin-top: auto; }
.cart-line__size {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  color: var(--ink);
  background: var(--bg-deep);
  border: 1px solid var(--line-bright);
  padding: 0.25rem 0.4rem;
}
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-bright); }
.qty button {
  width: 26px; height: 26px;
  color: var(--ink-dim);
  font-size: 0.9rem;
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.qty button:hover { color: var(--bg); background: var(--ink); }
.qty span { min-width: 26px; text-align: center; font-family: var(--font-mono); font-size: 0.72rem; }
.cart-line__right { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; }
.cart-line__price { font-family: var(--font-mono); font-size: 0.8rem; white-space: nowrap; }
.cart-line__rm {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  transition: color var(--dur-fast) var(--ease);
}
.cart-line__rm:hover { color: var(--warn); text-decoration: line-through; }

/* ---- пустая корзина ---- */
.drawer__empty {
  flex: 1;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  text-align: center;
  padding: var(--gutter);
}
.drawer.is-empty .drawer__empty { display: flex; }
.drawer.is-empty [data-cart-lines],
.drawer.is-empty [data-cart-foot] { display: none; }

/* ---- футер корзины ---- */
.drawer__foot {
  flex-shrink: 0;
  padding: 1.2rem var(--gutter) calc(1.2rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--bg-deep);
}
.field--sm { margin: 0; }
.field--sm input { padding: 0.75rem 0.9rem; }
.field--sm .btn { padding: 0.75rem 1.1rem; }
.drawer__total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.drawer__sum { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em; }
.drawer__discount { font-family: var(--font-mono); font-size: 0.66rem; color: var(--acid); letter-spacing: 0.1em; }
.drawer__checkout { width: 100%; text-align: center; }
.drawer__checkout span { display: block; }

/* ---- чекаут-форма ---- */
.checkout { display: flex; flex-direction: column; gap: 1rem; }
.fld { display: flex; flex-direction: column; gap: 0.4rem; }
.fld span { letter-spacing: 0.14em; }
.fld input {
  padding: 0.85rem 0.95rem;
  background: var(--bg-deep);
  border: 1px solid var(--line-bright);
  color: var(--ink);
  font-size: 0.9rem;
  transition: border-color var(--dur-fast) var(--ease);
}
.fld input:focus { border-color: var(--acid); }
.fld input::placeholder { color: var(--ink-faint); }
.consent {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  cursor: pointer;
  padding-top: 0.3rem;
}
.consent input { width: 16px; height: 16px; accent-color: var(--ink); margin-top: 2px; flex-shrink: 0; }
.consent span { font-size: 0.66rem; line-height: 1.5; color: var(--ink-dim); text-transform: none; letter-spacing: 0; }

/* ---- успех ---- */
.drawer__success {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1.2rem;
  padding: var(--gutter);
}
.drawer__success h3 { line-height: 1; }
.drawer__success p { max-width: 32ch; }

/* счётчик в навигации */
.nav__cart [data-cart-count] { font-variant-numeric: tabular-nums; }
.nav__cart.has-items { background: var(--ink); color: var(--bg); }

/* ============================================================
   PDP — карточка товара
   ============================================================ */
.pdp {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-fast) var(--ease), visibility var(--dur-fast) var(--ease);
}
.pdp.is-open { opacity: 1; visibility: visible; }
.pdp__overlay {
  position: absolute;
  inset: 0;
  background: rgba(3, 3, 4, 0.78);
  backdrop-filter: blur(4px);
}
.pdp__panel {
  position: relative;
  z-index: 1;
  width: min(1100px, 94vw);
  max-height: 92svh;
  overflow: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--line-bright);
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  transform: translateY(14px) scale(0.985);
  transition: transform var(--dur) var(--ease);
}
.pdp.is-open .pdp__panel { transform: none; }
@media (max-width: 820px) {
  .pdp__panel { grid-template-columns: 1fr; max-height: 94svh; }
}
.pdp__close {
  position: absolute;
  top: 1rem; right: 1rem;
  z-index: 3;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  font-size: 1.1rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-bright);
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.pdp__close:hover { background: var(--ink); color: var(--bg); transform: rotate(90deg); }

/* галерея */
.pdp__gallery {
  background: var(--bg-deep);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
@media (max-width: 820px) { .pdp__gallery { border-right: none; border-bottom: 1px solid var(--line); } }
.pdp__stage {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.pdp__img {
  width: 100%; height: 100%;
  object-fit: contain;
  filter: grayscale(1) contrast(1.03);
}
.pdp__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  font-size: 1.4rem; line-height: 1;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-bright);
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.pdp__nav:hover { background: var(--ink); color: var(--bg); }
.pdp__nav--prev { left: 1rem; }
.pdp__nav--next { right: 1rem; }
.pdp__thumbs {
  display: flex;
  gap: 0.6rem;
  padding: 0.9rem;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.pdp__thumb {
  width: 60px; height: 72px;
  object-fit: cover;
  background: var(--bg);
  border: 1px solid var(--line-bright);
  filter: grayscale(1);
  opacity: 0.5;
  cursor: pointer;
  transition: opacity var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.pdp__thumb:hover { opacity: 0.85; }
.pdp__thumb.is-active { opacity: 1; border-color: var(--ink); }

/* инфо */
.pdp__info {
  padding: clamp(1.6rem, 3vw, 2.6rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.pdp__code { letter-spacing: 0.16em; }
.pdp__name {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 1;
}
.pdp__price {
  display: flex; align-items: baseline; gap: 0.7rem;
  font-family: var(--font-mono); font-size: 1.05rem;
}
.pdp__price .product__old { font-size: 0.85rem; }
.pdp__block { display: flex; flex-direction: column; gap: 0.7rem; margin-top: 0.4rem; }
.pdp__label { letter-spacing: 0.16em; color: var(--ink-dim); }
.pdp__sizes { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.size-chip {
  min-width: 48px;
  padding: 0.6rem 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-align: center;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-bright);
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.size-chip:hover { border-color: var(--ink); }
.size-chip.is-active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pdp__add { width: 100%; text-align: center; margin-top: 0.4rem; }
.pdp__add span { display: block; }
.pdp__desc {
  margin-top: 0.6rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  color: var(--ink-dim);
  font-size: 0.92rem;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.pdp__desc b { color: var(--ink); }

/* подсказка кликабельности карточки */
.product__media { cursor: pointer; }
