/*
 Theme Name:   Astra Child
 Theme URI:    https://embroiderycool.com/
 Description:  System 7.3.1 BLINDADO - ADD TO CART + Reorden + Ultra Compacto
 Author:       Embroidery Cool Team
 Template:     astra
 Version:      7.3.1
*/

/* ==========================================================================
   1. VARIABLES DE SISTEMA
   ========================================================================== */
:root {
    --color-primary: #7047EB;
    --color-primary-hover: #5A35C6;
    --color-secondary: #A244FF;
    --color-accent: #E23B7B;
    --bg-body: #F8F9FA;
    --bg-card: #FFFFFF;
    --text-main: #111827;
    --text-body: #4B5563;
    --text-muted: #9CA3AF;
    --border-color: #E5E7EB;
    --radius-lg: 16px;
    --radius-sm: 8px;
    --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 8px 16px rgba(0, 0, 0, 0.1);
    --font-family-primary: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ==========================================================================
   2. RESET Y ESTRUCTURA BASE
   ========================================================================== */
* { box-sizing: border-box; }

body { 
    background-color: var(--bg-body); 
    color: var(--text-body); 
    font-family: var(--font-family-primary); 
    margin: 0; 
}

#page { 
    display: flex; 
    flex-direction: column; 
    min-height: 100vh; 
}

.site-content { 
    flex: 1; 
    background-color: var(--bg-body); 
    width: 100%; 
}

.site-content .ast-container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

body.woocommerce-page .site-content .ast-container,
body.archive .site-content .ast-container {
    max-width: 1280px !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
    display: block !important;
}

body.woocommerce-page a { 
    text-decoration: none !important; 
    box-shadow: none !important; 
}

/* ==========================================================================
   3. OCULTAR ELEMENTOS RESIDUALES
   ========================================================================== */
.woocommerce-products-header,
.woocommerce-products-header__title,
.page-title,
.entry-title,
.entry-header,
.ast-archive-description,
.term-description,
.ast-breadcrumbs-wrapper,
.woocommerce-breadcrumb,
.breadcrumb,
#breadcrumbs,
.rank-math-breadcrumb,
.yoast-breadcrumb,
.ast-woocommerce-container .entry-header,
.site-content .ast-container .entry-header,
.header.woocommerce-products-header,
.archive .ast-archive-description,
.archive.woocommerce .site-content .ast-container .entry-header {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

.ast-woocommerce-container > .entry-header,
.ast-woocommerce-container > h1,
.ast-woocommerce-container > h2,
.woocommerce-products-header__title {
    display: none !important;
}

.ast-woocommerce-container {
    font-size: 0 !important;
}

.ast-woocommerce-container > * {
    font-size: 1rem; 
}

/* ==========================================================================
   4. BOTONES GENERALES
   ========================================================================== */
.btn-modern, 
.button, 
#place_order {
    display: inline-flex; 
    align-items: center; 
    justify-content: center;
    padding: 14px 32px; 
    font-weight: 700; 
    font-size: 15px;
    border-radius: 12px; 
    border: none; 
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1; 
    gap: 8px; 
    box-shadow: var(--shadow-soft);
}

.btn-primary, 
.checkout-button, 
#place_order { 
    background-color: var(--color-primary) !important; 
    color: white !important; 
}

.btn-primary:hover, 
#place_order:hover { 
    background-color: var(--color-primary-hover) !important; 
    transform: translateY(-2px); 
    box-shadow: 0 10px 15px -3px rgba(112, 71, 235, 0.3); 
}

/* ==========================================================================
   5. HERO DE TIENDA
   ========================================================================== */
.ec-shop-header-block { 
    padding: 20px 20px 50px !important; 
    text-align: center; 
    background-color: var(--bg-body); 
    width: 100%; 
    margin-bottom: 30px; 
}

.ec-hero-content { 
    max-width: 800px; 
    margin: 0 auto; 
}

.ec-official-store { 
    display: block; 
    color: var(--color-primary); 
    font-weight: 800; 
    text-transform: uppercase; 
    font-size: 13px; 
    letter-spacing: 2px; 
    margin-bottom: 8px; 
}

.ec-shop-title {
    font-size: clamp(2.2rem, 5vw, 3.5rem) !important; 
    font-weight: 900 !important; 
    line-height: 1.2 !important; 
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
    background-clip: text; 
    display: inline-block;
    margin: 0 0 12px 0;
}

.ec-shop-subtitle { 
    font-size: 15px !important; 
    color: var(--text-body); 
    margin: 12px 0 30px !important; 
    line-height: 1.5;
}

