/* ==========================================================================
   Product detail page layout
   ========================================================================== */
.pdp {
  padding-bottom: var(--space-10);
}

.pdp__title {
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-text-primary);
  margin: 0 0 var(--space-2);
}

.pdp__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-6);
  font-size: var(--text-sm);
  color: var(--color-text-body);
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border);
}

.pdp__meta-link {
  color: var(--color-brand-blue);
  font-weight: 700;
}

.pdp__meta-warranty {
  color: var(--color-price);
}

.pdp__meta-stock {
  color: var(--color-success);
}

.pdp__layout {
  display: grid;
  grid-template-columns: 390px 1fr 300px;
  gap: var(--space-6);
  align-items: start;
}

/* Stretch only the left column to the row's tallest column (col-center,
   whose last child is pdp-perks) so the sticky gallery below has room to
   travel — col-center and col-right stay at their natural heights. */
.pdp__col-left {
  align-self: stretch;
}

/* ==========================================================================
   Gallery
   ========================================================================== */
.pdp-gallery {
  background: var(--color-bg-white);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 84px;
}

.pdp-gallery__main {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  background: var(--color-bg-white);
  overflow: hidden;
}

.pdp-gallery__main-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity var(--transition-fast);
}

.pdp-gallery__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-sm);
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: background var(--transition-fast);
}

.pdp-gallery__arrow:hover {
  background: var(--color-bg-white);
}

.pdp-gallery__arrow--prev {
  left: var(--space-2);
}

.pdp-gallery__arrow--next {
  right: var(--space-2);
}

.pdp-gallery__hint {
  position: absolute;
  bottom: var(--space-2);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  background: rgba(255, 255, 255, 0.85);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.pdp-gallery__thumbs {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.pdp-gallery__thumb {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg-white);
  padding: 2px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.pdp-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

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

.pdp-gallery__badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin-top: var(--space-4);
  font-size: var(--text-xs);
  color: var(--color-text-body);
}

/* ==========================================================================
   Center column — price, summary, color, offers, qty, actions
   ========================================================================== */
.pdp-price-group {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.pdp-price {
  font-size: 28px;
  font-weight: 800;
  color: var(--color-price);
}

.pdp-old-price {
  font-size: var(--text-xl);
  font-weight: 400;
  color: #787878;
  text-decoration: line-through;
}

.pdp-discount {
  font-size: var(--text-sm);
  color: #fff;
  background: var(--color-price);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.pdp-vat {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.pdp-summary {
  margin-bottom: var(--space-4);
}

.pdp-summary__title {
  font-size: var(--text-md);
  font-weight: 700;
  margin: 0 0 var(--space-2);
}

.pdp-summary__list {
  list-style: disc;
  padding-left: 20px;
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--color-text-body);
}

.pdp-summary__extra {
  display: none;
}

.pdp-summary.is-expanded .pdp-summary__extra {
  display: list-item;
}

.pdp-summary__toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: var(--space-2);
  background: none;
  border: 0;
  color: var(--color-brand-blue);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
}

.pdp-summary.is-expanded .pdp-summary__toggle svg {
  transform: rotate(180deg);
}

.pdp-color {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--space-4);
}

.pdp-color__text {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--text-base);
  margin-bottom: 10px;
}

.pdp-color__label {
  color: var(--color-text-muted);
}

.pdp-color__value {
  font-weight: 700;
}

.pdp-color__swatches {
  display: flex;
  gap: var(--space-2);
}

.pdp-color__swatch {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid transparent;
  box-shadow: 0 0 0 1px var(--color-border);
  cursor: pointer;
  padding: 0;
}

.pdp-color__swatch.is-active {
  border-color: var(--color-brand-blue);
  box-shadow: 0 0 0 1px var(--color-brand-blue);
}

.pdp-offer {
  border: 1px solid red;
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}

.pdp-offer__title {
  margin-bottom: var(--space-2);
}

.pdp-offer__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-price);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 700;
  padding: 3px 12px;
  border-radius: var(--radius-sm);
  clip-path: polygon(0 0, 100% 0, 94% 100%, 0% 100%);
}

