/* ═══════════════════════════════════════════════════════════════
   IVA Cloud — Product Detail Page Styles
   Uses CSS variables from tokens.css
═══════════════════════════════════════════════════════════════ */

/* ─── PRODUCT PAGE TOP WRAPPER ──────────────────────────────── */
.product-page-top {
  position: relative;
  overflow: hidden;
  background: var(--bg-deep);
}

.product-page-top::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: radial-gradient(
    ellipse 60% 40% at 50% 0%,
    rgba(0, 199, 209, 0.18) 0%,
    rgba(0, 199, 209, 0.08) 25%,
    rgba(0, 199, 209, 0.02) 50%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}

.product-page-top > * {
  position: relative;
  z-index: 1;
}

/* ─── BREADCRUMBS ───────────────────────────────────────────── */
.product-breadcrumbs {
  padding: calc(var(--navbar-height) + 1.5rem) 0 0;
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.85rem;
}

.breadcrumb-list a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.breadcrumb-list a:hover {
  color: var(--text-on-dark);
}

.breadcrumb-list svg {
  color: var(--text-muted);
  opacity: 0.5;
  flex-shrink: 0;
}

.breadcrumb-current {
  color: var(--text-on-dark);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

/* ─── PRODUCT HERO ──────────────────────────────────────────── */
.product-hero {
  padding: 2rem 0 5rem;
}

/* Hero 2-column grid */
.product-hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  position: relative;
  z-index: 2;
}

@media (min-width: 900px) {
  .product-hero-grid {
    grid-template-columns: 1.2fr 1fr;
    gap: 4rem;
    align-items: start;
  }
}

/* ─── GALLERY ───────────────────────────────────────────────── */
.product-gallery {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Main image */
.gallery-main {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.5s var(--ease-premium);
  box-sizing: border-box;
}

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

/* Placeholder */
.gallery-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-elevated), var(--bg-card-dark));
  color: var(--text-on-dark);
}

.gallery-placeholder svg {
  opacity: 0.12;
}

/* Thumbnails */
.gallery-thumbs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.gallery-thumb {
  width: 80px;
  height: 80px;
  border: 2px solid var(--border-dark);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-elevated);
  padding: 0;
  flex-shrink: 0;
  transition: border-color var(--transition-base),
              transform var(--transition-fast);
}

.gallery-thumb:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.gallery-thumb.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
  box-sizing: border-box;
}

/* ─── PRODUCT INFO ──────────────────────────────────────────── */
.product-info {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

@media (min-width: 900px) {
  .product-info {
    position: sticky;
    top: calc(var(--navbar-height) + 1.5rem);
  }
}

/* Eyebrow — category */
.product-eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  color: var(--accent);
}

/* H1 */
.product-title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: var(--ls-tight);
  color: var(--text-on-dark);
  margin: 0;
  line-height: 1.1;
}

/* Short description */
.product-short-desc {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

/* ─── PRICE BLOCK ───────────────────────────────────────────── */
.product-price-block {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.price-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  color: var(--text-muted);
}

.price-value {
  font-family: var(--font-mono);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  color: var(--text-on-dark);
  letter-spacing: -0.03em;
  line-height: 1;
}

.price-per-month {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: lowercase;
  align-self: flex-end;
  padding-bottom: 0.15em;
}

/* ─── AVAILABILITY ──────────────────────────────────────────── */
.product-availability {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.availability-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.availability-dot--green {
  background: var(--success);
  box-shadow: 0 0 6px rgba(0, 196, 140, 0.5);
}

.availability-dot--yellow {
  background: #F5A623;
  box-shadow: 0 0 6px rgba(245, 166, 35, 0.4);
}

.availability-text {
  font-size: 0.875rem;
  color: var(--success);
  font-weight: 500;
}

.availability-text--order {
  color: #F5A623;
}

/* ─── ACTION BUTTONS ────────────────────────────────────────── */
.product-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

@media (min-width: 480px) {
  .product-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

/* "В кошик" — primary pill */
.btn-add-to-cart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.9rem 2rem;
  background: var(--accent);
  border: none;
  border-radius: 100px;
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  flex: 1;
  min-width: 200px;
  transition: background var(--transition-base),
              transform var(--transition-fast),
              box-shadow var(--transition-base);
}

.btn-add-to-cart:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 199, 209, 0.35);
}

