/* ================================
   NOTDEAD — product.css
   ================================ */

.product-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding-top: var(--nav-h);
}

/* Skeleton placeholder shown on first paint (Telegram-style opacity pulse).
   JS overwrites the entire #product-wrap innerHTML in renderProduct() — the
   skeleton disappears with the old DOM. Visible for ~100–400 ms on refresh,
   far better than "all content gone." */
.product-skel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  max-width: 1180px;
  margin: 0 auto;
  min-height: calc(100vh - var(--nav-h));
}
.product-skel-gallery {
  margin: 48px 48px 48px 48px;
  background: rgba(232,228,220,0.04);
  border: 1px solid var(--border);
  min-height: 60vh;
  animation: ndSkelPulse 1.4s ease-in-out infinite;
}
.product-skel-details {
  padding: 56px 56px 56px 56px;
  display: flex; flex-direction: column;
}
.product-skel-block {
  background: rgba(232,228,220,0.06);
  animation: ndSkelPulse 1.4s ease-in-out infinite;
  margin-bottom: 14px;
}
.product-skel-badge { width: 90px;  height: 14px; margin-bottom: 18px; }
.product-skel-title { width: 72%;   height: 36px; margin-bottom: 14px; }
.product-skel-price { width: 35%;   height: 28px; margin-bottom: 26px; }
.product-skel-desc  { width: 100%;  height: 12px; margin-bottom: 8px; }
.product-skel-desc.short { width: 60%; margin-bottom: 26px; }
.product-skel-btn   { width: 100%;  height: 48px; margin-top: 10px; }
/* Small stagger so the pulse isn't synchronized across all blocks. */
.product-skel-details .product-skel-block:nth-child(2) { animation-delay: 0.1s; }
.product-skel-details .product-skel-block:nth-child(3) { animation-delay: 0.2s; }
.product-skel-details .product-skel-block:nth-child(4) { animation-delay: 0.3s; }
.product-skel-details .product-skel-block:nth-child(5) { animation-delay: 0.4s; }
.product-skel-details .product-skel-block:nth-child(6) { animation-delay: 0.5s; }
.product-skel-details .product-skel-block:nth-child(7) { animation-delay: 0.6s; }
@keyframes ndSkelPulse {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 1; }
}
@media (max-width: 900px) {
  .product-skel { grid-template-columns: 1fr; }
  /* min-height 60vw — matches the real .product-gallery mobile block below
     so docH doesn't jump when the skeleton is replaced with content. */
  .product-skel-gallery { margin: 24px 20px; min-height: 60vw; }
  .product-skel-details { padding: 32px 20px 48px; }
  .product-skel-title { height: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .product-skel-gallery,
  .product-skel-block { animation: none; }
}

/* Soft fade when the real product content replaces the skeleton (matches the
   feed/post transition). Retriggered from renderProduct() via .nd-fade-in. */
@keyframes ndProductFade { from { opacity: 0; } to { opacity: 1; } }
#product-wrap.nd-fade-in { animation: ndProductFade 0.4s ease; }
@media (prefers-reduced-motion: reduce) { #product-wrap.nd-fade-in { animation: none; } }

.product-page-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  max-width: 1280px;
  margin: 0 auto;
  min-height: calc(100vh - var(--nav-h));
}

/* --- Gallery --- */
.product-gallery {
  padding: 48px 48px 48px 48px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
}

.product-main-img {
  flex: 1;
  background: var(--bg2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  cursor: zoom-in;
}
/* Dark base behind the shimmer — shows a contrasted background instead of an
   empty container while the image is loading. Both go away on .loaded. */
.product-main-img:not(.loaded)::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #0a0a09 0%, #16140f 100%);
  z-index: 0;
}

.product-main-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease, opacity 0.3s ease;
  opacity: 0;
}
.product-main-img.loaded img { opacity: 1; }
.product-main-img:hover img {
  transform: scale(1.03);
}

/* Shimmer placeholder for the main product photo — brighter/more contrasted
   than the card-level shimmer so the eye locks onto it on first paint. */
.product-main-img:not(.loaded)::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(232,228,220,0.13) 50%,
    transparent 100%);
  background-size: 200% 100%;
  animation: ndSkeleton 1.6s linear infinite;
  pointer-events: none; z-index: 1;
}