.pdp-offer__list {
  list-style: none;
  counter-reset: offer;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.pdp-offer__list li {
  counter-increment: offer;
  position: relative;
  padding-left: 28px;
  font-size: var(--text-base);
  color: var(--color-text-body);
}

.pdp-offer__list li::before {
  content: counter(offer);
  position: absolute;
  left: 0;
  top: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-price);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pdp-qty {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.pdp-qty__control {
  display: flex;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.pdp-qty__btn {
  width: 34px;
  height: 34px;
  border: 0;
  background: #f4f4f4;
  font-size: var(--text-lg);
  cursor: pointer;
}

.pdp-qty__input {
  width: 44px;
  height: 34px;
  border: 0;
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  text-align: center;
  font-size: var(--text-base);
}

.pdp-actions {
  display: flex;
  gap: var(--space-3);
}

.pdp-actions__btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: var(--space-4) var(--space-5);
  border: 0;
  border-radius: var(--radius-lg);
  font-size: var(--text-md);
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  transition: filter var(--transition-fast);
}

.pdp-actions__btn span {
  font-size: var(--text-xs);
  font-weight: 400;
  text-transform: none;
}

.pdp-actions__btn:hover {
  filter: brightness(1.08);
}

.pdp-actions__btn--buy {
  background: var(--color-brand-blue);
  color: #fff;
}

.pdp-actions__btn--cart {
  background: #2fa84f;
  color: #fff;
}

/* ==========================================================================
   Right column — trust + consult merged into a single card
   ========================================================================== */
.pdp-trust {
  background: var(--color-bg-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
}

.pdp-trust__title {
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0 0 var(--space-3);
}

.pdp-trust__title--consult {
  margin-top: var(--space-5);
}

.pdp-trust__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-body);
}

.pdp-trust__list li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.pdp-trust__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--color-brand-blue);
}

.pdp-trust__icon svg {
  width: 100%;
  height: 100%;
}

.pdp-consult__row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 13px;
  color: var(--color-text-body);
  margin-bottom: var(--space-2);
}

.pdp-consult__row a {
  color: var(--color-brand-blue);
  font-weight: 700;
}

.pdp-consult__form {
  display: flex;
  gap: var(--space-2);
  margin: var(--space-3) 0;
}

.pdp-consult__input {
  flex: 1;
  height: 38px;
  padding: 0 var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}

.pdp-consult__submit {
  padding: 0 var(--space-5);
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--color-brand-blue);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.pdp-consult__note {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.pdp-consult__note a {
  color: var(--color-brand-blue);
}

.pdp-perks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5) var(--space-8);
  margin-bottom: var(--space-4);
  margin-top: 30px;
}

.pdp-perks__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-xs);
}

.pdp-perks__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

.pdp-perks__icon svg {
  width: 100%;
  height: 100%;
}

.pdp-perks__icon--truck {
  color: #f0831e;
}

.pdp-perks__icon--support {
  color: var(--color-brand-blue);
}

.pdp-perks__icon--quality {
  color: #eab308;
}

.pdp-perks__icon--genuine {
  color: #16a34a;
}

.pdp-perks__item strong {
  display: block;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 2px;
}

.pdp-perks__item span {
  color: var(--color-text-muted);
}

