/* Fríðheimr — Single Product Page (Boutique Redesign)
   Applies to: .single-product body class
   Physical: amuletts, candles, runic circles, talismans, sets, certificates
   Services: external type (mostly inherits, some overrides)
   Version: 1.0.0
*/

/* ═══════════════════════════════════════════════════════════════
   1. HERO — TWO-COLUMN GRID
═══════════════════════════════════════════════════════════════ */

.single-product div.product {
  display: grid !important;
  grid-template-columns: 55fr 45fr !important;
  gap: 56px !important;
  align-items: start !important;
  max-width: 1160px;
  margin: 0 auto;
  padding: 40px 32px;
}

.single-product div.product .woocommerce-product-gallery {
  grid-column: 1 !important;
  grid-row: 1 !important;
  position: sticky !important;
  top: 80px !important;
  width: 100% !important;
  float: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.single-product div.product .summary {
  grid-column: 2 !important;
  grid-row: 1 !important;
  width: 100% !important;
  float: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* All after-summary sections span full width */
.single-product div.product .woocommerce-tabs,
.single-product div.product .sp-section,
.single-product div.product .sp-trust-final,
.single-product div.product .related.products {
  grid-column: 1 / -1 !important;
}

/* ═══════════════════════════════════════════════════════════════
   2. GALLERY
═══════════════════════════════════════════════════════════════ */

/* Main image wrapper */
.single-product .woocommerce-product-gallery__wrapper {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid #ede9fe;
  background: #f9f7ff;
}

.single-product .woocommerce-product-gallery .woocommerce-product-gallery__image img {
  aspect-ratio: 4 / 3;
  width: 100%;
  object-fit: cover;
  display: block;
}

/* Zoom trigger — subtle */
.single-product .woocommerce-product-gallery__trigger {
  background: rgba(255, 255, 255, 0.9) !important;
  border-radius: 8px !important;
  top: 12px !important;
  right: 12px !important;
  width: 30px !important;
  height: 30px !important;
  padding: 5px !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
}

/* Thumbnails strip */
.single-product .flex-control-thumbs {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  margin-top: 10px !important;
  padding: 0 !important;
  list-style: none !important;
}

.single-product .flex-control-thumbs li { flex: 0 0 auto !important; }

.single-product .flex-control-thumbs img {
  width: 66px !important;
  height: 66px !important;
  object-fit: cover !important;
  border-radius: 10px !important;
  border: 2px solid transparent !important;
  cursor: pointer !important;
  opacity: 0.7;
  transition: border-color 180ms ease, opacity 180ms ease, transform 180ms ease !important;
}

.single-product .flex-control-thumbs li.flex-active img,
.single-product .flex-control-thumbs img:hover {
  border-color: #9333ea !important;
  opacity: 1 !important;
  transform: scale(1.04);
}

/* ═══════════════════════════════════════════════════════════════
   3. SUMMARY — RIGHT COLUMN
═══════════════════════════════════════════════════════════════ */

/* Category label (added via PHP hook) */
.sp-cat {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
}

.sp-cat__icon {
  flex-shrink: 0;
  opacity: 0.85;
}

.sp-cat__link {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9333ea;
  text-decoration: none;
}

.sp-cat__link:hover { color: #7e22ce; text-decoration: underline; }

/* Product title */
.single-product .product_title {
  font-size: 28px !important;
  font-weight: 800 !important;
  color: #1a0f3c !important;
  line-height: 1.2 !important;
  margin: 0 0 12px !important;
}

/* Short description */
.single-product .woocommerce-product-details__short-description {
  font-size: 15px !important;
  color: #4b5563 !important;
  line-height: 1.72 !important;
  margin: 0 0 16px !important;
}

/* Price */
.single-product .price {
  font-size: 26px !important;
  font-weight: 800 !important;
  color: #9333ea !important;
  margin: 0 0 10px !important;
  display: block !important;
  line-height: 1.15 !important;
}

.single-product .price del {
  font-size: 16px !important;
  color: #9ca3af !important;
  font-weight: 400 !important;
}

/* Stock status */
.single-product .stock {
  font-size: 12px !important;
  font-weight: 600 !important;
  padding: 4px 12px !important;
  border-radius: 20px !important;
  display: inline-block !important;
  margin-bottom: 16px !important;
}

.single-product .in-stock {
  background: #f0fdf4 !important;
  color: #15803d !important;
}

.single-product .out-of-stock {
  background: #fff7ed !important;
  color: #c2410c !important;
}

/* Add-to-cart form */
.single-product form.cart {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  flex-wrap: wrap !important;
  margin: 20px 0 16px !important;
}

/* Quantity input */
.single-product .quantity {
  display: flex !important;
  align-items: center !important;
  border: 1.5px solid #ede9fe !important;
  border-radius: 50px !important;
  overflow: hidden !important;
  height: 48px !important;
  background: #fff !important;
}

.single-product .quantity .qty {
  width: 52px !important;
  text-align: center !important;
  border: none !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  color: #1a0f3c !important;
  background: transparent !important;
  padding: 0 !important;
  -moz-appearance: textfield !important;
}

.single-product .quantity .qty::-webkit-inner-spin-button,
.single-product .quantity .qty::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* Primary CTA button */
.single-product .single_add_to_cart_button,
.single-product .product_type_external.single_add_to_cart_button {
  font-family: var(--font-main, inherit) !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  padding: 0 32px !important;
  border-radius: 50px !important;
  border: none !important;
  cursor: pointer !important;
  background: #f5d97a !important;
  color: #1a0f3c !important;
  transition: background 200ms ease, transform 200ms ease !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  height: 48px !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

.single-product .single_add_to_cart_button:hover {
  background: #f0cf60 !important;
  transform: translateY(-2px) !important;
}

.single-product .single_add_to_cart_button.loading {
  opacity: 0.8 !important;
}

/* Telegram secondary link */
.sp-tg-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #9333ea;
  text-decoration: none;
  margin-top: 10px;
  font-weight: 500;
}

.sp-tg-link svg { flex-shrink: 0; }
.sp-tg-link:hover { color: #7e22ce; text-decoration: underline; }

/* Trust mini badges */
.sp-trust-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid #f0ecff;
}

.sp-trust-item {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.4;
}

.sp-trust-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9333ea;
  flex-shrink: 0;
  margin-top: 3px;
  opacity: 0.65;
}

/* Hide default WC noise */
.single-product .product_meta { display: none !important; }
.single-product .woocommerce-product-rating { display: none !important; }
.single-product .woocommerce-tabs { display: none !important; }

/* Breadcrumb — subtle */
.single-product .woocommerce-breadcrumb {
  font-size: 12px !important;
  color: #9ca3af !important;
  padding: 12px 32px !important;
  margin: 0 !important;
  max-width: 1160px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.single-product .woocommerce-breadcrumb a {
  color: #9ca3af !important;
  text-decoration: none !important;
}

.single-product .woocommerce-breadcrumb a:hover { color: #9333ea !important; }

/* ═══════════════════════════════════════════════════════════════
   4. AFTER-SUMMARY SECTIONS (full-width inside .product grid)
═══════════════════════════════════════════════════════════════ */

/* Section base */
.sp-section {
  padding: 52px 0;
  border-top: 1px solid #f0ecff;
}

.sp-section__title {
  font-size: 20px;
  font-weight: 800;
  color: #1a0f3c;
  margin: 0 0 24px;
  letter-spacing: -0.01em;
}

/* ── О предмете / О сеансе ─────── */
.sp-about__body {
  font-size: 15px;
  color: #4b5563;
  line-height: 1.8;
  max-width: 680px;
}

.sp-about__body p { margin: 0 0 1em; }
.sp-about__body p:last-child { margin-bottom: 0; }
.sp-about__body ul, .sp-about__body ol { padding-left: 20px; margin: 0 0 1em; }
.sp-about__body li { margin-bottom: 6px; }
.sp-about__body strong, .sp-about__body b { color: #1a0f3c; font-weight: 600; }

/* ── Характеристики ─────────────── */
.sp-specs {
  display: flex;
  flex-direction: column;
  max-width: 540px;
  border: 1px solid #ede9fe;
  border-radius: 16px;
  overflow: hidden;
}

.sp-spec {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 11px 20px;
  border-bottom: 1px solid #ede9fe;
}

.sp-spec:last-child { border-bottom: none; }

.sp-spec:nth-child(even) { background: #faf9ff; }

.sp-spec__key {
  font-size: 11px;
  font-weight: 700;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  flex-shrink: 0;
  width: 130px;
  min-width: 130px;
}

.sp-spec__val {
  font-size: 14px;
  color: #1a0f3c;
  font-weight: 500;
}

/* ── Как использовать ───────────── */
.sp-howto {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 580px;
  position: relative;
}

.sp-howto::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 30px;
  bottom: 16px;
  width: 1px;
  background: #ede9fe;
  z-index: 0;
}

.sp-howto__step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  position: relative;
}

.sp-howto__num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ede9fe;
  color: #9333ea;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.sp-howto__text {
  font-size: 15px;
  color: #4b5563;
  line-height: 1.65;
  padding-top: 4px;
}

.sp-howto__note {
  font-size: 13px;
  color: #78716c;
  margin-top: 14px;
  padding: 10px 14px;
  background: #fff7ed;
  border-left: 3px solid #fb923c;
  border-radius: 0 8px 8px 0;
  max-width: 540px;
}

/* ── Как происходит заказ ────────── */
.sp-order__steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  position: relative;
  max-width: 860px;
}

.sp-order__steps::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 18px;
  right: 18px;
  height: 1px;
  background: linear-gradient(90deg, #9333ea 0%, #c4b5fd 100%);
  z-index: 0;
}

.sp-order__step {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.sp-order__num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #9333ea;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(147, 51, 234, 0.22);
}

.sp-order__step-label {
  font-size: 13px;
  color: #1a0f3c;
  font-weight: 700;
  line-height: 1.3;
}

.sp-order__step-text {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.5;
}

/* ── Доверие + дисклеймер ───────── */
.sp-trust-final {
  padding: 48px 0;
  border-top: 1px solid #f0ecff;
}

.sp-trust-final__inner {
  background: #f9f7ff;
  border-radius: 20px;
  padding: 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.sp-trust-final__title {
  font-size: 16px;
  font-weight: 800;
  color: #1a0f3c;
  margin: 0 0 14px;
}

.sp-trust-badges {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sp-trust-badge {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  color: #374151;
  line-height: 1.4;
}

.sp-trust-badge__dot {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 50%;
  background: #ede9fe;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.sp-disclaimer {
  font-size: 13px;
  color: #9ca3af;
  line-height: 1.7;
  padding: 20px;
  background: rgba(255,255,255,0.7);
  border-radius: 12px;
  border: 1px solid #ede9fe;
}

/* ── Похожие товары ─────────────── */
.sp-related {
  padding-bottom: 56px;
}

.sp-related:not(:first-of-type) { padding-top: 0; }

.sp-related__subtitle {
  font-size: 20px;
  font-weight: 800;
  color: #1a0f3c;
  margin: 0 0 24px;
}

.sp-related__subtitle + .sp-related__subtitle { margin-top: 40px; }

.sp-related__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.sp-related__card {
  background: #fff;
  border: 1px solid #ede9fe;
  border-radius: 14px;
  overflow: hidden;
  transition: box-shadow 220ms ease, transform 220ms ease;
  text-decoration: none !important;
  display: block;
}

.sp-related__card:hover {
  box-shadow: 0 8px 24px rgba(147, 51, 234, 0.1);
  transform: translateY(-3px);
}

.sp-related__img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}

.sp-related__img-placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, #f9f7ff 0%, #f0ecff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c4b5fd;
  font-size: 28px;
}

.sp-related__info {
  padding: 12px 14px 14px;
}

.sp-related__cat {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #9333ea;
  margin-bottom: 4px;
}

.sp-related__name {
  font-size: 13px;
  font-weight: 600;
  color: #1a0f3c;
  line-height: 1.3;
  margin-bottom: 6px;
}

.sp-related__price {
  font-size: 14px;
  font-weight: 700;
  color: #9333ea;
}

/* Hide default WC related (replaced by .sp-related) */
.single-product .related.products { display: none !important; }

/* ═══════════════════════════════════════════════════════════════
   5. MOBILE
═══════════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .single-product div.product {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
    padding: 20px !important;
  }

  .single-product div.product .woocommerce-product-gallery {
    grid-column: 1 !important;
    grid-row: 1 !important;
    position: static !important;
  }

  .single-product div.product .summary {
    grid-column: 1 !important;
    grid-row: 2 !important;
  }

  .single-product .product_title {
    font-size: 22px !important;
  }

  .sp-trust-row {
    grid-template-columns: 1fr;
  }

  .sp-order__steps {
    grid-template-columns: 1fr;
    max-width: 360px;
    gap: 20px;
  }

  .sp-order__steps::before {
    top: 0;
    bottom: 0;
    left: 17px;
    right: auto;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg, #9333ea 0%, #c4b5fd 100%);
  }

  .sp-order__step {
    flex-direction: row;
    gap: 14px;
    align-items: flex-start;
  }

  .sp-order__num { flex-shrink: 0; }

  .sp-trust-final__inner {
    grid-template-columns: 1fr;
    padding: 28px 20px;
  }

  .sp-related__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

@media (max-width: 560px) {
  .single-product .price {
    font-size: 22px !important;
  }

  .single-product .woocommerce-product-gallery .woocommerce-product-gallery__image img {
    aspect-ratio: 3 / 2;
  }

  .sp-related__grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .sp-section { padding: 36px 0; }
}
