/*
Theme Name:   Shopper Modern
Theme URI:    https://ciudadvirtual.app
Description:  Child theme of Shopper with modern design enhancements
Author:       Ciudad Virtual
Author URI:   https://ciudadvirtual.app
Template:     shopper
Version:      1.0.0
License:      GNU General Public License v2 or later
License URI:  http://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  shopper-modern
*/

/* ==========================================================================
   VARIABLES CSS MODERNAS
   ========================================================================== */

:root {
    /* Colores principales - Paleta moderna */
    --primary-color: #2196F3;
    --primary-dark: #1976D2;
    --primary-light: #BBDEFB;
    
    --secondary-color: #FF5722;
    --secondary-dark: #E64A19;
    --secondary-light: #FFCCBC;
    
    --accent-color: #00BCD4;
    --success-color: #4CAF50;
    --warning-color: #FF9800;
    --error-color: #F44336;
    
    /* Grises modernos */
    --gray-50: #FAFAFA;
    --gray-100: #F5F5F5;
    --gray-200: #EEEEEE;
    --gray-300: #E0E0E0;
    --gray-400: #BDBDBD;
    --gray-500: #9E9E9E;
    --gray-600: #757575;
    --gray-700: #616161;
    --gray-800: #424242;
    --gray-900: #212121;
    
    /* Tipografía */
    --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    --font-heading: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Sombras modernas */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Bordes */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* Transiciones */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   TIPOGRAFÍA MODERNA
   ========================================================================== */

body {
    font-family: var(--font-primary);
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-800);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.3;
    color: var(--gray-900);
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

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

.button,
button,
input[type="submit"],
input[type="button"],
.btn,
.woocommerce #respond input#submit,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 12px 24px;
    font-weight: 500;
    font-size: 16px;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.5;
    /* Centrado perfecto */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    vertical-align: middle;
}

.button:hover,
button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
.woocommerce #respond input#submit:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    color: white;
}

.button:active,
button:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

/* Asegurar que los iconos dentro de botones también estén centrados */
.button > *,
button > *,
.woocommerce a.button > *,
.woocommerce button.button > * {
    vertical-align: middle;
}

/* Fix para botones con solo iconos */
.button.icon-only,
button.icon-only {
    padding: 12px;
    width: auto;
    min-width: 44px;
}

/* Botón secundario */
.button.alt,
.woocommerce #respond input#submit.alt,
.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce input.button.alt {
    background: var(--secondary-color);
}

.button.alt:hover,
.woocommerce #respond input#submit.alt:hover,
.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover,
.woocommerce input.button.alt:hover {
    background: var(--secondary-dark);
}

/* ==========================================================================
   CARDS Y PRODUCTOS MODERNOS
   ========================================================================== */

/* Forzar reset completo de floats y clears del tema padre */
.woocommerce ul.products,
.woocommerce-page ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 1.5rem !important;
}

.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    overflow: hidden;
    border: 1px solid var(--gray-200);
    width: 100% !important;
    margin: 0 !important;
    float: none !important;
    clear: none !important;
}

/* Eliminar nth-child clears del tema padre */
.woocommerce ul.products li.product:nth-child(4n+1),
.woocommerce ul.products li.product.first {
    clear: none !important;
}

.woocommerce ul.products li.product:hover,
.woocommerce-page ul.products li.product:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: var(--gray-300);
}

.woocommerce ul.products li.product img,
.woocommerce-page ul.products li.product img {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    transition: transform var(--transition-slow);
}

.woocommerce ul.products li.product:hover img {
    transform: scale(1.05);
}

/* ==========================================================================
   HEADER MODERNO
   ========================================================================== */

.site-header {
    background: white;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.site-branding {
    padding: 1rem 0;
}

/* Navegación moderna */
.main-navigation a {
    color: var(--gray-700);
    font-weight: 500;
    transition: color var(--transition-fast);
    position: relative;
}

.main-navigation a:hover,
.main-navigation a:focus {
    color: var(--primary-color);
}

.main-navigation a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width var(--transition-base);
}

.main-navigation a:hover::after,
.main-navigation .current-menu-item a::after {
    width: 100%;
}

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

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
input[type="range"],
input[type="date"],
input[type="month"],
input[type="week"],
input[type="time"],
input[type="datetime"],
input[type="datetime-local"],
input[type="color"],
textarea,
select {
    background: white;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 16px;
    transition: all var(--transition-fast);
    width: 100%;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* ==========================================================================
   BADGES Y ETIQUETAS MODERNAS
   ========================================================================== */

.woocommerce span.onsale {
    background: var(--secondary-color);
    color: white;
    border-radius: var(--radius-full);
    padding: 8px 16px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: var(--shadow-md);
}

.woocommerce .star-rating {
    color: #FFC107;
}

/* ==========================================================================
   FOOTER MODERNO
   ========================================================================== */

.site-footer {
    background: var(--gray-900);
    color: var(--gray-300);
    padding: 4rem 0 2rem;
    margin-top: 4rem;
}

.site-footer a {
    color: var(--gray-300);
    transition: color var(--transition-fast);
}

.site-footer a:hover {
    color: var(--primary-light);
}

/* ==========================================================================
   ANIMACIONES Y TRANSICIONES SUAVES
   ========================================================================== */

* {
    transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;
    transition-duration: var(--transition-base);
}

/* ==========================================================================
   RESPONSIVE MODERNO
   ========================================================================== */

@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    
    .site-header {
        position: relative;
    }
}

/* ==========================================================================
   MEJORAS DE ACCESIBILIDAD
   ========================================================================== */

:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* ==========================================================================
   LOADING Y SKELETON (Opcional)
   ========================================================================== */

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 2000px 100%;
    animation: shimmer 2s infinite;
}