.pdp-ads {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.pdp-ads img {
  width: 100%;
  border-radius: var(--radius-md);
}

/* ==========================================================================
   Description + specs
   ========================================================================== */
.pdp__details {
  display: flex;
  align-items: flex-start;
  gap: var(--space-6);
  margin-top: var(--space-8);
}

/* Left column: description + reviews, each sized to its own content —
   a flex column (not a grid row) so the right column's height never
   pushes a gap between them. */
.pdp__details-left {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.pdp__details-right {
  flex: 0 0 390px;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.pdp-description,
.pdp-specs {
  background: var(--color-bg-white);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}

.pdp-description__title,
.pdp-specs__title {
  font-size: var(--text-lg);
  font-weight: 700;
  margin: 0 0 var(--space-4);
}

.pdp-description__body p {
  font-size: var(--text-base);
  line-height: 1.8;
  color: var(--color-text-body);
  margin-bottom: var(--space-2);
}

.pdp-description__hidden {
  display: none;
}

.pdp-description.is-expanded .pdp-description__hidden {
  display: block;
}

.pdp-description__toggle,
.pdp-specs__toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--space-3);
  background: none;
  border: 0;
  color: var(--color-brand-blue);
  font-weight: 700;
  font-size: var(--text-sm);
  cursor: pointer;
}

.pdp-description.is-expanded .pdp-description__toggle svg {
  transform: rotate(90deg);
}

.pdp-specs__table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--color-border);
}

.pdp-specs__table th,
.pdp-specs__table td {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  font-weight: 400;
  border: 1px solid var(--color-border);
}

.pdp-specs__table th {
  width: 45%;
  font-weight: 700;
  color: var(--color-text-primary);
}

.pdp-specs__table td {
  color: var(--color-text-body);
}

.pdp-specs__table td a {
  color: var(--color-brand-blue);
}

.pdp-specs__row--hidden {
  display: none;
}

.pdp-specs.is-expanded .pdp-specs__row--hidden {
  display: table-row;
}

.pdp-specs__toggle {
  width: 100%;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-2) 0;
}

.pdp-specs.is-expanded .pdp-specs__toggle svg {
  transform: rotate(180deg);
}

/* ==========================================================================
   Similar / viewed products tabs
   ========================================================================== */
.pdp-tabs {
  margin-top: var(--space-8);
  background: var(--color-bg-white);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  position: relative;
}

.pdp-tabs__nav {
  display: flex;
  gap: var(--space-6);
  border-bottom: 2px solid var(--color-border-light);
  margin-bottom: var(--space-5);
}

.pdp-tabs__btn {
  background: none;
  border: 0;
  padding: var(--space-2) 0 var(--space-3);
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--color-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.pdp-tabs__btn.is-active {
  color: var(--color-brand-blue);
  border-bottom-color: var(--color-brand-blue);
}

.pdp-tabs__panel {
  display: none;
}

.pdp-tabs__panel.is-active {
  display: block;
  position: relative;
}

.pdp-tabs__track {
  display: flex;
  gap: var(--space-4);
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  padding-bottom: var(--space-2);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.pdp-tabs__track::-webkit-scrollbar {
  display: none;
}

.pdp-tabs__track .product-card {
  width: 200px;
}

.pdp-tabs__arrow {
  position: absolute;
  top: 45%;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-bg-white);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  font-size: var(--text-xl);
  color: var(--color-text-primary);
}

.pdp-tabs__arrow--prev {
  left: -14px;
}

.pdp-tabs__arrow--next {
  right: -14px;
}

.pdp-tabs__empty {
  text-align: center;
  color: var(--color-text-muted);
  padding: var(--space-8) 0;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
  .pdp__layout {
    grid-template-columns: 320px 1fr;
  }

  .pdp__col-left {
    align-self: start;
  }

  .pdp-gallery {
    position: static;
    top: auto;
  }

  .pdp__col-right {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
  }

  .pdp-ads {
    grid-column: 1 / -1;
    flex-direction: row;
  }

  .pdp__details {
    flex-direction: column;
  }

  .pdp__details-right {
    flex: 1 1 auto;
  }
}

@media (max-width: 768px) {
  .pdp__layout {
    grid-template-columns: 1fr;
  }

  .pdp__col-right {
    grid-template-columns: 1fr;
  }


  .pdp-perks {
    grid-template-columns: 1fr;
  }

  .pdp-actions {
    flex-direction: column;
  }
}

@media (max-width: 600px) {
  .pdp__title {
    font-size: var(--text-lg);
  }

  .pdp-price {
    font-size: var(--text-2xl);
  }


  .pdp-tabs__track .product-card {
    width: 160px;
  }
}
