/* ==========================================================================
   GCE Technology - Product Detail Page Styles (Alibaba-inspired)
   ========================================================================== */

/* Loading skeleton */
.pd-loading {
  padding: 60px 0 80px;
}

.pd-skeleton-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  align-items: start;
}

.pd-skeleton {
  background: linear-gradient(90deg, #1e293b 0%, #334155 50%, #1e293b 100%);
  background-size: 200% 100%;
  animation: pdShimmer 1.6s ease-in-out infinite;
  border-radius: 8px;
}

.pd-skel-gallery { height: 460px; }

.pd-skel-info { padding: 20px 0; }
.pd-skel-line { height: 18px; margin: 14px 0; border-radius: 6px; }
.pd-skel-title { height: 36px; width: 70%; }
.pd-skel-line-sm { width: 40%; }
.pd-skel-line-md { width: 85%; }

@keyframes pdShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Error state */
.pd-error {
  padding: 80px 0;
  text-align: center;
}

.pd-error-box {
  max-width: 540px;
  margin: 0 auto;
  padding: 40px 32px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 12px;
}

.pd-error-box h2 {
  color: #fca5a5;
  margin: 0 0 12px;
  font-size: 22px;
}

.pd-error-box p {
  color: #cbd5e1;
  margin: 0;
}

/* Main layout */
.pd-main {
  display: block;
}

/* Hero grid */
.pd-hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 48px;
  align-items: start;
}

/* ============ Gallery ============ */
.pd-gallery {
  position: sticky;
  top: 90px;
}

.pd-gallery-main {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #0f172a;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.pd-gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.4s ease;
  cursor: zoom-in;
}

.pd-gallery-main img:hover {
  transform: scale(1.03);
}

.pd-gallery-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: #64748b;
  font-size: 14px;
}

.pd-gallery-icon {
  font-size: 64px;
  opacity: 0.6;
}

.pd-gallery-zoom {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  border: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.pd-gallery-main:hover .pd-gallery-zoom {
  opacity: 1;
}

.pd-gallery-thumbs {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.pd-gallery-thumbs::-webkit-scrollbar {
  height: 4px;
}
.pd-gallery-thumbs::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 2px;
}

.pd-thumb {
  flex: 0 0 80px;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #1e293b;
  cursor: pointer;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
}

.pd-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pd-thumb:hover {
  border-color: #475569;
  transform: translateY(-2px);
}

.pd-thumb.active {
  border-color: #fbbf24;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.2);
}

.pd-thumb-video {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  color: #fff;
  font-size: 24px;
}

/* ============ Info ============ */
.pd-info {
  padding-top: 8px;
}

.pd-info-category {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  margin-bottom: 12px;
}

.pd-info-title {
  font-size: 28px;
  line-height: 1.25;
  font-weight: 700;
  margin: 0 0 12px;
  color: #f1f5f9;
}

.pd-info-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 13px;
  color: #94a3b8;
}

.pd-info-meta-code {
  font-family: 'Courier New', monospace;
  background: #1e293b;
  padding: 3px 10px;
  border-radius: 4px;
  color: #cbd5e1;
}

.pd-info-meta-badge {
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
  padding: 3px 10px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.pd-info-desc {
  color: #cbd5e1;
  font-size: 14px;
  line-height: 1.7;
  margin: 0 0 24px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Key specs grid */
.pd-info-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 24px;
}

.pd-info-spec-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pd-info-spec-card-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 6px;
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.pd-info-spec-card-body {
  min-width: 0;
  flex: 1;
}

.pd-info-spec-card-label {
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.pd-info-spec-card-value {
  font-size: 14px;
  font-weight: 600;
  color: #f1f5f9;
  word-break: break-word;
}

/* CTAs */
.pd-info-cta {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.pd-info-cta .btn {
  flex: 1;
  min-width: 160px;
  text-align: center;
  justify-content: center;
}

/* Quick info row */
.pd-info-quick {
  display: flex;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid #1e293b;
  border-bottom: 1px solid #1e293b;
  flex-wrap: wrap;
}

.pd-info-quick-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #94a3b8;
}

.pd-info-quick-icon {
  color: #fbbf24;
  font-size: 14px;
}

/* ============ Tabs ============ */
.pd-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid #1e293b;
  margin-bottom: 28px;
  overflow-x: auto;
}

.pd-tab {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 20px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  white-space: nowrap;
}

.pd-tab:hover {
  color: #cbd5e1;
}

.pd-tab.active {
  color: #fbbf24;
  border-bottom-color: #fbbf24;
}

.pd-tab-panel {
  animation: pdFadeIn 0.3s ease;
}

@keyframes pdFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.pd-section-title {
  font-size: 22px;
  font-weight: 700;
  color: #f1f5f9;
  margin: 0 0 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid #1e293b;
}

/* Description body */
.pd-desc-body {
  color: #cbd5e1;
  line-height: 1.8;
  font-size: 15px;
}

.pd-desc-body p {
  margin: 0 0 16px;
}

.pd-desc-body ul, .pd-desc-body ol {
  margin: 0 0 16px;
  padding-left: 24px;
}

.pd-desc-body li {
  margin-bottom: 8px;
}

.pd-desc-body strong {
  color: #f1f5f9;
}

.pd-desc-body h3 {
  font-size: 19px;
  color: #f1f5f9;
  margin: 0 0 14px;
}

.pd-desc-body a {
  color: #06B6D4;
  text-decoration: underline;
}

.pd-desc-body a:hover {
  color: #22d3ee;
}

.pd-desc-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 10px 0;
}