.btn-add-to-cart:active {
  transform: translateY(0);
}

/* "Консультація" — secondary */
.btn-consultation {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.5rem;
  background: transparent;
  border: 1px solid var(--border-dark);
  border-radius: 100px;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color var(--transition-base),
              color var(--transition-base),
              background var(--transition-base);
}

.btn-consultation:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-on-dark);
  background: var(--bg-elevated);
}

/* Mobile: full-width buttons */
@media (max-width: 479px) {
  .btn-add-to-cart,
  .btn-consultation {
    width: 100%;
    min-width: unset;
    flex: unset;
  }
}

/* ─── SECTION SHARED ────────────────────────────────────────── */
.product-section-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: var(--ls-tight);
  color: var(--text-on-dark);
  margin: 0 auto 2.5rem;
  text-align: center;
}

/* ─── SPECS SECTION ─────────────────────────────────────────── */
.product-specs {
  background: var(--bg-dark);
  padding: 4rem 0;
  border-top: 1px solid var(--border-dark);
}

.product-specs > *,
.product-description > *,
.related-products > * {
  max-width: 1200px;
  margin-left: auto !important;
  margin-right: auto !important;
}

.specs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-lg);
  overflow: hidden;
  max-width: 960px;
  margin: 0 auto;
}

@media (min-width: 640px) {
  .specs-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.spec-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: center;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-dark);
  transition: background var(--transition-fast);
}

.spec-row:last-child {
  border-bottom: none;
}

@media (min-width: 640px) {
  /* In 2-column layout, remove border between paired rows */
  .spec-row:nth-last-child(1):nth-child(even),
  .spec-row:nth-last-child(2):nth-child(odd) {
    border-bottom: none;
  }
}

.spec-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.spec-key {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.spec-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-on-dark);
}

/* ─── DESCRIPTION SECTION ───────────────────────────────────── */
.product-description {
  background: var(--bg-deep);
  padding: 4rem 0;
  border-top: 1px solid var(--border-dark);
}

.product-description-body {
  max-width: 720px;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-muted);
}

/* Стилі для HTML-контенту з БД */
.product-description-body h2,
.product-description-body h3 {
  color: var(--text-on-dark);
  font-weight: 700;
  letter-spacing: var(--ls-tight);
  margin: 2rem 0 0.75rem;
}

.product-description-body h2 { font-size: 1.35rem; }
.product-description-body h3 { font-size: 1.1rem; }

.product-description-body p {
  margin: 0 0 1.25rem;
}

.product-description-body ul,
.product-description-body ol {
  margin: 0 0 1.25rem;
  padding-left: 1.4rem;
}

.product-description-body li {
  margin-bottom: 0.5rem;
}

.product-description-body strong {
  color: var(--text-on-dark);
  font-weight: 600;
}

.product-description-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.product-description-body a:hover {
  color: var(--accent-hover);
}

/* ─── RELATED PRODUCTS ──────────────────────────────────────── */
.related-products {
  background: var(--bg-dark);
  padding: 4rem 0;
  border-top: 1px solid var(--border-dark);
}

/* Inherit shop grid but override columns for 3 */
.related-products .related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

@media (min-width: 640px) {
  .related-products .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .related-products .related-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ─── RICH CONTENT (TinyMCE Output) ─────────────────────────── */
.rich-content {
  max-width: 760px;
  margin: 0 auto;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-muted);
  text-align: left;
}
.rich-content p { margin-bottom: 1.25em; }
.rich-content h2 { font-size: 1.35rem; font-weight: 700; margin: 2em 0 0.75em; color: var(--text-on-dark); }
.rich-content h3 { font-size: 1.1rem; font-weight: 600; margin: 1.5em 0 0.5em; color: var(--text-on-dark); }
.rich-content ul, .rich-content ol { margin: 0 0 1.25em; padding-left: 1.4rem; }
.rich-content li { margin-bottom: 0.5em; }
.rich-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.rich-content a:hover { color: var(--accent-hover); }
.rich-content blockquote { border-left: 3px solid var(--accent); padding-left: 1.25rem; color: var(--text-muted); margin: 1.5rem 0; font-style: italic; }
.rich-content table { border-collapse: collapse; margin: 1.5rem 0; width: 100%; border: 1px solid var(--border-dark); }
.rich-content table td, .rich-content table th { padding: 12px 16px; border: 1px solid var(--border-dark); }
.rich-content table th { background: var(--bg-elevated); text-align: left; color: var(--text-on-dark); }