.ec-ticker-wrapper { 
    display: flex; 
    gap: 10px; 
    justify-content: center; 
    flex-wrap: wrap; 
}

.ec-badge-pill {
    background: #FFF; 
    color: var(--text-main); 
    padding: 10px 20px; 
    border-radius: 100px; 
    border: 1px solid var(--border-color);
    font-weight: 700; 
    font-size: 13px; 
    text-decoration: none !important; 
    transition: all 0.3s ease; 
    white-space: nowrap; 
    box-shadow: var(--shadow-soft);
}

.ec-badge-pill:hover { 
    background: var(--color-primary); 
    color: #FFF !important; 
    transform: translateY(-2px); 
    box-shadow: 0 6px 12px rgba(112, 71, 235, 0.2); 
}

/* ==========================================================================
   6. GRID DE PRODUCTOS - INVENCIBLE
   ========================================================================== */
body.woocommerce ul.products,
body.woocommerce-page ul.products,
body.post-type-archive-product ul.products,
body.tax-product_cat ul.products,
body.tax-product_tag ul.products,
body.search ul.products,
.woocommerce ul.products,
ul.products.columns-4,
ul.products.columns-3 {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 28px !important;
    width: 100% !important;
    margin: 30px 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

body.woocommerce ul.products li.product,
body.woocommerce-page ul.products li.product,
body.post-type-archive-product ul.products li.product,
body.tax-product_cat ul.products li.product,
.woocommerce ul.products li.product,
ul.products li.product {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    float: none !important;
    clear: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
}

/* ==========================================================================
   7. IMAGEN DEL PRODUCTO
   ========================================================================== */
.astra-shop-thumbnail-wrap {
    aspect-ratio: 1/1 !important;
    overflow: hidden !important;
    position: relative;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-lg) !important;
    background: var(--bg-card) !important;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
    margin-bottom: 0 !important;
    width: 100% !important;
}

.product:hover .astra-shop-thumbnail-wrap { 
    border-color: var(--color-primary) !important; 
    box-shadow: var(--shadow-hover) !important; 
}

.astra-shop-thumbnail-wrap img { 
    width: 100% !important; 
    height: 100% !important; 
    object-fit: cover !important; 
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1) !important; 
}

.product:hover .astra-shop-thumbnail-wrap img { 
    transform: scale(1.05); 
}

/* Sale badge */
.woocommerce span.onsale {
    background: var(--color-accent) !important;
    color: white !important;
    top: 10px !important;
    left: 10px !important;
    right: auto !important;
    width: auto !important;
    padding: 4px 12px !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    border-radius: 50px !important;
    line-height: 1 !important;
    min-width: auto !important;
    min-height: auto !important;
    z-index: 5;
}

/* ==========================================================================
   8. CONTENEDOR DE PIE DE TARJETA - NUEVO ORDEN
   ========================================================================== */

/* Contenedor principal */
.ec-card-footer {
    display: flex !important;
    flex-direction: column !important;
    padding: 10px 0 0 0 !important;
    gap: 6px !important;
    text-align: center !important;
    background: transparent !important;
    flex: 1 !important;
    margin: 0 !important;
}

/* Remover título nativo después del hook */
.woocommerce-loop-product__title {
    display: none !important;
}

/* Botón ADD TO CART - PRIMERO (order 2) */
.ec-btn-add-to-cart {
    width: 100% !important;
    height: 38px !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: var(--radius-sm) !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border: none !important;
    cursor: pointer !important;
}

/* Estado ACTIVO */
.ec-btn-add-to-cart.ec-btn-active {
    background: var(--color-primary) !important;
    color: white !important;
}

.ec-btn-add-to-cart.ec-btn-active:hover {
    background: var(--color-primary-hover) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(112, 71, 235, 0.25) !important;
}

/* Estado INACTIVO */
.ec-btn-add-to-cart.ec-btn-inactive {
    background: #F3F4F6 !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-color) !important;
}

.ec-btn-add-to-cart.ec-btn-inactive:hover {
    background: #E5E7EB !important;
    border-color: var(--color-primary) !important;
    color: var(--color-primary) !important;
}

/* Vendedor */
.ec-store-name {
    display: block !important;
    font-size: 10px !important;
    color: var(--text-muted) !important;
    font-weight: 500 !important;
    margin: 0 !important;
    text-transform: lowercase !important;
    opacity: 0.85 !important;
}

/* Categoría + Precio */
.ec-category-price {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    font-size: 12px !important;
    margin: 2px 0 0 0 !important;
    padding: 0 !important;
}

