/* ATTACH | SHOP — магазин цифровых товаров */

.shop-hero { padding: calc(var(--nav-h) + 70px) 0 44px; }
.shop-hero h1 { font-size: clamp(2.2rem, 5vw, 3.7rem); }
.shop-hero .lead { max-width: 620px; }
.shop-perks { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 30px; }
.perk {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 18px; border-radius: 100px;
  border: 1px solid var(--line); background: var(--panel);
  font-size: 13.5px; font-weight: 500; backdrop-filter: blur(12px);
}
.perk .em { font-size: 16px; }

/* ------------------------------------------------------------- фильтры */

.shop-toolbar {
  position: sticky; top: var(--nav-h); z-index: 90;
  padding: 16px 0;
  background: rgba(5, 6, 11, 0.82);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
  margin-bottom: 36px;
}
.toolbar-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.search-box { position: relative; flex: 1; min-width: 220px; }
.search-box .input { padding-left: 44px; border-radius: 100px; }
.search-box::before {
  content: '🔍'; position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  font-size: 14px; opacity: 0.6; pointer-events: none;
}
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 17px; border-radius: 100px; white-space: nowrap;
  border: 1px solid var(--line); background: var(--panel);
  font-size: 13.5px; font-weight: 600; color: var(--muted);
  transition: 0.25s var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip.active { background: var(--grad); color: #06070d; border-color: transparent; box-shadow: 0 6px 24px -8px rgba(123, 92, 255, 0.9); }
.chip small { opacity: 0.65; font-weight: 500; }

/* -------------------------------------------------------------- каталог */

/* min() не даёт треку стать шире контейнера на узких экранах (320–360 px) */
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(292px, 100%), 1fr)); gap: 20px; padding-bottom: 90px; }

.product {
  border-radius: var(--r-lg); border: 1px solid var(--line);
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015));
  padding: 24px; display: flex; flex-direction: column; position: relative; overflow: hidden;
  transition: transform 0.35s var(--ease), border-color 0.35s, box-shadow 0.35s;
}
.product:hover { transform: translateY(-6px); border-color: var(--line-strong); box-shadow: 0 30px 60px -35px rgba(0, 0, 0, 1); }
.product::before {
  content: ''; position: absolute; top: 0; left: 24px; right: 24px; height: 1px;
  background: var(--grad); opacity: 0; transition: opacity 0.35s;
}
.product:hover::before { opacity: 1; }
.product-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }

/* карточка с загруженным фото */
.product.has-photo { padding: 0; }
.product.has-photo > *:not(.product-photo) { padding-inline: 24px; }
.product.has-photo > *:last-child { padding-bottom: 24px; }
.product.has-photo::before { left: 0; right: 0; }
.product-photo {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden;
  border-radius: var(--r-lg) var(--r-lg) 0 0; background: rgba(255, 255, 255, 0.03);
  margin-bottom: 18px;
}
.product-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.product:hover .product-photo img { transform: scale(1.05); }
.product-photo::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(8, 10, 18, 0.85), transparent 55%);
}
.product-badge.on-photo { position: absolute; top: 12px; right: 12px; z-index: 1; }

.modal-photo {
  border-radius: var(--r); overflow: hidden; margin-bottom: 22px;
  aspect-ratio: 16 / 9; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line);
}
.modal-photo img { width: 100%; height: 100%; object-fit: cover; }
.product-ic {
  width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center;
  font-size: 23px; background: var(--grad-soft); border: 1px solid var(--line); flex: none;
}
.product-badge {
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em; padding: 5px 10px;
  border-radius: 100px; background: var(--grad); color: #06070d;
}
.product h3 { font-size: 1.08rem; line-height: 1.3; margin-bottom: 6px; }
.product .sub { color: var(--muted); font-size: 13.4px; min-height: 38px; }
.product-meta { display: flex; gap: 7px; flex-wrap: wrap; margin: 16px 0 18px; }
.product-foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.price-box .now { font-size: 1.32rem; font-weight: 800; letter-spacing: -0.02em; }
.price-box .old { font-size: 12.5px; color: var(--dim); text-decoration: line-through; }
.product .btn-add { padding: 11px 18px; font-size: 13.5px; }
.stock-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.stock-dot i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.stock-dot.low i { background: var(--warn); box-shadow: 0 0 10px var(--warn); }
.stock-dot.out i { background: var(--err); box-shadow: none; }

.empty { text-align: center; padding: 80px 20px; color: var(--muted); grid-column: 1 / -1; }
.empty .em { font-size: 44px; display: block; margin-bottom: 14px; opacity: 0.7; }

/* ---------------------------------------------------------------- модалки */

.overlay {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(3, 4, 8, 0.78); backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.overlay.open { display: flex; animation: fadeIn 0.25s; }
@keyframes fadeIn { from { opacity: 0; } }

.modal {
  width: min(680px, 100%); max-height: 88vh; overflow-y: auto;
  background: linear-gradient(170deg, #0d101c, #080a12);
  border: 1px solid var(--line-strong); border-radius: var(--r-lg);
  box-shadow: var(--shadow); padding: 34px;
  animation: modalIn 0.35s var(--ease); position: relative;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(24px) scale(0.97); } }
.modal h2 { font-size: 1.6rem; padding-right: 40px; }
.modal-section { margin-top: 24px; }
.modal-section h4 { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); margin-bottom: 12px; }
.feature-list { display: flex; flex-direction: column; gap: 10px; }
.feature-list li { display: flex; gap: 10px; font-size: 14.5px; color: var(--muted); }
.feature-list li::before { content: '✓'; color: var(--ok); font-weight: 700; }

