/* ============================================================
   Single Product — Leñas Solórzano
   Layout inspiré des captures user (style electropo).
   Scoped under .sp-page — uses main.css tokens.
   ============================================================ */

.sp-page {
  --sp-gap: 40px;
  --sp-card-radius: 16px;
  --sp-border: #F0E6D3;
  --sp-cream: #FAF3EB;
  --sp-navy: #3D2010;
  --sp-navy-dark: #1A0C05;
  --sp-teal: #C4561A;
  --sp-text: #2C1A0E;
  --sp-muted: #7A6A5A;
  --sp-green: #25A96B;
  --sp-red: #EF4444;
  padding-bottom: 80px;
}

/* ── Breadcrumb ───────────────────────────────────────── */
.sp-breadcrumb {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  padding: 20px 0 16px;
  font-size: 13px; color: var(--sp-muted);
}
.sp-breadcrumb a { color: var(--sp-teal); text-decoration: none; }
.sp-breadcrumb a:hover { text-decoration: underline; }
.sp-breadcrumb__sep { opacity: 0.5; }
.sp-breadcrumb__current { color: var(--sp-text); font-weight: 500; }

/* ── Row 1 : Gallery + Info ───────────────────────────── */
.sp-main {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-gap);
  margin-bottom: 24px;
}
@media (min-width: 900px) {
  .sp-main { grid-template-columns: minmax(0, 1fr) minmax(400px, 1fr); }
}

/* Gallery */
.sp-gallery { min-width: 0; }
.sp-gallery__main {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--sp-cream);
  border-radius: var(--sp-card-radius);
  overflow: hidden;
  margin: 0;
  display: flex; align-items: center; justify-content: center;
}
.sp-gallery__main img {
  max-width: 88%; max-height: 88%;
  width: auto; height: auto;
  object-fit: contain;
}
.sp-gallery__thumbs {
  display: flex; gap: 12px; list-style: none; padding: 12px 0 0; margin: 0;
  overflow-x: auto; scrollbar-width: none;
}
.sp-gallery__thumbs::-webkit-scrollbar { display: none; }
.sp-gallery__thumb {
  width: 72px; height: 72px;
  padding: 4px;
  background: var(--sp-cream);
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s;
}
.sp-gallery__thumb img { width: 100%; height: 100%; object-fit: contain; }
.sp-gallery__thumb.is-active { border-color: var(--sp-teal); }
.sp-gallery__thumb:hover { border-color: rgba(196,86,26,0.5); }

/* Info column */
.sp-info { min-width: 0; }
.sp-info__brand {
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--sp-muted); margin: 0 0 10px;
}
.sp-info__title {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 700; color: var(--sp-navy);
  line-height: 1.2; margin: 0 0 12px;
}
.sp-info__cat-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  background: #B5D334; color: #1a1a1a;
  font-size: 11px; font-weight: 700;
  margin-bottom: 16px;
}
.sp-info__price-row {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  margin: 0 0 12px;
}
.sp-price {
  font-size: 32px; font-weight: 700;
  color: var(--sp-green);
  letter-spacing: -0.02em;
  line-height: 1;
}
.sp-price .woocommerce-Price-amount { color: inherit; }
.sp-price--sale { color: var(--sp-teal); }
.sp-price--old {
  font-size: 18px; text-decoration: line-through;
  color: var(--sp-muted); font-weight: 500;
}
.sp-badge-discount {
  padding: 4px 10px;
  background: var(--sp-red); color: white;
  font-size: 12px; font-weight: 700;
  border-radius: 999px;
}
.sp-info__stock {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(37,169,107,0.10);
  color: var(--sp-green);
  font-size: 13px; font-weight: 600;
  margin: 0 0 16px;
}
.sp-info__stock.is-out {
  background: rgba(239,68,68,0.10); color: var(--sp-red);
}
.sp-info__stock .sp-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: currentColor;
}
.sp-info__lead {
  font-size: 14px; color: var(--sp-text);
  line-height: 1.6; margin: 0 0 12px;
}
.sp-checks {
  list-style: none; padding: 0; margin: 0 0 20px;
  display: flex; flex-direction: column; gap: 8px;
}
.sp-checks li {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 14px; color: var(--sp-text);
  line-height: 1.5;
}
.sp-check-ico { flex-shrink: 0; color: var(--sp-green); margin-top: 2px; }

