/**
 * Typography & Spacing Improvements - ITOOLS
 * Estilos globales para mejorar legibilidad en desktop y mobile
 */

/* ========================================
   TIPOGRAFÍA BASE
   ======================================== */

/* Mejorar legibilidad en todos los dispositivos */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "kern" 1;
    font-kerning: normal;
}

/* ========================================
   HEADINGS RESPONSIVE
   ======================================== */

/* H1 - Títulos principales */
h1, .h1 {
    font-size: clamp(1.75rem, 4vw, 3rem); /* 28px - 48px */
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

/* H2 - Títulos de sección */
h2, .h2 {
    font-size: clamp(1.5rem, 3vw, 2.25rem); /* 24px - 36px */
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 0.875rem;
}

/* H3 - Subtítulos */
h3, .h3 {
    font-size: clamp(1.25rem, 2.5vw, 1.875rem); /* 20px - 30px */
    line-height: 1.4;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

/* H4 - Títulos menores */
h4, .h4 {
    font-size: clamp(1.125rem, 2vw, 1.5rem); /* 18px - 24px */
    line-height: 1.4;
    font-weight: 600;
    margin-bottom: 0.625rem;
}

/* H5, H6 */
h5, .h5 {
    font-size: clamp(1rem, 1.5vw, 1.25rem); /* 16px - 20px */
    line-height: 1.5;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

h6, .h6 {
    font-size: clamp(0.875rem, 1.25vw, 1rem); /* 14px - 16px */
    line-height: 1.5;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* ========================================
   PÁRRAFOS Y TEXTO
   ======================================== */

/* Body text responsive */
p {
    font-size: clamp(0.875rem, 1.5vw, 1rem); /* 14px - 16px */
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* Texto grande para intros */
.lead, .text-lead {
    font-size: clamp(1rem, 2vw, 1.25rem); /* 16px - 20px */
    line-height: 1.7;
    font-weight: 400;
}

/* Texto pequeño */
.text-sm, small {
    font-size: clamp(0.75rem, 1.25vw, 0.875rem); /* 12px - 14px */
    line-height: 1.5;
}

/* ========================================
   ESPACIADO CONSISTENTE
   ======================================== */

/* Secciones con espaciado vertical responsive */
section {
    padding-top: clamp(2rem, 5vw, 4rem);
    padding-bottom: clamp(2rem, 5vw, 4rem);
}

/* Contenedores principales */
.container-spacing {
    padding-left: clamp(1rem, 3vw, 2rem);
    padding-right: clamp(1rem, 3vw, 2rem);
}

/* ========================================
   MEJORAR CARDS Y COMPONENTES
   ======================================== */

/* Cards más espaciosas */
.product-card,
.card {
    padding: clamp(1rem, 2vw, 1.5rem);
}

.product-card h3,
.card h3 {
    margin-bottom: 0.5rem;
    font-size: clamp(1rem, 1.75vw, 1.25rem);
}

.product-card p,
.card p {
    font-size: clamp(0.875rem, 1.25vw, 1rem);
    line-height: 1.5;
}

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

/* Botones con mejor espaciado */
button,
.button,
.btn,
.wp-element-button,
.woocommerce-Button {
    font-size: clamp(0.875rem, 1.5vw, 1rem) !important;
    padding: clamp(0.625rem, 1.5vw, 0.875rem) clamp(1rem, 3vw, 1.5rem) !important;
    line-height: 1.5 !important;
    font-weight: 500 !important;
}

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

ul, ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* ========================================
   CATEGORÍAS Y BREADCRUMBS
   ======================================== */

/* Breadcrumbs más legibles */
.woocommerce-breadcrumb,
nav[aria-label="Breadcrumb"] {
    font-size: clamp(0.75rem, 1.25vw, 0.875rem);
    padding: clamp(0.75rem, 2vw, 1rem) 0;
    line-height: 1.5;
}

.woocommerce-breadcrumb a,
nav[aria-label="Breadcrumb"] a {
    color: #6b7280;
    transition: color 0.2s ease;
}

.woocommerce-breadcrumb a:hover,
nav[aria-label="Breadcrumb"] a:hover {
    color: #2563eb;
}

/* ========================================
   PRECIOS
   ======================================== */

/* Precios más destacados */
.price,
.woocommerce-Price-amount {
    font-size: clamp(1.25rem, 2.5vw, 1.75rem) !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
}

/* Precio regular tachado */
del .woocommerce-Price-amount {
    font-size: clamp(1rem, 1.75vw, 1.25rem) !important;
    font-weight: 400 !important;
    opacity: 0.7;
}

/* ========================================
   FILTROS Y SIDEBAR
   ======================================== */

/* Títulos de filtros */
.filters-sidebar h3,
.filters-sidebar h4,
aside h3,
aside h4 {
    font-size: clamp(1rem, 1.5vw, 1.125rem);
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

/* Texto de filtros */
.filters-sidebar label,
aside label {
    font-size: clamp(0.875rem, 1.25vw, 0.9375rem);
    line-height: 1.5;
}

/* ========================================
   RESPONSIVE TABLES
   ======================================== */

/* Tablas responsive */
table {
    font-size: clamp(0.75rem, 1.25vw, 0.875rem);
}

table th,
table td {
    padding: clamp(0.5rem, 1.5vw, 1rem);
}

/* ========================================
   FORMULARIOS
   ======================================== */

/* Inputs y selects más espaciosos */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="search"],
select,
textarea {
    font-size: clamp(0.875rem, 1.5vw, 1rem) !important;
    padding: clamp(0.625rem, 1.5vw, 0.875rem) clamp(0.75rem, 2vw, 1rem) !important;
    line-height: 1.5 !important;
}

/* Labels de formularios */
label {
    font-size: clamp(0.875rem, 1.25vw, 0.9375rem);
    font-weight: 500;
    margin-bottom: 0.375rem;
    display: inline-block;
}

/* ========================================
   MODALES Y POPUPS
   ======================================== */

/* Modales más legibles */
.modal-content,
.popup-content {
    padding: clamp(1.5rem, 3vw, 2rem);
}

.modal-title,
.popup-title {
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    margin-bottom: 1rem;
}

/* ========================================
   PRODUCTO ÚNICO
   ======================================== */

/* Título del producto */
.product-title,
.product_title {
    font-size: clamp(1.5rem, 3.5vw, 2.5rem) !important;
    line-height: 1.2 !important;
    font-weight: 700 !important;
    margin-bottom: clamp(0.75rem, 2vw, 1.25rem) !important;
}

/* Descripción del producto */
.woocommerce-product-details__short-description,
.product-description {
    font-size: clamp(0.9375rem, 1.5vw, 1.0625rem);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

/* ========================================
   MEJORAS ESPECÍFICAS MOBILE
   ======================================== */

@media (max-width: 640px) {
    /* Reducir espaciado en mobile */
    section {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
    
    /* Ajustar line-height en mobile para mejor lectura */
    p {
        line-height: 1.7;
    }
    
    /* Botones más grandes en mobile para mejor UX */
    button,
    .button,
    .btn {
        min-height: 44px !important; /* Tamaño mínimo recomendado para touch */
    }
    
    /* Cards con menos padding en mobile */
    .product-card,
    .card {
        padding: 1rem;
    }
}

/* ========================================
   MEJORAS ESPECÍFICAS TABLET
   ======================================== */

@media (min-width: 641px) and (max-width: 1024px) {
    /* Espaciado medio para tablets */
    section {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
}

/* ========================================
   MEJORAS ESPECÍFICAS DESKTOP
   ======================================== */

@media (min-width: 1025px) {
    /* Mayor espaciado en desktop */
    section {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }
    
    /* Contenido más ancho pero limitado */
    .content-wrapper {
        max-width: 1280px;
        margin-left: auto;
        margin-right: auto;
    }
}

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

/* Clases helper para espaciado responsive */
.spacing-xs { margin-bottom: clamp(0.5rem, 1vw, 0.75rem); }
.spacing-sm { margin-bottom: clamp(0.75rem, 1.5vw, 1rem); }
.spacing-md { margin-bottom: clamp(1rem, 2vw, 1.5rem); }
.spacing-lg { margin-bottom: clamp(1.5rem, 3vw, 2rem); }
.spacing-xl { margin-bottom: clamp(2rem, 4vw, 3rem); }

/* Padding responsive */
.padding-section { padding: clamp(2rem, 5vw, 4rem) clamp(1rem, 3vw, 2rem); }
.padding-container { padding: clamp(1rem, 2vw, 1.5rem); }

/* ========================================
   ACCESIBILIDAD Y LEGIBILIDAD
   ======================================== */

/* Mejorar contraste de texto gris */
.text-gray-600 {
    color: #4b5563 !important; /* Más oscuro para mejor contraste */
}

.text-gray-500 {
    color: #6b7280 !important;
}

/* Separación de links con texto */
a {
    text-decoration-skip-ink: auto;
}

/* Focus visible para accesibilidad */
*:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
    border-radius: 2px;
}

/* ========================================
   ANIMACIONES SUAVES
   ======================================== */

/* Transiciones suaves para mejor UX */
a, button, .button, .btn {
    transition: all 0.2s ease-in-out;
}

/* Reducir movimiento para usuarios que lo prefieran */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