.ec-product-category {
    color: var(--text-body) !important;
    font-weight: 500 !important;
    font-size: 11px !important;
}

.ec-separator {
    color: var(--text-muted) !important;
    opacity: 0.5 !important;
    font-size: 10px !important;
}

.ec-product-price {
    color: var(--color-primary) !important;
    font-weight: 800 !important;
    font-size: 14px !important;
}

/* Ocultar precio nativo si existe */
.price {
    display: none !important;
}

/* Ocultar rating nativo */
.star-rating {
    display: none !important;
}

/* ==========================================================================
   9. RESPONSIVE - TABLET (1024px)
   ========================================================================== */
@media (max-width: 1024px) {
    body.woocommerce ul.products,
    body.woocommerce-page ul.products,
    .woocommerce ul.products {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 24px !important;
    }

    .astra-shop-thumbnail-wrap {
        border-radius: 14px !important;
    }

    .ec-product-price {
        font-size: 13px !important;
    }
}

/* ==========================================================================
   10. RESPONSIVE - MÓVIL (768px) ULTRA COMPACTO
   ========================================================================== */
@media (max-width: 768px) {
    /* Header */
    .ec-shop-header-block {
        padding: 20px 0 35px !important;
        margin-bottom: 20px;
    }

    .ec-shop-title {
        font-size: clamp(1.8rem, 4.5vw, 2.5rem) !important;
        margin: 0 0 8px 0;
    }

    .ec-shop-subtitle {
        font-size: 14px !important;
        margin: 8px 0 20px !important;
    }

    /* Pills scrolleable */
    .ec-ticker-wrapper {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 0 20px;
        gap: 8px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        margin-bottom: 10px;
    }

    .ec-ticker-wrapper::-webkit-scrollbar {
        display: none;
    }

    .ec-badge-pill {
        font-size: 12px;
        padding: 8px 18px;
    }

    /* Grid: 2 columnas */
    body.woocommerce ul.products,
    body.woocommerce-page ul.products,
    .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    /* Tarjeta ultra compacta */
    .astra-shop-thumbnail-wrap {
        border-radius: 12px !important;
        margin-bottom: 0 !important;
    }

    /* Footer compacto */
    .ec-card-footer {
        padding: 8px 0 0 0 !important;
        gap: 4px !important;
    }

    /* Botón compacto */
    .ec-btn-add-to-cart {
        height: 34px !important;
        font-size: 10px !important;
        margin-top: 2px !important;
    }

    .ec-btn-add-to-cart:active {
        transform: translateY(-1px);
    }

    /* Vendedor pequeño */
    .ec-store-name {
        font-size: 9px !important;
        margin: 0 !important;
    }

    /* Categoría + Precio compacto */
    .ec-category-price {
        font-size: 10px !important;
        gap: 4px !important;
        margin: 1px 0 0 0 !important;
    }

    .ec-product-category {
        font-size: 10px !important;
    }

    .ec-separator {
        font-size: 8px !important;
    }

    .ec-product-price {
        font-size: 12px !important;
    }
}

/* ==========================================================================
   11. MÓVIL MUY PEQUEÑO (480px)
   ========================================================================== */
@media (max-width: 480px) {
    body.woocommerce ul.products,
    body.woocommerce-page ul.products,
    .woocommerce ul.products {
        gap: 10px !important;
    }

    .ec-btn-add-to-cart {
        height: 32px !important;
        font-size: 9px !important;
    }

    .ec-product-price {
        font-size: 11px !important;
    }
}

/* ==========================================================================
   12. CATEGORY STRIP
   ========================================================================== */
.ec-category-strip {
    display: flex;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.ec-cat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    min-width: 80px;
}

.ec-cat-icon {
    width: 64px;
    height: 64px;
    border-radius: 24px;
    background: white;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
    color: var(--text-muted);
}

.ec-cat-icon .material-symbols-outlined {
    font-size: 28px;
}

.ec-cat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-body);
    text-align: center;
}

.ec-cat-item:hover .ec-cat-icon {
    transform: translateY(-5px);
    border-color: var(--color-primary);
    color: var(--color-primary);
    box-shadow: var(--shadow-hover);
}

.ec-cat-item:hover .ec-cat-label {
    color: var(--color-primary);
}

@media (max-width: 768px) {
    .ec-category-strip {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 0 20px 10px;
        gap: 20px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .ec-category-strip::-webkit-scrollbar {
        display: none;
    }

    .ec-cat-icon {
        width: 56px;
        height: 56px;
        border-radius: 20px;
    }

    .ec-cat-icon .material-symbols-outlined {
        font-size: 24px;
    }
}