/**
 * Divi Child Theme - Custom Styles (Minimal)
 * @version 1.0.0
 */

:root {
    --primary: #EAEBED;
    --text: #333;
}

/* Utilities */
.hidden { display: none !important; }
.text-center { text-align: center !important; }

/* Shortcode base */
.shortcode-wrapper {
    padding: 20px;
}

@media (max-width: 768px) {
    .shortcode-wrapper {
        padding: 15px;
    }
}

/* ============================================
   ESTILOS MENU AWS (BÚSQUEDA)
   ============================================ */

/* Contenedor búsqueda lado derecho */
.aws-container .aws-search-field {
    width: 100%;
    max-width: 100%;
    color: #313131;
    padding: 6px;
    line-height: 30px;
    display: block;
    font-size: 16px;
    position: relative;
    z-index: 2;
    -webkit-appearance: none;
    height: 100%;
    min-height: inherit;
    margin: 0 !important;
    border: 1px solid #d8d8d8;
    outline: 0;
    border-radius: 0px 30px 30px 0px !important;
}

/* Contenedor búsqueda lado izquierdo */
.aws-container .aws-search-form .aws-form-btn {
    display: -webkit-box;
    display: -moz-box;
    display: -ms-flexbox;
    display: -webkit-flex;
    display: flex;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    background: #ffffff !important;
    border: 1px solid #EAEBED !important;
    margin: 0 0 0 -1px;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    border-radius: 30px 0px 0px 30px !important;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-transition: background-color 100ms ease-in-out;
    -moz-transition: background-color 100ms ease-in-out;
    -o-transition: background-color 100ms ease-in-out;
    transition: background-color 100ms ease-in-out;
}

/* ============================================
   TARJETAS DE PRODUCTO - HOME
   ============================================ */

/* Grid de productos con altura uniforme por fila */
.woocommerce ul.products,
.woocommerce-page ul.products {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
    gap: 20px !important;
    align-items: stretch;
    width: 100% !important;
}

/* Layout de la tarjeta completa */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
    float: none !important;
    margin: 0 !important;
    padding: 0;
    position: relative;
    width: 100% !important;
    background-color: white;
    text-align: center;
    display: flex !important;
    flex-direction: column;
}

/* Contenedor del enlace (imagen + título + precio) crece para ocupar espacio */
.woocommerce ul.products li.product > a.woocommerce-loop-product__link {
    flex: 1;
    display: flex !important;
    flex-direction: column;
    border-radius: 24px 24px 0 0;
    overflow: hidden;
    background: white;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    padding-bottom: 0;
}

/* Fallback: si el enlace no tiene esa clase exacta */
.woocommerce ul.products li.product > a:first-child {
    flex: 1;
}

/* Contenedor del enlace - tarjeta completa (selector anterior para compatibilidad) */
.woocommerce ul.products li.product a {
    display: block;
    border-radius: 24px;
    overflow: hidden;
    background: white;
    text-align: center;
    padding-bottom: 10px;
    transition: all 0.3s ease;
    position: relative;
}

/* Imagen con altura fija y recorte proporcional */
.woocommerce ul.products li.product a img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    object-position: center;
    display: block;
    border-radius: 24px 24px 0 0;
    box-shadow:
        0px 0px 20px 8px rgba(255, 255, 255, 0.4),
        0px 0px 40px 16px rgba(255, 255, 255, 0.2),
        0px 0px 60px 24px rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(226, 232, 240, 0.6);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

/* Título ocupa el espacio flexible → precio y botón quedan al fondo */
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product h3 {
    flex: 1;
}

/* Hover DESACTIVADO - solo mantener border-radius */
.woocommerce ul.products li.product a:hover img {
    border-radius: 24px 24px 0 0;
}

/* Remover efectos de hover en el enlace */
.woocommerce ul.products li.product a:hover {
    box-shadow: none !important;
    transform: none !important;
}

.woocommerce ul.products li.first,
.woocommerce-page ul.products li.first {
    background-color: white;
}

/* Estilo de texto en tarjeta de producto */
.woocommerce ul.products li.product .woocommerce-loop-category__title, 
.woocommerce ul.products li.product .woocommerce-loop-product__title, 
.woocommerce ul.products li.product h3 {
    font-weight: bold;
    margin-bottom: 8px;
}

/* Precio */
.woocommerce ul.products li.product .price {
    margin-bottom: 12px;
    font-weight: 600;
}

/* ============================================
   BOTÓN AGREGAR AL CARRITO - HOME
   ============================================ */

/* Mostrar y estilizar botón */
.woocommerce ul.products li.product .button,
.woocommerce ul.products li.product .add_to_cart_button,
.woocommerce ul.products li.product .product_type_simple {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: auto !important;
    height: 30px !important;
    margin: 0 10px 15px !important;
    background-color: #034AB1 !important;
    color: #ffffff !important;
    font-family: 'Open Sans', sans-serif !important;
    font-size: 14px !important;
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
    padding: 0 15px !important;
    position: relative !important;
}

