
/* ══════════════════════════════════════════
   CSS VARIABLES
══════════════════════════════════════════ */
:root {
  --bg:        #09090b;
  --surface:   #111113;
  --card:      #18181b;
  --border:    #27272a;
  --border-l:  #3f3f46;
  --text:      #fafafa;
  --muted:     #71717a;
  --subtle:    #3f3f46;
  --accent:    #6ee7b7;
  --accent-d:  #34d399;
  --accent-l:  rgba(110,231,183,.08);
  --accent2:   #818cf8;
  --accent2-l: rgba(129,140,248,.08);
  --danger:    #f87171;
  --success:   #4ade80;
  --shadow:    0 2px 16px rgba(0,0,0,.5);
  --r:         10px;
  --r-lg:      16px;
  --r-xl:      20px;
}

/* ══════════════════════════════════════════
   BASE RESET
══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }

/* ══════════════════════════════════════════
   LAYOUT WRAPPER
══════════════════════════════════════════ */
.detail-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 80px;
  position: relative;
  z-index: 1;
  width: 100%;
}

/* ══════════════════════════════════════════
   BREADCRUMB
══════════════════════════════════════════ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .76rem;
  color: var(--muted);
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
  transition: color .2s;
}
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep   { color: var(--subtle); font-size: .7rem; }
.breadcrumb .curr  {
  color: var(--text);
  font-weight: 500;
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ══════════════════════════════════════════
   TWO-COLUMN GRID (desktop only)
══════════════════════════════════════════ */
.product-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 52px;
  align-items: start;
  width: 100%;
}

/* ══════════════════════════════════════════
   IMAGE PANEL
══════════════════════════════════════════ */
.img-panel {
  position: sticky;
  top: 120px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.img-main {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  position: relative;
}
.img-main::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(110,231,183,.04), transparent 70%);
  pointer-events: none;
}
.img-main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 28px;
  transition: transform .5s cubic-bezier(.25,.46,.45,.94);
  position: relative;
  z-index: 1;
}
.img-main:hover img { transform: scale(1.05); }

.img-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--subtle);
}
.img-placeholder span { font-size: 5rem; opacity: .15; }
.img-placeholder p    { font-size: .82rem; font-weight: 500; color: var(--muted); }

/* Image meta strip */
.img-meta-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  flex-wrap: wrap;
}
.img-meta-strip span {
  font-size: .7rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.ms-divider {
  width: 1px;
  height: 14px;
  background: var(--border);
  flex-shrink: 0;
}

/* ══════════════════════════════════════════
   INFO PANEL
══════════════════════════════════════════ */
.info-panel {
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: 100%;
  min-width: 0;
}

/* Category tag */
.product-cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--accent2);
  background: var(--accent2-l);
  padding: 5px 13px;
  border-radius: 6px;
  width: fit-content;
  max-width: 100%;
  border: 1px solid rgba(129,140,248,.15);
}

/* Title */
.product-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -.5px;
  line-height: 1.3;
  color: var(--text);
  word-break: break-word;
  margin: 0;
}

/* Source link */
.product-link-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  text-decoration: none;
  color: var(--muted);
  font-size: .75rem;
  font-family: 'JetBrains Mono', monospace;
  transition: all .2s;
  overflow: hidden;
  width: 100%;
}
.product-link-box:hover {
  background: var(--accent-l);
  border-color: rgba(110,231,183,.2);
  color: var(--accent);
}
.product-link-box .link-icon { flex-shrink: 0; }
.product-link-box .link-url {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* Price + stock row */
.price-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.price {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: -1.5px;
  line-height: 1;
}
.stock-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: .78rem;
  font-weight: 700;
  padding: 7px 15px;
  border-radius: 20px;
  white-space: nowrap;
}
.stock-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  animation: blink 2s ease infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: .3; }
}
.badge-in  { background: rgba(74,222,128,.12);  color: var(--success); border: 1px solid rgba(74,222,128,.25); }
.badge-in::before  { background: var(--success); }
.badge-out { background: rgba(248,113,113,.10); color: var(--danger);  border: 1px solid rgba(248,113,113,.20); }
.badge-out::before { background: var(--danger); animation: none; }

/* CTA buttons */
.cta-row {
  display: flex;
  gap: 12px;
  width: 100%;
}

.btn-primary {
  flex: 1;
  min-width: 0;
  padding: 14px 24px;
  background: var(--accent);
  color: #09090b;
  border: none;
  border-radius: var(--r);
  font-family: 'Outfit', sans-serif;
  font-size: .95rem;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all .25s;
  box-shadow: 0 4px 24px rgba(110,231,183,.25);
  letter-spacing: .2px;
  text-align: center;
}
.btn-primary:hover {
  background: var(--accent-d);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(110,231,183,.3);
}
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  padding: 14px 20px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-family: 'Outfit', sans-serif;
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all .2s;
  white-space: nowrap;
}
.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border-l);
  background: var(--surface);
}

