
:root{--bg:var(--tg-theme-bg-color,#f4f5f7);--surface:var(--tg-theme-secondary-bg-color,#fff);--text:var(--tg-theme-text-color,#15171a);--muted:var(--tg-theme-hint-color,#717781);--accent:var(--tg-theme-button-color,#6d42dd);--accent-text:var(--tg-theme-button-text-color,#fff);--border:rgba(30,34,40,.1);--success-bg:#e8f7ec;--success-text:#23773c;--radius:18px}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:var(--bg);color:var(--text);font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}body{padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}button,input,select{font:inherit}button{cursor:pointer}.app-shell{width:min(100%,760px);margin:0 auto;padding:14px}.store-header,.store-identity,.detail-heading,.detail-price-row,.filter-row{display:flex;align-items:center}.store-header{justify-content:space-between;gap:14px;padding:8px 2px 16px}.store-identity{gap:12px}.store-logo{width:48px;height:48px;border-radius:15px;display:grid;place-items:center;background:var(--accent);color:var(--accent-text);font-weight:800}.eyebrow{margin:0 0 4px;color:var(--muted);font-size:12px;text-transform:uppercase;letter-spacing:.08em}h1,h2,h3,p{margin-top:0}h1{margin-bottom:2px;font-size:21px}.store-meta{margin:0;color:var(--muted);font-size:13px}.icon-button,.dialog-close{border:0;background:var(--surface);color:var(--text);border-radius:14px;box-shadow:0 1px 0 var(--border)}.icon-button{width:44px;height:44px}.hero{display:flex;justify-content:space-between;gap:18px;align-items:center;padding:20px;border-radius:22px;background:var(--surface);border:1px solid var(--border)}.hero h2{margin-bottom:7px;font-size:25px}.hero p:last-child{margin:0;color:var(--muted);line-height:1.45}.hero-badge{min-width:76px;height:76px;border-radius:22px;display:grid;place-content:center;text-align:center;background:color-mix(in srgb,var(--accent) 12%,var(--surface))}.hero-badge span{font-size:26px;font-weight:800;color:var(--accent)}.hero-badge small{color:var(--muted)}.controls{padding:16px 0 10px}.search-box{display:flex;align-items:center;gap:10px;padding:0 14px;border-radius:15px;background:var(--surface);border:1px solid var(--border)}.search-box input{width:100%;padding:14px 0;border:0;outline:none;color:var(--text);background:transparent}.filter-row{gap:8px;margin-top:10px;overflow-x:auto;scrollbar-width:none}.filter-row::-webkit-scrollbar{display:none}.filter-row select{flex:1 0 auto;min-width:130px;padding:11px 12px;border:1px solid var(--border);border-radius:13px;background:var(--surface);color:var(--text)}.status-panel{padding:14px;border-radius:14px;color:var(--muted);background:var(--surface);border:1px solid var(--border)}.status-panel.hidden{display:none}.product-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:4px 0 24px}.product-card{overflow:hidden;border-radius:var(--radius);background:var(--surface);border:1px solid var(--border);transition:transform .15s ease}.product-card:active{transform:scale(.985)}.product-image{position:relative;aspect-ratio:1/1;display:grid;place-items:center;overflow:hidden;background:color-mix(in srgb,var(--surface) 85%,#cdd3dc)}.product-image img{width:100%;height:100%;object-fit:cover}.product-placeholder{font-size:44px;opacity:.7}.discount-badge{position:absolute;right:8px;bottom:8px;padding:5px 8px;border-radius:9px;background:var(--accent);color:var(--accent-text);font-size:12px;font-weight:700}.product-body{padding:11px}.product-brand{color:var(--muted);font-size:12px}.product-title{margin:3px 0 7px;min-height:38px;font-size:15px;line-height:1.25}.product-meta{margin-bottom:10px;color:var(--muted);font-size:12px}.product-price{font-size:16px;font-weight:800}.product-old-price{display:block;margin-top:3px;color:var(--muted);font-size:12px;text-decoration:line-through}.empty-state{padding:48px 20px;text-align:center;color:var(--muted)}.empty-state h3{color:var(--text);margin-bottom:8px}.empty-icon{font-size:42px}.hidden{display:none!important}dialog{width:min(100% - 20px,720px);max-height:calc(100vh - 20px);padding:0;border:0;border-radius:24px;color:var(--text);background:var(--surface)}dialog::backdrop{background:rgba(5,7,10,.58);backdrop-filter:blur(4px)}.product-detail{position:relative}.dialog-close{position:absolute;z-index:2;top:12px;right:12px;width:38px;height:38px}.detail-gallery{min-height:280px;display:flex;overflow-x:auto;scroll-snap-type:x mandatory;background:color-mix(in srgb,var(--surface) 80%,#cad0da)}.detail-gallery img,.detail-gallery .gallery-placeholder{flex:0 0 100%;width:100%;min-height:280px;object-fit:cover;scroll-snap-align:start}.gallery-placeholder{display:grid;place-items:center;font-size:64px}.detail-content{padding:20px}.detail-heading{justify-content:space-between;align-items:flex-start;gap:12px}.detail-heading h2{margin-bottom:8px}.condition-chip{flex:none;padding:7px 10px;border-radius:999px;background:var(--success-bg);color:var(--success-text);font-size:12px;font-weight:700}.detail-price-row{gap:10px;margin:12px 0 18px}.detail-price-row strong{color:var(--accent);font-size:25px}.detail-price-row span{color:var(--muted);text-decoration:line-through}.spec-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;margin:0}.spec-grid div{padding:13px;border-radius:14px;background:var(--bg)}.spec-grid dt{color:var(--muted);font-size:12px}.spec-grid dd{margin:4px 0 0;font-weight:700}.description-block{padding:18px 0 8px}.description-block p{color:var(--muted);line-height:1.55;white-space:pre-line}.primary-button,.contact-action{width:100%;border:0;border-radius:15px;font-weight:700}.primary-button{padding:15px;background:var(--accent);color:var(--accent-text)}.contact-sheet{position:relative;padding:24px}.contact-actions{display:grid;gap:10px;margin-top:18px}.contact-action{padding:14px;text-align:left;background:var(--bg);color:var(--text);border:1px solid var(--border)}.contact-action strong,.contact-action span{display:block}.contact-action span{margin-top:3px;color:var(--muted);font-size:12px}@media(max-width:390px){.app-shell{padding:10px}.hero{padding:16px}.hero-badge{min-width:66px;height:66px}.product-grid{gap:9px}.product-body{padding:9px}}@media(min-width:620px){.product-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}

.detail-gallery video {
  flex: 0 0 100%;
  width: 100%;
  min-height: 280px;
  max-height: 520px;
  object-fit: contain;
  background: #000;
  scroll-snap-align: start;
}


/* v0.5 — product card polish */
.product-card {
  cursor: pointer;
}

.product-card:hover {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
}

.availability-badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 5px 8px;
  border-radius: 9px;
  background: rgba(20, 20, 20, .72);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  backdrop-filter: blur(6px);
}

.product-package {
  min-height: 30px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.detail-gallery-wrap {
  position: relative;
}

.gallery-counter {
  position: absolute;
  right: 14px;
  bottom: 12px;
  z-index: 2;
  min-width: 46px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(20,20,20,.68);
  color: #fff;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(8px);
}

.spec-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.spec-wide {
  grid-column: 1 / -1;
}

.seller-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg);
}

