/* Детальная страница товара */

.pd-main {
  padding-bottom: clamp(2rem, 4vw, 3.5rem);
}

.pd-layout {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
}

@media (min-width: 900px) {
  .pd-layout {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    align-items: start;
  }
}

/* Галерея */
.pd-gallery__main {
  position: relative;
  display: block;
}

.pd-gallery__main--solo {
  display: block;
}

.pd-gallery__main-frame {
  width: 100%;
  min-width: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-bg-elevated);
  box-shadow: var(--shadow-card);
}

.pd-gallery__main-img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.pd-gallery__arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 65px;
  height: 65px;
  margin: 0 20px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transform: translateY(-50%);
  transition:
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.pd-gallery__arrow--prev {
  left: 0;
}

.pd-gallery__arrow--next {
  right: 0;
}

.pd-gallery__arrow-icon {
  display: block;
  width: auto;
  height: 26px;
  object-fit: contain;
  pointer-events: none;
}

.pd-gallery__arrow--prev .pd-gallery__arrow-icon {
  transform: scaleX(-1);
}

.pd-gallery__arrow:hover,
.pd-gallery__arrow:focus-visible,
.pd-gallery__arrow:active {
  background: #ffffff48;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
}

@media (prefers-reduced-motion: reduce) {
  .pd-gallery__arrow {
    transition: none;
  }
}

.pd-gallery[data-product-gallery-empty] .pd-gallery__arrow {
  display: none;
}

/* Телефон и планшет: листаем миниатюрами, стрелки скрыты */
@media (max-width: 1023.98px) {
  .pd-gallery__arrow {
    display: none;
  }
}

.pd-gallery__thumbs-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 1rem;
}

.pd-gallery__thumbs-nav {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-heading);
  font-size: 1.1rem;
  line-height: 1;
  transition: background var(--transition);
}

.pd-gallery__thumbs-nav:hover,
.pd-gallery__thumbs-nav:focus-visible {
  background: var(--color-accent-light);
}

.pd-gallery__thumbs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 0.25rem 0;
  flex: 1;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.pd-gallery__thumb {
  flex: 0 0 auto;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  overflow: hidden;
  width: 72px;
  height: 72px;
  cursor: pointer;
  background: var(--color-bg-soft);
  transition: border-color var(--transition), transform var(--transition);
}

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

.pd-gallery__thumb:hover,
.pd-gallery__thumb:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(17, 24, 109, 0.35);
}

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

/* Инфо */
.pd-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-heading);
  font-size: clamp(1.35rem, 3.5vw, 2rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -1px;
  color: var(--color-ink);
}

.pd-collection {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: -0.5px;
  text-transform: uppercase;
  color: var(--color-ink-muted-light);
}

.pd-price {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-bottom: 1rem;
}

.pd-price__current {
  font-size: 1.5rem;
  font-weight: 500;
  color: #1a1a1a;      /* Глубокий темный цвет */
}

.pd-price__sale {
  font-size: 1rem;     /* На фото процент довольно крупный */
  font-weight: 400;
  color: #ffffff;
  background-color: #141575; /* Темно-синий фон как на фото */
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* Убираем градиент, если нужен строгий плоский цвет */
}

.pd-price__old {
  font-size: 1.2rem;
  color: #a3aab5;
  text-decoration: line-through;
}

.pd-lead {
  margin: 0 0 1.25rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--color-text-muted);
}

.pd-cta {
  margin-bottom: 1.75rem;
  width: 100%;
  max-width: 100%;
  text-align: center;
}

/* Аккордеон */
.pd-accordions {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.pd-acc {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  overflow: hidden;
}

.pd-acc__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
  cursor: pointer;
  padding: 0.95rem 1.1rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-heading);
  transition: background var(--transition);
}

.pd-acc__summary::-webkit-details-marker {
  display: none;
}

.pd-acc__summary::after {
  content: "+";
  flex-shrink: 0;
  font-weight: 400;
  opacity: 0.7;
}

.pd-acc[open] .pd-acc__summary::after {
  content: "−";
}

.pd-acc__summary:hover,
.pd-acc__summary:focus-visible {
  background: rgba(17, 24, 109, 0.05);
}

.pd-acc__body {
  padding: 0 1.1rem 1.1rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--color-text-muted);
}

.pd-acc__body > p:only-child {
  margin: 0;
}

/* Текст из админки (HTML: b, br, списки и т.д.) */
.pd-rich-text :is(p, ul, ol) {
  margin: 0 0 0.75em;
}

.pd-rich-text :is(p, ul, ol):last-child {
  margin-bottom: 0;
}

