/* ============================================================
   Витрина ESQ — надстройка над main.css (общий дизайн-код)
   ============================================================ */

/* ---------- Шапка магазина ---------- */
.shop-header .container { gap: 22px; }

.shop-phone {
  font-family: var(--cond);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: .02em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.shop-phone small { font-size: 11px; color: var(--ink-muted); font-family: var(--sans); letter-spacing: 0; }

.cart-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
.cart-link:hover { border-color: var(--brand); color: var(--brand-dark); }
.cart-link__count {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
}
.cart-link__count[data-empty="1"] { background: var(--line-strong); color: var(--ink-muted); }

/* ---------- Hero витрины ---------- */
.shop-hero {
  position: relative;
  overflow: hidden;
  padding: 64px 0 58px;
  color: #c9d8e5;
  background:
    radial-gradient(900px 420px at 80% -10%, rgba(28, 96, 172, .5), transparent 62%),
    linear-gradient(160deg, #071523 0%, #0a2a43 55%, #071b2e 100%);
  background-color: #081826;
  isolation: isolate;
}
.shop-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 20%, transparent 78%);
}
.shop-hero h1 { color: #fff; margin-bottom: 16px; }
.shop-hero h1 span { color: #7fb2e8; }
.shop-hero__lead { color: #b7cadb; max-width: 60ch; margin-bottom: 26px; }

.hero-search {
  display: flex;
  gap: 10px;
  max-width: 640px;
  margin-bottom: 18px;
}
.hero-search input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 15px;
  padding: 13px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .08);
  color: #fff;
}
.hero-search input::placeholder { color: #9db8ce; }
.hero-search input:focus { outline: none; border-color: #7fb2e8; background: rgba(255, 255, 255, .14); }

.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Полоса преимуществ ---------- */
.trust {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.trust__item { display: flex; gap: 12px; align-items: flex-start; }
.trust__icon {
  width: 38px; height: 38px;
  flex: 0 0 38px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--brand-soft);
  color: var(--brand-dark);
}
.trust__title { font-weight: 600; font-size: 14.5px; color: var(--ink); line-height: 1.25; }
.trust__text { font-size: 13px; color: var(--ink-muted); line-height: 1.4; margin-top: 2px; }

/* ---------- Серии ---------- */
.series-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.series-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 26px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fff;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s, transform .15s;
  overflow: hidden;
}
.series-card:hover { border-color: var(--brand); box-shadow: var(--shadow); transform: translateY(-2px); color: inherit; }
.series-card__kicker { font-family: var(--cond); font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--steel); }
.series-card__title { font-size: 1.35rem; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.series-card__text { font-size: 14px; color: var(--ink-muted); }
.series-card__meta { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; font-size: 13px; color: var(--steel); }
.series-card__price { font-size: 1.05rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.series-card__arrow { position: absolute; right: 24px; bottom: 24px; color: var(--brand); }

/* ---------- Сетка товаров ---------- */
.catalog-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; align-items: start; }

.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }

.pcard {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s, transform .15s;
  height: 100%;
}
.pcard:hover { border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-2px); }
.pcard[hidden] { display: none; }

.pcard__img {
  display: block;
  aspect-ratio: 4 / 3;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 10px;
}
.pcard__img img { width: 100%; height: 100%; object-fit: contain; display: block; }