/* Mini specs 2x2 grid */
.sp-mini-specs {
  display: grid; grid-template-columns: 1fr 1fr;
  border: 1px solid var(--sp-border); border-radius: 10px;
  overflow: hidden;
  margin: 0 0 16px;
}
.sp-mini-spec {
  padding: 12px 14px;
  border-top: 1px solid var(--sp-border);
  border-right: 1px solid var(--sp-border);
  display: flex; flex-direction: column; gap: 4px;
}
.sp-mini-spec:nth-child(-n+2) { border-top: none; }
.sp-mini-spec:nth-child(2n) { border-right: none; }
.sp-mini-spec__label {
  font-size: 11px; color: var(--sp-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.sp-mini-spec__value {
  font-size: 14px; font-weight: 600; color: var(--sp-text);
}

/* Mini info bar */
.sp-info-bar {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-wrap: wrap; gap: 16px;
  font-size: 12px; color: var(--sp-muted);
}
.sp-info-bar li { display: inline-flex; align-items: center; gap: 6px; }
.sp-info-bar svg { color: var(--sp-teal); }
.sp-info-bar--dark { color: rgba(255,255,255,0.8); }
.sp-info-bar--dark svg { color: rgba(255,255,255,0.85); }

/* ── Row 2 : CTA banner (full-width, dark) ────────────── */
.sp-cta-banner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 16px 24px;
  padding: 16px 24px;
  background: var(--sp-navy-dark);
  color: white;
  border-radius: var(--sp-card-radius);
  margin: 8px 0 40px;
  box-shadow: 0 6px 20px rgba(26,12,5,0.20);
  transition: box-shadow 0.25s, transform 0.25s;
}
.sp-cta-banner.is-sticky {
  position: sticky; top: 130px; z-index: 30;
  box-shadow: 0 10px 30px rgba(26,12,5,0.30);
}
.sp-cta-banner__info { flex: 1 1 300px; min-width: 0; }
.sp-cta-banner__actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; flex-wrap: wrap; }

