/* =========================================
   ESTILOS EXCLUSIVOS PARA PÁGINA DE PRODUCTOS
   ========================================= */

/* Fondo oscuro específico para esta página */
body.catalog-page {
    background-color: #0a0a0a;
}

/* Contenedor Principal */
.catalog-wrapper { 
    max-width: 1400px; 
    margin: 40px auto; 
    padding: 0 20px; 
}

/* =========================================
   BARRA DE PESTAÑAS (MARCAS)
   ========================================= */
#brand-tabs {
    display: flex; 
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    
    padding: 25px 20px;
    background: #111;
    border-bottom: 1px solid #333;
    margin-bottom: 40px;
    border-radius: 8px;
}

/* Botones de Marca */
.tab {
    padding: 10px 22px; 
    background: transparent; 
    color: #aaa; 
    border: 1px solid #444;
    border-radius: 8px; 
    cursor: pointer; 
    transition: all 0.3s ease; 
    font-size: 0.85rem; 
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tab:hover { 
    border-color: #d4af37; 
    color: #fff; 
    background: rgba(255,255,255,0.05);
    transform: translateY(-2px);
}

.tab.active { 
    background: #d4af37; 
    color: #000; 
    border-color: #d4af37; 
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
    transform: scale(1.05);
}

.tab i {
    margin-right: 6px;
    font-size: 0.9rem;
}

/* Tabs especiales */
.tab-filtros {
    border-color: #d4af37;
    color: #d4af37;
}

.tab-filtros:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: #d4af37;
    color: #fff;
}

.tab-filtros.active {
    background: #d4af37;
    color: #000;
}

/* =========================================
   GRID DE PRODUCTOS - DISEÑO ESCRITORIO FORZADO
   ========================================= */

/* Para pantallas de PC (desktop) - 4 columnas */
.products-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 25px !important;
    width: 100% !important;
}

/* Para laptops pequeñas o ventanas medianas - 3 columnas */
@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* Para tablets - 2 columnas */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }
}

/* Solo para teléfonos muy pequeños - 1 columna */
@media (max-width: 450px) {
    .products-grid {
        grid-template-columns: 1fr !important;
    }
}

/* =========================================
   BARRA DE PESTAÑAS RESPONSIVE (DE ESCRITORIO)
   ========================================= */
@media (max-width: 768px) {
    #brand-tabs {
        justify-content: center; /* Centrado, no con scroll */
        flex-wrap: wrap;
        padding: 15px 10px;
        gap: 8px;
    }
    .tab {
        padding: 8px 16px;
        font-size: 0.75rem;
    }
}
/* =========================================
   TARJETA DE PRODUCTO
   ========================================= */
.product-card {
    background: #151515;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    border-color: #d4af37;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}

.card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #333;
    color: #fff;
    padding: 4px 8px;
    font-size: 0.7rem;
    font-weight: bold;
    border-radius: 4px;
    z-index: 2;
}

/* =========================================
   IMAGEN DE LA TARJETA
   ========================================= */
.card-img-placeholder {
    height: 220px;
    width: 100%;
    background-color: #151515;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid #222;
}

.card-img-placeholder img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    display: block;
}

.card-img-placeholder i {
    font-size: 4rem;
    color: #333;
}

/* =========================================
   CUERPO DE LA TARJETA
   ========================================= */
.card-body {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: #151515;
}

.card-body h3 {
    font-size: 1rem;
    color: #fff;
    margin-bottom: 8px;
    line-height: 1.3;
    height: 42px;
    overflow: hidden;
}

.card-code {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 15px;
}

/* Stack de Precios */
.price-stack {
    background: #0f0f0f;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
    border: 1px solid #222;
}

.p-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-bottom: 4px;
    color: #aaa;
}

