/* ==========================================================================
   CYBER VISUAL - GLOBAL PRODUCT CARD CSS (SPRINT PC-01)
   100% Custom, Zero Bloat, Glassmorphism Premium
   ========================================================================== */

/* 1. RESET WOOCOMMERCE & ELEMENTOR WRAPPERS */
/* 2. OVERRIDE GLOBAL DO WOOCOMMERCE/ELEMENTOR */
html body.woocommerce ul.products,
html body .ast-woocommerce-container ul.products,
html body .elementor-widget-woocommerce ul.products,
html body .elementor-widget-wc-archive-products ul.products,
section.related.products ul.products,
.elementor-widget-woocommerce-product-related ul.products {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
    display: grid !important;
    grid-template-columns: repeat(6, 1fr) !important;
    row-gap: 10px !important;
    column-gap: 10px !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
    box-sizing: border-box !important;
}

html body.woocommerce ul.products::before,
html body.woocommerce ul.products::after {
    display: none !important; /* Remove float clearing */
}

/* RESPONSIVE GRID - ALIGNED WITH HOME SPEED */
@media (max-width: 1024px) {
    html body.woocommerce ul.products,
    html body .ast-woocommerce-container ul.products,
    html body .elementor-widget-woocommerce ul.products,
    html body .elementor-widget-wc-archive-products ul.products,
    section.related.products ul.products,
    .elementor-widget-woocommerce-product-related ul.products {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}
@media (max-width: 768px) {
    html body.woocommerce ul.products,
    html body .ast-woocommerce-container ul.products,
    html body .elementor-widget-woocommerce ul.products,
    html body .elementor-widget-wc-archive-products ul.products,
    section.related.products ul.products,
    .elementor-widget-woocommerce-product-related ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
@media (max-width: 480px) {
    html body.woocommerce ul.products,
    html body .ast-woocommerce-container ul.products,
    html body .elementor-widget-woocommerce ul.products,
    html body .elementor-widget-wc-archive-products ul.products,
    section.related.products ul.products,
    .elementor-widget-woocommerce-product-related ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

html body.woocommerce ul.products li.product,
html body .ast-woocommerce-container ul.products li.product,
html body .elementor-widget-woocommerce ul.products li.product,
html body .elementor-widget-wc-archive-products ul.products li.product {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important; /* Remove margin since grid handles gap */
    width: 100% !important; /* Fill grid cell */
    box-shadow: none !important;
    float: none !important; /* Remove WooCommerce float */
}

html body.woocommerce ul.products li.product:hover,
html body .ast-woocommerce-container ul.products li.product:hover,
html body .elementor-widget-woocommerce ul.products li.product:hover,
html body .elementor-widget-wc-archive-products ul.products li.product:hover {
    box-shadow: none !important;
    transform: none !important;
}

/* 2. CYBER CARD CONTAINER */
.cyber-product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: max-content !important;
    background: rgba(10, 15, 30, 0.6) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(0, 229, 255, 0.4) !important;
    border-radius: 12px !important;
    overflow: hidden;
    padding: 4px 4px 10px 4px !important; /* 4px do topo, direita, esquerda. 10px bottom */
    box-sizing: border-box;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
    
    width: 100% !important;
}




.cyber-product-card:hover {
    border-color: rgba(0, 229, 255, 1) !important;
    box-shadow: 0 8px 25px rgba(0, 229, 255, 0.3), inset 0 0 15px rgba(0, 229, 255, 0.1) !important;
    transform: translateY(-5px) !important;
}

/* 3. BADGE */
.cyber-product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.4);
}

/* 4. IMAGE */
.cyber-product-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1.4 / 1;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 10px;
    box-sizing: border-box;
}

.cyber-product-img {
    order: 1 !important;
    width: 100% !important;
    max-width: 1616px !important;
    height: auto !important;
    aspect-ratio: 1.4 / 1;
    object-fit: contain !important;
    flex-shrink: 0 !important; /* Impede a imagem de encolher */
    background-color: #fff !important; /* Garante fundo branco para o border-radius funcionar na imagem inteira */
    border-radius: 8px !important; /* Cantos arredondados na imagem */
    overflow: hidden !important;
    transition: transform 0.3s ease !important;
    margin: 0 0 5px 0 !important;
    display: block;
}

