        :root {
            --primary-color: #e62429;
            --dark-color: #202020;
            --light-color: #f4f4f4;
        }
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            margin: 0;
            padding: 0;
            background-color: var(--light-color);
            color: var(--dark-color);
        }
        header {
            background-color: var(--dark-color);
            color: white;
            padding: 0.7rem 2rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        header h1 {
            margin: 0;
            color: var(--primary-color);
            letter-spacing: 2px;
        }
        nav a {
            color: white;
            text-decoration: none;
            margin-left: 15px;
            font-weight: bold;
        }
        nav a:hover {
            color: var(--primary-color);
        }
        .hero {
            text-align: center;
            padding: 0.1rem 0.1rem;
            background: #202020;
            color: white;
        }
        .hero h2 {
            font-size: 2rem;
            margin-bottom: 5px;
            margin-top: 5px;
        }
        .hero p {
            margin-bottom: 10px;
            margin-top: 2px;
        }
        .btn {
            background-color: var(--primary-color);
            color: white;
            padding: 10px 20px;
            text-decoration: none;
            font-weight: bold;
            border-radius: 5px;
            display: inline-block;
            border: none;
            cursor: pointer;
        }
        .container {
            max-width: 1000px;
            margin: 2rem auto;
            padding: 0 1rem;
        }
        .products-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
            gap: 20px;
        }
        .product-card {
            background: white;
            border-radius: 8px;
            padding: 15px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
            text-align: center;
            transition: transform 0.3s;
        }
        .product-card:hover {
            transform: translateY(-5px);   
            background: #f4e4e4;
        }
        .product-card img {
            max-width: 100%;
            border-radius: 5px;
            height: 280px;
            object-fit: cover;
        }
        
        /* Etiqueta para el código de referencia */
        .ref-badge {
            display: inline-block;
            background-color: #e0e0e0;
            color: #444;
            font-size: 0.75rem;
            font-weight: bold;
            padding: 3px 8px;
            border-radius: 4px;
            margin-top: 10px;
            margin-bottom: 4px;
        }
        .price {
            font-size: 1.2rem;
            color: var(--primary-color);
            font-weight: bold;
            margin-bottom: 0px;
            margin-top: 4px;
        }
        .condition {
            font-size: 0.8rem;
            color: #666;
            margin-bottom: 0px;
            margin-top: 4px;
        }
        .desc {
            font-size: 0.9rem;
            color: #666;
            margin-bottom: 0px;
            margin-top: 4px;
        }
        .cat {
            font-size: 0.9rem;
            color: #666;
            margin-bottom: 0px;
            margin-top: 4px;
            font-weight: bold;
        }     
        .tit {
            font-size: 1.1rem;
            color: #333;
            margin-bottom: 0px;
            margin-top: 4px;
            font-weight: bold;
        }     
        .search-box {
            width: 100%;
            max-width: 500px;
            margin: 0 auto 2rem auto;
            display: block;
            padding: 12px 16px;
            font-size: 1rem;
            border: 2px solid #ccc;
            border-radius: 8px;
            outline: none;
            transition: border-color 0.3s;
        }
        .search-box:focus {
            border-color: var(--primary-color);
        }
        
        /* --- Ventana emergente (Modal / Lightbox) --- */
        .modal {
            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;
        }
        .modal-contenido {
            max-width: 90%;
            max-height: 85vh;
            border-radius: 8px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.6);
            animation: zoomIn 0.25s ease-out;
        }
        @keyframes zoomIn {
            from { transform: scale(0.7); opacity: 0; }
            to { transform: scale(1); opacity: 1; }
        }
        .cerrar-modal {
            position: absolute;
            top: 20px;
            right: 35px;
            color: white;
            font-size: 40px;
            font-weight: bold;
            cursor: pointer;
            line-height: 1;
            user-select: none;
        }
        .cerrar-modal:hover {
            color: var(--primary-color);
        }
        
        /* --- Estilos del Pie de Página (Footer) --- */
        footer {
            background-color: var(--dark-color);
            color: #ccc;
            padding: 3rem 2rem 1.5rem 2rem;
            margin-top: 4rem;
            border-top: 4px solid var(--primary-color);
        }
        .footer-grid {
            max-width: 1000px;
            margin: 0 auto;
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 30px;
        }
        .footer-column h3, .footer-column h4 {
            color: white;
            margin-top: 0;
            margin-bottom: 1rem;
            text-transform: uppercase;
            letter-spacing: 1px;
            font-size: 1rem;
        }
        .footer-column p {
            font-size: 0.88rem;
            line-height: 1.6;
            margin: 5px 0;
        }
        .footer-column a {
            color: #bbb;
            text-decoration: none;
            display: block;
            margin-bottom: 8px;
            font-size: 0.88rem;
            transition: color 0.2s;
        }
        .footer-column a:hover {
            color: var(--primary-color);
        }
        .footer-bottom {
            max-width: 1000px;
            margin: 2.5rem auto 0 auto;
            padding-top: 1.5rem;
            border-top: 1px solid #333;
            text-align: center;
            font-size: 0.85rem;
            color: #777;
        }        
        
        /* --- Estilos de la Paginación --- */
        .pagination-container {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 8px;
            margin-top: 2.5rem;
            margin-bottom: 2rem;
        }
        .btn-pagina {
            background-color: white;
            color: var(--dark-color);
            border: 1px solid #ccc;
            padding: 8px 14px;
            border-radius: 5px;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        .btn-pagina:hover:not(:disabled) {
            background-color: var(--primary-color);
            color: white;
            border-color: var(--primary-color);
        }
        .btn-pagina.activo {
            background-color: var(--primary-color);
            color: white;
            border-color: var(--primary-color);
        }
        .btn-pagina:disabled {
            opacity: 0.4;
            cursor: not-allowed;
        }
      

/* --- Estilos del Carrito --- */
.cart-modal-contenido {
    background: white;
    padding: 25px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6);
    position: relative;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.cart-items-list {
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: 15px;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f4f4f4;
}

.cart-item-title {
    font-size: 0.9rem;
    font-weight: bold;
    margin: 0;
}

.cart-item-sub {
    font-size: 0.75rem;
    color: #666;
    margin: 2px 0 0 0;
}

.btn-remove {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 8px;
}

.cart-summary {
    text-align: right;
    margin-top: 10px;
}

.cart-total-line {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--dark-color);
    margin: 5px 0;
}

.min-warning {
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: bold;
    margin: 5px 0 0 0;
}

.cart-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    gap: 10px;
}

.btn-secundario {
    background-color: #777;
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-weight: bold;
}

.btn-secundario:hover {
    background-color: #555;
}

.btn-disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
    background-color: #ccc !important;
}


/* --- Contenedor de Filtros y Ordenación --- */
.filtros-container {
    max-width: 750px;
    margin: 0 auto 2rem auto;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.filtros-container .search-box {
    margin: 0;
    flex: 1;
    min-width: 260px;
}

.select-orden {
    padding: 12px 16px;
    font-size: 0.95rem;
    border: 2px solid #ccc;
    border-radius: 8px;
    outline: none;
    background: white;
    color: var(--dark-color);
    cursor: pointer;
    transition: border-color 0.3s;
}

.select-orden:focus {
    border-color: var(--primary-color);
}