/* Description */
.desc-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-l);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  font-size: .875rem;
  color: var(--muted);
  line-height: 1.8;
  word-break: break-word;
}

/* Details table */
.details-table {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  width: 100%;
}
.details-table-head {
  padding: 14px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.details-table-head::before {
  content: '';
  width: 3px;
  height: 12px;
  background: var(--accent2);
  border-radius: 2px;
  flex-shrink: 0;
}
.detail-row {
  display: flex;
  align-items: flex-start;
  padding: 13px 20px;
  border-bottom: 1px solid var(--border);
  font-size: .83rem;
  transition: background .15s;
}
.detail-row:last-child { border-bottom: none; }
.detail-row:hover      { background: rgba(255,255,255,.02); }
.dk {
  width: 130px;
  flex-shrink: 0;
  color: var(--muted);
  font-weight: 500;
  padding-top: 1px;
}
.dv {
  color: var(--text);
  font-weight: 600;
  flex: 1;
  min-width: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: .76rem;
  word-break: break-all;
  line-height: 1.6;
}

/* ══════════════════════════════════════════
   RESPONSIVE — TABLET  ≤ 1024px
══════════════════════════════════════════ */
@media screen and (max-width: 1024px) {
  .product-grid  { gap: 36px !important; }
  .product-title { font-size: 1.55rem !important; }
  .price         { font-size: 2.1rem  !important; }
  .img-panel     { top: 90px !important; }
}

/* ══════════════════════════════════════════
   RESPONSIVE — MOBILE  ≤ 768px
══════════════════════════════════════════ */
@media screen and (max-width: 768px) {
  .detail-wrap {
    padding: 20px 16px 56px !important;
  }

  /* ★ CORE FIX — force single column */
  .product-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  /* Unstick image panel */
  .img-panel {
    position: static !important;
    top: auto !important;
    width: 100% !important;
  }

  /* Cap image on mobile */
  .img-main {
    height: 300px !important;
    max-height: 300px !important;
    aspect-ratio: unset !important;
  }

  .product-title { font-size: 1.3rem  !important; }
  .price         { font-size: 1.85rem !important; letter-spacing: -1px !important; }
  .info-panel    { gap: 18px !important; }

  /* Buttons — full width stacked */
  .cta-row {
    flex-direction: column !important;
    gap: 10px !important;
  }
  .btn-primary {
    width: 100% !important;
    flex: none !important;
    justify-content: center !important;
  }
  .btn-ghost {
    width: 100% !important;
    justify-content: center !important;
  }

  .dk { width: 110px !important; }
}

/* ══════════════════════════════════════════
   RESPONSIVE — SMALL PHONE  ≤ 480px
══════════════════════════════════════════ */
@media screen and (max-width: 480px) {
  .detail-wrap {
    padding: 14px 12px 48px !important;
  }
  .breadcrumb {
    font-size: .68rem !important;
    margin-bottom: 16px !important;
    gap: 4px !important;
  }
  .breadcrumb .curr {
    max-width: 150px !important;
  }
  .img-main {
    height: 240px !important;
    max-height: 240px !important;
  }
  .img-main img {
    padding: 16px !important;
  }
  .img-meta-strip {
    gap: 6px !important;
    padding: 10px 12px !important;
  }
  .ms-divider {
    display: none !important;
  }
  .img-meta-strip span {
    font-size: .63rem !important;
  }
  .product-cat   { font-size: .62rem !important; padding: 4px 10px !important; }
  .product-title { font-size: 1.1rem !important; }
  .price         { font-size: 1.55rem !important; }
  .price-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
    padding: 16px 0 !important;
  }
  .btn-primary,
  .btn-ghost {
    font-size: .88rem !important;
    padding: 13px 18px !important;
  }
  .desc-box {
    font-size: .82rem !important;
    padding: 14px 16px 14px 18px !important;
  }
  .detail-row {
    flex-direction: column !important;
    gap: 3px !important;
    padding: 11px 14px !important;
  }
  .dk {
    width: auto !important;
    font-size: .71rem !important;
  }
  .dv { font-size: .78rem !important; }
  .details-table-head {
    font-size: .62rem !important;
    padding: 12px 14px !important;
  }
  .product-link-box {
    font-size: .68rem !important;
    padding: 9px 12px !important;
  }
}

/* ══════════════════════════════════════════
   RESPONSIVE — EXTRA SMALL  ≤ 360px
══════════════════════════════════════════ */
@media screen and (max-width: 360px) {
  .product-title  { font-size: 1rem    !important; }
  .price          { font-size: 1.35rem !important; }
  .img-meta-strip { display: none      !important; }
  .detail-wrap    { padding: 12px 10px 40px !important; }
}