.pd-rich-text ul,
.pd-rich-text ol {
  padding-left: 1.25em;
}

.pd-rich-text li + li {
  margin-top: 0.35em;
}

.pd-rich-text b,
.pd-rich-text strong {
  font-weight: 700;
  color: var(--color-text);
}

.pd-rich-text a {
  color: var(--color-heading);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Низ pd-info: «Назад» + преимущества */
.pd-info-footer {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: clamp(2rem, 4vw, 3rem);
  padding-top: clamp(1.5rem, 3vw, 2.5rem);
}

.pd-info-footer__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px 24px;
  align-items: start;
}

.pd-info-footer__back {
  align-self: center;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: #6c757d;
  text-decoration: none;
  transition: color 0.2s ease;
}

.pd-info-footer__back:hover,
.pd-info-footer__back:focus-visible {
  color: #141575;
}

.pd-info-footer__feature {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.pd-info-footer__icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.pd-info-footer__text {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: #212529;
}

/* «Вам может понравиться» — те же стили, что new-collection (см. new-collection.css) */
.page-product-detail .pd-related.new-collection {
  margin-top: 0;
}

/* ——— Мобильная и планшетная вёрстка (до 2 колонок) ——— */
@media (max-width: 899.98px) {
  .page-product-detail .pd-main > .container {
    --pd-gutter: 16px;
    padding-left: var(--pd-gutter);
    padding-right: var(--pd-gutter);
  }

  .pd-layout {
    gap: 24px;
  }

  .pd-gallery {
    margin-left: calc(-1 * var(--pd-gutter));
    margin-right: calc(-1 * var(--pd-gutter));
    width: calc(100% + 2 * var(--pd-gutter));
  }

  .pd-gallery__main-frame {
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-shadow: none;
  }

  .pd-gallery__main-img {
    aspect-ratio: 1;
    max-height: min(92vw, 480px);
    object-fit: cover;
  }

  .pd-gallery__thumbs-wrap {
    margin-top: 12px;
    padding: 0 var(--pd-gutter);
  }

  .pd-gallery__thumbs {
    gap: 8px;
    padding: 4px 0 8px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .pd-gallery__thumbs::-webkit-scrollbar {
    display: none;
  }

  .pd-gallery__thumb {
    width: 64px;
    height: 64px;
    scroll-snap-align: start;
    -webkit-tap-highlight-color: transparent;
  }

  .pd-gallery__thumb:hover,
  .pd-gallery__thumb:focus-visible {
    transform: none;
  }

  .pd-info {
    min-width: 0;
  }

  .pd-title {
    font-size: clamp(1.25rem, 6.5vw, 1.75rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
  }

  .pd-collection {
    margin-bottom: 12px;
    font-size: 13px;
  }

  .pd-price__current {
    font-size: clamp(1.25rem, 5.5vw, 1.5rem);
  }

  .pd-price__old {
    font-size: 1rem;
    width: 100%;
  }

  .pd-lead {
    font-size: 15px;
    line-height: 1.55;
    margin-bottom: 20px;
  }

  .pd-cta {
    min-height: 52px;
    margin-bottom: 28px;
    font-size: 14px;
    letter-spacing: 0.06em;
  }

  .pd-accordions {
    gap: 12px;
  }

  .pd-acc {
    border: 1px solid var(--color-border);
    border-radius: 10px;
    border-bottom: 1px solid var(--color-border);
  }

  .pd-acc__summary {
    min-height: 48px;
    padding: 14px 16px;
    font-size: 11px;
  }

  .pd-acc__body {
    padding: 0 16px 16px;
    font-size: 14px;
  }

  .pd-info-footer {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border);
    gap: 16px;
  }

  .pd-info-footer__row,
  .pd-info-footer__row--bottom {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .pd-info-footer__back {
    align-self: start;
    font-size: 15px;
    padding-bottom: 4px;
  }

  .pd-info-footer__text {
    font-size: 15px;
  }

  .page-product-detail .pd-related.new-collection {
    padding: 40px var(--pd-gutter) 48px;
  }

  .page-product-detail .pd-related .new-collection__head {
    margin-bottom: 28px;
  }
}

@media (max-width: 479px) {
  .page-product-detail .pd-main > .container {
    --pd-gutter: 12px;
  }

  .pd-gallery__thumb {
    width: 56px;
    height: 56px;
  }

  .pd-title {
    font-size: 20px;
  }

  .pd-price__sale {
    font-size: 0.875rem;
    padding: 3px 7px;
  }
}

@media (max-width: 359px) {
  .pd-gallery__thumbs-nav {
    display: none;
  }

  .pd-acc__summary {
    letter-spacing: 0.1em;
  }
}