/* Quantity */
.sp-qty {
  display: inline-flex; align-items: center;
  background: white; color: var(--sp-navy);
  border-radius: 10px;
  overflow: hidden;
}
.sp-qty__btn {
  width: 40px; height: 44px;
  background: transparent; border: none;
  font-size: 20px; font-weight: 600; color: var(--sp-navy);
  cursor: pointer;
  transition: background 0.15s;
}
.sp-qty__btn:hover { background: rgba(196,86,26,0.10); }
.sp-qty__input {
  width: 48px; height: 44px;
  border: none; text-align: center;
  font-size: 15px; font-weight: 600; color: var(--sp-navy);
  background: transparent;
  -moz-appearance: textfield;
}
.sp-qty__input::-webkit-outer-spin-button,
.sp-qty__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* CTA button (on banner) */
.sp-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 24px;
  background: var(--sp-teal); color: white;
  border: none; border-radius: 10px;
  font-size: 15px; font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
  min-height: 44px;
}
.sp-cta:hover { background: #A8461A; }
.sp-cta:active { transform: scale(0.98); }
.sp-cta.is-disabled { background: rgba(255,255,255,0.15); cursor: not-allowed; color: rgba(255,255,255,0.5); }
.sp-cta .sp-cta__total { color: white; font-weight: 700; }
.sp-cta .sp-cta__sep { opacity: 0.6; margin: 0 2px; }
.sp-cta .woocommerce-Price-amount { color: inherit; }

/* ── Row 3 : Description + Sidebar Info clave ─────────── */
.sp-body {
  display: grid; grid-template-columns: 1fr; gap: 32px;
  margin: 0 0 48px;
}
@media (min-width: 900px) {
  .sp-body { grid-template-columns: minmax(0, 2.4fr) minmax(280px, 1fr); }
}
.sp-body__main { min-width: 0; }
.sp-h2 {
  font-size: clamp(1.3rem, 2vw, 1.6rem);
  font-weight: 700; color: var(--sp-navy);
  margin: 32px 0 16px; padding-bottom: 8px;
  border-bottom: 2px solid var(--sp-cream);
}
.sp-h2:first-child { margin-top: 0; }
.sp-body__prose {
  font-size: 15px; line-height: 1.7; color: var(--sp-text);
}
.sp-body__prose p { margin: 0 0 16px; }
.sp-body__prose h3 { font-size: 18px; font-weight: 700; color: var(--sp-navy); margin: 24px 0 12px; }
.sp-body__prose strong { color: var(--sp-navy); }
.sp-body__prose ul, .sp-body__prose ol { padding-left: 22px; margin: 0 0 16px; }
.sp-body__prose li { margin: 4px 0; }

/* Specs table */
.sp-specs-table {
  width: 100%;
  border-collapse: collapse;
  border-top: 1px solid var(--sp-border);
  font-size: 14px;
}
.sp-specs-table tr { border-bottom: 1px solid var(--sp-border); }
.sp-specs-table tr:nth-child(even) { background: #FBF8F2; }
.sp-specs-table th, .sp-specs-table td {
  padding: 12px 16px;
  text-align: left; vertical-align: top;
}
.sp-specs-table th {
  font-weight: 500; color: var(--sp-muted);
  width: 40%;
}
.sp-specs-table td {
  color: var(--sp-text); font-weight: 600;
}

/* Reviews */
.sp-reviews__head {
  display: flex; justify-content: space-between; align-items: baseline;
  flex-wrap: wrap; gap: 12px;
  margin-bottom: 20px;
}
.sp-reviews__head strong { color: var(--sp-navy); font-size: 20px; }
.sp-reviews__count { color: var(--sp-muted); font-size: 13px; }
.sp-reviews__link {
  color: var(--sp-teal); font-weight: 600; text-decoration: none; font-size: 14px;
}
.sp-reviews__link:hover { text-decoration: underline; }

/* Sidebar card */
.sp-body__side { min-width: 0; }
@media (min-width: 900px) { .sp-body__side { position: sticky; top: 130px; align-self: start; } }
.sp-side-card {
  background: var(--sp-cream);
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-card-radius);
  padding: 24px;
}
.sp-side-card__title {
  font-size: 15px; font-weight: 700; color: var(--sp-navy);
  margin: 0 0 16px;
}
.sp-side-card__list {
  list-style: none; padding: 0; margin: 0 0 20px;
  display: flex; flex-direction: column; gap: 10px;
}
.sp-side-card__list li {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 14px; color: var(--sp-text); line-height: 1.5;
}
.sp-side-card__list svg { color: var(--sp-teal); flex-shrink: 0; margin-top: 2px; }
.sp-side-card__contact {
  padding-top: 16px; border-top: 1px solid var(--sp-border);
}
.sp-side-card__label {
  font-size: 12px; color: var(--sp-muted);
  text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 700; margin: 0 0 4px;
}
.sp-side-card__mail {
  color: var(--sp-teal); font-weight: 600; font-size: 14px; text-decoration: none;
}
.sp-side-card__mail:hover { text-decoration: underline; }

/* ── Row 4 : Related products ─────────────────────────── */
.sp-related { margin-top: 48px; }
.sp-related__title {
  font-size: clamp(1.4rem, 2.4vw, 1.8rem);
  font-weight: 700; color: var(--sp-navy);
  margin: 0 0 24px;
}
.sp-related__grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px;
}
@media (min-width: 640px) { .sp-related__grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .sp-related__grid { grid-template-columns: repeat(4, 1fr); } }

/* ── Mobile adjustments ───────────────────────────────── */
@media (max-width: 767px) {
  .sp-cta-banner { flex-direction: column; align-items: stretch; padding: 16px; }
  .sp-cta-banner__info { text-align: center; }
  .sp-cta-banner__actions { justify-content: space-between; }
  .sp-cta { flex: 1; }
  .sp-mini-specs { grid-template-columns: 1fr; }
  .sp-mini-spec:nth-child(2n) { border-right: none; }
  .sp-mini-spec { border-right: none; }
  .sp-info__title { font-size: 22px; }
  .sp-price { font-size: 26px; }
}
