/* =====================================================================
   VMSKPR STORE — оформление магазина (подключается только на store.html).
   Переопределяет старые стили магазина из style.css.
   ===================================================================== */

.store { --st-radius: 22px; --st-bg: #f4f6fb; background: var(--st-bg); }
.store .section { padding: 64px 0; }

/* ---------- Первый экран ---------- */
.st-hero {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(900px 420px at 85% 10%, rgba(255,255,255,.16), transparent 60%),
    radial-gradient(700px 400px at 0% 100%, rgba(229,48,60,.28), transparent 60%),
    linear-gradient(135deg, #1f5bff 0%, #1440c4 55%, #0b2a8a 100%);
  padding: 64px 0 72px;
}
.st-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(255,255,255,.14) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 70%);
          mask-image: linear-gradient(90deg, transparent 0%, #000 70%);
}
.st-hero .container { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.st-hero .container > * { min-width: 0; }
.st-tag {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); padding: 7px 14px; border-radius: 999px;
}
.st-tag i { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 4px rgba(74,222,128,.25); }
.st-hero h1 { color: #fff; font-size: clamp(38px, 6.2vw, 72px); letter-spacing: -.035em; margin: 18px 0 14px; line-height: 1.02; }
.st-hero h1 span { display: block; font-size: .42em; letter-spacing: -.01em; font-weight: 700; color: rgba(255,255,255,.8); margin-top: 10px; }
.st-hero p { color: rgba(255,255,255,.86); font-size: 18px; max-width: 540px; margin: 0 0 28px; }
.st-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.st-actions .btn { margin: 0; }
.btn.st-light { background: #fff; color: var(--brand); border-color: #fff; }
.btn.st-light:hover { background: #eaf0ff; border-color: #eaf0ff; color: var(--brand-dark); }
.btn.st-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.45); }
.btn.st-outline:hover { background: rgba(255,255,255,.12); border-color: #fff; color: #fff; }
.st-perks { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 32px 0 0; padding: 0; list-style: none; }
.st-perks li { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: rgba(255,255,255,.92); }
.st-perks svg { width: 20px; height: 20px; flex: none; }

/* Витрина из трёх товаров справа */
.st-show { position: relative; height: 420px; }
.st-show .sc {
  position: absolute; width: 56%; aspect-ratio: 1; border-radius: 28px; background: #fff;
  box-shadow: 0 30px 60px rgba(4, 16, 64, .35); display: grid; place-items: center; overflow: hidden;
  transition: transform .4s ease;
}
.st-show .sc svg, .st-show .sc img { width: 84%; height: 84%; object-fit: contain; }
.st-show .sc:nth-child(1) { left: 0; top: 40px; transform: rotate(-7deg); z-index: 2; }
.st-show .sc:nth-child(2) { right: 0; top: 0; transform: rotate(6deg); width: 50%; }
.st-show .sc:nth-child(3) { left: 30%; bottom: 0; transform: rotate(-1deg); width: 46%; z-index: 3; }
.st-show:hover .sc:nth-child(1) { transform: rotate(-9deg) translateY(-6px); }
.st-show:hover .sc:nth-child(2) { transform: rotate(8deg) translateY(-6px); }
.st-show .sc-price {
  position: absolute; left: 12px; bottom: 12px; background: var(--ink); color: #fff; font-weight: 800; font-size: 14px;
  padding: 6px 12px; border-radius: 999px;
}

/* ---------- Панель поиска и разделов (закреплена под шапкой) ---------- */
.st-bar {
  position: sticky; top: 76px; z-index: 40;
  background: rgba(244,246,251,.9); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s;
}
.st-bar.stuck { border-bottom-color: var(--line); box-shadow: 0 6px 20px rgba(15,23,42,.06); }
.st-bar .container { display: flex; align-items: center; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
.st-search { position: relative; flex: 0 0 300px; }
.st-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.st-search input {
  width: 100%; height: 46px; padding: 0 40px 0 42px; border: 1.5px solid var(--line); border-radius: 14px;
  font: inherit; font-size: 16px; background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
.st-search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(31,91,255,.12); }
.st-search input::-webkit-search-cancel-button { display: none; }
.st-search .st-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border-radius: 50%;
  border: 0; background: var(--bg-alt); color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; display: none;
}
.st-search.has-q .st-clear { display: block; }

.store .chips {
  flex: 1; min-width: 0; display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; scrollbar-width: none;
  scroll-snap-type: x proximity; padding: 2px; margin: -2px;
}
.store .chips::-webkit-scrollbar { display: none; }
.store .chip {
  flex: none; scroll-snap-align: start; display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 16px; font-size: 15px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff;
  white-space: nowrap; transition: .15s;
}
.store .chip small { font-size: 12px; font-weight: 700; color: var(--muted); background: var(--bg-alt); padding: 2px 8px; border-radius: 999px; }
.store .chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.store .chip.on small { background: rgba(255,255,255,.16); color: #fff; }

/* ---------- Каталог ---------- */
.st-catalog { padding: 28px 0 72px; }
.store .shop-section + .shop-section { margin-top: 48px; }
.store .shop-cat { font-size: clamp(22px, 2.6vw, 28px); margin: 0 0 18px; }
.store .shop-cat span { background: #fff; border: 1px solid var(--line); }
.store .shop-grid { grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 20px; }
.st-empty { text-align: center; padding: 64px 20px; color: var(--muted); font-size: 17px; }
.st-empty b { display: block; font-size: 22px; color: var(--ink); margin-bottom: 6px; }

.store .product {
  border: 1px solid rgba(15,23,42,.06); border-radius: var(--st-radius); background: #fff;
  box-shadow: 0 1px 2px rgba(15,23,42,.04); transition: transform .2s, box-shadow .2s;
}
.store .product:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(15,23,42,.10); }
.store .product:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.store .pv { background: radial-gradient(circle at 50% 40%, #ffffff 0%, #f1f4fa 55%, #e4e9f3 100%); margin: 8px 8px 0; border-radius: 16px; overflow: hidden; }
.store .pv svg { transition: transform .35s ease; }
.store .product:hover .pv svg { transform: scale(1.06); }
.store .pbadge { top: 10px; left: 10px; font-size: 12px; padding: 5px 10px; box-shadow: 0 4px 10px rgba(229,48,60,.3); }
.store .pinfo { padding: 14px 16px 16px; }
.store .pinfo h3 { font-size: 16px; line-height: 1.3; margin: 0 0 4px; }
.store .pvar { font-size: 13.5px; margin-bottom: 10px; line-height: 1.4; }
.store .swatches { margin: 0 0 12px; }
.store .swatches i { width: 18px; height: 18px; box-shadow: inset 0 0 0 2px #fff; }
.pfoot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.store .pprice { margin: 0; font-size: 19px; letter-spacing: -.01em; }
.padd {
  flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 42px; padding: 0 16px; border-radius: 12px; border: 0; background: var(--brand); color: #fff;
  font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; transition: background .15s, transform .1s;
}
.padd:hover { background: var(--brand-dark); }
.padd:active { transform: scale(.96); }
.padd svg { width: 18px; height: 18px; }

/* ---------- Как заказать ---------- */
.st-how { background: #fff; }
.st-how h2 { margin: 0 0 28px; font-size: clamp(26px, 3vw, 36px); }
.st-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: st; }
.st-step { position: relative; background: var(--st-bg); border-radius: var(--st-radius); padding: 24px 22px; }
.st-step::before {
  counter-increment: st; content: counter(st); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  background: var(--brand); color: #fff; font-weight: 800; font-size: 17px; margin-bottom: 16px;
}
.st-step h3 { font-size: 18px; margin: 0 0 6px; }
.st-step p { margin: 0; color: var(--muted); font-size: 15px; }
.st-contact {
  margin-top: 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--ink); color: #cbd5e1; border-radius: var(--st-radius); padding: 22px 26px;
}
.st-contact b { color: #fff; display: block; font-size: 17px; margin-bottom: 2px; }
.st-contact .btn { margin: 0; }
.btn.wa, .btn.wa:hover { background: #25d366; border-color: #25d366; color: #fff; }
.btn.wa:hover { filter: brightness(.95); }

/* ---------- Карточка товара (окно) ---------- */
.store .modal { align-items: center; padding: 24px 16px; }
.store .modal-box { max-width: 960px !important; padding: 28px; border-radius: 28px; animation: st-pop .22s ease; }
@keyframes st-pop { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.store .pm-grid { grid-template-columns: 1.05fr 1fr; gap: 32px; align-items: start; }
.store .pv.big { margin: 0; border-radius: 22px; position: sticky; top: 0; }
.store .pm-grid h2 { font-size: clamp(22px, 2.6vw, 30px); }
.store .pm-price { font-size: 30px; margin-bottom: 8px; color: var(--ink); }
.store .opt-v span { padding: 10px 16px; border-radius: 12px; min-width: 48px; text-align: center; transition: .12s; }
.store .opt-v span:hover { border-color: #b7c4dc; }
.store .qty { border-radius: 14px; }
.store .qty button { width: 46px; height: 46px; }
.store .qty input { height: 46px; font-size: 17px; -moz-appearance: textfield; }
.store .qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.store .pm-actions { grid-template-columns: 1fr 1fr; }
.store .pm-actions .btn { padding: 14px 16px; border-radius: 14px; font-size: 16px; }
.store .modal-close { background: #fff; box-shadow: 0 2px 10px rgba(15,23,42,.14); z-index: 3; transition: .15s; }
.store .modal-close:hover { background: var(--bg-alt); }

/* ---------- Корзина ---------- */
.store .cart-fab {
  right: 24px; bottom: 24px; padding: 10px 12px 10px 18px; gap: 12px; font-size: 16px;
  background: var(--ink); box-shadow: 0 16px 40px rgba(15,23,42,.35);
}
.store .cart-fab svg { width: 22px; height: 22px; }
.store .cart-fab .cf-l { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; background: none; min-width: 0; height: auto; padding: 0; font-size: 16px; }
.store .cart-fab .cf-n { order: 0; }
.store .cart-fab .cf-n { background: var(--accent); }
.store .cart-fab .cf-t { background: rgba(255,255,255,.12); border-radius: 999px; padding: 6px 12px; font-size: 15px; }
.store .cart { animation: st-fade .2s ease; }
@keyframes st-fade { from { opacity: 0; } to { opacity: 1; } }
.store .cart-panel { max-width: 460px; padding: 0; display: flex; flex-direction: column; animation: st-slide .25s ease; }
@keyframes st-slide { from { transform: translateX(40px); } to { transform: none; } }
.store .cart-head { position: sticky; top: 0; z-index: 2; background: #fff; padding: 20px 24px; margin: 0; border-bottom: 1px solid var(--line); }
.store #cart-list, .store .cart-total, .store #cart-form { padding-left: 24px; padding-right: 24px; }
.store #cart-form { padding-bottom: 24px; }
.store .cline { gap: 14px; }
.store .pv.sm { margin: 0; width: 72px; height: 72px; border-radius: 14px; }
.store .cart-total { font-weight: 800; }
.store #cart-form .btn { width: 100%; justify-content: center; padding: 15px; border-radius: 14px; font-size: 16px; }

/* ---------- Планшеты ---------- */
@media (max-width: 1020px) {
  .st-hero .container { grid-template-columns: 1fr 1fr; gap: 28px; }
  .st-show { height: 340px; }
  .st-steps { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Телефоны ---------- */
@media (max-width: 760px) {
  .store .section { padding: 44px 0; }
  .st-hero { padding: 32px 0 36px; }
  .st-hero .container { grid-template-columns: 1fr; gap: 24px; }
  .st-hero p { font-size: 16px; margin-bottom: 22px; }
  .st-actions { gap: 10px; }
  .st-actions .btn { flex: 1 1 auto; justify-content: center; padding: 13px 18px; white-space: nowrap; }
  .st-perks { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 8px; margin: 22px -20px 0; padding: 0 20px; }
  .st-perks::-webkit-scrollbar { display: none; }
  .st-perks li { flex: none; font-size: 14px; background: rgba(255,255,255,.12); border-radius: 999px; padding: 8px 12px; }
  .st-show { display: none; }

  .st-bar .container { flex-direction: column; align-items: stretch; gap: 10px; padding-top: 10px; padding-bottom: 10px; }
  .st-search { flex: none; }
  .st-search input { height: 44px; }
  .store .chips { margin: 0 -20px; padding: 0 20px; }
  .store .chip { height: 38px; padding: 0 14px; font-size: 14px; }

  .st-catalog { padding: 20px 0 96px; }
  .store .shop-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .store .shop-section + .shop-section { margin-top: 36px; }
  .store .shop-cat { margin-bottom: 12px; }
  .store .product { border-radius: 18px; }
  .store .product:hover { transform: none; }
  .store .pv { margin: 6px 6px 0; border-radius: 13px; }
  .store .pinfo { padding: 10px 10px 12px; }
  .store .pinfo h3 { font-size: 14px; }
  .store .pvar { font-size: 12.5px; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .store .swatches { margin-bottom: 8px; gap: 4px; }
  .store .swatches i { width: 14px; height: 14px; }
  .store .pprice { font-size: 15.5px; }
  .padd { width: 38px; height: 38px; padding: 0; border-radius: 11px; }
  .padd span { display: none; }

  .st-steps { grid-template-columns: 1fr; gap: 10px; }
  .st-step { display: grid; grid-template-columns: 40px 1fr; column-gap: 14px; padding: 16px; }
  .st-step::before { grid-row: span 2; margin: 0; }
  .st-contact { padding: 20px; }
  .st-contact .btn { width: 100%; justify-content: center; }

  /* Карточка товара — шторка снизу */
  .store .modal { align-items: flex-end; padding: 0; }
  .store .modal-box {
    border-radius: 26px 26px 0 0; padding: 14px 16px 0; max-height: 94vh; max-height: 94dvh; overflow-y: auto;
    animation: st-up .28s cubic-bezier(.2,.8,.2,1);
  }
  .store .modal-box::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 99px; background: #d5dbe6; margin: 0 auto 10px; }
  @keyframes st-up { from { transform: translateY(100%); } to { transform: none; } }
  .store .modal-box > .modal-close { position: sticky; top: 0; float: right; margin: -6px -4px 0 8px; }
  .store .pm-grid { grid-template-columns: 1fr; gap: 16px; }
  .store .pv.big { position: static; max-width: 340px; width: 100%; margin: 0 auto; }
  .store .pm-price { font-size: 26px; }
  .store .pm-actions {
    position: sticky; bottom: 0; z-index: 2; background: #fff; margin: 18px -16px 0; padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line);
    grid-template-columns: 1fr; gap: 8px;
  }
  .store .pm-actions .btn { font-size: 15px; padding: 12px 10px; }
  .store .pm-note { margin-bottom: 0; padding-bottom: 4px; }

  /* Корзина — на весь экран, кнопка внизу по центру */
  .store .cart-panel { max-width: none; animation: st-up .28s cubic-bezier(.2,.8,.2,1); }
  .store .cart-head { padding: 16px 20px; }
  .store #cart-list, .store .cart-total, .store #cart-form { padding-left: 20px; padding-right: 20px; }
  .store #cart-form { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  .store .cart-fab {
    left: auto; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom));
    width: 58px; height: 58px; padding: 0; border-radius: 50%; justify-content: center; gap: 0;
  }
  .store .cart-fab .cf-l { font-size: 0; gap: 0; }
  .store .cart-fab .cf-l svg { width: 26px; height: 26px; }
  .store .cart-fab .cf-n { position: absolute; top: -4px; right: -4px; min-width: 24px; height: 24px; font-size: 13px; box-shadow: 0 0 0 3px #fff; }
  .store .cart-fab .cf-t { display: none; }
}
@media (max-width: 360px) {
  .store .shop-grid { gap: 8px; }
  .store .pinfo { padding: 8px 8px 10px; }
  .store .pprice { font-size: 14.5px; }
}
/* Пока открыто окно товара или корзина, страница под ними не прокручивается
   (важно для iPhone: иначе снизу выглядывает подвал сайта) */
body.st-lock { position: fixed; left: 0; right: 0; width: 100%; overflow: hidden; }
.store .modal, .store .cart { overscroll-behavior: contain; }
.store .modal-box, .store .cart-panel { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
@media (max-width: 760px) {
  .store .modal { overflow: hidden; height: 100%; height: 100dvh; }
  .store .modal-box { margin-top: auto; }
  .store .cart { height: 100%; height: 100dvh; }
  .store .cart-panel { height: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .store *, .store *::before { animation: none !important; transition: none !important; }
}