/* Hover del botón */
.woocommerce ul.products li.product .button:hover,
.woocommerce ul.products li.product .add_to_cart_button:hover {
    background-color: #023a8f !important;
    transform: translateY(-2px) !important;
    box-shadow: 0px 4px 12px rgba(3, 74, 177, 0.3) !important;
}

/* REMOVER todos los ::after de Divi (ícono del carrito de Divi) */
.woocommerce ul.products li.product .button::after,
.woocommerce ul.products li.product .add_to_cart_button::after,
.woocommerce ul.products li.product .button.alt::after,
.woocommerce ul.products li.product .add_to_cart_button.alt::after {
    content: none !important;
    display: none !important;
    opacity: 0 !important;
}

.woocommerce ul.products li.product .button:hover::after,
.woocommerce ul.products li.product .add_to_cart_button:hover::after {
    opacity: 0 !important;
    margin-left: 0 !important;
}

/* Ícono del carrito ANTES del texto - FORZAR con !important */
.woocommerce ul.products li.product .button::before,
.woocommerce ul.products li.product .add_to_cart_button::before {
    content: '' !important;
    display: inline-block !important;
    width: 20px !important;
    height: 20px !important;
    background-image: url('https://staging.retrofase.cl/wp-content/uploads/2025/11/Cart-Icon-Retrofase.png') !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    filter: brightness(0) invert(1) !important;
    flex-shrink: 0 !important;
    opacity: 1 !important;
    position: static !important;
    margin: 0 !important;
    font-family: inherit !important;
    font-size: inherit !important;
    line-height: 1em !important;
    order: -1 !important;
}

/* Ocultar íconos de Divi/WooCommerce */
.woocommerce ul.products li.product .button .et_pb_button_wrapper,
.woocommerce ul.products li.product .button i,
.woocommerce ul.products li.product .add_to_cart_button i {
    display: none !important;
}

/* Estado "Añadido" - Enlace "Ver carrito" DEBAJO del botón en HOME */
.woocommerce ul.products li.product .added_to_cart {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    min-width: 150px !important;
    height: 28px !important;
    background: #FFFFFF !important;
    border: 2px solid #034AB1 !important;
    border-radius: 8px !important;
    font-family: 'Open Sans', sans-serif !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    color: #034AB1 !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    margin: 0 10px 15px !important;
    padding: 0 15px !important;
    position: relative !important;
}

.woocommerce ul.products li.product .added_to_cart:hover {
    background: #034AB1 !important;
    color: #FFFFFF !important;
    transform: translateY(-2px) !important;
    box-shadow: 0px 4px 12px rgba(3, 74, 177, 0.3) !important;
}

/* Ícono antes del texto "Ver carrito" */
.woocommerce ul.products li.product .added_to_cart::before {
    content: '👁' !important;
    margin-right: 6px !important;
    font-size: 14px !important;
}

/* Loading state */
.woocommerce ul.products li.product .button.loading::after,
.woocommerce ul.products li.product .add_to_cart_button.loading::after {
    content: '' !important;
    width: 14px !important;
    height: 14px !important;
    border: 2px solid #ffffff !important;
    border-top-color: transparent !important;
    border-radius: 50% !important;
    animation: spin 0.6s linear infinite !important;
    margin-left: 8px !important;
    display: inline-block !important;
    opacity: 1 !important;
    position: static !important;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

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

@media (max-width: 768px) {
    .woocommerce ul.products,
    .woocommerce-page ul.products {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
        gap: 12px !important;
    }

    .woocommerce ul.products li.product .button,
    .woocommerce ul.products li.product .add_to_cart_button {
        width: 100%;
        max-width: 227px;
    }

    .woocommerce ul.products li.product .added_to_cart {
        width: 100%;
        max-width: 227px;
    }
}

/* Mostrar solo cuando carrito está vacío */
.show-when-cart-empty {
    display: none;
}

/* ============================================
   RETROFASE CART EMPTY STATE
   ============================================ */

/* Base - ocultar por defecto */
.retrofase-cart-empty-state {
    display: none;
}

/* Mostrar solo cuando carrito está vacío */
.cart-empty .retrofase-cart-empty-state {
    display: block;
}

/* Contenedor principal */
.retrofase-cart-empty-state {
    width: 100%;
    max-width: 600px;
    margin: 60px auto;
    padding: 40px 20px;
    text-align: center;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 24px;
    border: 2px solid #eaebed;
    position: relative;
    overflow: hidden;
}

.retrofase-cart-empty-state::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #034AB1, #e3ba5d, #034AB1);
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { background-position: -200% 0; }
    50% { background-position: 200% 0; }
}

.empty-cart-container {
    position: relative;
    z-index: 1;
}