.seller-panel-logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 800;
}

.seller-panel-text {
  min-width: 0;
}

.seller-panel-text span,
.seller-panel-text small {
  display: block;
  color: var(--muted);
}

.seller-panel-text span {
  margin-bottom: 2px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.seller-panel-text strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seller-panel-text small {
  margin-top: 2px;
  font-size: 12px;
}

.sticky-action {
  position: sticky;
  bottom: 0;
  padding-top: 10px;
  padding-bottom: max(2px, env(safe-area-inset-bottom));
  background:
    linear-gradient(
      to bottom,
      color-mix(in srgb, var(--surface) 0%, transparent),
      var(--surface) 28%
    );
}

.detail-content {
  padding-bottom: 14px;
}

@media (max-width: 520px) {
  dialog.product-dialog {
    width: 100%;
    max-width: none;
    height: calc(100dvh - env(safe-area-inset-top));
    max-height: none;
    margin: env(safe-area-inset-top) 0 0;
    border-radius: 22px 22px 0 0;
  }

  .product-detail {
    min-height: 100%;
  }

  .detail-gallery,
  .detail-gallery img,
  .detail-gallery video,
  .detail-gallery .gallery-placeholder {
    min-height: 330px;
  }

  .detail-content {
    padding: 18px 16px 12px;
  }
}
