/* Stage 0.7 product card preview — scoped under body.ra99-product-preview / .ra99-pp* */
body.ra99-product-preview {
  --ra99-pp-buybar-h: 0px;
  padding-bottom: calc(var(--ra99-pp-buybar-h) + 12px);
}
body.ra99-product-preview .ra99-product-main {
  padding: 10px 0 40px;
}
.ra99-pp-banner {
  max-width: 1180px;
  margin: 0 auto 10px;
  padding: 8px 14px;
  background: #fff6e8;
  border: 1px solid rgba(196, 122, 18, 0.35);
  border-radius: 10px;
  color: #8a5a10;
  font-size: 0.85rem;
  font-weight: 600;
  width: min(1180px, calc(100% - 28px));
}
.ra99-pp-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 auto 14px;
  font-size: 0.85rem;
}
.ra99-pp-switcher__label { color: var(--muted, #698097); font-weight: 600; }
.ra99-pp-switcher__link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  background: #eef4f9;
  color: var(--text, #17324d);
  font-weight: 700;
}
.ra99-pp-switcher__link.is-active {
  background: var(--primary, #0b4e80);
  color: #fff;
}

.ra99-pp .wrap,
.ra99-pp.wrap {
  width: min(1180px, calc(100% - 28px));
  margin-inline: auto;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
body.ra99-product-preview .ra99-pp-product {
  min-width: 0;
  max-width: 100%;
}

.ra99-pp-title {
  margin: 0 0 10px;
  font-size: clamp(1.25rem, 2.2vw, 1.85rem);
  line-height: 1.3;
  color: var(--brand-blue, #1a3a5c);
  font-weight: 700;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}
.ra99-pp-head {
  display: block !important;
  margin: 0 0 8px;
  min-width: 0;
}
.ra99-pp-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  font-size: 0.9rem;
  color: var(--muted, #698097);
}
.ra99-pp-meta span { margin-right: 4px; }
.ra99-pp-meta strong { color: var(--text, #17324d); }

.ra99-pp-crumbs {
  margin-bottom: 8px;
}
.ra99-pp-crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  font-size: 0.8rem;
  color: var(--muted, #698097);
  line-height: 1.35;
}
.ra99-pp-crumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 8px;
  color: #a8b8c8;
}
.ra99-pp-crumbs a { color: var(--muted, #698097); }
.ra99-pp-crumbs a:hover { color: var(--primary, #0b4e80); }
.ra99-pp-crumbs [aria-current="page"] {
  color: var(--muted, #698097);
  font-weight: 500;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.ra99-pp-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 22px 28px;
  align-items: start;
  margin-bottom: 28px;
  min-width: 0;
  max-width: 100%;
}

.ra99-pp-gallery {
  background: #fff;
  border: 1px solid var(--border, rgba(16, 55, 88, 0.12));
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 8px 20px rgba(10, 45, 72, 0.05);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.ra99-pp-gallery__main {
  position: relative;
  background: #f7fbfe;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ra99-pp-gallery__zoom {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 16px;
  background: transparent;
  cursor: zoom-in;
}
.ra99-pp-gallery__zoom img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 0 auto;
}
.ra99-pp-gallery__thumbs {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.ra99-pp-gallery__thumb {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 4px;
  background: #f7fbfe;
  cursor: pointer;
  min-width: 72px;
  min-height: 72px;
}
.ra99-pp-gallery__thumb.is-active {
  border-color: var(--primary, #0b4e80);
}
.ra99-pp-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #f0f5fa;
}

.ra99-pp-buybox {
  background: #fff;
  border: 1px solid var(--border, rgba(16, 55, 88, 0.12));
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 12px 28px rgba(10, 45, 72, 0.1);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.ra99-pp-buybox__price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px 16px;
  margin-bottom: 14px;
}
.ra99-pp-price {
  margin: 0;
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary, #0b4e80);
  font-variant-numeric: tabular-nums;
}
.ra99-pp-price__old {
  margin-left: 10px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--muted, #698097);
}
.ra99-pp-stock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-weight: 700;
  font-size: 0.95rem;
}
.ra99-pp-stock--is-ok { color: #1c8d56; }
.ra99-pp-stock--is-out { color: #c47a12; }
.ra99-pp-stock__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.ra99-pp-qty-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.ra99-pp-qty-label {
  font-weight: 600;
  color: var(--muted, #698097);
  font-size: 0.9rem;
}
.ra99-pp-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border, rgba(16, 55, 88, 0.12));
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.ra99-pp-qty__btn {
  width: 44px;
  height: 44px;
  border: 0;
  background: #f3f7fb;
  color: var(--text, #17324d);
  font-size: 1.2rem;
  cursor: pointer;
}
.ra99-pp-qty__input {
  width: 56px;
  height: 44px;
  border: 0;
  border-left: 1px solid var(--border, rgba(16, 55, 88, 0.12));
  border-right: 1px solid var(--border, rgba(16, 55, 88, 0.12));
  text-align: center;
  font-weight: 700;
}

.ra99-pp-actions {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.ra99-pp-cart { width: 100%; font-size: 1.02rem; }
.ra99-pp-mgr { width: 100%; }
.ra99-pp-mgr > summary { width: 100%; list-style: none; cursor: pointer; }
.ra99-pp-mgr > summary::-webkit-details-marker { display: none; }

.ra99-pp-trust {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.ra99-pp-trust__item {
  padding: 10px;
  border-radius: 10px;
  background: #f5f9fc;
  border: 1px solid var(--border, rgba(16, 55, 88, 0.12));
  min-height: 64px;
}
.ra99-pp-trust__item strong {
  display: block;
  font-size: 0.88rem;
  color: var(--text, #17324d);
}
.ra99-pp-trust__item span {
  display: block;
  font-size: 0.78rem;
  color: var(--muted, #698097);
  line-height: 1.3;
}

.ra99-pp-promo {
  margin: 0;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border, rgba(16, 55, 88, 0.12));
}
.ra99-pp-promo__label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 8px;
}
.ra99-pp-promo__row { display: flex; gap: 8px; }
.ra99-pp-promo__input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--border, rgba(16, 55, 88, 0.12));
  border-radius: 10px;
}
.ra99-pp-promo__msg { margin: 8px 0 0; font-size: 0.85rem; color: #1c8d56; }

.ra99-pp-options { margin-bottom: 14px; display: grid; gap: 10px; }
.ra99-pp-option__label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 0.9rem; }
.ra99-pp-option__control {
  width: 100%;
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid var(--border, rgba(16, 55, 88, 0.12));
  padding: 8px 10px;
}

.ra99-pp-tabs {
  background: #fff;
  border: 1px solid var(--border, rgba(16, 55, 88, 0.12));
  border-radius: 14px;
  padding: 8px 8px 18px;
  margin-bottom: 28px;
}
.ra99-pp-tabs__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border, rgba(16, 55, 88, 0.12));
}
.ra99-pp-tabs__btn {
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted, #698097);
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.ra99-pp-tabs__btn.is-active {
  background: #e8f2fa;
  color: var(--primary, #0b4e80);
}
.ra99-pp-tabs__panel { padding: 12px 10px 4px; }
.ra99-pp-tabs__panel[hidden] { display: none; }
.ra99-pp-specs { width: 100%; border-collapse: collapse; }
.ra99-pp-specs th,
.ra99-pp-specs td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border, rgba(16, 55, 88, 0.12));
  vertical-align: top;
}
.ra99-pp-specs th {
  width: 42%;
  color: var(--muted, #698097);
  font-weight: 600;
}
.ra99-pp-info-list { margin: 0 0 12px; padding-left: 18px; }
.ra99-pp-info-list li { margin: 0 0 8px; }
.ra99-pp-muted { color: var(--muted, #698097); }
.ra99-pp-desc { line-height: 1.55; }

.ra99-pp-rail { margin-bottom: 28px; }
.ra99-pp-rail__head h2 {
  margin: 0 0 12px;
  font-size: 1.25rem;
  color: var(--brand-blue, #1a3a5c);
}
.ra99-pp-rail__track {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.ra99-pp-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--border, rgba(16, 55, 88, 0.12));
  border-radius: 12px;
}
.ra99-pp-card__link {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: inherit;
}
.ra99-pp-card img {
  width: 100%;
  height: 140px;
  object-fit: contain;
  background: #f7fbfe;
  border-radius: 8px;
}
.ra99-pp-card__name {
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ra99-pp-card__meta {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px;
}
.ra99-pp-card__price { font-weight: 800; color: var(--primary, #0b4e80); }
.ra99-pp-card__stock { font-size: 0.78rem; font-weight: 700; }
.ra99-pp-card__stock.is-ok { color: #1c8d56; }
.ra99-pp-card__stock.is-out { color: #c47a12; }
.ra99-pp-card__cart { width: 100%; min-height: 40px; }
.ra99-pp-card__oos {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 10px;
  background: #f3f6f9;
  color: #c47a12;
  font-weight: 700;
  font-size: 0.88rem;
  text-align: center;
}

.ra99-pp-buybar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 34;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border, rgba(16, 55, 88, 0.12));
  box-shadow: 0 -8px 24px rgba(10, 45, 72, 0.08);
}
.ra99-pp-buybar[hidden] { display: none !important; }
.ra99-pp-buybar__price {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary, #0b4e80);
  white-space: nowrap;
}
.ra99-pp-buybar__btn { flex: 1; min-height: 48px; }

/* Keep help widget above buybar, not covering checkout */
body.ra99-product-preview .help-widget {
  bottom: calc(18px + var(--ra99-pp-buybar-h));
  z-index: 40;
}

.ra99-pp-lightbox {
  border: 0;
  padding: 0;
  background: rgba(8, 24, 40, 0.88);
  max-width: 100vw;
  max-height: 100vh;
  width: 100vw;
  height: 100vh;
}
.ra99-pp-lightbox::backdrop { background: transparent; }
.ra99-pp-lightbox img {
  display: block;
  max-width: min(92vw, 1100px);
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 5vh auto 0;
}
.ra99-pp-lightbox__close {
  position: fixed;
  top: 12px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 2;
}
.ra99-pp-lightbox__nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #17324d;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.ra99-pp-lightbox__nav--prev { left: 12px; }
.ra99-pp-lightbox__nav--next { right: 12px; }

@media (max-width: 900px) {
  .ra99-pp-grid { grid-template-columns: 1fr; }
  .ra99-pp-title {
    font-size: clamp(1.1rem, 4.5vw, 1.4rem);
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .ra99-pp-actions { grid-template-columns: 1fr; }
  .ra99-pp-trust { grid-template-columns: 1fr; }
  .ra99-pp-rail__track { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ra99-pp-gallery__main { aspect-ratio: 1 / 1; min-height: 280px; }
}

@media (max-width: 560px) {
  .ra99-pp-rail__track { grid-template-columns: 1fr 1fr; }
  .ra99-pp-buybar:not([hidden]) ~ *,
  body.ra99-product-preview.has-buybar {
    --ra99-pp-buybar-h: 72px;
  }
}

/* —— Stage 0.7.2: header cart must stay fully inside viewport (~1280–1440) ——
   Shared chrome uses nowrap + search min-width:300 + full mgr/cart labels;
   flex overflow + site-header overflow-x:clip hid badge/sum and blocked mini-cart. */
body.ra99-product-preview .header-bar {
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
body.ra99-product-preview .search {
  flex: 1 1 auto;
  min-width: 0;
}
body.ra99-product-preview .header-actions {
  flex: 0 0 auto;
  flex-shrink: 0;
  min-width: 0;
  max-width: 100%;
}
body.ra99-product-preview .header-cart {
  flex: 0 0 auto;
  flex-shrink: 0;
  position: relative;
}
body.ra99-product-preview .header-cart__btn {
  max-width: none;
}
body.ra99-product-preview #headerCartDropdown.ra99-mini-cart__panel {
  right: 0;
  left: auto;
  width: min(380px, calc(100vw - 24px));
  max-width: calc(100vw - 16px);
}

/* Collapse long labels before cart is pushed past wrap edge (~1180 content) */
@media (min-width: 901px) and (max-width: 1479px) {
  body.ra99-product-preview .header-cart__label {
    display: none !important;
  }
  body.ra99-product-preview .mgr-label--full {
    display: none !important;
  }
  body.ra99-product-preview .mgr-label--short {
    display: inline !important;
  }
  body.ra99-product-preview .search {
    min-width: 0;
    flex: 1 1 12rem;
  }
}

@media (min-width: 901px) and (max-width: 1280px) {
  body.ra99-product-preview .header-cart__sum {
    font-size: 0.8rem;
  }
  body.ra99-product-preview .header-actions {
    gap: 6px;
  }
  body.ra99-product-preview .header-actions .btn-primary {
    padding: 0 10px;
    font-size: 0.85rem;
  }
}

@media (min-width: 1480px) {
  body.ra99-product-preview .search {
    min-width: min(300px, 100%);
  }
}
