/* ================================================================
   ARAFA CNC — SPARE PART DETAILS
   SECTION 01 — Product overview
   SECTION 02 — Image gallery, arrows, dynamic thumbnails
   SECTION 03 — Title, description, request buttons
   SECTION 04 — Technical specifications
   SECTION 05 — Related spare parts
   SECTION 06 — Responsive (tablet / mobile)
   All images listed in each product appear in the thumbnail grid. No price, quantity, or cart elements.
================================================================ */

/* Keep widths contained on mobile even when global.css is absent. */
.product-details-section *,
.product-specifications-section *,
.related-products-section * { box-sizing: border-box; }
.product-details-section, .product-specifications-section,
.related-products-section { min-width: 0; }

/* ================================================================
   SECTION 01 — PRODUCT OVERVIEW
================================================================ */
.product-details-section {
  background: #f1f1f1;
  padding: 48px 0 62px;
}
.details-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  column-gap: clamp(32px, 5vw, 90px);
}
.details-gallery, .details-info { min-width: 0; }

/* ================================================================
   SECTION 02 — GALLERY
================================================================ */
.details-gallery { width: 100%; max-width: 690px; }
.main-product-image {
  position: relative;
  width: 100%;
  min-height: 310px;
  height: clamp(315px, 30vw, 390px);
  padding: 10px 65px;
  display: grid;
  place-items: center;
  background: transparent;
  overflow: hidden;
}
.detail-main-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: transparent;
}
.gallery-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: #ff5a12;
  cursor: pointer;
  transition: background .2s ease;
}
.gallery-arrow:hover { background: #e54c06; }
.gallery-arrow[hidden] { display: none; }
.gallery-arrow--prev { inset-inline-start: 5px; }
.gallery-arrow--next { inset-inline-end: 5px; }
.thumb-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  justify-content: start;
  gap: 10px;
  padding: 0 54px;
  margin-top: 8px;
}
.detail-thumb {
  display: grid;
  place-items: center;
  width: 100%;
  height: 78px;
  padding: 5px;
  border: 2px solid transparent;
  border-radius: 5px;
  background: #fff;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .2s ease;
}
.detail-thumb img { width: 100%; height: 100%; object-fit: contain; }
.detail-thumb.is-active { border-color: #ff5a12; }

/* ================================================================
   SECTION 03 — PRODUCT NAME, DESCRIPTION, REQUEST ACTIONS
================================================================ */
.details-info { text-align: start; padding: 10px 0; }
.product-category-label {
  display: inline-block;
  margin-bottom: 8px;
  color: #ff5a12;
  font-size: 12px;
  font-weight: 700;
}
.details-info h1 {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 18px;
  padding-bottom: 12px;
  color: #061725;
  font-size: clamp(25px, 2.8vw, 34px);
  font-weight: 800;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.details-info h1::after {
  content: '';
  position: absolute;
  bottom: 0;
  inset-inline-start: 0;
  width: 76px;
  height: 2px;
  background: #ff5a12;
}
.product-description-text {
  max-width: 660px;
  color: #566575;
  font-size: 14px;
  line-height: 1.95;
  text-align: start;
  overflow-wrap: anywhere;
}
.product-description-text p { margin: 0 0 10px; }
.details-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 32px;
}
.details-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 155px;
  min-height: 46px;
  padding: 11px 22px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  transition: background .2s, color .2s;
}
.details-actions .btn--primary { border: 1px solid #ff5a12; background: #ff5a12; color: #fff; }
.details-actions .btn--primary:hover { background: #e54c06; }
.details-actions .btn--outline { border: 1px solid #061725; background: transparent; color: #061725; }
.details-actions .btn--outline:hover { background: #061725; color: #fff; }

/* ================================================================
   SECTION 04 — TECHNICAL SPECIFICATIONS
================================================================ */
.product-specifications-section {
  background: #f1f1f1;
  padding: 40px 0 74px;
}
.specifications-layout {
  display: grid;
  grid-template-columns: minmax(230px, .32fr) minmax(0, .68fr);
  align-items: center;
  gap: clamp(24px, 5vw, 70px);
}
.specifications-heading { text-align: start; }
.specifications-heading .section-title,
.related-products-section .section-title {
  margin: 0;
  color: #081e33;
  font-size: clamp(25px, 3vw, 38px);
  font-weight: 800;
  line-height: 1.45;
}
.specifications-table-wrap {
  width: 100%;
  border: 1px solid #dedede;
  overflow: hidden;
}
.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  table-layout: fixed;
}
.spec-table tr:nth-child(odd) { background: #f5f5f5; }
.spec-table tr:nth-child(even) { background: #fff; }
.spec-table td {
  padding: 10px 15px;
  border-bottom: 1px solid #dedede;
  border-inline-end: 1px solid #dedede;
  color: #10293d;
  vertical-align: top;
  text-align: start;
  overflow-wrap: anywhere;
}
.spec-table tr:last-child td { border-bottom: 0; }
.spec-table td:first-child { width: 42%; font-weight: 700; }
.spec-table td:last-child { border-inline-end: 0; }

/* ================================================================
   SECTION 05 — RELATED PARTS
================================================================ */
.related-products-section { padding: 60px 0 75px; background: #fff; }
.related-products-section .section-title { margin-bottom: 26px; }
.related-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.related-card {
  min-width: 0;
  padding: 15px;
  background: #fff;
  border: 1px solid #e1e8ee;
  border-radius: 11px;
  transition: border-color .2s ease;
}
.related-card:hover { border-color: #ff5a12; }
.related-card__image {
  display: grid;
  place-items: center;
  height: 170px;
  margin-bottom: 12px;
  overflow: hidden;
}
.related-card__image img { width: 100%; height: 100%; object-fit: contain; }
.related-card h3 { color: #092236; font-size: 15px; line-height: 1.7; margin: 0 0 12px; }
.related-card .btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 39px;
  padding: 8px 12px;
  border: 1px solid #ff5a12;
  border-radius: 6px;
  color: #ff5a12;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}
.related-card .btn:hover { color: #fff; background: #ff5a12; }

/* ================================================================
   SECTION 06 — TABLET / MOBILE
================================================================ */
@media (max-width: 900px) {
  .details-top { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .details-gallery { max-width: none; }
  .details-info { padding: 0; }
  .specifications-layout { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .product-details-section { padding: 23px 0 38px; }
  .main-product-image { height: 300px; min-height: 0; padding: 12px 44px; }
  .gallery-arrow { width: 35px; height: 35px; }
  .gallery-arrow--prev { inset-inline-start: 2px; }
  .gallery-arrow--next { inset-inline-end: 2px; }
  .thumb-row { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 0; }
  .detail-thumb { height: 76px; }
  .details-info h1 { font-size: 28px; }
  .product-description-text { font-size: 13px; line-height: 1.9; }
  .details-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .details-actions .btn { min-width: 0; padding: 10px 6px; font-size: 12px; }
  .product-specifications-section { padding: 32px 0 48px; }
  .spec-table { font-size: 12px; }
  .spec-table td { padding: 10px 8px; }
  .related-grid { grid-template-columns: minmax(0, 1fr); }
}
.gallery-arrow:focus-visible, .detail-thumb:focus-visible, .details-actions .btn:focus-visible {
  outline: 3px solid #ff5a12;
  outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  .detail-thumb, .gallery-arrow, .related-card { transition: none; }
}
