/* =========================================
   1. VARIABLES GLOBALES Y RESET
   ========================================= */
:root {
    --accent: #32D74B; 
    --text-sub: #86868b;
    --border-light: #e5e5ea;
    
    /* Variables Cromáticas Financieras */
    --price-gray: #708090; 
    --price-blue: #007AFF; 
    --price-green: #00a82d; 
    --price-orange: #F57C00; 
    
    /* Variables del Panel */
    --primary: #000000; 
    --primary-hover: #333333;
    --success: #32D74B; 
    --danger: #ff453a;
    --bg-panel: #f5f5f7; 
    --white: #ffffff; 
    --text-panel: #1d1d1f; 
    
    /* Variables Catálogo/Producto */
    --bg-light: #ffffff; 
    --card-light: #ffffff; 
    --text-dark: #1d1d1f; 
    --bg-product: #f5f5f7;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
h1, h2, h3, h4 { font-family: 'Montserrat', sans-serif; }

/* Clases de Utilidad de Precios */
.price-gray { color: var(--price-gray) !important; font-weight: 700; }
.price-blue { color: var(--price-blue) !important; font-weight: 800; }
.price-green { color: var(--price-green) !important; font-weight: 800; }
.price-orange { color: var(--price-orange) !important; font-weight: 800; }

/* =========================================
   2. ESTILOS EXCLUSIVOS DEL CATÁLOGO
   ========================================= */
body.app-catalog { font-family: 'Inter', sans-serif; background-color: var(--bg-light); color: var(--text-dark); margin:0; }
.app-catalog .catalog-header { background-color: #000000; color: #ffffff; text-align: center; padding: 60px 20px 30px; margin-bottom: 40px; }

/* --- DISEÑO HUD HEADER --- */
.app-catalog .brand-title { 
    font-family: 'Rajdhani', sans-serif; font-weight: 300; font-size: clamp(35px, 7vw, 60px); 
    letter-spacing: 15px; margin: 0 0 15px 0; display: flex; justify-content: center; align-items: center; gap: 15px; 
}
.app-catalog .hud-text {
    font-family: 'Orbitron', sans-serif; font-weight: 700; font-size: clamp(18px, 4vw, 26px);
    letter-spacing: 6px; color: #ffffff; border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 14px; border-radius: 4px;
}
.app-catalog .dolar-rate { 
    display: inline-block; font-family: 'Rajdhani', sans-serif; font-weight: 600; 
    letter-spacing: 2px; background: rgba(50, 215, 75, 0.05); 
    border: 1px solid rgba(50, 215, 75, 0.3); color: var(--accent); 
    padding: 8px 25px; border-radius: 4px; text-transform: uppercase; font-size: 16px;
}

.app-catalog .catalog-container { max-width: 800px; margin: 0 auto; padding: 0 20px; min-height: 60vh; }

/* --- BOTONES DE MARCA --- */
.app-catalog .brand-btn { 
    background: #000000; border: 1px solid var(--accent); width: 100%; padding: 18px 25px; 
    margin-bottom: 15px; border-radius: 12px; cursor: pointer; display: flex; align-items: center; 
    justify-content: space-between; color: #ffffff; transition: filter 0.3s, transform 0.2s, box-shadow 0.3s; 
}
.app-catalog .brand-btn:hover { box-shadow: 0 4px 15px rgba(50, 215, 75, 0.2); transform: scale(0.99); }
.app-catalog .brand-btn-content { display: flex; align-items: center; text-align: left; }
.app-catalog .brand-text-wrapper { display: flex; flex-direction: column; justify-content: center; }

.app-catalog .brand-name { font-size: 24px; font-weight: 700; font-family: 'Montserrat', sans-serif; letter-spacing: 1px; color: #ffffff; }
.app-catalog .brand-subtext { font-size: 12px; font-weight: 500; color: #a1a1a6; font-family: 'Inter', sans-serif; margin-top: 4px; }

/* --- GRILLA DE PRODUCTOS --- */
.app-catalog .product-list { display: flex; flex-direction: column; gap: 15px; display: none; margin-bottom: 30px; }
.app-catalog .product-list.active { display: flex; }
.app-catalog .product-card { background: var(--card-light); border: 1px solid var(--border-light); border-radius: 16px; padding: 25px 20px; display: flex; align-items: flex-start; text-align: left; position: relative; box-shadow: 0 4px 20px rgba(0,0,0,0.03); }

/* --- TAGS (Con alineación Flexbox para Iconos Vectoriales) --- */
.app-catalog .ui-tag { 
    position: absolute; top: -10px; left: 20px; font-size: 11px; font-weight: 800; 
    padding: 4px 12px; border-radius: 50px; text-transform: uppercase; letter-spacing: 1px; 
    color: #fff; box-shadow: 0 4px 10px rgba(0,0,0,0.1); z-index: 10;
    display: flex; align-items: center; gap: 6px; 
}
.app-catalog .tag-nuevo { background: #0A84FF; } 
.app-catalog .tag-ultimo { background: #FF9F0A; } 
.app-catalog .tag-sinstock { background: #FF453A; } 
.app-catalog .tag-proximamente { background: #8E8E93; } 
.app-catalog .tag-porpedido { background: #AF52DE; }

.app-catalog .product-img-placeholder { width: 110px; height: 110px; margin-right: 25px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: #f5f5f7; border-radius: 12px; padding: 10px; margin-top: 10px; }
.app-catalog .product-img-placeholder img { max-width: 100%; max-height: 100%; object-fit: contain; }
.app-catalog .product-info-wrap { flex-grow: 1; width: 100%; display: flex; flex-direction: column; }
.app-catalog .product-title { font-size: 18px; font-weight: 700; margin-bottom: 12px; color: var(--text-dark); }

/* --- LISTA DE PRECIOS EXACTA --- */
.app-catalog .simple-price-list { list-style: none; padding: 0; margin: 0 0 15px 0; font-size: 14px; color: var(--text-dark); line-height: 1.8; flex-grow: 1; }
.app-catalog .simple-price-list li { display: flex; align-items: center; gap: 6px; font-weight: 500; }

/* --- GRUPO DE BOTONES --- */
.action-group { display: flex; gap: 10px; width: 100%; margin-top: auto; }
.btn-details { flex-grow: 1; background: #000000; color: #ffffff; border: 1px solid var(--accent); text-decoration: none; padding: 12px; border-radius: 10px; font-size: 13px; font-weight: 700; text-transform: uppercase; display: block; text-align: center; transition: 0.3s; }
.btn-details:hover { background: var(--accent); color: #000000; }
.btn-share { width: 45px; flex-shrink: 0; background: #f5f5f7; color: var(--text-dark); border: 1px solid var(--border-light); border-radius: 10px; font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.3s; }
.btn-share:hover { background: var(--border-light); }

/* Nuevo Botón Agregar al Carrito */
.btn-add-cart {
    background: #111; color: var(--accent); border: 1px solid var(--accent);
    width: 100%; padding: 12px; border-radius: 10px; font-size: 13px; font-weight: 700;
    text-transform: uppercase; margin-top: 10px; cursor: pointer; transition: 0.3s;
    display: flex; align-items: center; justify-content: center; gap: 8px; font-family: 'Inter', sans-serif;
}
.btn-add-cart:hover { background: var(--accent); color: #000; }

@media (max-width: 600px) {
    .app-catalog .product-card { flex-direction: column; align-items: center; padding-top: 35px; }
    .app-catalog .ui-tag { left: 50%; transform: translateX(-50%); }
    .app-catalog .product-img-placeholder { margin: 0 0 20px 0; width: 140px; height: 140px; }
    .app-catalog .product-info-wrap { width: 100%; }
}

/* =========================================
   3. ESTILOS EXCLUSIVOS DEL PRODUCTO
   ========================================= */
body.app-product { font-family: 'Inter', sans-serif; background-color: var(--bg-product); color: var(--text-dark); margin: 0; padding: 20px 20px 0 20px; }
.app-product .container { width: 100%; max-width: 600px; margin: 20px auto; min-height: 70vh; }
.app-product .product-detail-card { background: var(--card-light); padding: 40px 30px; border-radius: 24px; border: 1px solid var(--border-light); box-shadow: 0 10px 30px rgba(0,0,0,0.05); }
.app-product .img-container { text-align: center; margin-bottom: 25px; padding: 20px; background: #ffffff; border-radius: 16px; }
.app-product .product-img { width: 250px; height: 250px; object-fit: contain; }
.app-product h1 { font-size: 26px; margin: 0 0 10px 0; text-align: center; }
.app-product .competitor-price { text-align: center; color: var(--text-sub); font-size: 14px; margin-bottom: 30px; }
.app-product .competitor-price del { color: #ff453a; font-weight: 600; margin-left: 5px; }
.app-product .breakdown-box { border: 1px solid var(--border-light); border-radius: 16px; padding: 20px; margin-bottom: 30px; }
.app-product .breakdown-title { font-size: 14px; text-transform: uppercase; color: var(--text-sub); margin-bottom: 15px; border-bottom: 1px solid var(--border-light); padding-bottom: 10px; }

.app-product .price-main-highlight { text-align: center; background: rgba(0, 168, 45, 0.05); border: 1px solid rgba(0, 168, 45, 0.2); border-radius: 12px; padding: 20px; margin-bottom: 20px; }
.app-product .price-main-highlight .label { font-size: 13px; text-transform: uppercase; font-weight: 700; color: var(--text-sub); letter-spacing: 1px; margin-bottom: 5px; }
.app-product .price-main-highlight .amount { font-size: clamp(28px, 6vw, 36px); font-weight: 800; color: var(--price-green); letter-spacing: -1px; }

.app-product .bd-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px dashed var(--border-light); font-size: 15px; }
.app-product .bd-item:last-child { border-bottom: none; padding-bottom: 0; }
.app-product .bd-item span { color: var(--text-sub); }

.app-product .ml-specs-container { margin-top: 40px; }
.app-product .ml-specs-title { font-size: 20px; font-weight: 600; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 1px solid var(--border-light); }
.app-product .ml-table { width: 100%; border-collapse: collapse; border-radius: 8px; overflow: hidden; box-shadow: 0 0 0 1px var(--border-light); }
.app-product .ml-table tr:nth-child(odd) { background-color: #f5f5f7; }
.app-product .ml-table tr:nth-child(even) { background-color: #ffffff; }
.app-product .ml-table td { padding: 14px 20px; border-bottom: 1px solid var(--border-light); font-size: 14px; color: var(--text-dark); vertical-align: middle; }
.app-product .ml-table tr:last-child td { border-bottom: none; }
.app-product .btn-back { display: block; text-align: center; margin-top: 25px; color: var(--text-sub); text-decoration: none; font-size: 14px; font-weight: 600; }

/* =========================================
   4. ESTILOS DE BOTÓN WHATSAPP FLOTANTE
   ========================================= */
.wa-float { position: fixed; width: 60px; height: 60px; bottom: 40px; right: 40px; background-color: #25d366; color: #FFF; border-radius: 50px; text-align: center; font-size: 30px; box-shadow: 0px 4px 15px rgba(0,0,0,0.15); z-index: 1000; display: flex; align-items: center; justify-content: center; text-decoration: none; transition: transform 0.3s ease, background-color 0.3s ease; }
.wa-float:hover { transform: scale(1.05); background-color: #20b858; color: #FFF; }
@media (max-width: 1024px) { .wa-float { width: 55px; height: 55px; bottom: 30px; right: 30px; font-size: 28px; } }
@media (max-width: 768px) { .wa-float { width: 50px; height: 50px; bottom: 20px; right: 20px; font-size: 25px; } }

/* =========================================
   5. FOOTER GLOBAL
   ========================================= */
.global-footer { 
    text-align: center; 
    padding: 50px 20px 40px; 
    margin-top: 50px; 
    border-top: 1px solid var(--border-light); 
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
}
.app-catalog .global-footer, .app-product .global-footer, .app-home .global-footer { background-color: transparent; }
.footer-title { font-family: 'Montserrat', sans-serif; font-weight: 300; font-size: 14px; letter-spacing: 6px; color: var(--text-sub); text-transform: uppercase; margin: 0; }
.footer-contact { margin: 5px 0; }
.footer-email { color: var(--text-sub); text-decoration: none; font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 500; transition: color 0.3s ease; display: inline-flex; align-items: center; gap: 8px; }
.footer-email i { font-size: 14px; }
.footer-email:hover { color: #32D74B; }
.footer-legal { font-family: 'Inter', sans-serif; font-size: 10px; color: #666666; line-height: 1.8; text-transform: uppercase; letter-spacing: 1px; margin: 0; }

/* =========================================
   6. PANEL ESTILOS BASE
   ========================================= */
body.app-panel { font-family: 'Inter', sans-serif; background: var(--bg-panel); color: var(--text-panel); padding: 20px; display: flex; justify-content: center; }
.app-panel .container { width: 100%; max-width: 1000px; }
.app-panel .card { background: var(--white); padding: 30px; border-radius: 16px; box-shadow: 0 4px 20px rgba(0,0,0,0.04); margin-bottom: 25px; }
.app-panel h2, .app-panel h4 { margin-bottom: 20px; color: var(--primary); }
.app-panel .grid-config { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; }
.app-panel label { display: block; font-size: 13px; font-weight: 600; color: var(--text-sub); margin-bottom: 5px; }
.app-panel input, .app-panel select, .app-panel textarea { width: 100%; padding: 12px 15px; border: 1px solid var(--border-light); border-radius: 10px; font-size: 14px; font-family: 'Inter', sans-serif; transition: border-color 0.2s; }
.app-panel input:focus, .app-panel select:focus, .app-panel textarea:focus { outline: none; border-color: var(--primary); }
.app-panel button { padding: 14px 20px; border-radius: 10px; border: none; font-weight: 600; cursor: pointer; transition: 0.2s; font-family: 'Inter', sans-serif; }
.app-panel .btn-main { background: var(--primary); color: white; width: 100%; }
.app-panel .btn-main:hover { background: var(--primary-hover); }
.app-panel .btn-save { background: var(--success); color: white; font-size: 16px; width: 100%; margin-top: 20px; }
.app-panel .btn-save:hover { filter: brightness(1.1); }
.app-panel .btn-global { background: #007AFF; color: white; margin-top: 15px; }
.app-panel .product-item { display: flex; justify-content: space-between; align-items: center; padding: 15px; border-bottom: 1px solid #eee; background: #fafafa; border-radius: 8px; margin-bottom: 10px; }
.app-panel .product-info { display: flex; flex-direction: column; }
.app-panel .product-title { font-weight: 600; }
.app-panel .product-meta { font-size: 12px; color: var(--text-sub); }
.app-panel .img-preview { width: 100%; height: 180px; background: #f9f9f9; border: 1px dashed var(--border-light); border-radius: 10px; display: flex; align-items: center; justify-content: center; overflow: hidden; margin-bottom: 15px; }
.app-panel #login-panel { max-width: 400px; margin: 100px auto; text-align: center; }
.app-panel .badge { padding: 4px 8px; border-radius: 4px; font-size: 11px; font-weight: bold; }
.app-panel .badge-active { background: #e5fceb; color: #008a20; }
.app-panel .badge-inactive { background: #ffe5e5; color: #d90000; }
.app-panel .form-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 30px; }
.app-panel .ars-preview { font-size: 13px; color: var(--success); font-weight: 600; margin-top: 8px; display: block; }
@media (max-width: 768px) { .app-panel .form-grid { grid-template-columns: 1fr; } }

/* =========================================
   7. MEJORAS DE CATÁLOGO (Buscador y Comparador)
   ========================================= */
.catalog-tools { max-width: 800px; margin: 0 auto 25px; padding: 0 20px; display: flex; flex-direction: column; gap: 15px; }
.search-box { position: relative; width: 100%; }
.search-box i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-sub); }
.search-bar { width: 100%; padding: 14px 20px 14px 45px; border-radius: 12px; border: 1px solid var(--border-light); background: var(--card-light); font-family: 'Inter', sans-serif; font-size: 15px; color: var(--text-dark); outline: none; transition: all 0.3s; box-shadow: 0 4px 15px rgba(0,0,0,0.02); }
.search-bar:focus { border-color: var(--primary); box-shadow: 0 4px 20px rgba(0,0,0,0.08); }

.stock-indicator { margin-top: -5px; margin-bottom: 12px; }
.stock-text { font-size: 11px; color: #FF9F0A; font-weight: 700; display: flex; align-items: center; gap: 5px; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.stock-bar { width: 100%; height: 3px; background: #f0f0f0; border-radius: 2px; overflow: hidden; }
.stock-bar-fill { height: 100%; background: #FF9F0A; width: 15%; border-radius: 2px; animation: pulseStock 2s infinite alternate; }
@keyframes pulseStock { 0% { opacity: 0.4; } 100% { opacity: 1; } }

.btn-compare { background: transparent; border: 1px dashed var(--text-sub); color: var(--text-sub); font-size: 12px; padding: 8px 12px; border-radius: 8px; cursor: pointer; transition: 0.2s; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 10px; }
.btn-compare:hover { border-color: #000; color: #000; }
.btn-compare.selected { background: rgba(0, 122, 255, 0.05); border: 1px solid var(--price-blue); color: var(--price-blue); }

.compare-floater { position: fixed; bottom: 25px; left: 50%; transform: translateX(-50%); background: #000; color: #fff; padding: 12px 25px; border-radius: 50px; display: flex; gap: 20px; align-items: center; box-shadow: 0 10px 40px rgba(0,0,0,0.4); z-index: 1000; transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s; font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 600; }
.compare-floater.hidden { transform: translate(-50%, 150px); opacity: 0; pointer-events: none; }
.compare-floater button { background: var(--accent); color: #000; border: none; padding: 8px 16px; border-radius: 20px; font-weight: 700; cursor: pointer; text-transform: uppercase; font-size: 12px; letter-spacing: 0.5px; transition: filter 0.2s; }
.compare-floater button:hover { filter: brightness(1.1); }

.compare-modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(5px); z-index: 3000; display: flex; justify-content: center; align-items: center; padding: 20px; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.compare-modal.active { opacity: 1; pointer-events: auto; }
.compare-content { background: #fff; border-radius: 24px; width: 100%; max-width: 800px; max-height: 90vh; overflow-y: auto; padding: 30px; position: relative; box-shadow: 0 20px 50px rgba(0,0,0,0.5); }
.compare-close { position: absolute; top: 20px; right: 25px; font-size: 24px; cursor: pointer; color: var(--text-sub); background: none; border: none; transition: 0.2s; }
.compare-close:hover { color: #000; }
.compare-table { width: 100%; border-collapse: collapse; margin-top: 25px; font-family: 'Inter', sans-serif; font-size: 14px; }
.compare-table th, .compare-table td { padding: 15px; border-bottom: 1px solid var(--border-light); text-align: left; vertical-align: top; }
.compare-table th { font-weight: 700; color: #000; width: 33.33%; font-size: 16px; padding-top: 0; }
.compare-table tr:last-child td { border-bottom: none; }
.compare-table td:first-child { font-weight: 600; color: var(--text-sub); background: #fafafc; border-radius: 8px 0 0 8px; }
.empty-state { text-align: center; padding: 50px 20px; color: var(--text-sub); font-family: 'Inter', sans-serif; }
.empty-state i { font-size: 40px; margin-bottom: 15px; color: var(--border-light); }

/* =========================================
   8. NUEVOS ESTILOS DEL CARRITO (FASE 1)
   ========================================= */
.cart-floater {
    position: fixed; bottom: 40px; left: 40px; width: 60px; height: 60px;
    background-color: #111; color: var(--accent); border: 2px solid var(--accent);
    border-radius: 50%; box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    cursor: pointer; z-index: 1000; display: flex; align-items: center;
    justify-content: center; font-size: 24px; transition: transform 0.3s;
}
.cart-floater:hover { transform: scale(1.05); }
.cart-badge {
    position: absolute; top: -5px; right: -5px; background: #ff453a;
    color: white; font-size: 12px; font-weight: bold; width: 22px; height: 22px;
    display: flex; align-items: center; justify-content: center; border-radius: 50%;
}

.cart-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(5px);
    display: none; justify-content: center; align-items: flex-end;
    z-index: 4000;
}
.cart-modal.active { display: flex; }

.cart-content {
    background: #111; width: 100%; max-width: 500px;
    border-top: 2px solid var(--accent); border-radius: 20px 20px 0 0;
    padding: 25px; position: relative; color: #fff; font-family: 'Inter', sans-serif;
    animation: slideUp 0.3s ease-out; max-height: 90vh; overflow-y: auto;
}

.cart-close {
    position: absolute; top: 15px; right: 20px; background: none;
    border: none; color: #fff; font-size: 24px; cursor: pointer;
}

.cart-items-container { margin-bottom: 20px; }
.cart-item {
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid #333; padding: 12px 0;
}
.cart-item-info { display: flex; flex-direction: column; }
.cart-item-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.cart-item-price { color: var(--accent); font-weight: bold; font-size: 15px; }
.cart-item-remove {
    background: none; border: none; color: #ff453a; font-size: 16px; cursor: pointer; padding: 5px;
}

.checkout-section select {
    width: 100%; padding: 12px; background: #222; color: #fff;
    border: 1px solid #444; border-radius: 8px; font-family: 'Inter', sans-serif; margin-top: 5px;
}

.financial-breakdown {
    background: #1a1a1a; padding: 15px; border-radius: 8px;
    margin: 20px 0; border: 1px solid #333;
}
.breakdown-row { display: flex; justify-content: space-between; margin-bottom: 8px; }
.total-row { font-size: 1.2rem; font-weight: bold; }
.installment-message {
    background: rgba(50, 215, 75, 0.1); padding: 10px; border-radius: 5px;
    text-align: center; margin-top: 15px; border: 1px solid var(--price-green); font-size: 0.95rem;
}

.btn-checkout-mp {
    width: 100%; background: #009EE3; color: white; padding: 15px;
    border: none; border-radius: 8px; font-size: 1.1rem; font-weight: bold;
    cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 10px; transition: 0.3s;
}
.btn-checkout-mp:hover { background: #0087c1; }

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* Ajustes Responsivos Móviles */
@media (max-width: 768px) {
    .btn-compare { display: none !important; }
    .compare-floater { display: none !important; }
    .cart-floater { bottom: 20px; left: 20px; width: 50px; height: 50px; font-size: 20px; }
    .cart-badge { width: 18px; height: 18px; font-size: 10px; }
}

@media (min-width: 768px) {
    .cart-modal { align-items: center; }
    .cart-content { border-radius: 15px; border: 1px solid #333; }
}