/* ---------------------------------------------------------------- корзина */

.cart-btn { position: relative; }
.cart-count {
  position: absolute; top: -6px; right: -6px;
  min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 100px; background: var(--c3); color: #fff;
  font-size: 11px; font-weight: 800; display: grid; place-items: center;
  box-shadow: 0 0 14px rgba(255, 78, 203, 0.8);
  transform: scale(0); transition: transform 0.3s var(--ease);
}
.cart-count.show { transform: scale(1); }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 420;
  width: min(460px, 100%);
  background: linear-gradient(180deg, #0b0e18, #06070d);
  border-left: 1px solid var(--line-strong);
  box-shadow: -30px 0 80px -30px rgba(0, 0, 0, 1);
  transform: translateX(102%);
  transition: transform 0.45s var(--ease);
  display: flex; flex-direction: column;
}
.drawer.open { transform: none; }
.drawer-head { padding: 24px 26px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.drawer-head h3 { font-size: 1.25rem; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 26px; }
.drawer-foot { padding: 22px 26px; border-top: 1px solid var(--line); background: rgba(255, 255, 255, 0.02); }

.cart-item { display: flex; gap: 14px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.cart-item:last-child { border-bottom: 0; }
.cart-item .ic { width: 42px; height: 42px; border-radius: 12px; background: var(--grad-soft); border: 1px solid var(--line); display: grid; place-items: center; font-size: 18px; flex: none; overflow: hidden; }
.cart-item .ic img { width: 100%; height: 100%; object-fit: cover; }
.cart-item .info { flex: 1; min-width: 0; }
.cart-item b { font-size: 14px; display: block; line-height: 1.35; }
.cart-item small { color: var(--dim); font-size: 12px; }
.qty { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 100px; margin-top: 9px; }
.qty button { width: 26px; height: 26px; display: grid; place-items: center; color: var(--muted); font-size: 15px; border-radius: 50%; transition: 0.2s; }
.qty button:hover { color: var(--text); background: var(--panel-2); }
.qty span { min-width: 26px; text-align: center; font-size: 13.5px; font-weight: 700; }
.cart-item .right { text-align: right; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; }
.cart-item .rm { color: var(--dim); font-size: 12px; transition: color 0.2s; }
.cart-item .rm:hover { color: var(--err); }

.sum-row { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); margin-bottom: 9px; }
.sum-row.total { font-size: 1.28rem; font-weight: 800; color: var(--text); margin: 14px 0 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.sum-row.discount { color: var(--ok); }
.promo-row { display: flex; gap: 8px; margin-bottom: 16px; }
.promo-row .input { border-radius: 100px; text-transform: uppercase; }

/* ----------------------------------------------------------- выдача/заказ */

.pay-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pay-methods.with-online { grid-template-columns: repeat(3, 1fr); }
.pay-methods.with-online .pay-method.online { grid-column: 1 / -1; padding: 15px 12px; }
.pay-method small { display: block; font-weight: 500; color: var(--dim); font-size: 11px; margin-top: 3px; }
.pay-method.online.active small { color: var(--muted); }
.pay-method {
  padding: 13px 8px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--panel); text-align: center; font-size: 12.5px; font-weight: 600;
  transition: 0.25s var(--ease); cursor: pointer;
}
.pay-method .em { display: block; font-size: 19px; margin-bottom: 5px; }
.pay-method.active { border-color: var(--c2); background: rgba(123, 92, 255, 0.14); color: var(--text); }

.success-ic {
  width: 74px; height: 74px; border-radius: 50%; margin: 0 auto 20px;
  background: var(--grad); display: grid; place-items: center; font-size: 34px;
  box-shadow: var(--glow); animation: popIn 0.5s var(--ease);
}
@keyframes popIn { from { transform: scale(0.4); opacity: 0; } }

.key-block { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-bottom: 14px; }
.key-head { padding: 13px 18px; background: rgba(255, 255, 255, 0.04); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.key-head b { font-size: 14px; }
.key-list { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.key-value {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  padding: 12px 14px; border-radius: 10px; background: rgba(0, 0, 0, 0.42);
  font-family: var(--font-mono); font-size: 12.6px; word-break: break-all;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.key-value button { color: var(--c1); font-size: 12px; font-weight: 600; white-space: nowrap; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--line); transition: 0.2s; }
.key-value button:hover { background: rgba(34, 225, 255, 0.12); }
.key-note { padding: 12px 18px; font-size: 13px; color: var(--muted); background: rgba(34, 225, 255, 0.05); border-top: 1px solid var(--line); }

.co-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.order-code {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 16px 20px; border-radius: var(--r);
  background: rgba(123, 92, 255, 0.1); border: 1px dashed rgba(123, 92, 255, 0.5);
  margin: 20px 0;
}
.order-code b { font-family: var(--font-mono); font-size: 18px; letter-spacing: 0.05em; }

/* ---------------------------------------------------- страница проверки */

.lookup { padding: calc(var(--nav-h) + 80px) 0 90px; min-height: 100vh; }
.lookup-card { max-width: 700px; margin-inline: auto; padding: 40px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--panel); }
.lookup-form { display: flex; gap: 10px; margin-top: 24px; }

@media (max-width: 640px) {
  .modal { padding: 26px 20px; }
  .co-row { grid-template-columns: 1fr; }
  .shop-toolbar { top: calc(var(--nav-h) - 1px); }
  .pay-methods { grid-template-columns: 1fr; }
  .lookup-card { padding: 26px 20px; }
  .lookup-form { flex-direction: column; }
}
