/*
Theme Name: PC Compra Official Theme
Version: 16.0 (SEO & AI Optimized - Ultimate Edition)
Author: Gemini & PC Compra
Description: Diseño de alto rendimiento, optimizado para conversión y visibilidad en IA.
*/

:root {
    /* --- PALETA DE COLORES CORPORATIVA --- */
    --primary: #2563eb;       /* Azul Royal */
    --primary-hover: #1d4ed8; /* Azul Oscuro Hover */
    --accent: #0ea5e9;        /* Celeste Detalles */
    
    --bg-body: #f8fafc;       /* Fondo gris muy claro */
    --header-bg: #0f172a;     /* Azul noche (Header y Footer) */
    --menu-bg: #1e293b;       /* Azul grisáceo */
    
    --text-main: #1e293b;
    --text-light: #64748b;
    --white: #ffffff;
    --border: #e2e8f0;
    
    --cart-btn: #16a34a;      /* Verde Compra (Éxito) */
}

/* --- RESET & GLOBAL --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    overflow-x: hidden;
    line-height: 1.5;
}
a { text-decoration: none; color: inherit; transition: 0.2s ease; }
img { max-width: 100%; display: block; height: auto; }
ul { list-style: none; }

.cg-container { width: 100%; max-width: 1350px; margin: 0 auto; padding: 0 15px; }

/* OPTIMIZACIÓN DE RENDIMIENTO PARA GOOGLE/IA */
.section-block {
    margin-bottom: 60px;
    content-visibility: auto; /* Solo renderiza lo que el usuario ve */
    contain-intrinsic-size: 500px;
}

/* =========================================
   1. HEADER (ESTILO PROFESIONAL)
   ========================================= */
header.main-header { background: var(--header-bg); color: var(--white); }
.header-top { padding: 15px 0; border-bottom: 1px solid rgba(255,255,255,0.1); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap; }

.logo-wrapper { flex-shrink: 0; }
.site-logo { max-height: 50px; width: auto; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2)); }

.search-box-header { flex-grow: 1; max-width: 600px; min-width: 280px; }
.woocommerce-product-search {
    display: flex; border-radius: 8px; overflow: hidden; background: var(--white);
    border: 2px solid transparent; transition: 0.3s;
}
.woocommerce-product-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2); }
.woocommerce-product-search input { width: 100%; padding: 12px 15px; border: none; outline: none; color: #333; font-size: 16px; }
.woocommerce-product-search button { background: var(--primary); border: none; padding: 0 25px; cursor: pointer; color: white; transition: 0.2s; }
.woocommerce-product-search button:hover { background: var(--primary-hover); }

.cart-btn-cg {
    display: flex; align-items: center; gap: 10px; 
    background: rgba(255,255,255,0.1); padding: 10px 20px; 
    border-radius: 8px; border: 1px solid rgba(255,255,255,0.2); 
    color: var(--white); font-weight: 700; white-space: nowrap;
}
.cart-btn-cg:hover { background: var(--primary); border-color: var(--primary); }
.count-badge { background: var(--accent); color: white; padding: 2px 8px; border-radius: 50px; font-size: 0.75rem; }

.header-bottom { background: var(--menu-bg); box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.cg-menu-list { display: flex; justify-content: center; overflow-x: auto; margin: 0; padding: 0; -webkit-overflow-scrolling: touch; }
.cg-menu-list li a { 
    display: block; padding: 16px 25px; color: var(--white); 
    font-weight: 700; text-transform: uppercase; font-size: 0.85rem; white-space: nowrap; 
    border-bottom: 3px solid transparent; letter-spacing: 0.5px;
}
.cg-menu-list li a:hover { background: rgba(255,255,255,0.05); border-bottom-color: var(--primary); }

/* =========================================
   2. HOME: COMPONENTES
   ========================================= */
.hero-full-width { width: 100%; margin-bottom: 0; }
.slider-img { width: 100%; height: auto; max-height: 520px; object-fit: cover; }

.benefits-section { background: var(--white); border-bottom: 1px solid var(--border); padding: 25px 0; margin-bottom: 40px; }
.benefits-flex { display: flex; justify-content: space-between; align-items: center; }
.b-item { display: flex; align-items: center; gap: 15px; flex: 1; justify-content: center; }
.b-item img { width: 32px; opacity: 0.8; } 
.b-item strong { display: block; font-size: 0.9rem; color: var(--text-main); }
.b-item p { font-size: 0.8rem; color: var(--text-light); margin: 0; }
.b-separator { width: 1px; height: 35px; background: var(--border); margin: 0 20px; }

.promo-banner-section {
    position: relative; background-size: cover; background-position: center;
    border-radius: 15px; overflow: hidden; height: 300px;
    display: flex; align-items: center; justify-content: flex-end;
    box-shadow: 0 12px 30px rgba(0,0,0,0.1); margin-bottom: 60px;
}
.promo-banner-section::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(15,23,42,0.85) 70%);
}
.promo-content { position: relative; z-index: 2; max-width: 500px; padding: 40px; color: var(--white); text-align: right; }
.promo-content h2 { font-size: 2.4rem; font-weight: 800; margin-bottom: 10px; }
.btn-promo {
    display: inline-block; background: var(--primary); color: var(--white); padding: 12px 35px;
    border-radius: 8px; font-weight: 700; text-transform: uppercase; box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
}