.pcard__body { display: flex; flex-direction: column; gap: 8px; padding: 16px 16px 18px; flex: 1; }
.pcard__badges { display: flex; flex-wrap: wrap; gap: 6px; min-height: 20px; }
.badge {
  font-family: var(--cond);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 5px;
  background: var(--panel-alt);
  border: 1px solid var(--line);
  color: var(--steel);
  white-space: nowrap;
}
.badge--in { background: var(--ok-soft); border-color: #c6e5d8; color: var(--ok); }
.badge--order { background: var(--accent-soft); border-color: #f3d6c1; color: #93500f; }
.badge--ex { background: #fdeaea; border-color: #f4c9c9; color: #9b2c2c; }
.badge--bronze { background: #fbf1e2; border-color: #eddbc0; color: #7c5a1c; }

.pcard__title { font-size: 15.5px; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; margin: 0; }
.pcard__title a { color: var(--ink); text-decoration: none; }
.pcard__title a:hover { color: var(--brand); }
.pcard__meta { font-size: 13px; color: var(--ink-muted); margin: 0; line-height: 1.4; }

.pcard__bottom { margin-top: auto; padding-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pcard__price { font-size: 1.15rem; font-weight: 700; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pcard__price small { font-size: 12px; font-weight: 500; color: var(--ink-muted); }

.add-btn {
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.add-btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.add-btn.is-added { background: var(--ok); border-color: var(--ok); }

/* ---------- Фильтры ---------- */
.filters {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.filters__group { display: flex; flex-direction: column; gap: 8px; }
.filters__title {
  font-family: var(--cond);
  font-size: 12.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--steel);
  font-weight: 500;
  margin: 0;
}
.filter-opt {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
}
.filter-opt input { accent-color: var(--brand); width: 16px; height: 16px; margin: 0; }
.filter-opt .count { margin-left: auto; font-size: 12px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.filters__reset {
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
  color: var(--ink-soft);
}
.filters__reset:hover { border-color: var(--brand); color: var(--brand-dark); }

.filters-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  margin-bottom: 16px;
}
.filters-toggle:hover { border-color: var(--brand); color: var(--brand-dark); }

/* ---------- Панель каталога ---------- */
.catalog-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.catalog-head h1 { margin: 0; font-size: clamp(1.5rem, 2.4vw, 2rem); }
.catalog-count { font-size: 14px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.catalog-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 20px; }
.catalog-toolbar .search { flex: 1 1 260px; max-width: 360px; }
.sort-select {
  font: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
}
.empty-state {
  padding: 40px 24px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink-muted);
  background: #fff;
}
.empty-state strong { display: block; color: var(--ink); margin-bottom: 6px; font-size: 16px; }

/* ---------- Карточка товара ---------- */
.pdp { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .95fr); gap: 36px; align-items: start; }
.pdp__media {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  display: grid;
  place-items: center;
  min-height: 320px;
}
.pdp__media img { max-width: 100%; height: auto; display: block; }
.pdp__title { margin: 0 0 10px; font-size: clamp(1.4rem, 2.2vw, 1.85rem); }
.pdp__badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.pdp__meta { font-size: 14px; color: var(--ink-muted); margin-bottom: 18px; }

.pdp__buy {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.pdp__price { font-size: 2rem; font-weight: 700; letter-spacing: -.02em; color: var(--ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.pdp__price small { font-size: .5em; font-weight: 500; color: var(--ink-muted); }
.pdp__stock { font-size: 13.5px; margin: 8px 0 16px; color: var(--ink-muted); }
.pdp__stock b { color: var(--ok); }
.pdp__stock.is-order b { color: var(--accent); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; }
.qty button {
  width: 40px; height: 44px;
  border: 0;
  background: #fff;
  font-size: 18px;
  color: var(--ink);
  cursor: pointer;
}
.qty button:hover { background: var(--panel-alt); }
.qty input {
  width: 54px;
  height: 44px;
  border: 0;
  border-inline: 1px solid var(--line);
  text-align: center;
  font: inherit;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.qty input:focus { outline: none; }
.pdp__actions { display: flex; gap: 10px; margin-top: 16px; }
.pdp__actions .btn { flex: 1; justify-content: center; }

.pdp__notes { margin: 16px 0 0; padding: 0; list-style: none; font-size: 13.5px; color: var(--ink-muted); display: grid; gap: 8px; }
.pdp__notes li { display: flex; gap: 8px; align-items: flex-start; }
.pdp__notes svg { flex: 0 0 16px; margin-top: 3px; color: var(--brand); }

.spec-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.spec-table th, .spec-table td { padding: 11px 0; border-bottom: 1px dashed var(--line); text-align: left; vertical-align: top; }
.spec-table th { color: var(--ink-muted); font-weight: 500; width: 46%; }
.spec-table td { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.spec-table tr:last-child th, .spec-table tr:last-child td { border-bottom: 0; }

/* ---------- Корзина ---------- */
.cart-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, .8fr); gap: 26px; align-items: start; }
.cart-list { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cart-row { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto auto; gap: 16px; align-items: center; padding: 16px; border-bottom: 1px solid var(--line); }
.cart-row:last-child { border-bottom: 0; }
.cart-row img { width: 84px; height: 66px; object-fit: contain; background: #fff; }
.cart-row__name { font-size: 14.5px; font-weight: 600; color: var(--ink); text-decoration: none; }
.cart-row__name:hover { color: var(--brand); }
.cart-row__meta { font-size: 12.5px; color: var(--ink-muted); margin-top: 3px; }
.cart-row__price { font-size: 15px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cart-row__remove { border: 0; background: none; color: var(--ink-muted); cursor: pointer; font-size: 13px; }
.cart-row__remove:hover { color: var(--danger); }

.cart-summary {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.cart-summary__row { display: flex; justify-content: space-between; gap: 12px; font-size: 14.5px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.cart-summary__row:last-of-type { border-bottom: 0; }
.cart-summary__total { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 13px; color: var(--ink-muted); }
.field input, .field textarea {
  font: inherit;
  font-size: 14.5px;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.field textarea { resize: vertical; min-height: 74px; }

.form-note { font-size: 12px; color: var(--ink-muted); margin-top: 10px; line-height: 1.45; }
.form-success {
  background: var(--ok-soft);
  border: 1px solid #c6e5d8;
  color: #0f5139;
  border-radius: var(--radius-sm);
  padding: 16px;
  font-size: 14px;
}

/* ---------- Адаптив витрины ---------- */
@media (max-width: 1080px) {
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-layout { grid-template-columns: 1fr; }
  .filters { position: static; }
  .filters-toggle { display: inline-flex; }
  .filters { display: none; }
  .filters.is-open { display: flex; }
  .pdp { grid-template-columns: 1fr; }
  .cart-layout { grid-template-columns: 1fr; }
  .cart-summary { position: static; }
  .trust { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .series-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .product-grid { grid-template-columns: 1fr; }
  .trust { grid-template-columns: 1fr; }
  .shop-hero { padding: 40px 0 36px; }
  .hero-search { flex-direction: column; }
  .cart-row { grid-template-columns: 64px minmax(0, 1fr); grid-template-areas: "img name" "img price"; }
  .cart-row img { width: 64px; height: 54px; grid-area: img; }
  .cart-row__name { grid-area: name; }
  .cart-row__price { grid-area: price; }
  .cart-row__remove { justify-self: start; }
  .shop-phone { display: none; }
}

@media print {
  .filters, .catalog-toolbar, .add-btn, .cart-link, .shop-phone { display: none !important; }
}