/* Thumbnail strip also gets a placeholder until the background image loads. */
.product-thumb { background-color: #0e0d0c; }

.zoom-hint {
  position: absolute;
  bottom: 16px; right: 16px;
  background: rgba(8,8,7,0.78);
  color: var(--white);
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  padding: 6px 10px;
  border: 1px solid var(--border2);
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
.product-main-img:hover .zoom-hint { opacity: 1; }

/* Gallery prev/next arrows */
.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  background: rgba(8,8,7,0.6);
  border: 1px solid rgba(232,228,220,0.12);
  color: var(--white);
  font-size: 26px;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  z-index: 3;
}
.gallery-nav:hover { background: rgba(8,8,7,0.9); border-color: var(--white2); }
.gallery-prev { left: 12px; }
.gallery-next { right: 12px; }

.product-emoji-big {
  font-size: 100px;
}

/* Thumbnails */
.product-thumbs {
  display: flex;
  gap: 8px;
}

.product-thumb {
  width: 72px;
  height: 72px;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.2s;
  flex-shrink: 0;
}

.product-thumb.active,
.product-thumb:hover {
  border-color: var(--white2);
}

/* --- Details --- */
.product-details {
  padding: 56px 56px 56px 56px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.product-page-badge {
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--gray);
}

.product-page-name {
  font-family: var(--font-display);
  font-size: clamp(48px, 5vw, 80px);
  letter-spacing: 3px;
  line-height: 1;
  color: var(--white);
}

.product-page-price {
  font-family: var(--font-display);
  font-size: 40px;
  letter-spacing: 2px;
  color: var(--white);
}

.product-page-desc {
  font-size: 15px;
  color: var(--white2);
  line-height: 1.8;
  max-width: 480px;
  white-space: pre-line;
}

/* Sizes */
.product-page-sizes-label {
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: -8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.size-chart-btn {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--white2);
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  padding: 6px 12px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.size-chart-btn:hover { border-color: var(--white); color: var(--white); }

/* Buy button */
.btn-buy {
  width: 100%;
  text-align: center;
  font-size: 18px;
  padding: 18px;
  margin-top: 8px;
}

/* Buy now */
.btn-checkout-direct {
  display: block;
  text-align: center;
  font-family: var(--font-ui);
  font-size: 13px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--gray);
  padding: 14px;
  border: 1px solid var(--border);
  transition: color 0.2s, border-color 0.2s;
}

.btn-checkout-direct:hover {
  color: var(--white);
  border-color: var(--border2);
}

/* Meta info */
.product-page-meta {
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.meta-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.meta-key {
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gray);
}

.meta-val {
  font-family: var(--font-ui);
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--white2);
}

/* --- Related products --- */
.related-section {
  position: relative;
  z-index: 1;
  padding: 64px 48px;
  border-top: 1px solid var(--border);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  margin-top: 32px;
}

/* Related card — image + overlay */
.related-card {
  cursor: pointer;
  position: relative;
  overflow: hidden;
  background: var(--bg2);
}

.related-card:hover .related-img img {
  transform: scale(1.05);
}

.related-img {
  aspect-ratio: 1;
  position: relative;
  overflow: hidden;
  background: #0e0d0c;
}

.related-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s cubic-bezier(.25,.46,.45,.94);
}

.related-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}

.related-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 32px 20px 18px;
  background: linear-gradient(transparent, rgba(8,8,7,0.92) 60%);
  pointer-events: none;
}

.related-info-name {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 1px;
  color: var(--white);
  line-height: 1.1;
}

.related-info-price {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--white2);
  margin-top: 6px;
}

/* --- Lightbox --- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 60px 20px;
}
.lightbox.show { display: flex; }

.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  animation: lb-fade 0.25s ease;
}
@keyframes lb-fade { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: scale(1); } }

.lightbox-close {
  position: absolute;
  top: 20px; right: 24px;
  width: 44px; height: 44px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--white);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s;
  z-index: 2;
}
.lightbox-close:hover { background: rgba(255,255,255,0.18); }

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 54px; height: 54px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--white);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, border-color 0.2s;
  z-index: 2;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.16); border-color: var(--white); }
.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }

.lightbox-counter {
  position: absolute;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  color: var(--white2);
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 4px;
}

/* --- Size chart modal --- */
.size-chart-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.94);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 40px 20px;
}
.size-chart-modal.show { display: flex; }

.size-chart-inner {
  position: relative;
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.size-chart-inner img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  display: block;
}
.size-chart-close {
  position: absolute;
  top: -42px; right: 0;
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--white);
  font-size: 22px; line-height: 1;
  cursor: pointer;
  transition: background 0.2s;
}
.size-chart-close:hover { background: rgba(255,255,255,0.25); }

/* --- Responsive --- */
@media (max-width: 900px) {
  .product-page-inner {
    grid-template-columns: 1fr;
  }
  .product-gallery {
    position: static;
    height: auto;
    padding: 24px 20px;
    border-right: none;
    border-bottom: 1px solid var(--border);
    min-height: 60vw;
  }
  .product-details {
    padding: 32px 20px 48px;
  }
  .related-section { padding: 48px 20px; }
  .related-grid { grid-template-columns: 1fr 1fr; }
}