.section-header { 
    display: flex; justify-content: space-between; align-items: center; 
    margin-bottom: 30px; border-bottom: 2px solid var(--border); padding-bottom: 12px; 
}
.section-header h2 { font-size: 1.8rem; font-weight: 400; color: var(--text-main); }
.section-header h2 strong { font-weight: 800; color: var(--primary); }

/* --- CARDS DE PRODUCTO --- */
.cg-card {
    background: var(--white); border: 1px solid var(--border); border-radius: 12px; padding: 15px;
    height: 100%; display: flex; flex-direction: column; position: relative; transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.cg-card:hover { border-color: var(--primary); transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,0,0,0.08); }
.card-img { height: 170px; display: flex; align-items: center; justify-content: center; margin-bottom: 15px; }
.card-img img { max-height: 100%; object-fit: contain; transition: 0.4s; }
.cg-card:hover .card-img img { transform: scale(1.08); }

.card-data h3 { font-size: 0.95rem; font-weight: 600; color: var(--text-main); height: 40px; overflow: hidden; margin-bottom: 10px; line-height: 1.3; }
.price-row { font-size: 1.4rem; font-weight: 800; color: var(--primary); margin-top: auto; margin-bottom: 15px; }

.btn-add-loop {
    display: block; width: 100%; text-align: center;
    background: var(--white); color: var(--cart-btn); border: 2px solid var(--cart-btn);
    padding: 10px; border-radius: 8px; font-weight: 800; font-size: 0.8rem;
    text-transform: uppercase; cursor: pointer; transition: 0.2s;
}
.btn-add-loop:hover { background: var(--cart-btn); color: white; box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3); }

/* =========================================
   3. MOSAICO HÍBRIDO (GRANDE + SLIDER)
   ========================================= */
.hybrid-grid { display: grid; gap: 20px; height: 440px; }
@media (min-width: 1024px) { .hybrid-grid { grid-template-columns: 380px 1fr; } }

.cat-big-hybrid {
    display: block; width: 100%; height: 100%;
    background-size: cover; background-position: center;
    border-radius: 15px; position: relative; overflow: hidden;
}
.cat-overlay-big {
    position: absolute; bottom: 0; left: 0; width: 100%;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.95), transparent);
    padding: 35px; color: white; font-weight: 800; font-size: 1.6rem; text-transform: uppercase;
}