.pd-desc-body blockquote {
  border-left: 3px solid #D4AF37;
  margin: 0 0 16px;
  padding: 8px 16px;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.03);
}

/* Spec table */
.pd-spec-table {
  width: 100%;
  border-collapse: collapse;
  background: #0f172a;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #1e293b;
}

.pd-spec-table tr {
  border-bottom: 1px solid #1e293b;
  transition: background 0.15s;
}

.pd-spec-table tr:nth-child(even) {
  background: rgba(251, 191, 36, 0.03);
}

.pd-spec-table tr:hover {
  background: rgba(251, 191, 36, 0.06);
}

.pd-spec-table td {
  padding: 14px 18px;
  font-size: 14px;
}

.pd-spec-table td:first-child {
  width: 35%;
  color: #94a3b8;
  font-weight: 500;
  background: #1e293b;
}

.pd-spec-table td:last-child {
  color: #e2e8f0;
  font-weight: 500;
}

/* Video */
.pd-video-wrapper {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

.pd-video-wrapper iframe,
.pd-video-wrapper video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  border: 1px solid #1e293b;
  background: #000;
}

/* Resources */
.pd-resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.pd-resource-card {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.2s;
}

.pd-resource-card:hover {
  border-color: #fbbf24;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.pd-resource-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 8px;
  background: rgba(251, 191, 36, 0.1);
  color: #fbbf24;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.pd-resource-info {
  flex: 1;
  min-width: 0;
}

.pd-resource-info h4 {
  margin: 0 0 4px;
  font-size: 15px;
  color: #f1f5f9;
}

.pd-resource-info p {
  margin: 0;
  font-size: 12px;
  color: #94a3b8;
}

/* ============ Related products ============ */
.pd-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.pd-related-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  overflow: hidden;
  transition: all 0.25s;
  text-decoration: none;
  display: block;
  color: inherit;
}

.pd-related-card:hover {
  border-color: #fbbf24;
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.3);
}

.pd-related-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #0f172a;
  overflow: hidden;
}

.pd-related-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

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

.pd-related-body {
  padding: 14px;
}

.pd-related-title {
  font-size: 14px;
  font-weight: 600;
  color: #f1f5f9;
  margin: 0 0 6px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pd-related-spec {
  font-size: 12px;
  color: #94a3b8;
}

.pd-related-cta {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  color: #fbbf24;
  font-weight: 600;
}

/* ============ Responsive ============ */
@media (max-width: 960px) {
  .pd-skeleton-grid {
    grid-template-columns: 1fr;
  }
  .pd-skel-gallery {
    height: 360px;
  }
  .pd-hero-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .pd-gallery {
    position: static;
  }
  .pd-info-title {
    font-size: 24px;
  }
  .pd-info-specs {
    grid-template-columns: 1fr;
  }
  .pd-info-cta .btn {
    flex: 1 1 calc(50% - 5px);
  }
}

@media (max-width: 600px) {
  .pd-info-title {
    font-size: 22px;
  }
  .pd-info-cta {
    flex-direction: column;
  }
  .pd-info-cta .btn {
    width: 100%;
  }
  .pd-tab {
    padding: 10px 14px;
    font-size: 14px;
  }
  .pd-spec-table td {
    padding: 10px 12px;
    font-size: 13px;
  }
  .pd-related-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }
}