/**
 * Purewell — Estilos Base
 *
 * Estilos fundamentales aplicados a todos los elementos HTML.
 * Define la tipografía, colores y espaciados base.
 *
 * @version 1.0
 */

/* ============================================
   🎯 CONFIGURACIÓN BASE
   ============================================ */

html {
  font-size: 16px;
  /* Optimización para scroll suave en iOS */
  -webkit-overflow-scrolling: touch;
  /* Prevenir scroll horizontal */
  overflow-x: hidden;
  max-width: 100%;
  /* Mejorar renderizado de texto */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--pw-font-sans);
  font-size: var(--pw-text-base);
  font-weight: var(--pw-font-weight-regular);
  line-height: var(--pw-leading-relaxed);
  color: var(--pw-text);
  background-color: var(--pw-white);
  /* Prevenir scroll horizontal */
  overflow-x: hidden;
  max-width: 100%;
  position: relative;
}

/* ============================================
   📝 TIPOGRAFÍA
   ============================================ */

h1,
h2 {
  font-family: var(--pw-font-serif);
  font-weight: var(--pw-font-weight-bold);
  line-height: var(--pw-leading-tight);
  margin-bottom: var(--pw-space-4);
  color: var(--pw-primary);
}

h3,
h4,
h5,
h6 {
  font-family: var(--pw-font-sans);
  font-weight: var(--pw-font-weight-bold);
  line-height: var(--pw-leading-snug);
  margin-bottom: var(--pw-space-3);
  color: var(--pw-secondary);
}

h1 {
  font-size: var(--pw-text-5xl);
  font-weight: var(--pw-font-weight-black);
}

/* h2 - Títulos de secciones principales */
h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: var(--pw-font-weight-black);
  line-height: 1.3;
}

h3 {
  font-size: var(--pw-text-2xl);
}

h4 {
  font-size: var(--pw-text-xl);
}

h5 {
  font-size: var(--pw-text-lg);
}

h6 {
  font-size: var(--pw-text-base);
}

/* Párrafos - texto base 16px */
p {
  font-size: 1rem; /* 16px */
  color: var(--pw-text);
  margin-bottom: var(--pw-space-4);
}

strong,
b {
  font-weight: var(--pw-font-weight-bold);
}

em,
i {
  font-style: italic;
}

small {
  font-size: var(--pw-text-sm);
  color: var(--pw-text-secondary);
}

/* ============================================
   🔗 ENLACES
   ============================================ */

a {
  color: var(--pw-primary);
  text-decoration: none;
  transition: color var(--pw-transition-base);
}

a:hover {
  color: var(--pw-dark-olive);
}

a:focus {
  outline: 2px solid var(--pw-primary);
  outline-offset: 2px;
}

/* ============================================
   📋 LISTAS
   ============================================ */

ul,
ol {
  margin-bottom: var(--pw-space-4);
  padding-left: var(--pw-space-6);
}

ul {
  list-style-type: disc;
}

ol {
  list-style-type: decimal;
}

li {
  margin-bottom: var(--pw-space-2);
}

/* ============================================
   🎨 BOTONES
   ============================================ */

.btn {
  display: inline-block;
  padding: var(--pw-space-3) var(--pw-space-6);
  font-family: var(--pw-font-sans);
  font-size: var(--pw-text-base);
  font-weight: var(--pw-font-weight-semibold);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: var(--pw-tracking-wide);
  border-radius: var(--pw-radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--pw-transition-base);
  text-decoration: none;
}

.btn-primary {
  background-color: var(--pw-primary);
  color: var(--pw-text-inverse);
}

.btn-primary:hover {
  background-color: var(--pw-dark-olive);
  transform: translateY(-2px);
  box-shadow: var(--pw-shadow-md);
}

.btn-secondary {
  background-color: var(--pw-secondary);
  color: var(--pw-text-inverse);
}

.btn-secondary:hover {
  background-color: var(--pw-rich-chocolate);
  transform: translateY(-2px);
  box-shadow: var(--pw-shadow-md);
}

.btn-outline {
  background-color: transparent;
  color: var(--pw-primary);
  border: var(--pw-border-width-2) solid var(--pw-primary);
}

.btn-outline:hover {
  background-color: var(--pw-primary);
  color: var(--pw-text-inverse);
}

.btn-lg {
  padding: var(--pw-space-4) var(--pw-space-8);
  font-size: var(--pw-text-lg);
}

.btn-sm {
  padding: var(--pw-space-2) var(--pw-space-4);
  font-size: var(--pw-text-sm);
}

/* ============================================
   📦 CONTENEDORES
   ============================================ */

.container {
  width: 100%;
  max-width: var(--pw-container-xl);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--pw-space-5);
  padding-right: var(--pw-space-5);
}

.container-sm {
  max-width: var(--pw-container-sm);
}

.container-md {
  max-width: var(--pw-container-md);
}

.container-lg {
  max-width: var(--pw-container-lg);
}

