/* ==========================================================================
   pages/product_detail.css — Product detail (card) page
   ========================================================================== */

/* --- Layout --- */

.pd-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

/* --- Gallery --- */

.pd-gallery__main {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--light-bg);
  aspect-ratio: 4 / 3;
}

.pd-gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pd-gallery__thumbs {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 4px;
}

.pd-gallery__thumb {
  flex: 0 0 80px;
  height: 60px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  background: var(--light-bg);
  padding: 0;
  transition: border-color var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.pd-gallery__thumb.is-active {
  border-color: var(--brand-blue);
}

@media (hover: hover) {
  .pd-gallery__thumb:hover {
    border-color: var(--brand-blue);
  }
}

.pd-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--light-bg);
}

/* --- Info --- */

.pd-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pd-info__title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  color: var(--brand-dark);
  line-height: 1.2;
}

.pd-info__sku {
  font-size: 13px;
  color: var(--steel);
}

.pd-info__availability {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  width: fit-content;
}

.pd-info__availability--InStock {
  background: rgba(39, 174, 96, 0.1);
  color: var(--success);
}

.pd-info__availability--OutOfStock {
  background: rgba(231, 76, 60, 0.1);
  color: var(--error);
}

.pd-info__availability--PreOrder {
  background: rgba(212, 118, 10, 0.1);
  color: var(--accent);
}

.pd-info__price {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  color: var(--accent);
}

.pd-info__price--request {
  color: var(--steel);
  font-weight: 500;
  font-size: 1.1rem;
}

.pd-info__desc {
  color: var(--text);
  line-height: 1.7;
  max-width: 56ch;
}

.pd-info__cta {
  margin-top: 16px;
  align-self: flex-start;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pd-info__cta:focus-visible {
  outline: 3px solid var(--brand-blue);
  outline-offset: 4px;
}

/* --- Variants table section --- */

.pd-variants-section .table-wrap {
  box-shadow:
    0 20px 50px rgba(43, 58, 78, 0.18),
    0 0 0 1px rgba(91, 181, 232, 0.15);
  border-radius: var(--radius-lg);
  overflow: hidden;
  max-width: 960px;
  margin-inline: auto;
}

.pd-variants-section .product-table {
  width: 100%;
  border-collapse: collapse;
}

.pd-variants-section .product-table th {
  background: var(--brand-dark);
  color: var(--white);
  font-family: var(--font-heading);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.04em;
  padding: 14px 20px;
  text-align: left;
}

.pd-variants-section .product-table td {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
}

.pd-variants-section .product-table tbody tr:last-child td {
  border-bottom: none;
}

.pd-variants-section .product-table tbody tr:nth-child(even) {
  background: var(--light-bg);
}

/* --- КОВС specs block --- */

.kovs-specs {
  margin-top: 16px;
}

.kovs-specs__title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--brand-dark);
  margin: 40px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
}

.kovs-specs__title:first-child {
  margin-top: 0;
}

.kovs-specs .kovs-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 8px;
}

.kovs-specs .kovs-table thead th {
  background: var(--brand-dark);
  color: var(--white);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 12px 16px;
  text-align: left;
}

.kovs-specs .kovs-table tbody td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.kovs-specs .kovs-table tbody tr:last-child td {
  border-bottom: none;
}

.kovs-specs .kovs-table tbody tr:nth-child(even) {
  background: var(--light-bg);
}

.kovs-specs__komplekt {
  margin-top: 40px;
}

.kovs-specs__subtitle {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--brand-dark);
  margin: 32px 0 10px;
}

.kovs-specs__list {
  margin: 0 0 8px 24px;
  padding: 0;
  line-height: 1.8;
}

.kovs-specs__list li {
  margin-bottom: 4px;
}

/* --- Tablet --- */

@media (max-width: 1024px) {
  .pd-layout {
    gap: 32px;
  }
}

/* --- Mobile --- */

@media (max-width: 768px) {
  .pd-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .pd-gallery__main {
    aspect-ratio: 16 / 10;
  }

  .pd-gallery__thumb {
    flex: 0 0 64px;
    height: 48px;
  }

  .pd-info__cta {
    align-self: stretch;
    text-align: center;
  }

  .pd-variants-section .product-table th,
  .pd-variants-section .product-table td {
    padding: 10px 14px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .pd-gallery__thumbs {
    gap: 6px;
  }

  .pd-gallery__thumb {
    flex: 0 0 56px;
    height: 42px;
  }

  .pd-variants-section .table-wrap {
    border-radius: var(--radius-md);
    margin-inline: -8px;
  }

  .pd-variants-section .product-table th,
  .pd-variants-section .product-table td {
    padding: 8px 10px;
    font-size: 13px;
  }
}

/* --- iOS Safari safe area --- */

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .pd-hero {
    padding-bottom: env(safe-area-inset-bottom);
  }
}