.p-row strong { color: #fff; }
.p-row.wholesale strong { color: #4caf50; }
.p-row.promo strong { color: #d4af37; font-size: 1.1em; }

/* Botón Añadir */
.btn-add {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid #444;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 6px;
    text-transform: uppercase;
    font-size: 0.85rem;
    margin-top: auto;
}

.btn-add:hover {
    background: #fff;
    color: #000;
    border-color: #fff;
}

.status-msg {
    grid-column: 1/-1;
    text-align: center;
    padding: 40px;
    color: #888;
    font-size: 1.1rem;
}

/* =========================================
   ETIQUETAS DE ESTADO
   ========================================= */
.card-status-badge {
    position: absolute;
    top: 15px;
    left: 0;
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #fff;
    z-index: 3;
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
    clip-path: polygon(0 0, 100% 0, 90% 100%, 0% 100%);
    pointer-events: none;
}

.badge-stock { background: #444; color: #ccc; }
.badge-offer { background: #d4af37; color: #000; }
.badge-promo { background: #e91e63; color: #fff; }
.badge-scarce { background: #ff5722; color: #fff; }
.badge-order { background: #2196f3; color: #fff; }
.badge-default { background: #333; color: #fff; }

/* Etiqueta superior derecha (presentación) */
.card-badge-right {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 4px 8px;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
    border-radius: 4px;
    z-index: 2;
    pointer-events: none;
    user-select: none;
}

/* =========================================
   TARJETA DE FILTRO (SIN IMAGEN)
   ========================================= */
.product-card-filtro {
    min-height: auto;
}

.product-card-filtro .card-body {
    padding: 25px 20px;
    justify-content: flex-start;
}

.product-card-filtro .card-body h3 {
    height: auto;
    min-height: auto;
    font-size: 0.95rem;
    margin-bottom: 12px;
}

.product-card-filtro .card-code {
    margin-bottom: 18px;
}

.product-card-filtro .price-stack {
    margin-top: auto;
}

/* =========================================
   MODAL (VENTANA EMERGENTE)
   ========================================= */
.modal-overlay {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #151515;
    border: 1px solid #333;
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 25px;
    color: #fff;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    z-index: 10;
}

.close-modal:hover { color: #d4af37; }

.modal-body {
    display: flex;
    flex-wrap: wrap;
    padding: 0;
}

.modal-image-container {
    flex: 1 1 400px;
    background: #151515;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    min-height: 300px;
    border-right: 1px solid #222;
}

.modal-image-container img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
}

.modal-info {
    flex: 1 1 400px;
    padding: 40px;
    display: flex;
    flex-direction: column;
}

.modal-info h2 {
    color: #fff;
    font-size: 1.8rem;
    margin-bottom: 10px;
    line-height: 1.2;
}

.modal-code {
    color: #888;
    font-size: 1rem;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.modal-prices {
    background: #0f0f0f;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #222;
    margin-bottom: 25px;
}

.mp-row {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: #ccc;
}

.mp-row strong { color: #fff; font-size: 1.2rem; }
.mp-row.wholesale strong { color: #4caf50; }
.mp-row.promo strong { color: #d4af37; font-size: 1.4rem; }

.modal-description h4 {
    color: #d4af37;
    font-size: 1rem;
    text-transform: uppercase;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.modal-description p {
    color: #aaa;
    line-height: 1.6;
    font-size: 0.95rem;
    margin-bottom: 30px;
}

.btn-add-modal {
    width: 100%;
    padding: 15px;
    background: #d4af37;
    color: #000;
    border: none;
    font-weight: bold;
    font-size: 1rem;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 6px;
    transition: 0.3s;
    margin-top: auto;
}

.btn-add-modal:hover {
    background: #fff;
    transform: scale(1.02);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   RESPONSIVE - MODAL Y TABS
   ========================================= */
@media (max-width: 768px) {
    .modal-body { flex-direction: column; }
    .modal-image-container { padding: 20px; min-height: 250px; border-right: none; border-bottom: 1px solid #222; }
    .modal-info { padding: 20px; }
    .modal-info h2 { font-size: 1.4rem; }
    
    #brand-tabs {
        justify-content: flex-start;
        overflow-x: auto;
        white-space: nowrap;
        flex-wrap: nowrap;
        padding: 15px 10px;
        gap: 8px;
    }
    .tab {
        flex-shrink: 0;
        padding: 8px 16px;
        font-size: 0.75rem;
    }
}

/* =========================================
   BOTONES DOBLES EN PRODUCTO (ELEGANTES)
   ========================================= */
.btn-group-product {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    margin-top: auto !important;
    width: 100% !important;
}

.btn-group-product .btn-add {
    width: 100% !important;
    padding: 12px 8px !important;
    background: transparent !important;
    border: 1.5px solid rgba(212, 175, 55, 0.4) !important;
    color: #d4af37 !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    border-radius: 8px !important;
    text-transform: uppercase !important;
    font-size: 0.72rem !important;
    letter-spacing: 0.5px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    margin: 0 !important;
}

.btn-group-product .btn-add:hover {
    background: rgba(212, 175, 55, 0.1) !important;
    border-color: #d4af37 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 15px rgba(212, 175, 55, 0.2) !important;
}

.btn-group-product .btn-add.in-cart {
    background: rgba(37, 211, 102, 0.15) !important;
    border-color: #25d366 !important;
    color: #25d366 !important;
}

.btn-group-product .btn-wa-product {
    width: 100% !important;
    padding: 12px 8px !important;
    background: linear-gradient(135deg, #25d366, #1da851) !important;
    border: none !important;
    color: #fff !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    border-radius: 8px !important;
    text-transform: uppercase !important;
    font-size: 0.72rem !important;
    letter-spacing: 0.5px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
}

.btn-group-product .btn-wa-product:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(37, 211, 102, 0.4) !important;
}

/* =========================================
   BOTÓN FLOTANTE DEL CARRITO
   ========================================= */
.cart-float {
    position: fixed !important;
    bottom: 30px !important;
    right: 30px !important;
    width: 62px !important;
    height: 62px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #d4af37, #b8932e) !important;
    color: #000 !important;
    border: 3px solid #fff !important;
    font-size: 1.5rem !important;
    cursor: pointer !important;
    z-index: 9998 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.5) !important;
    transition: all 0.3s ease !important;
    padding: 0 !important;
    margin: 0 !important;
}

.cart-float:hover {
    transform: scale(1.1) translateY(-3px) !important;
    box-shadow: 0 15px 40px rgba(212, 175, 55, 0.8) !important;
}

.cart-float-count {
    position: absolute !important;
    top: -6px !important;
    right: -6px !important;
    background: #e74c3c !important;
    color: #fff !important;
    width: 26px !important;
    height: 26px !important;
    border-radius: 50% !important;
    display: none;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.75rem !important;
    font-weight: 800 !important;
    border: 2px solid #fff !important;
    box-sizing: border-box !important;
}

/* =========================================
   PANEL LATERAL DEL CARRITO (DERECHA)
   ========================================= */
.cart-sidebar {
    position: fixed !important;
    top: 0 !important;
    right: -450px !important;
    width: 400px !important;
    max-width: 90vw !important;
    height: 100vh !important;
    background: #0f0f0f !important;
    border-left: 2px solid rgba(212, 175, 55, 0.4) !important;
    z-index: 100000 !important;
    display: flex !important;
    flex-direction: column !important;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.8) !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

.cart-sidebar.active {
    right: 0 !important;
}

.cart-sidebar-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.7) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    z-index: 99999 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease !important;
}

.cart-sidebar-overlay.active {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.cart-sidebar-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 22px 25px !important;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2) !important;
    background: linear-gradient(180deg, #1a1a1a, #0f0f0f) !important;
    flex-shrink: 0 !important;
}

.cart-sidebar-header h3 {
    color: #d4af37 !important;
    font-size: 1.1rem !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    text-transform: uppercase !important;
    letter-spacing: 1.5px !important;
    font-weight: 700 !important;
}

.cart-sidebar-close {
    background: transparent !important;
    border: none !important;
    color: #aaa !important;
    font-size: 1.8rem !important;
    cursor: pointer !important;
    line-height: 1 !important;
    transition: all 0.3s ease !important;
    padding: 0 !important;
    width: 30px !important;
    height: 30px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
}

.cart-sidebar-close:hover {
    color: #d4af37 !important;
    background: rgba(212, 175, 55, 0.1) !important;
    transform: rotate(90deg) !important;
}

.cart-sidebar-body {
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 15px !important;
}

.cart-sidebar-body::-webkit-scrollbar {
    width: 6px;
}

.cart-sidebar-body::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.3);
    border-radius: 3px;
}

.cart-sidebar-empty {
    text-align: center !important;
    color: #666 !important;
    padding: 60px 20px !important;
    font-size: 0.95rem !important;
}

/* ITEM DEL CARRITO */
.cart-item {
    display: flex !important;
    gap: 12px !important;
    padding: 12px !important;
    background: #151515 !important;
    border: 1px solid #2a2a2a !important;
    border-radius: 10px !important;
    margin-bottom: 10px !important;
    position: relative !important;
    transition: all 0.3s ease !important;
}

.cart-item:hover {
    border-color: #d4af37 !important;
}

.cart-item-img {
    width: 62px !important;
    height: 62px !important;
    border-radius: 8px !important;
    background: #0a0a0a !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
    padding: 5px !important;
    box-sizing: border-box !important;
}

.cart-item-img img {
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
}

.cart-item-img i {
    color: #d4af37 !important;
    font-size: 1.5rem !important;
}

.cart-item-info {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    min-width: 0 !important;
    padding-right: 20px !important;
}

.cart-item-info strong {
    color: #fff !important;
    font-size: 0.82rem !important;
    line-height: 1.3 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

.cart-item-code {
    color: #666 !important;
    font-size: 0.7rem !important;
}

.cart-item-controls {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin-top: 6px !important;
}

.cart-qty-btn {
    width: 24px !important;
    height: 24px !important;
    border-radius: 4px !important;
    background: #2a2a2a !important;
    border: none !important;
    color: #fff !important;
    font-weight: bold !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    font-size: 0.9rem !important;
}

.cart-qty-btn:hover {
    background: #d4af37 !important;
    color: #000 !important;
}

.cart-qty {
    color: #fff !important;
    font-weight: 700 !important;
    min-width: 20px !important;
    text-align: center !important;
    font-size: 0.85rem !important;
}

.cart-item-price {
    color: #d4af37 !important;
    font-weight: 700 !important;
    margin-left: auto !important;
    font-size: 0.85rem !important;
}

.cart-item-remove {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    width: 22px !important;
    height: 22px !important;
    border-radius: 50% !important;
    background: rgba(231, 76, 60, 0.2) !important;
    border: none !important;
    color: #e74c3c !important;
    cursor: pointer !important;
    font-size: 0.9rem !important;
    line-height: 1 !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
}

.cart-item-remove:hover {
    background: #e74c3c !important;
    color: #fff !important;
}

/* FOOTER DEL CARRITO */
.cart-sidebar-footer {
    padding: 20px 25px !important;
    border-top: 1px solid rgba(212, 175, 55, 0.2) !important;
    background: linear-gradient(180deg, #0f0f0f, #0a0a0a) !important;
    flex-shrink: 0 !important;
}

.cart-sidebar-total {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 15px !important;
    padding: 14px 18px !important;
    background: rgba(212, 175, 55, 0.08) !important;
    border: 1px solid rgba(212, 175, 55, 0.3) !important;
    border-radius: 10px !important;
}

.cart-sidebar-total span {
    color: #aaa !important;
    font-size: 0.85rem !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    font-weight: 600 !important;
}

.cart-sidebar-total strong {
    color: #d4af37 !important;
    font-size: 1.5rem !important;
    font-weight: 800 !important;
}

.cart-sidebar-checkout {
    width: 100% !important;
    padding: 16px !important;
    background: linear-gradient(135deg, #25d366, #1da851) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 10px !important;
    font-weight: 700 !important;
    font-size: 0.9rem !important;
    text-transform: uppercase !important;
    letter-spacing: 1.5px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    margin-bottom: 10px !important;
}

.cart-sidebar-checkout:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 10px 25px rgba(37, 211, 102, 0.4) !important;
}

.cart-sidebar-clear {
    width: 100% !important;
    padding: 10px !important;
    background: transparent !important;
    border: 1px solid #444 !important;
    color: #888 !important;
    border-radius: 8px !important;
    font-size: 0.8rem !important;
    cursor: pointer !important;
    text-transform: uppercase !important;
    transition: all 0.3s ease !important;
}

.cart-sidebar-clear:hover {
    border-color: #e74c3c !important;
    color: #e74c3c !important;
}

/* RESPONSIVE */
@media (max-width: 600px) {
    .cart-float {
        width: 55px !important;
        height: 55px !important;
        font-size: 1.2rem !important;
        bottom: 20px !important;
        right: 20px !important;
    }
    .cart-sidebar {
        width: 100vw !important;
        max-width: 100vw !important;
    }
    .btn-group-product .btn-add,
    .btn-group-product .btn-wa-product {
        font-size: 0.68rem !important;
        padding: 10px 5px !important;
    }
}