/* ============================================
   📐 UTILIDADES DE ESPACIADO
   ============================================ */

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--pw-space-1); }
.mt-2 { margin-top: var(--pw-space-2); }
.mt-3 { margin-top: var(--pw-space-3); }
.mt-4 { margin-top: var(--pw-space-4); }
.mt-6 { margin-top: var(--pw-space-6); }
.mt-8 { margin-top: var(--pw-space-8); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--pw-space-1); }
.mb-2 { margin-bottom: var(--pw-space-2); }
.mb-3 { margin-bottom: var(--pw-space-3); }
.mb-4 { margin-bottom: var(--pw-space-4); }
.mb-6 { margin-bottom: var(--pw-space-6); }
.mb-8 { margin-bottom: var(--pw-space-8); }

.pt-0 { padding-top: 0; }
.pt-4 { padding-top: var(--pw-space-4); }
.pt-8 { padding-top: var(--pw-space-8); }
.pt-12 { padding-top: var(--pw-space-12); }
.pt-16 { padding-top: var(--pw-space-16); }

.pb-0 { padding-bottom: 0; }
.pb-4 { padding-bottom: var(--pw-space-4); }
.pb-8 { padding-bottom: var(--pw-space-8); }
.pb-12 { padding-bottom: var(--pw-space-12); }
.pb-16 { padding-bottom: var(--pw-space-16); }

/* ============================================
   🎯 UTILIDADES DE TEXTO
   ============================================ */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-xs { font-size: var(--pw-text-xs); }
.text-sm { font-size: var(--pw-text-sm); }
.text-base { font-size: var(--pw-text-base); }
.text-lg { font-size: var(--pw-text-lg); }
.text-xl { font-size: var(--pw-text-xl); }

.text-primary { color: var(--pw-primary); }
.text-secondary { color: var(--pw-secondary); }
.text-muted { color: var(--pw-text-secondary); }

.font-bold { font-weight: var(--pw-font-weight-bold); }
.font-semibold { font-weight: var(--pw-font-weight-semibold); }
.font-normal { font-weight: var(--pw-font-weight-regular); }

.uppercase { text-transform: uppercase; }
.lowercase { text-transform: lowercase; }
.capitalize { text-transform: capitalize; }

/* ============================================
   🖼️ IMÁGENES Y MEDIOS
   ============================================ */

img {
  max-width: 100%;
  height: auto;
}

.img-rounded {
  border-radius: var(--pw-radius-md);
}

.img-circle {
  border-radius: var(--pw-radius-full);
}

/* ============================================
   📺 UTILIDADES PARA VSL (Video Sales Letters)
   ============================================ */

/* Títulos principales de sección */
.vsl-title {
  font-family: var(--pw-font-serif);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: var(--pw-font-weight-black);
  color: var(--pw-primary);
  line-height: 1.3;
  margin: 0;
}

/* Subtítulos de sección con estilo itálico */
.vsl-subtitle {
  font-size: clamp(1.125rem, 2.75vw, 1.5rem);
  font-weight: var(--pw-font-weight-semibold);
  line-height: 1.5;
  font-style: italic;
  color: var(--pw-secondary);
}

/* Texto grande para contenido narrativo */
.vsl-text-large {
  font-size: clamp(1.0625rem, 2.5vw, 1.1875rem);
  line-height: 1.8;
}

/* Texto destacado/énfasis */
.vsl-text-highlight {
  font-size: clamp(1.125rem, 2.75vw, 1.375rem);
  font-weight: var(--pw-font-weight-semibold);
  line-height: 1.6;
}

/* Texto con mayor énfasis */
.vsl-text-emphasis {
  font-size: clamp(1.1875rem, 3vw, 1.5rem);
  font-weight: var(--pw-font-weight-semibold);
  line-height: 1.6;
  font-style: italic;
}

/* Override de color para fondos oscuros */
.text-white {
  color: var(--pw-white);
}

/* Override de color para texto en fondos claros */
.text-on-dark {
  color: var(--pw-white);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* ============================================
   📱 RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  html {
    font-size: 14px;
  }

  h1 {
    font-size: var(--pw-text-4xl);
  }

  h2 {
    font-size: var(--pw-text-2xl);
  }

  h3 {
    font-size: var(--pw-text-xl);
  }
}

@media (max-width: 480px) {
  .container {
    padding-left: var(--pw-space-4);
    padding-right: var(--pw-space-4);
  }
}

/* ============================================
   📱 FIXES PARA MÓVILES
   ============================================ */

/* Prevenir scroll horizontal en todos los elementos */
* {
  min-width: 0;
}

/* Asegurar que las secciones no se salgan */
section {
  overflow-x: hidden;
  max-width: 100vw;
}

/* En móviles, desactivar el overscroll bounce horizontal */
@media (max-width: 768px) {
  body {
    overscroll-behavior-x: none;
    overscroll-behavior-y: contain; /* Prevenir bounce en scroll vertical */
  }
  
  /* Asegurar que elementos dentro de containers no se salgan */
  .container,
  .container-sm,
  .container-md,
  .container-lg {
    overflow-x: hidden;
  }
}

/* Optimizaciones adicionales para dispositivos móviles */
@media (hover: none) and (pointer: coarse) {
  /* Desactivar hover en dispositivos táctiles */
  * {
    transition-duration: 0.1s !important;
  }
  
  /* Mejorar rendimiento de scroll */
  * {
    -webkit-tap-highlight-color: transparent;
  }
}
