/**
 * Paluwe Beauty - Estilos de Vista Inmersiva Vertical Estilo TikTok / Stories
 * Diseño enfocado en Smartphone (Pantalla Completa 9:16) y Regla del Grid 3x3
 * Adaptación Total a Modo Claro (Crema) y Modo Oscuro
 */

.tiktok-viewport-container {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  background: var(--tiktok-bg);
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
  transition: background-color 0.3s ease;
}

/* Marco para Desktop / PC (centrado con proporción móvil 9:16) */
.tiktok-device-wrapper {
  width: 100%;
  height: 100%;
  max-width: 480px;
  position: relative;
  overflow: hidden;
  background: var(--tiktok-bg);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.4), 0 0 100px rgba(217, 27, 66, 0.1);
}

@media (min-width: 768px) {
  .tiktok-device-wrapper {
    height: 94vh;
    border-radius: var(--radius-xl);
    border: 1px solid var(--card-glass-border);
  }
}

/* Slider Vertical de Productos */
.tiktok-slider {
  width: 100%;
  height: 100%;
  position: relative;
  touch-action: pan-y;
}

.tiktok-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.45s var(--ease-smooth), transform 0.45s var(--ease-smooth);
  will-change: transform, opacity;
}

.tiktok-slide.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  z-index: 10;
}

.tiktok-slide.slide-prev {
  opacity: 0;
  transform: translateY(-100%) scale(0.95);
}

.tiktok-slide.slide-next {
  opacity: 0;
  transform: translateY(100%) scale(0.95);
}

/* =========================================================
   ESTRUCTURA DE GRID 3X3
   - 2/3 Superiores (66%): Foco 100% en la Foto del Producto
   - 1/3 Inferior (33%): Tarjeta Glassmorphism de Información
   ========================================================= */

.grid-3x3-container {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: 2fr 1fr;
  position: relative;
}

/* 1. ZONA SUPERIOR (2/3 DEL GRID) - FOTO DEL PRODUCTO A PANTALLA COMPLETA */
.product-visual-area {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
  background: var(--bg-surface-elevated);
}

/* Carrusel de Imágenes con Crossfade Suave */
.product-gallery {
  width: 100%;
  height: 100%;
  position: relative;
}

.gallery-image-item {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  opacity: 0;
  transition: opacity 0.5s var(--ease-smooth), transform 0.6s var(--ease-smooth);
  will-change: opacity, transform;
}

.gallery-image-item.active {
  opacity: 1;
  transform: scale(1);
  z-index: 2;
}

/* Indicadores de Múltiples Fotos (Barra Superior de Historias) */
.gallery-story-indicators {
  position: absolute;
  top: 14px;
  left: 16px;
  right: 16px;
  display: flex;
  gap: 5px;
  z-index: 30;
}

.story-indicator-bar {
  flex: 1;
  height: 3px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

[data-theme="dark"] .story-indicator-bar {
  background: rgba(255, 255, 255, 0.3);
}

.story-indicator-fill {
  width: 0%;
  height: 100%;
  background: var(--paluwe-red);
  transition: width 0.3s linear;
}

.story-indicator-bar.active .story-indicator-fill {
  width: 100%;
}

/* Flechas de cambio de foto (tap izquierdo / derecho) */
.gallery-touch-zone {
  position: absolute;
  top: 0;
  bottom: 35%;
  width: 50%;
  z-index: 15;
  cursor: pointer;
}
.gallery-touch-zone.zone-left { left: 0; }
.gallery-touch-zone.zone-right { right: 0; }

/* 2. ZONA INFERIOR (1/3 DEL GRID) - TARJETA DE INFORMACIÓN CON GLASSMORPHISM */
.product-info-card-3x3 {
  grid-row: 2;
  position: relative;
  z-index: 20;
  align-self: end;
  width: 100%;
  background: var(--tiktok-card-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--tiktok-card-border);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 16px 18px 20px 18px;
  box-shadow: 0 -15px 35px rgba(0, 0, 0, 0.15);
  max-height: 48vh;
  overflow-y: auto;
  scrollbar-width: none;
}

[data-theme="dark"] .product-info-card-3x3 {
  box-shadow: 0 -15px 35px rgba(0, 0, 0, 0.6);
}

.product-info-card-3x3::-webkit-scrollbar {
  display: none;
}

/* Cabecera de la Tarjeta */
.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.card-category-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--paluwe-rose);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-badge-highlight {
  font-size: 10.5px;
  background: linear-gradient(135deg, var(--paluwe-red), var(--paluwe-rose));
  color: #fff;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-weight: 700;
}