/* 5. CONTENT AREA */
.cyber-product-content {
    padding: 8px 8px 0 8px; /* Removed bottom padding */
    display: flex;
    flex-direction: column;
    
    position: relative;
    z-index: 2;
}

.cyber-product-content > * {
    position: static !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    transform: none !important;
}

/* 6. TITLE */
.cyber-product-title {
    order: 2 !important;
    font-family: 'Orbitron', sans-serif !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #e2e8f0 !important;
    margin: 0 0 5px 0 !important;
    line-height: 1.4 !important;
    text-align: center !important;
    padding: 0 5px !important;
    
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    min-height: 2.8em !important;
    max-height: 2.8em !important; /* Force exact 2 lines height */
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cyber-product-card:hover .cyber-product-title {
    order: 2 !important;
    color: #ffffff !important;
}

/* 7. PRICING */
.cyber-product-pricing {
    order: 3 !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 0; /* Removed margin-bottom */
    
}

.cyber-product-regular-price {
    font-size: 11px !important;
    color: #94a3b8 !important;
    text-decoration: line-through !important;
    margin-bottom: 2px;
    text-align: center !important;
    display: block !important;
    width: 100% !important;
}

.cyber-product-price {
    font-family: 'Orbitron', sans-serif !important;
    font-size: 17px !important;
    font-weight: 800 !important;
    color: #00FF88 !important;
    line-height: 1.2 !important;
    text-align: center !important;
    display: block !important;
    width: 100% !important;
    margin-bottom: 0 !important; /* Removed margin-bottom */
}

/* 8. NEW CART BUTTON (BLINDADO) & ELEMENTOR FALLBACK */
button.cyber-cart-btn,
html body .elementor-widget-woocommerce ul.products li.product .button,
html body .elementor-widget-wc-archive-products ul.products li.product .button,
html body .ast-woocommerce-container ul.products li.product .button,
html body.woocommerce ul.products li.product .button {
    position: relative;
    width: 100%;
    background-color: rgba(15, 23, 42, 0.8) !important;
    background: rgba(15, 23, 42, 0.8) !important;
    border: 1px solid rgba(0, 255, 136, 0.4) !important;
    border-radius: 6px !important;
    color: #00FF88 !important;
    font-family: 'Orbitron', sans-serif !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    padding: 10px !important;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease !important;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none !important;
    text-shadow: 0 0 5px rgba(0, 255, 136, 0.2) !important;
    margin-top: 5px !important;
}

button.cyber-cart-btn::before,
html body .elementor-widget-woocommerce ul.products li.product .button::before,
html body .elementor-widget-wc-archive-products ul.products li.product .button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 136, 0.1), transparent);
    transition: left 0.5s ease;
}

button.cyber-cart-btn:hover,
html body .elementor-widget-woocommerce ul.products li.product .button:hover,
html body .elementor-widget-wc-archive-products ul.products li.product .button:hover {
    background-color: rgba(0, 255, 136, 0.1) !important;
    background: rgba(0, 255, 136, 0.1) !important;
    border-color: #00FF88 !important;
    color: #ffffff !important;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.2) !important;
}

button.cyber-cart-btn:hover::before,
html body .elementor-widget-woocommerce ul.products li.product .button:hover::before,
html body .elementor-widget-wc-archive-products ul.products li.product .button:hover::before {
    left: 100%;
}

/* Spinner animado escondido por padrÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â£o */
.cyber-btn-spinner {
    display: none;
    width: 16px;
    height: 16px;
    animation: cyber-spin 1s linear infinite;
    stroke: #00E5FF;
}

@keyframes cyber-spin {
    100% { transform: rotate(360deg); }
}