/* Gaming Controller Icon */
.empty-cart-icon {
    position: relative;
    margin-bottom: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.controller-icon {
    position: relative;
    transform: scale(1);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-10px) scale(1.05); }
}

.controller-body {
    width: 120px;
    height: 80px;
    background: linear-gradient(145deg, #034AB1, #023a8f);
    border-radius: 25px;
    position: relative;
    box-shadow: 
        0 8px 24px rgba(3, 74, 177, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

/* D-pad */
.dpad {
    width: 24px;
    height: 24px;
    position: relative;
}

.dpad::before,
.dpad::after {
    content: '';
    position: absolute;
    background: #ffffff;
    border-radius: 2px;
}

.dpad::before {
    width: 20px;
    height: 6px;
    top: 9px;
    left: 2px;
}

.dpad::after {
    width: 6px;
    height: 20px;
    top: 2px;
    left: 9px;
}

/* Buttons */
.buttons {
    display: flex;
    flex-wrap: wrap;
    width: 24px;
    height: 24px;
    gap: 2px;
}

.buttons span {
    width: 10px;
    height: 10px;
    background: #ffffff;
    border-radius: 50%;
    opacity: 0.9;
}

.buttons span:nth-child(1) { animation: buttonPulse 2s ease-in-out infinite 0s; }
.buttons span:nth-child(2) { animation: buttonPulse 2s ease-in-out infinite 0.5s; }
.buttons span:nth-child(3) { animation: buttonPulse 2s ease-in-out infinite 1s; }
.buttons span:nth-child(4) { animation: buttonPulse 2s ease-in-out infinite 1.5s; }

@keyframes buttonPulse {
    0%, 90%, 100% { opacity: 0.9; }
    45% { opacity: 0.5; }
}

/* Floating particles */
.floating-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.floating-particles span {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #e3ba5d;
    border-radius: 50%;
    animation: particle 4s linear infinite;
}

.floating-particles span:nth-child(1) {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.floating-particles span:nth-child(2) {
    top: 40%;
    right: 15%;
    animation-delay: 1.5s;
}

.floating-particles span:nth-child(3) {
    bottom: 30%;
    left: 20%;
    animation-delay: 3s;
}

@keyframes particle {
    0% {
        opacity: 0;
        transform: translateY(0px) scale(0.5);
    }
    25% {
        opacity: 1;
        transform: translateY(-20px) scale(1);
    }
    75% {
        opacity: 1;
        transform: translateY(-40px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-60px) scale(0.5);
    }
}

/* Content */
.empty-cart-content {
    max-width: 480px;
    margin: 0 auto;
}

.empty-cart-title {
    font-family: 'Open Sans', sans-serif;
    font-weight: 700;
    font-size: 28px;
    line-height: 1.2;
    color: #2d3748;
    margin: 0 0 16px;
    background: linear-gradient(135deg, #034AB1, #e3ba5d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.empty-cart-subtitle {
    font-family: 'Open Sans', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.5;
    color: #64748b;
    margin: 0 0 32px;
}

/* Categories chips */
.empty-cart-categories {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 32px;
}

.category-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: #ffffff;
    border: 1px solid #eaebed;
    border-radius: 20px;
    font-family: 'Open Sans', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: #64748b;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.category-chip::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(3, 74, 177, 0.1), transparent);
    transition: left 0.5s ease;
}

.category-chip:hover {
    border-color: #034AB1;
    color: #034AB1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(3, 74, 177, 0.15);
}

.category-chip:hover::before {
    left: 100%;
}

/* CTA Button */
.empty-cart-cta {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 32px;
    background: linear-gradient(135deg, #034AB1, #023a8f);
    border: none;
    border-radius: 50px;
    font-family: 'Open Sans', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: #ffffff;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(3, 74, 177, 0.3);
}

.empty-cart-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.empty-cart-cta:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 24px rgba(3, 74, 177, 0.4);
}

.empty-cart-cta:hover::before {
    left: 100%;
}

.cta-arrow {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.empty-cart-cta:hover .cta-arrow {
    transform: translateX(4px);
}

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

@media (max-width: 768px) {
    .retrofase-cart-empty-state {
        margin: 40px auto;
        padding: 32px 16px;
        border-radius: 20px;
    }
    
    .empty-cart-title {
        font-size: 24px;
    }
    
    .empty-cart-subtitle {
        font-size: 15px;
        margin-bottom: 24px;
    }
    
    .controller-body {
        width: 100px;
        height: 68px;
        padding: 0 16px;
    }
    
    .empty-cart-cta {
        padding: 14px 28px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .retrofase-cart-empty-state {
        margin: 20px auto;
        padding: 24px 12px;
    }
    
    .empty-cart-categories {
        gap: 6px;
    }
    
    .category-chip {
        padding: 6px 12px;
        font-size: 13px;
    }
}