.product-main-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 21px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 4px;
}

.product-subtitle-text {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.35;
  margin-bottom: 10px;
}

.product-description-text {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 12px;
}

/* Lista de Beneficios en Chips Suaves */
.benefits-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.benefit-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 500;
}

.benefit-chip-icon {
  color: var(--paluwe-rose);
  font-size: 12px;
}

/* Selector de Presentaciones (Tamaños / ml) */
.options-section-title {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.6px;
  margin-bottom: 6px;
}

.presentations-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.presentation-pill {
  padding: 7px 14px;
  border-radius: var(--radius-md);
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: all var(--transition-normal);
}

.presentation-pill:hover {
  background: var(--paluwe-rose-soft);
  border-color: var(--paluwe-rose);
  color: var(--paluwe-red);
}

.presentation-pill.active {
  background: var(--paluwe-rose-soft);
  border-color: var(--paluwe-red);
  color: var(--paluwe-red);
  box-shadow: 0 0 15px rgba(217, 27, 66, 0.2);
}

.presentation-pill .pill-price {
  font-size: 11px;
  color: var(--paluwe-red);
  font-weight: 700;
}

/* Selector de Variantes (Colores / Aromas) */
.variants-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  overflow-x: auto;
}

.variant-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  color: var(--text-secondary);
  font-size: 11.5px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.variant-chip.active {
  border-color: var(--paluwe-rose);
  background: var(--paluwe-rose-soft);
  color: var(--paluwe-red);
  font-weight: 700;
}

.variant-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 5px rgba(0,0,0,0.3);
}

/* Barra de Precio y Botones de Acción */
.action-price-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--divider-color);
}

.price-display-box {
  display: flex;
  flex-direction: column;
}

.price-display-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.price-display-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  font-family: inherit;
  transition: opacity 0.3s var(--ease-smooth);
}

.btn-add-tiktok {
  flex: 1;
  padding: 13px 18px;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--paluwe-red), var(--paluwe-red-dark));
  color: #fff !important;
  box-shadow: 0 6px 20px rgba(217, 27, 66, 0.35);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.btn-add-tiktok:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 25px rgba(217, 27, 66, 0.5);
}

/* =========================================================
   CONTROLES LATERALES FLOTANTES (ESTILO TIKTOK)
   ========================================================= */

.tiktok-sidebar-actions {
  position: absolute;
  right: 14px;
  bottom: 35%;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.tiktok-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
}

.tiktok-action-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--btn-glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--btn-glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-fast);
  color: var(--text-primary);
}

.tiktok-action-btn:hover .tiktok-action-circle {
  transform: scale(1.12);
  border-color: var(--paluwe-red);
  background: var(--paluwe-rose-soft);
  color: var(--paluwe-red);
}

.tiktok-action-label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-primary);
  text-shadow: 0 1px 4px rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] .tiktok-action-label {
  color: #fff;
  text-shadow: 0 2px 5px rgba(0,0,0,0.8);
}

/* Botón Superior Izquierdo: Volver al Catálogo */
.btn-back-catalog {
  position: absolute;
  top: 24px;
  left: 16px;
  z-index: 30;
  background: var(--btn-glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--btn-glass-border);
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.btn-back-catalog:hover {
  background: var(--paluwe-rose-soft);
  border-color: var(--paluwe-red);
  color: var(--paluwe-red);
}

/* Flechas de Navegación Vertical Flotantes (para PC / Desktop) */
.desktop-nav-arrows {
  position: absolute;
  right: -60px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  flex-direction: column;
  gap: 12px;
  z-index: 40;
}

@media (min-width: 768px) {
  .desktop-nav-arrows {
    display: flex;
  }
}

.btn-nav-arrow {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--card-glass-border);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.btn-nav-arrow:hover {
  background: var(--paluwe-red);
  color: #fff;
  border-color: var(--paluwe-red);
  transform: scale(1.1);
}
