/**
 * Single Product Styles
 * Santoliquido - Diseño aprobado final
 * 
 * FASE 1: Estilos visuales completos
 * FASE 2: Sin cambios (todo es visual)
 * 
 * Scope: Todas las clases usan prefijo .sp- para evitar conflictos
 */

/* =============================================
   DESIGN TOKENS
============================================= */
:root {
  --color-primary: #1f3a54;
  --color-secondary: #383838;
  --color-safety: #ffb400;
  --color-accent: #e5525d;
  --color-white: #ffffff;
  --color-light-grey: #f5f5f5;
  --color-border: #e8e8e8;
  --color-mid-grey: #a3a3a3;

  --font-family: "Inter", sans-serif;

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;

  /* VISUAL CHANGE: sombras eliminadas — sistema sin elevación flotante */
  --shadow-card: none;
  --shadow-sticky: none;

  --transition: 0.2s ease;

  /* Layout tokens */
  --header-height: 120px;
}

/* =============================================
   LAYOUT WRAPPER
============================================= */
/* VISUAL CHANGE: padding-top compensates header height */
.sp-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: calc(var(--header-height) + 28px) 20px 72px;
}

/* 2-col desktop layout */
.sp-layout {
  display: grid;
  grid-template-columns: 65fr 35fr;
  grid-template-areas:
    "main   sidebar"
    "main   sidebar"
    "main   sidebar";
  gap: 20px;
  align-items: start;
}

/* VISUAL CHANGE: columna principal como contenedor único sin gaps visibles entre secciones.
   Las secciones internas se separan solo con border-bottom, no con espacio entre cards */
.sp-main {
  grid-area: main;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.sp-sidebar {
  grid-area: sidebar;
}

/* Sticky sidebar wrapper — también sin gap entre bloques */
.sp-sidebar-inner {
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* =============================================
   CARD BASE — SISTEMA UNIFICADO
============================================= */
/* VISUAL CHANGE: las "cards" ya no son cajas flotantes independientes.
   Son secciones dentro de dos contenedores principales (main-panel y sidebar-panel).
   El fondo blanco, el borde externo y el radio se aplican al nivel de columna,
   no por bloque. Cada .sp-card es ahora una sección interna separada por border-bottom. */
.sp-card {
  background: var(--color-white);
  border: none;
  border-radius: 0;
  padding: 28px;
  box-shadow: none;
  text-align: left;
  /* Divisor interno sutil entre secciones */
  border-bottom: 1px solid var(--color-border);
}

/* Último bloque de cada columna sin borde inferior */
.sp-main > .sp-card:last-child,
.sp-sidebar-inner > .sp-card:last-child {
  border-bottom: none;
}

/* Contenedor visual de la columna principal (reemplaza múltiples cards) */
.sp-main {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* Contenedor visual de la columna sidebar (mismo criterio) */
.sp-sidebar-inner {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* =============================================
   TYPOGRAPHY HELPERS
============================================= */
.t-label {
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-mid-grey);
}

.t-h2 {
  font-size: 36px;
  font-weight: 800;
  line-height: 40px;
  color: var(--color-primary);
}

.t-h3 {
  font-size: 24px;
  font-weight: 700;
  line-height: 32px;
  color: var(--color-primary);
}

.t-h4 {
  font-size: 20px;
  font-weight: 600;
  line-height: 24px;
  color: var(--color-secondary);
}

.t-body {
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
}

.t-small {
  font-size: 14px;
  line-height: 24px;
  color: var(--color-mid-grey);
}

/* =============================================
   BADGE
============================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge--operational {
  background: #e6f4ea;
  color: #1a7f3c;
}

.badge--operational::before {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1a7f3c;
}

.badge--reserved {
  background: #fff3cd;
  color: #856404;
}

.badge--sold {
  background: #f8d7da;
  color: #842029;
}

/* =============================================
   BLOCK 1 — IDENTIDAD (sidebar top)
============================================= */
.sp-identity {
}

.sp-identity__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.sp-identity__title {
  font-size: 30px;
  font-weight: 800;
  line-height: 36px;
  color: var(--color-primary);
  margin-bottom: 4px;
  text-align: left;
}

.sp-identity__subtitle {
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  color: var(--color-mid-grey);
  margin-bottom: 24px;
  text-align: left;
}

.sp-identity__details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.sp-identity__detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sp-identity__detail-value {
  font-size: 16px;
  font-weight: 600;
  line-height: 20px;
  color: var(--color-secondary);
}

/* =============================================
   BLOCK 2 — GALERÍA
============================================= */
.sp-gallery__main {
  width: 100%;
  aspect-ratio: 16/10;
  background: var(--color-light-grey);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  margin-bottom: 12px;
}

.sp-gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: contain !important;
  background: var(--color-white);
}

.sp-gallery__count {
  position: absolute;
  bottom: 12px;
  right: 12px;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.75);
  color: var(--color-white);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
}

.sp-gallery__thumbs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.sp-gallery__thumb {
  aspect-ratio: 4/3;
  background: var(--color-light-grey);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
}

.sp-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--color-white);
}

