/* Product detail popup, shared by the category pages and the flooring page. */
:root {
  --surface: var(--panel);
  --card: var(--panel);
  --border: var(--line);
  --accent-hover: var(--accent-dark);
  --accent-light: var(--accent-soft);
  --white: #ffffff;
  --navy: var(--text);
  --green: var(--good);
  --green-bg: var(--good-soft);
  --yellow: var(--warn);
  --yellow-bg: var(--warn-soft);
  --red: var(--bad);
  --red-bg: var(--bad-soft);
  --shadow-sm: 0 1px 3px rgba(28,34,43,.10);
  --shadow-xl: 0 20px 40px -8px rgba(28,34,43,.25);
}
.spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
/* ── PRODUCT DETAIL MODAL ── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.65);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  padding: 16px;
}
.overlay.open { opacity: 1; pointer-events: all; }
.detail-modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 860px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(.96) translateY(12px);
  transition: transform .25s ease;
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
  box-shadow: var(--shadow-xl);
}
.overlay.open .detail-modal { transform: scale(1) translateY(0); }
.detail-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all .15s;
}
.detail-close:hover { background: var(--border); color: var(--text); }

.detail-gallery {
  background: var(--surface);
  border-radius: 20px 0 0 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.gallery-main {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  background: var(--surface);
}
.gallery-main img { width: 100%; height: 100%; object-fit: contain; transition: opacity .18s; }
.gallery-main .no-img { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; opacity: .2; width: 100%; height: 100%; }
.gallery-main .no-img i { font-size: 56px; }
.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  background: rgba(16,22,30,0.9);
  border: 1.5px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text);
  z-index: 5;
  transition: all .15s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  line-height: 1;
}
.gallery-nav:hover { background: var(--border); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.gallery-prev { left: 10px; }
.gallery-next { right: 10px; }
.gallery-counter {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
}
.detail-thumbs {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  overflow-x: auto;
  background: var(--surface);
  border-top: 1px solid var(--border);
  scrollbar-width: none;
  flex-shrink: 0;
}
.detail-thumbs::-webkit-scrollbar { display: none; }
.detail-thumb { width: 52px; height: 44px; border-radius: 8px; object-fit: cover; border: 2px solid transparent; cursor: pointer; opacity: .55; transition: all .15s; flex-shrink: 0; }
.detail-thumb.active, .detail-thumb:hover { border-color: var(--accent); opacity: 1; }

.detail-info { padding: 32px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; }
.detail-cat { font-size: 11px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .7px; }
.detail-name { font-size: 20px; font-weight: 800; color: var(--text); line-height: 1.3; letter-spacing: -.3px; }
.detail-price { font-size: 30px; font-weight: 900; color: var(--accent); letter-spacing: -.5px; }
.detail-price .unit { font-size: 14px; color: var(--muted); font-weight: 500; }
.detail-price.no-price { font-size: 16px; color: var(--muted); font-weight: 500; }

.detail-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--muted);
}
.detail-tag.in_stock { background: var(--green-bg); border-color: #bbf7d0; color: var(--green); }
.detail-tag.low_stock { background: var(--yellow-bg); border-color: #fde68a; color: var(--yellow); }
.detail-tag.out_stock { background: var(--red-bg); border-color: #fecaca; color: var(--red); }

.detail-qty {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.detail-qty-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.detail-qty-value { font-size: 26px; font-weight: 900; letter-spacing: -.5px; }
.detail-qty-unit { font-size: 11px; color: var(--muted); margin-top: 2px; }

.detail-desc { font-size: 13px; color: var(--muted); line-height: 1.75; }

.detail-cta {
  background: var(--accent-light);
  border: 1.5px solid #bfdbfe;
  border-radius: 12px;
  padding: 16px;
}
.detail-cta p { font-size: 12px; color: var(--muted); margin-bottom: 10px; font-weight: 500; }
.detail-cta a { color: var(--accent); text-decoration: none; font-weight: 700; font-size: 14px; }
.detail-cta a:hover { text-decoration: underline; }

@media (max-width: 680px) {
  .detail-modal { grid-template-columns: 1fr; }
  .detail-gallery { border-radius: 20px 20px 0 0; }
  .gallery-main { min-height: 220px; }
}

.detail-brand { font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: -8px; }
