/* ============================================================
   product_detail.css
   ============================================================ */

.pd-section {
  padding: 40px 0 70px;
}

/* Breadcrumb */
.pd-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 28px;
}
.pd-crumb a { transition: color 0.2s ease; }
.pd-crumb a:hover { color: var(--blue); }
.pd-crumb-current { color: #dcedfc; font-weight: 500; }

/* Main Layout (Media Left, Info Right) */
.pd-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 40px;
  align-items: start;
}

/* ---------- Media Split (3D + Gallery Side-by-Side) ---------- */
.pd-media-wrapper {
  width: 100%;
}

.pd-media-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
}

/* 3D Box */
.pd-3d-box {
  position: relative;
  border-radius: 20px;
  border: 1px solid rgba(22, 162, 255, 0.22);
  background: radial-gradient(circle at center, rgba(14, 111, 255, 0.1), #05101c 70%);
  overflow: hidden;
  height: 420px;
  min-height: 420px; /* Force the height */
}

/* Force the viewer container to fill the box */
.stl-viewer--big {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Force the canvas inside to fill the viewer container */
.stl-viewer--big canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
  outline: none;
  cursor: grab;
}
/* Floating text overlay inside the 3D box */
.stl-hint, .pd-hint {
  position: absolute;
  bottom: 12px;
  left: 0; 
  width: 100%;
  text-align: center;
  font-size: 11.5px;
  letter-spacing: 0.6px;
  color: rgba(200, 220, 240, 0.55);
  pointer-events: none;
  z-index: 2;
}

/* Gallery Box */
.pd-gallery-box {
  border-radius: 20px;
  border: 1px solid rgba(22, 162, 255, 0.22);
  background: rgba(3, 10, 19, 0.98);
  overflow: hidden;
  height: 420px;
  display: flex;
  flex-direction: column;
}

.pd-gallery-full {
  grid-column: 1 / -1;
}

.gallery-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 10px;
}

.gallery-main img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  transition: opacity 0.2s ease, transform 0.4s ease;
}

.gallery-thumbs {
  display: flex;
  gap: 8px;
  padding: 10px;
  overflow-x: auto;
  border-top: 1px solid rgba(56, 129, 210, 0.18);
  background: rgba(3, 10, 19, 0.65);
}

.gallery-thumb {
  flex: 0 0 50px;
  width: 50px; height: 50px;
  border-radius: 8px;
  overflow: hidden;
  padding: 0;
  border: 2px solid transparent;
  background: #07131f;
  cursor: pointer;
  transition: 0.2s ease;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb:hover { border-color: rgba(22, 162, 255, 0.5); }
.gallery-thumb--active { border-color: var(--blue); box-shadow: 0 0 10px rgba(22,162,255,0.4); }

.pd-placeholder {
  display: grid; place-items: center;
  width: 100%; height: 100%;
  font-size: 80px; font-weight: 800;
  color: rgba(22, 162, 255, 0.2);
}

/* ---------- Info Section (Right Side) ---------- */
.pd-cat {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  letter-spacing: 1.8px; text-transform: uppercase;
  color: var(--blue);
  padding: 5px 12px;
  border: 1px solid rgba(22, 162, 255, 0.3);
  border-radius: 999px;
  background: rgba(22, 162, 255, 0.08);
  margin-bottom: 16px;
}

.pd-title {
  font-size: 34px; font-weight: 800;
  line-height: 1.15; letter-spacing: -0.8px;
  margin-bottom: 18px; color: #fff;
}

.pd-price-row {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 22px; flex-wrap: wrap;
}

.pd-price {
  font-size: 32px; font-weight: 800;
  color: var(--blue); letter-spacing: -0.6px;
}

.pd-stock {
  font-size: 12.5px; font-weight: 600;
  padding: 5px 12px; border-radius: 999px;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.35);
  color: #4ade80;
}
.pd-stock--out {
  background: rgba(255, 77, 77, 0.1);
  border-color: rgba(255, 77, 77, 0.35);
  color: #ff6b6b;
}

.pd-desc {
  font-size: 15px; line-height: 1.8;
  color: var(--text-soft);
  margin-bottom: 28px;
}

.pd-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 30px; }

.pd-cta {
  min-height: 50px; padding: 0 26px;
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%) !important;
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.35) !important;
  font-weight: 700;
}
.pd-cta:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(37, 211, 102, 0.5) !important; }

.pd-secondary {
  min-height: 50px; padding: 0 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(22, 162, 255, 0.35);
  background: rgba(22, 162, 255, 0.06);
  color: var(--blue); font-weight: 600; transition: 0.25s ease;
}
.pd-secondary:hover { background: rgba(22, 162, 255, 0.14); border-color: var(--blue); }

.pd-meta {
  list-style: none;
  border-top: 1px solid rgba(56, 129, 210, 0.18);
  padding-top: 20px;
}
.pd-meta li {
  display: flex; justify-content: space-between;
  padding: 11px 0; font-size: 13.5px;
  border-bottom: 1px dashed rgba(56, 129, 210, 0.14);
}
.pd-meta li:last-child { border-bottom: none; }
.pd-meta span { color: var(--text-soft); }
.pd-meta strong { color: #dcedfc; font-weight: 600; }

/* Related Products */
.pd-related {
  margin-top: 70px; padding-top: 40px;
  border-top: 1px solid rgba(56, 129, 210, 0.16);
}
.pd-related-title { font-size: 26px; font-weight: 800; margin-bottom: 22px; }

/* Responsive */
@media (max-width: 1100px) {
  .pd-grid { grid-template-columns: 1fr; gap: 30px; }
  .pd-3d-box, .pd-gallery-box { height: 350px; }
}

@media (max-width: 820px) {
  .pd-media-split { grid-template-columns: 1fr; }
  .pd-title { font-size: 26px; }
  .pd-actions { flex-direction: column; }
  .pd-actions > * { width: 100%; justify-content: center; }
}