.sp-gallery__thumb.active {
  border-color: var(--color-primary);
}

.sp-gallery__thumb:hover {
  border-color: var(--color-safety);
  transform: scale(1.02);
}

.sp-gallery__thumb:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* =============================================
   BLOCK 3 — FICHA TÉCNICA
============================================= */
.sp-specs__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 32px;
  margin-bottom: 24px;
  text-align: left;
}

.sp-specs__item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sp-specs__value {
  font-size: 18px;
  font-weight: 600;
  line-height: 24px;
  color: var(--color-secondary);
}

/* =============================================
   BLOCK 4 — DESCRIPCIÓN
============================================= */
.sp-description__content {
  color: var(--color-secondary);
  line-height: 28px;
  text-align: left;
}

.sp-description__content p {
  margin-bottom: 16px;
  text-align: left;
}

.sp-description__content p:last-child {
  margin-bottom: 0;
}

/* =============================================
   BLOCK 7 — DOCUMENTOS (Opcional - no en HTML actual)
============================================= */
.sp-documents__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.sp-documents__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--color-light-grey);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--transition);
}

.sp-documents__item:hover {
  background: var(--color-border);
  transform: translateX(4px);
}

.sp-documents__icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-white);
  border-radius: var(--radius-sm);
  color: var(--color-accent);
  flex-shrink: 0;
}

.sp-documents__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sp-documents__name {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-secondary);
}

.sp-documents__meta {
  font-size: 13px;
  color: var(--color-mid-grey);
}

/* =============================================
   BLOCK 8 — CTAs Y CONVERSIÓN (sidebar bottom)
============================================= */
.sp-cta-panel__price-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  background: #f0f7ff;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}

.sp-cta-panel__price-note svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.sp-cta-panel__price-note span {
  font-size: 14px;
  line-height: 20px;
  color: var(--color-primary);
  font-weight: 500;
}

.btn-primary,
.btn-whatsapp {
  width: 100%;
  padding: 16px 24px;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  font-family: var(--font-family);
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-white);
  margin-bottom: 12px;
}

.btn-primary:hover {
  background: #152a3f;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(31, 58, 84, 0.2);
  text-decoration: none;
  color: var(--color-white);
}

.btn-whatsapp {
  background: #25d366;
  color: var(--color-white);
  margin-bottom: 24px;
}

.btn-whatsapp:hover {
  background: #1ebe57;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.25);
  text-decoration: none;
  color: var(--color-white);
}

.sp-divider {
  text-align: center;
  position: relative;
  margin: 28px 0;
}

.sp-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--color-border);
}

.sp-divider span {
  position: relative;
  background: var(--color-white);
  padding: 0 16px;
  font-size: 13px;
  color: var(--color-mid-grey);
  font-weight: 500;
}

/* =============================================
   FORMULARIO INTEGRADO
============================================= */
.sp-form {
}

.sp-form__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-secondary);
  margin-bottom: 20px;
}

.sp-form__group {
  margin-bottom: 16px;
}

.sp-form__label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-secondary);
  margin-bottom: 8px;
}

.sp-form__label span {
  color: var(--color-accent);
}

.sp-form__input,
.sp-form__select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-family: var(--font-family);
  color: var(--color-secondary);
  transition: all var(--transition);
  background: var(--color-white);
}

.sp-form__input:focus,
.sp-form__select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(31, 58, 84, 0.1);
}

.sp-form__input::placeholder {
  color: var(--color-mid-grey);
}

.sp-form__select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23383838' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

.sp-form__submit {
  width: 100%;
  padding: 14px 24px;
  background: var(--color-primary);
  color: var(--color-white);
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-family);
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.sp-form__submit:hover {
  background: #152a3f;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(31, 58, 84, 0.2);
}

.sp-form__submit:active {
  transform: translateY(0);
}

.sp-form__response-time {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #e6f4ea;
  border-radius: var(--radius-sm);
}

.sp-form__response-time span {
  font-size: 13px;
  color: #1a7f3c;
  font-weight: 500;
}

/* =============================================
   ALIGNMENT HELPERS
============================================= */
.sp-specs,
.sp-description {
  text-align: left;
}

.sp-specs h2,
.sp-description h2 {
  margin-bottom: 24px;
  text-align: left;
}

/* =============================================
   RESPONSIVE — TABLET
============================================= */
@media (max-width: 1024px) {
  .sp-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "sidebar"
      "main";
  }

  .sp-sidebar-inner {
    position: static;
  }

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

/* =============================================
   RESPONSIVE — MOBILE
============================================= */
@media (max-width: 768px) {
  .sp-page {
    padding: calc(var(--header-height) + 20px) 16px 48px;
  }

  .sp-card {
    padding: 20px;
  }

  .sp-identity__title {
    font-size: 24px;
    line-height: 30px;
  }

  .sp-identity__details {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .sp-gallery__thumbs {
    grid-template-columns: repeat(4, 1fr);
  }

  .sp-gallery__thumb:last-child {
    display: none;
  }

  .t-h2 {
    font-size: 28px;
    line-height: 34px;
  }

  .t-h3 {
    font-size: 20px;
    line-height: 26px;
  }
}