.cat-swiper-wrapper { width: 100%; height: 100%; overflow: hidden; position: relative; }
.cat-card-small {
    background: white; border: 1px solid var(--border); border-radius: 12px;
    height: 100%; transition: 0.3s; display: flex; flex-direction: column; overflow: hidden;
}
.cat-card-small:hover { border-color: var(--primary); transform: scale(1.02); }
.cat-card-small img { height: 110px; object-fit: cover; }
.cat-title-small { padding: 12px; font-weight: 700; font-size: 0.85rem; text-align: center; color: var(--text-main); border-top: 1px solid #f1f5f9; }

/* =========================================
   4. CATÁLOGO (ESTILO COMPRAGAMER)
   ========================================= */
.shop-container { display: flex; gap: 30px; margin-top: 40px; margin-bottom: 60px; }
.shop-sidebar { width: 260px; flex-shrink: 0; }
.shop-content { flex-grow: 1; min-width: 0; }

.sidebar-block { background: var(--white); border: 1px solid var(--border); border-radius: 12px; padding: 25px; margin-bottom: 25px; }
.widget-title { font-size: 1.2rem; font-weight: 800; border-bottom: 3px solid var(--primary); padding-bottom: 10px; margin-bottom: 20px; }

/* Menú Lateral Desktop */
.cat-menu-list { padding: 0; margin: 0; }
.cat-menu-list > li > a { font-weight: 700; display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #f1f5f9; font-size: 0.95rem; }
.cat-menu-list .sub-menu { padding-left: 15px; margin: 5px 0 15px; display: none; border-left: 2px solid var(--border); }
.cat-menu-list li.current-menu-item .sub-menu { display: block; }
.cat-menu-list a:hover { color: var(--primary); }

.products-grid-catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
.shop-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; background: #fff; padding: 15px 25px; border-radius: 12px; border: 1px solid var(--border); }

/* =========================================
   5. FICHA PRODUCTO (EMBUDO DE VENTAS)
   ========================================= */
.product-single-wrapper { margin-top: 30px; margin-bottom: 80px; }
.product-layout-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 50px; align-items: start; }

.main-image-box { 
    border: 1px solid #f1f5f9; border-radius: 15px; padding: 30px; 
    background: #fff; position: relative; box-shadow: 0 10px 20px rgba(0,0,0,0.02); 
}
.badge-sale-big { position: absolute; top: 20px; left: 20px; background: #ef4444; color: white; padding: 8px 15px; border-radius: 6px; font-weight: 900; }

.entry-title { font-size: 2.2rem; font-weight: 800; margin-bottom: 15px; color: var(--text-main); line-height: 1.2; }
.product-meta-top { margin-bottom: 25px; font-size: 0.9rem; color: #94a3b8; display: flex; gap: 20px; }
.stock-status { font-weight: 800; padding: 4px 10px; border-radius: 4px; }
.stock-status.in-stock { background: #f0fdf4; color: #16a34a; }
.stock-status.no-stock { background: #fef2f2; color: #ef4444; }

/* --- BUY BOX (CAJA DE COMPRA) --- */
.buy-box-card {
    background: #f8fafc; border: 2px solid #e2e8f0; border-radius: 15px;
    padding: 35px; box-shadow: 0 15px 35px -10px rgba(0,0,0,0.05);
}
.price-final { font-size: 2.8rem; font-weight: 900; color: var(--text-main); margin-bottom: 20px; letter-spacing: -1px; }
.price-final ins { text-decoration: none; }
.price-final del { font-size: 1.4rem; opacity: 0.4; margin-right: 10px; }

.installments-highlight {
    display: flex; align-items: center; gap: 12px; background: #eff6ff; color: #1e40af;
    padding: 15px; border-radius: 10px; border: 1px solid #dbeafe; font-size: 0.95rem; margin-bottom: 25px;
}

.short-desc-organic {
    margin-bottom: 30px; color: #475569; font-size: 1rem; line-height: 1.7;
    border-left: 4px solid var(--primary); padding-left: 20px;
}

/* BOTÓN COMPRA GIGANTE */
.add-to-cart-area-pro form.cart { display: flex; gap: 15px; margin-bottom: 25px; }
.add-to-cart-area-pro input.qty { 
    width: 75px; height: 60px; font-size: 1.3rem; font-weight: 800; 
    text-align: center; border: 2px solid #cbd5e1; border-radius: 10px; 
}
.add-to-cart-area-pro button[type="submit"] {
    flex-grow: 1; height: 60px; background: var(--primary); color: white;
    border: none; border-radius: 10px; font-size: 1.2rem; font-weight: 900;
    text-transform: uppercase; cursor: pointer; transition: 0.3s;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3);
}
.add-to-cart-area-pro button[type="submit"]:hover { background: var(--primary-hover); transform: translateY(-3px); }

.trust-icons-row { border-top: 1px solid #e2e8f0; padding-top: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.t-icon { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; font-weight: 700; color: #64748b; }

/* =========================================
   6. CARRITO & CHECKOUT
   ========================================= */
.woocommerce-cart-form tr.cart_item {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
    display: flex; align-items: center; padding: 20px; margin-bottom: 15px; position: relative;
}
.product-thumbnail img { width: 85px; height: 85px; object-fit: contain; border-radius: 10px; }
.product-name { flex-grow: 1; font-weight: 800; font-size: 1.1rem; padding: 0 20px; }
.product-subtotal { font-weight: 900; color: var(--primary); font-size: 1.3rem; }

/* CHECKOUT CLEANUP */
.woocommerce-checkout #order_review { 
    background: #f8fafc; padding: 30px; border: 2px solid var(--primary); border-radius: 15px; 
}
/* OCULTAR FILAS DE RECARGOS/OPENPAY PARA EVITAR CONFUSIÓN VISUAL */
.woocommerce-checkout .shop_table tr.fee, 
.woocommerce-checkout .shop_table tr.tax-rate { display: none !important; }

#place_order {
    width: 100%; background: #16a34a; color: white; padding: 20px;
    font-size: 1.2rem; font-weight: 900; text-transform: uppercase; border-radius: 10px; cursor: pointer;
}

/* =========================================
   7. RESPONSIVE MÓVIL (SISTEMA COMPRAGAMER)
   ========================================= */
@media (max-width: 900px) {
    /* Header Stack */
    .header-inner { flex-direction: column; align-items: stretch; gap: 15px; }
    .header-inner > div { order: 2; width: 100%; }
    .logo-wrapper { order: 1 !important; text-align: center; }
    .cart-btn-cg { width: 100%; justify-content: center; }

    /* Home Layout */
    .promo-banner-section { height: auto; min-height: 320px; }
    .promo-content { width: 100%; text-align: center; padding: 30px 15px; }
    .promo-content h2 { font-size: 1.8rem; }
    .benefits-flex { flex-direction: column; gap: 20px; }
    .b-separator { display: none; }

    /* Mosaico Híbrido Mobile */
    .hybrid-grid { height: auto; grid-template-columns: 1fr; }
    .cat-big-hybrid { height: 220px; margin-bottom: 10px; }
    .cat-swiper-wrapper { height: 320px; }

    /* CATÁLOGO MÓVIL: BOTONES HORIZONTALES */
    .shop-container { flex-direction: column; }
    .shop-sidebar { width: 100%; margin-bottom: 15px; }
    .sidebar-block { padding: 10px; background: transparent; border: none; }
    .widget-title { display: none; }
    
    .cat-menu-list { 
        display: flex; flex-direction: row; overflow-x: auto; gap: 12px; 
        padding: 5px 0; -webkit-overflow-scrolling: touch; 
    }
    .cat-menu-list li a {
        background: #fff; border: 1px solid #cbd5e1; border-radius: 50px;
        padding: 10px 20px; font-size: 0.85rem; white-space: nowrap; color: var(--text-main);
    }
    .cat-menu-list li.current-menu-item a { background: var(--primary); color: white; border-color: var(--primary); }

    /* Grilla 2 columnas */
    .products-grid-catalog { grid-template-columns: 1fr 1fr; gap: 12px; }
    .cg-card { padding: 10px; }
    .card-img { height: 130px; }
    .card-data h3 { font-size: 0.85rem; height: 35px; }
    .price-row { font-size: 1.1rem; }
    .btn-add-loop { font-size: 0.7rem; padding: 8px 4px; }

    /* Ficha Producto Mobile */
    .product-layout-grid { grid-template-columns: 1fr; gap: 30px; }
    .entry-title { font-size: 1.6rem; }
    .add-to-cart-area-pro form.cart { flex-direction: column; }
    .add-to-cart-area-pro .quantity { width: 100%; }
    .buy-box-card { padding: 20px; }
}

/* FOOTER (Mismo color que el header) */
.site-footer { 
    background: var(--header-bg); 
    color: #94a3b8; 
    padding: 70px 0; 
    margin-top: 100px; 
    border-top: 6px solid var(--primary); 
    text-align: center;
}
