/* PDP — локальна верстка каталогу */

.pdp-main {
  --pdp-dark: #1c212e;
  --pdp-orange: #53EB0C;
  --pdp-orange-hover: #3FBA09;
  --pdp-blue: #3b99d9;
  --pdp-gray-bg: #f5f5f7;
  --pdp-border: #e5e7eb;
  --pdp-text: #1f2937;
  --pdp-muted: #6b7280;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--pdp-text);
  background: #fff;
}

.pdp-main .main.container {
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .pdp-main .main.container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .pdp-main .main.container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

.pdp-inner {
  padding-top: 1.5rem;
  padding-bottom: 2rem;
}

.pdp-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .pdp-grid {
    grid-template-columns: minmax(0, 4fr) minmax(0, 5fr) minmax(0, 3fr);
    gap: 2rem;
    align-items: start;
  }

  .pdp-col--buy {
    padding-right: 1rem;
    border-right: 1px solid #f3f4f6;
  }

  .pdp-col--aside {
    padding-left: 0.5rem;
  }
}

/* Галерея */
.pdp-col--gallery {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.pdp-gallery-main {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  position: relative;
  background: #fff;
}

.pdp-gallery-main__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  vertical-align: middle;
}

.pdp-gallery-thumbs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.pdp-gallery-thumb {
  width: 4rem;
  height: 4rem;
  padding: 0.25rem;
  border: 1px solid var(--pdp-border);
  border-radius: 0.375rem;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.pdp-gallery-thumb:hover {
  border-color: #9ca3af;
}

.pdp-gallery-thumb.is-active {
  border-color: var(--pdp-orange);
  border-width: 2px;
  padding: calc(0.25rem - 1px);
}

.pdp-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Заголовок і мета */
.pdp-title {
  font-size: 22px;
  font-weight: 400;
  line-height: 1.25;
  color: #111827;
  margin: 0 0 0.75rem;
}

.pdp-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

.pdp-stock {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: #22c55e;
}

.pdp-stock--out {
  color: var(--pdp-muted);
}

.pdp-stock__ic {
  font-size: 0.65rem;
  line-height: 1;
}

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

.pdp-stars {
  display: inline-flex;
  gap: 1px;
  font-size: 0.75rem;
  line-height: 1;
  letter-spacing: -1px;
}

.pdp-star--full {
  color: #facc15;
}

.pdp-star--empty {
  color: #e5e7eb;
}

.pdp-reviews-link {
  color: var(--pdp-muted);
  text-decoration: none;
}

.pdp-reviews-link:hover {
  color: var(--pdp-blue);
  text-decoration: none;
}

/* Ціна */
.pdp-price-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.pdp-price-old {
  font-size: 0.875rem;
  color: #9ca3af;
  text-decoration: line-through;
  margin-bottom: 0.25rem;
}

.pdp-price-cur {
  font-size: 28px;
  font-weight: 500;
  color: #111827;
  line-height: 1.1;
}

.pdp-price-cur__suffix {
  font-size: 1.25rem;
  font-weight: 500;
}

.pdp-price-unavailable {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--pdp-muted);
}

/* Купити */
.pdp-buy-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.pdp-buy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 1.125rem;
  font-weight: 500;
  color: #fff;
  background: var(--pdp-orange);
  border-radius: 0.375rem;
  text-decoration: none;
  transition: background 0.15s ease;
  text-align: center;
}

.pdp-buy-btn:hover {
  background: var(--pdp-orange-hover);
  color: #fff;
  text-decoration: none;
}

/* Варіанти / колір / пам'ять — секції одна під одною; опції в колонку зверху вниз */
.pdp-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.pdp-block--last {
  margin-bottom: 0;
}

.pdp-label {
  display: block;
  width: 100%;
  font-size: 0.875rem;
  color: var(--pdp-muted);
  margin-right: 0;
}

/* Підпис і обране значення в один рядок (напр. «Колір:» + Citrus), свотчі нижче на всю ширину */
.pdp-label-row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 0.25rem 0.5rem;
  width: 100%;
  min-width: 0;
}

.pdp-label-row .pdp-label {
  width: auto;
  flex: 0 0 auto;
}

.pdp-value {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #111827;
}

.pdp-label-row .pdp-value {
  display: inline;
  width: auto;
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdp-chip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 0.25rem;
  width: 100%;
}

.pdp-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  color: #4b5563;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  background: #fff;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.pdp-chip:hover {
  border-color: #6b7280;
  color: #111827;
  text-decoration: none;
}