/* Estado: Carregando */
.cyber-cart-btn.is-loading span {
    display: none;
}
.cyber-cart-btn.is-loading .cyber-btn-spinner {
    display: block;
}
.cyber-cart-btn.is-loading {
    background: transparent !important;
    border-color: rgba(0, 229, 255, 0.5) !important;
    pointer-events: none;
}

/* Estado: Adicionado */
.cyber-cart-btn.is-added {
    background: rgba(0, 255, 136, 0.15) !important;
    border-color: #00FF88 !important;
    color: #00FF88 !important;
}

/* 9. CARD LINK OVERLAY */
.cyber-product-card-link {
    position: absolute;
    inset: 0;
    z-index: 10;
}

/* 10. OCULTAR ELEMENTOS ORIGINAIS DO WOOCOMMERCE/ASTRA */
html body.woocommerce ul.products li.product .woocommerce-loop-product__title,
html body.woocommerce ul.products li.product .price,
html body.woocommerce ul.products li.product .star-rating,
html body.woocommerce ul.products li.product .woocommerce-loop-product__link > img,
html body.woocommerce ul.products li.product .ast-woo-product-category {
    display: none !important;
}

/* RESPONSIVO MÃƒÆ’Ã†â€™Ãƒâ€šÃ‚ÂXIMO PARA OS CARDS NO SHORTCODE (FALLBACK) */
.cyber-shortcode-grid ul.products { display: grid !important; grid-template-columns: repeat(6, 1fr) !important; gap: 4px !important;  padding: 0 !important; margin: 0 !important; list-style: none !important; } @media (max-width: 1024px) { .cyber-shortcode-grid ul.products { grid-template-columns: repeat(3, 1fr) !important; } } @media (max-width: 768px) { .cyber-shortcode-grid ul.products { grid-template-columns: repeat(2, 1fr) !important; } } @media (max-width: 480px) { .cyber-shortcode-grid ul.products { grid-template-columns: repeat(1, 1fr) !important; } } .cyber-shortcode-grid ul.products li.product { margin-bottom: 0 !important; }



















/* FIX RELATED PRODUCTS ON SINGLE PRODUCT PAGE */
html body.single-product .related ul.products, html body.single-product .upsells ul.products { display: grid !important; grid-template-columns: repeat(4, 1fr) !important; gap: 15px !important; margin: 0 auto !important; width: 100% !important; max-width: none !important; }
html body.single-product .related ul.products li.product, html body.single-product .upsells ul.products li.product { width: 100% !important; max-width: none !important; margin: 0 !important; }

/* SEARCH PAGE OVERRIDE */
html body.search-results.woocommerce.woocommerce-page ul.products, html body.search-results .elementor-widget-wc-archive-products ul.products, html body.search-results .elementor-widget-woocommerce ul.products { display: grid !important; grid-template-columns: repeat(6, 1fr) !important; gap: 10px !important; gap: 10px !important; margin: 0 auto !important; padding-left: 10px !important; padding-right: 10px !important; width: 100% !important; box-sizing: border-box !important; justify-content: center !important; }
html body.search-results.woocommerce.woocommerce-page ul.products li.product, html body.tax-product_cat.woocommerce.woocommerce-page ul.products li.product, html body.archive.woocommerce.woocommerce-page ul.products li.product:not(.product-category), html body.home ul.products li.product { width: 100% !important; max-width: none !important; margin: 0 !important; margin-bottom: 0 !important; padding: 0 !important; padding-bottom: 0 !important; min-height: 0 !important; }

.cyber-product-card { margin-bottom: 0 !important; }


/* FIX LEGACY STYLE.CSS ON SEARCH PAGE */
html body.search-results ul.products li.product, html body.search ul.products li.product, html body.search-results.woocommerce-page ul.products li.product, html body.search-results article.post { background: transparent !important; border: none !important; padding: 0 !important; margin: 0 !important; box-shadow: none !important; border-radius: 0 !important; }



/* FIX HOVER GLOW FROM STYLE.CSS ON SEARCH PAGE */
html body.search-results ul.products li.product:hover, html body.search ul.products li.product:hover, html body.search-results.woocommerce-page ul.products li.product:hover, html body.search-results article.post:hover { box-shadow: none !important; transform: none !important; border-color: transparent !important; background: transparent !important; }


