/* BZ Tienda — hoja de estilo principal */

:root {
    --primary: #1e3a5f;
    --primary-dark: #0e1a2b;
    --accent: #3182ce;
    --accent-hover: #2b6cb0;
    --gold: #d69e2e;
    --success: #2f855a;
    --light-bg: #f8fafc;
    --card-bg: #ffffff;
    --text-dark: #1a202c;
    --text-muted: #4a5568;
    --border-color: #e2e8f0;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', system-ui, sans-serif; }
body { background: var(--light-bg); color: var(--text-dark); min-height: 100vh; display: flex; flex-direction: column; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ── Header ───────────────────────────────────────────────────────── */
header { background: var(--primary-dark); color: #fff; border-bottom: 3px solid var(--accent); position: sticky; top: 0; z-index: 1000; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
nav { max-width: 1300px; margin: 0 auto; padding: 0.8rem 1.5rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }

.brand { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: #fff; font-weight: 800; font-size: 1.3rem; }
.brand img { width: 38px; height: 38px; border-radius: 6px; background: #fff; padding: 2px; }

.search-box { display: flex; flex: 1; max-width: 550px; margin: 0 1.5rem; }
.search-box input { flex: 1; padding: 0.65rem 1rem; border-radius: 8px 0 0 8px; border: 1px solid var(--border-color); outline: none; font-size: 0.95rem; }
.search-box button { background: var(--accent); color: #fff; border: none; padding: 0 1.2rem; border-radius: 0 8px 8px 0; font-weight: bold; cursor: pointer; }

.header-actions { display: flex; align-items: center; gap: 1rem; }
.header-pill { color: #fff; text-decoration: none; font-weight: 700; font-size: 0.9rem; background: rgba(255,255,255,0.12); padding: 0.5rem 0.9rem; border-radius: 6px; }
.header-link { color: #fff; text-decoration: none; font-weight: 600; font-size: 0.9rem; }
.cart-btn { background: var(--accent); color: #fff; border: none; padding: 0.6rem 1.1rem; border-radius: 8px; font-weight: 700; cursor: pointer; display: flex; align-items: center; gap: 0.5rem; }
.cart-btn--alt { background: var(--primary); font-size: 0.85rem; }
.cart-badge { background: var(--gold); color: #000; padding: 0.1rem 0.5rem; border-radius: 50px; font-size: 0.8rem; }

/* ── Partner & Payment banners ─────────────────────────────────────── */
.partner-banner,
.payment-banner {
    background: #1a365d;
    color: #fff;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid var(--accent);
    gap: 1rem;
}
.partner-banner[hidden],
.payment-banner[hidden] {
    display: none !important;
}
.partner-banner__inner,
.payment-banner__inner { display: flex; align-items: center; gap: 1rem; }
.partner-banner__icon,
.payment-banner__icon { font-size: 1.6rem; }
.partner-banner__text strong,
.payment-banner__text strong { font-size: 1rem; }
.partner-banner__text small,
.payment-banner__text small { color: #a0aec0; display: block; }
.partner-banner__close,
.payment-banner__close { background: rgba(255,255,255,0.15); color: #fff; border: none; padding: 0.4rem 0.8rem; border-radius: 6px; font-size: 0.8rem; cursor: pointer; }

/* ── Hero ──────────────────────────────────────────────────────────── */
.store-hero { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: #fff; padding: 2.5rem 1.5rem; text-align: center; }
.store-hero h1 { font-size: 2.2rem; margin-bottom: 0.5rem; }
.store-hero p { color: #cbd5e0; font-size: 1.05rem; }

/* ── Soluciones / filtros ──────────────────────────────────────────── */
.solutions-bar { background: #ebf8ff; border-bottom: 1px solid #bee3f8; padding: 0.75rem 1.5rem; }
.solutions-container { max-width: 1300px; margin: 0 auto; display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap; }
.solutions-label { font-size: 0.85rem; font-weight: bold; color: var(--primary); align-self: center; }
.sol-btn { background: #fff; border: 1px solid #90cdf4; color: var(--primary); padding: 0.4rem 0.9rem; border-radius: 50px; font-size: 0.85rem; font-weight: 700; cursor: pointer; transition: all 0.2s; }
.sol-btn:hover, .sol-btn.is-active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Layout ────────────────────────────────────────────────────────── */
main:not(.product-wrapper) { max-width: 1300px; margin: 2rem auto; width: 100%; padding: 0 1.5rem; display: grid; grid-template-columns: 240px 1fr; gap: 2rem; flex: 1; }

.sidebar { background: #fff; padding: 1.25rem; border-radius: 12px; border: 1px solid var(--border-color); height: fit-content; }
.sidebar h3 { font-size: 1.05rem; margin-bottom: 1rem; color: var(--primary); border-bottom: 2px solid var(--light-bg); padding-bottom: 0.5rem; }
.sidebar-subtitle { margin-top: 1.5rem; }
.cat-list { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; }
.cat-item { font-size: 0.9rem; color: var(--text-muted); cursor: pointer; padding: 0.45rem 0.75rem; border-radius: 6px; transition: background 0.15s; }
.cat-item:hover, .cat-item.is-active { background: var(--light-bg); color: var(--primary); font-weight: 600; }

/* ── Resultados ────────────────────────────────────────────────────── */
.results-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.results-count { font-size: 0.9rem; color: var(--text-muted); }

.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.25rem; }
.catalog-empty { grid-column: 1 / -1; text-align: center; padding: 3rem; color: var(--text-muted); }
.catalog-empty .fa-boxes, .catalog-empty .fa-wifi { font-size: 2.5rem; margin-bottom: 1rem; color: var(--primary); display: block; }

.product-card { background: #fff; border: 1px solid var(--border-color); border-radius: 12px; padding: 1rem; display: flex; flex-direction: column; gap: 0.5rem; transition: transform 0.15s, box-shadow 0.15s; }
.product-card:hover { transform: translateY(-3px); box-shadow: 0 6px 14px rgba(0,0,0,0.08); }
.product-card-top { display: flex; justify-content: space-between; font-size: 0.78rem; }
.product-sku { color: var(--text-muted); }
.product-badge { color: var(--success); font-weight: 600; }
.product-img-container { width: 100%; height: 180px; display: flex; align-items: center; justify-content: center; background: var(--light-bg); border-radius: 8px; overflow: hidden; }
.product-img { max-width: 100%; max-height: 100%; object-fit: contain; }
.product-brand { color: var(--accent); font-weight: bold; font-size: 0.78rem; }
.product-title { font-size: 0.92rem; color: var(--text-dark); margin: 0.2rem 0; }
.product-price-box { margin: 0.5rem 0; }
.product-price { font-size: 1.2rem; font-weight: 800; color: var(--primary); }
.product-price-tax { font-size: 0.78rem; color: var(--text-muted); }
.btn-add-cart { width: 100%; background: var(--accent); color: #fff; border: none; padding: 0.6rem; border-radius: 6px; font-weight: 700; cursor: pointer; }
.btn-add-cart:hover { background: var(--accent-hover); }
.btn-ws-consult { display: block; text-align: center; margin-top: 0.4rem; padding: 0.5rem; border-radius: 6px; background: rgba(37,211,102,0.12); color: #25D366; text-decoration: none; font-weight: 600; font-size: 0.85rem; }

/* ── Cart modal ────────────────────────────────────────────────────── */
.cart-modal { 
    position: fixed; 
    inset: 0; 
    background: rgba(15, 23, 42, 0.65); 
    backdrop-filter: blur(4px);
    display: flex; 
    align-items: center; 
    justify-content: center; 
    z-index: 1200; 
    padding: 1rem;
}
.cart-modal[hidden] { display: none; }
.cart-modal-card { 
    background: #fff; 
    border-radius: 16px; 
    max-width: 540px; 
    width: 100%; 
    max-height: 90vh; 
    display: flex; 
    flex-direction: column; 
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: modalFadeIn 0.25s ease-out;
}
@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.96) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.cart-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.1rem 1.4rem;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
    flex-shrink: 0;
}
.cart-modal-header h3 {
    margin: 0;
    color: var(--primary);
    font-size: 1.25rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.cart-modal-close {
    background: #f1f5f9;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 1.4rem;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.cart-modal-close:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: rotate(90deg);
}

.cart-modal-body {
    padding: 1.2rem 1.4rem;
    overflow-y: auto;
    flex: 1;
}

.cart-modal-footer {
    padding: 1rem 1.4rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-shrink: 0;
}

.free-shipping-bar { background: #e6fffa; border: 1px solid #b2f5ea; color: #234e52; padding: 0.6rem; border-radius: 6px; font-size: 0.85rem; font-weight: bold; margin-bottom: 1rem; text-align: center; }
.free-shipping-bar.is-met { background: #c6f6d5; color: #22543d; }

.cart-modal-list { max-height: 220px; overflow-y: auto; margin-bottom: 1rem; display: flex; flex-direction: column; gap: 0.75rem; }
.cart-row { display: flex; justify-content: space-between; align-items: center; padding: 0.6rem 0.8rem; background: var(--light-bg); border-radius: 6px; font-size: 0.9rem; gap: 0.5rem; }
.cart-row--install { background: #ebf8ff; color: var(--primary); font-weight: bold; }
.cart-row__info { flex: 1; min-width: 0; }
.cart-row__actions { display: flex; align-items: center; gap: 0.35rem; }
.cart-row__subtotal { font-weight: bold; color: var(--primary); margin-right: 0.25rem; }
.cart-qty-btn { background: #e2e8f0; color: var(--text-dark); border: none; width: 26px; height: 26px; border-radius: 4px; font-weight: bold; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 0.85rem; }
.cart-qty-btn:hover { background: #cbd5e0; }
.cart-remove-btn { background: rgba(229, 62, 62, 0.12); color: #e53e3e; border: none; width: 26px; height: 26px; border-radius: 4px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 0.85rem; margin-left: 0.2rem; }
.cart-remove-btn:hover { background: #e53e3e; color: #fff; }

.cart-modal-totals { background: var(--light-bg); padding: 1rem; border-radius: 8px; margin-bottom: 1rem; }
.totals-row { display: flex; justify-content: space-between; margin-bottom: 0.4rem; font-size: 0.9rem; color: var(--text-muted); }
.totals-row--big { font-size: 1.3rem; font-weight: 900; color: var(--success); border-top: 1px solid var(--border-color); padding-top: 0.5rem; }

.install-promo { margin-bottom: 1rem; padding: 10px; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 6px; display: flex; align-items: center; }
.install-promo input { width: 20px; height: 20px; margin-right: 10px; }
.install-promo label { font-size: 0.95rem; font-weight: bold; color: #166534; cursor: pointer; }

.email-label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.4rem; }
.cart-modal-card input[type="email"] { width: 100%; padding: 0.75rem; border-radius: 6px; border: 1px solid var(--border-color); margin-bottom: 0.4rem; font-size: 0.95rem; }

.cart-modal-actions { display: flex; gap: 0.75rem; }
.cart-modal-actions .btn { flex: 1; padding: 0.8rem; border-radius: 8px; font-weight: bold; cursor: pointer; border: none; }
.btn-outline { background: #fff; border: 1px solid var(--border-color); color: var(--text-dark); }
.btn-primary { background: #009ee3; color: #fff; }
.btn-whatsapp-cart { background: #25d366; color: #fff; }
.btn-whatsapp-cart:hover { background: #1ebc57; }

.shipping-selector-wrap { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 0.8rem 1rem; margin-bottom: 1rem; }
.shipping-selector-title { font-size: 0.88rem; font-weight: bold; color: var(--primary); margin-bottom: 0.4rem; display: flex; align-items: center; gap: 0.4rem; }
.shipping-option { display: flex; align-items: center; justify-content: space-between; padding: 0.4rem 0; font-size: 0.85rem; border-bottom: 1px dashed #e2e8f0; cursor: pointer; }
.shipping-option:last-child { border-bottom: none; }
.shipping-option input { margin-right: 0.5rem; }
.shipping-option span { font-weight: 600; }
.shipping-heavy-alert { background: #fffaf0; border: 1px solid #feebc8; color: #c05621; padding: 0.6rem; border-radius: 6px; font-size: 0.8rem; margin-top: 0.5rem; line-height: 1.4; display: none; }

.checkout-fields-row { display: flex; gap: 0.5rem; margin-bottom: 0.8rem; flex-wrap: wrap; }
.checkout-field-cp { flex: 1; min-width: 140px; }
.checkout-field-email { flex: 2; min-width: 180px; }
.checkout-input { width: 100%; padding: 0.6rem; border-radius: 6px; border: 1px solid var(--border-color); font-size: 0.9rem; }

/* ── Toast ─────────────────────────────────────────────────────────── */
.toast-container { position: fixed; bottom: 85px; right: 20px; z-index: 10000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { background: #1a202c; color: #fff; padding: 0.75rem 1rem; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.3); font-size: 0.9rem; max-width: 320px; animation: slideIn 0.3s ease; pointer-events: auto; }
@keyframes slideIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ── WhatsApp float ────────────────────────────────────────────────── */
.wa-float { position: fixed; bottom: 20px; right: 20px; background: #25d366; color: #fff; width: 58px; height: 58px; border-radius: 50px; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 15px rgba(37,211,102,0.4); z-index: 9999; font-size: 1.8rem; text-decoration: none; }

/* ── Footer ────────────────────────────────────────────────────────── */
footer { background: var(--primary-dark); color: #fff; padding: 1.5rem; text-align: center; font-size: 0.88rem; margin-top: 2rem; }
footer a { color: #63b3ed; text-decoration: none; }

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    main { grid-template-columns: 1fr; }
    .search-box { max-width: none; margin: 0; }
    nav { flex-wrap: wrap; gap: 0.5rem; }
}

@media (max-width: 480px) {
    .products-grid { grid-template-columns: 1fr; }
    .cart-modal-card { width: 95%; padding: 1rem; }
    .cart-modal-actions { flex-direction: column; }
}

/* ── Paginación y Carga Dinámica ─────────────────────────────────────── */
.store-pagination-wrap {
    margin: 2.5rem auto 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    padding: 1.5rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    max-width: 600px;
    width: 100%;
}
.store-pagination-info {
    font-size: 0.95rem;
    color: var(--text-muted);
}
.store-pagination-info strong {
    color: var(--primary);
    font-weight: 700;
}
.store-pagination-progress {
    width: 100%;
    max-width: 320px;
    height: 6px;
    background: #edf2f7;
    border-radius: 10px;
    overflow: hidden;
}
.store-pagination-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, #2f855a 100%);
    width: 0%;
    transition: width 0.3s ease;
}
.btn-load-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    background: var(--primary);
    color: #ffffff;
    border: none;
    padding: 0.85rem 2.2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.25);
}
.btn-load-more:hover:not(:disabled) {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(49, 130, 206, 0.35);
}
.btn-load-more:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}
.store-pagination-end {
    font-size: 0.9rem;
    color: #718096;
    font-weight: 600;
    margin-top: 0.5rem;
}