.pdp-chip--lg {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

.pdp-chip--active {
  border-color: var(--pdp-orange);
  color: #111827;
  font-weight: 500;
  background: #fff7ed;
}

/* Один варіант без посилання (GPS, один розмір тощо) — не виглядає як «зламане» посилання */
.pdp-chip--readonly {
  cursor: default;
}

.pdp-chip--readonly:hover {
  border-color: #d1d5db;
  color: #4b5563;
}

.pdp-chip--readonly.pdp-chip--active:hover {
  border-color: var(--pdp-orange);
  color: #111827;
}

.pdp-swatches {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 0.25rem;
  width: 100%;
}

.pdp-swatch {
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  padding: 2px;
  border: 1px solid #d1d5db;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: border-color 0.15s ease;
  box-sizing: border-box;
}

.pdp-swatch:hover {
  border-color: #9ca3af;
  text-decoration: none;
}

.pdp-swatch--active {
  border-width: 2px;
  border-color: var(--pdp-orange);
  padding: 1px;
}

.pdp-swatch__dot {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 9999px;
}

/* Бічна колонка */
.pdp-aside-block {
  margin-bottom: 2rem;
}

.pdp-aside-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.pdp-aside-icon {
  flex: 0 0 2rem;
  width: 2rem;
  height: 2rem;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 1.75rem;
}

.pdp-aside-icon--shield {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%233b99d9'%3E%3Cpath d='M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4z'/%3E%3C/svg%3E");
}

.pdp-aside-icon--box {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233b99d9' stroke-width='1.8'%3E%3Cpath d='M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z'/%3E%3Cpath d='M3.27 6.96L12 12.01l8.73-5.05M12 22.08V12'/%3E%3C/svg%3E");
}

.pdp-aside-icon--pay {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233b99d9' stroke-width='1.8'%3E%3Crect x='2' y='6' width='20' height='12' rx='2'/%3E%3Cpath d='M6 12h.01M18 12h.01'/%3E%3C/svg%3E");
}

.pdp-aside-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #111827;
}

.pdp-aside-sub {
  margin-left: 2.25rem;
  margin-bottom: 1rem;
}

.pdp-aside-sub:last-child {
  margin-bottom: 0;
}

.pdp-aside-subtitle {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #111827;
}

.pdp-aside-head + .pdp-aside-list {
  margin-left: 2.25rem;
}

.pdp-aside-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
  color: #4b5563;
}

.pdp-aside-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.pdp-aside-list li:last-child {
  margin-bottom: 0;
}

.pdp-aside-caret {
  flex: 0 0 auto;
  color: #9ca3af;
  font-size: 0.75rem;
  line-height: 1.4;
}

.pdp-aside-accent {
  color: var(--pdp-blue);
  font-weight: 500;
}

.pdp-hr {
  border: none;
  border-top: 1px solid #f3f4f6;
  margin: 1.5rem 0;
}

.pdp-pay-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  margin-left: 2.25rem;
}

.pdp-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pdp-badge--pb {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  background: conic-gradient(#22c55e 0deg 120deg, #facc15 120deg 360deg);
}

.pdp-badge--pumb {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  background: #e3000f;
  color: #fff;
  font-weight: 700;
  font-size: 0.65rem;
  flex-direction: column;
  line-height: 1;
}

.pdp-badge__sub {
  display: block;
  font-size: 0.45rem;
  font-weight: 700;
  margin-top: 1px;
}

.pdp-badge--ap,
.pdp-badge--gp {
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  padding: 0.2rem 0.45rem;
  font-size: 0.625rem;
  font-weight: 700;
  color: #1f2937;
  gap: 0.2rem;
}

.pdp-badge--ap::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.15rem;
  border-radius: 40% 40% 45% 45%;
  background: #111827;
  display: inline-block;
  vertical-align: middle;
}

.pdp-badge--gp::before {
  content: "G";
  font-size: 0.55rem;
  color: #3b82f6;
  font-weight: 800;
  margin-right: 0.1rem;
}

/* Низ: опис + характеристики */
.pdp-bottom {
  margin-top: 3rem;
  padding-top: 0.5rem;
}

.pdp-bottom-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .pdp-bottom-grid {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }
}

.pdp-section-title {
  font-size: 1.5rem;
  font-weight: 400;
  color: #111827;
  margin: 0 0 1.5rem;
}

.pdp-desc {
  font-size: 0.875rem;
  line-height: 1.625;
  color: #4b5563;
}

.pdp-desc p {
  margin: 0 0 1rem;
}

.pdp-desc p:last-child {
  margin-bottom: 0;
}

.pdp-desc--muted {
  color: var(--pdp-muted);
  margin: 0;
}

.pdp-specs {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pdp-spec-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #f3f4f6;
  font-size: 0.875rem;
}

.pdp-spec-k {
  color: var(--pdp-muted);
  flex: 0 1 auto;
}

.pdp-spec-v {
  color: #111827;
  text-align: right;
}

/* 404 */
.pdp-notfound {
  padding: 2rem 0;
}

.pdp-notfound .page-title h1 {
  font-size: 1.5rem;
  font-weight: 500;
}

/*
 * Тема: .header-container { z-index: 3 }, .main-container { z-index: 2 } і ::before затемнення (z-index: 600)
 * всередині main — при невдалому порядку шарів меню «Каталог» лишається під оверлеєм (видно лише затемнення).
 * Тримаємо шапку вище всього контенту PDP і не даємо предкам обрізати absolute-панель.
 */
body.catalog-product-view #top.header-container.header-regular {
  position: relative;
  z-index: 5000;
}

body.catalog-product-view .main-container.col1-layout.pdp-main {
  position: relative;
  z-index: 1;
}

body.catalog-product-view #top .holder-container,
body.catalog-product-view #top .topcontainer,
body.catalog-product-view #top .container,
body.catalog-product-view #top .container-left,
body.catalog-product-view #top .boottom-items {
  overflow: visible;
}

/*
 * Не додавати position: relative / z-index на .catalog-wraper на PDP:
 * інакше .drop-catalog-product (width:100%) прив’язується до вузької колонки кнопки,
 * а .wrapper-submenu з left:% накладаються — як на скріншоті з трьома «призрачними» колонками.
 * Достатньо підняти лише #top над .main-container (правила вище).
 */