/* FIX SEARCH PAGE CONTAINER */
html body.search-results #primary, html body.search-results .site-main, html body.search-results .elementor-container, html body.search-results .elementor-section-wrap > .elementor-section { max-width: 1480px !important; width: 100% !important; margin-left: auto !important; margin-right: auto !important; float: none !important; clear: both !important; display: block !important; }

/* FIX CATEGORY PAGE E SHOP CONTAINER */
html body.tax-product_cat .site-main, html body.tax-product_cat .elementor-container, html body.tax-product_cat .elementor-section-wrap > .elementor-section, html body.tax-product_cat .elementor-location-archive,
html body.post-type-archive-product .site-main, html body.post-type-archive-product .elementor-container, html body.post-type-archive-product .elementor-section-wrap > .elementor-section, html body.post-type-archive-product .elementor-location-archive { max-width: 1320px !important; margin-left: auto !important; margin-right: auto !important; }
html body.search-results ul.products li.product img, html body.search ul.products li.product img, html body.search-results .elementor-widget-wc-archive-products ul.products li.product img, html body.search-results.woocommerce-page ul.products li.product img,
html body.tax-product_cat ul.products li.product img, html body.post-type-archive-product ul.products li.product img, html body.home ul.products li.product img { max-height: none !important; height: auto !important; aspect-ratio: 1.4 / 1 !important; border-radius: 8px !important; margin: 0 0 5px 0 !important; width: 100% !important; object-fit: contain !important; background-color: #fff !important; }

/* FIX HOME TO MATCH CATEGORIES */
html body.home .woocommerce ul.products, html body.home ul.products { gap: 10px !important; }







/* MOBILE GRID GAP REDUCTION */
@media (max-width: 768px) {
    html body.woocommerce ul.products,
    html body .ast-woocommerce-container ul.products,
    html body .elementor-widget-woocommerce ul.products,
    html body .elementor-widget-wc-archive-products ul.products,
    html body.home .woocommerce ul.products, 
    html body.home ul.products,
    html body.home div.woocommerce ul.products.columns-6,
    html body.home .elementor-widget-shortcode ul.products,
    html body.search-results.woocommerce.woocommerce-page ul.products {
        row-gap: 10px !important;
    }

    /* Correção do espaçamento entre as listas de produtos na Home no Mobile */
    html body.home .elementor-widget-shortcode.cyber-products,
    html body.home .elementor-widget.cyber-products {
        margin-bottom: 10px !important;
    }
    html body.home .elementor-widget.cyber-products .elementor-widget-container,
    html body.home .elementor-widget.cyber-products .elementor-shortcode,
    html body.home .elementor-widget.cyber-products .woocommerce,
    html body.home .elementor-widget.cyber-products .woocommerce ul.products {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }
}

/* FIX SEARCH PAGE COLUMNS ON MOBILE */
@media (max-width: 768px) {
    html body.search-results.woocommerce.woocommerce-page ul.products,
    html body.search-results .elementor-widget-wc-archive-products ul.products,
    html body.search-results .elementor-widget-woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* FIX HOME GRID GAP ON MOBILE (ULTIMATE OVERRIDE) */
@media (max-width: 768px) {
    html body.home.page-id-970 ul.products,
    html body.home ul.products,
    html body.home .woocommerce ul.products,
    html body.home .elementor-widget-shortcode ul.products {
        row-gap: 8px !important;
        column-gap: 8px !important;
        gap: 8px !important;
    }
    html body.home .cyber-products-section { margin-bottom: 0 !important; padding-bottom: 10px !important; padding-top: 10px !important; }
}

/* ABSOLUTE NUKE FOR CARD MARGINS ON HOME MOBILE */
@media (max-width: 768px) {
    html body.home ul.products li.product,
    html body.home .elementor-widget ul.products li.product,
    html body.home .woocommerce ul.products li.product {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }
    html body.home .cyber-product-card {
        margin-bottom: 0 !important;
        min-height: auto !important;
    }
}