/* ─── IVA HUB BENTO DESCRIPTION ─────────────────────────────── */
.iva-desc { font-family: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif; color: #fff; background: #050507; padding: 32px 20px; border-radius: 16px; margin: 0; }
.iva-desc * { box-sizing: border-box; }
.iva-desc .iva-lead { font-size: 18px; line-height: 1.5; color: #B4B2A9; max-width: 640px; margin: 0 0 28px; }
.iva-desc .iva-lead strong { color: #fff; font-weight: 500; }
.iva-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.iva-cell { background: #0A0A0B; border: 1px solid rgba(255, 255, 255, 0.06); border-radius: 16px; padding: 24px; min-height: 140px; display: flex; flex-direction: column; justify-content: space-between; }
.iva-cell.iva-accent { background: #0066FF; border-color: #0066FF; }
.iva-cell .iva-eyebrow { font-family: 'Geist Mono', ui-monospace, monospace; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: #5F5E5A; margin: 0 0 16px; }
.iva-cell.iva-accent .iva-eyebrow { color: rgba(255, 255, 255, 0.6); }
.iva-cell .iva-big { font-size: 56px; font-weight: 500; line-height: 1; letter-spacing: -0.02em; margin: 0; }
.iva-cell .iva-mid { font-size: 22px; font-weight: 500; line-height: 1.2; letter-spacing: -0.01em; margin: 0; color: #fff; }
.iva-cell .iva-small { font-size: 15px; line-height: 1.4; color: #B4B2A9; margin: 8px 0 0; }
.iva-cell.iva-accent .iva-small { color: rgba(255, 255, 255, 0.85); }
.iva-col-3 { grid-column: span 3; }
.iva-col-2 { grid-column: span 2; }
.iva-tall { min-height: 220px; }
.iva-strike { text-decoration: line-through; color: #5F5E5A; }
.iva-kit-list { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 10px; }
.iva-kit-list li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: #B4B2A9; }
.iva-kit-list li::before { content: ""; width: 6px; height: 6px; background: #0066FF; border-radius: 50%; flex-shrink: 0; }
@media (max-width: 720px) {
  .iva-desc { padding: 20px 14px; }
  .iva-desc .iva-lead { font-size: 16px; margin-bottom: 20px; }
  .iva-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .iva-col-3, .iva-col-2 { grid-column: span 2; }
  .iva-cell { padding: 18px; min-height: 120px; border-radius: 12px; }
  .iva-tall { min-height: 180px; }
  .iva-cell .iva-big { font-size: 44px; }
  .iva-cell .iva-mid { font-size: 18px; }
  .iva-cell .iva-small { font-size: 14px; }
}

/* ── Virtual product actions (App Store / Google Play) ── */
.product-virtual-actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.product-virtual-note {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
  padding: 14px 18px;
  background: rgba(0, 199, 209, 0.05);
  border: 1px solid rgba(0, 199, 209, 0.15);
  border-radius: 12px;
}

.product-virtual-stores {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-store {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 100px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  flex: 1;
  justify-content: center;
}

.btn-store--apple {
  background: #fff;
  color: #000;
}

.btn-store--apple:hover {
  background: #f0f0f0;
  transform: translateY(-1px);
}

.btn-store--google {
  background: var(--bg-card-dark);
  border: 1px solid var(--border-dark);
  color: var(--text-on-dark);
}

.btn-store--google:hover {
  border-color: rgba(0, 199, 209, 0.3);
  transform: translateY(-1px);
}
