/* Variables de color gris/negro */
:root {
    --bg-dark: #121212;
    --card-bg: #1e1e1e;
    --card-border: #333;
    --text-light: #ffffff;
    --text-gray: #b0b0b0;
    --accent: #2a2a2a;
    --accent-hover: #3a3a3a;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    padding: 20px;
    min-height: 100vh;
}

/* ============ CARDS DE PRODUCTOS ============ */
.horizontal-card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
    height: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.horizontal-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.card-content {
    display: flex;
    align-items: stretch;
    width: 100%;
    height: 100%;
}

/* Sección de imagen */
.card-image {
    flex: 0 0 150px;
    max-width: 150px;
    position: relative;
    overflow: hidden;
    border-right: 1px solid var(--card-border);
}

.image-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.5s ease;
    background-color: #2a2a2a;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.4) 0%, rgba(42, 42, 42, 0.8) 100%);
}

.horizontal-card:hover .image-background {
    transform: scale(1.05);
}

/* Contenido de la card */
.card-info {
    flex: 1;
    padding: 15px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background-color: var(--card-bg);
    position: relative;
    z-index: 1;
}

.product-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-light);
}

.product-description {
    font-size: 0.75rem;
    color: var(--text-gray);
    margin-bottom: 8px;
    line-height: 1.3;
    flex-grow: 1;
}

.product-price {
    font-size: 1rem;
    font-weight: bold;
    color: #4CAF50;
    margin-bottom: 8px;
}

.rating {
    font-size: 0.7rem;
    color: #ffc107;
    margin-bottom: 8px;
}

/* Botones de productos */
.cart-btn {
    background-color: var(--accent);
    color: var(--text-light);
    border: 1px solid var(--card-border);
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 0.7rem;
    transition: all 0.3s;
    width: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 70px;
}

.cart-btn:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}

/* ============ CARRITO DE COMPRAS ============ */
/* Botón flotante para móvil */
.cart-floating-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.cart-floating-btn .btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-floating-btn .btn:hover {
    transform: scale(1.1);
}

/* Botón fijo para desktop */
.cart-desktop-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.cart-desktop-btn .btn {
    padding: 0.5rem 1.5rem;
    transition: all 0.3s ease;
}

.cart-desktop-btn .btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Badges del carrito */
.cart-badge {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    font-size: 0.75rem;
    padding: 0 5px;
}

/* Items del carrito */
.cart-item {
    transition: background-color 0.2s ease;
    border-bottom: 1px solid var(--card-border);
    padding: 0.75rem 0;
}

.cart-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.cart-item .btn-sm {
    width: 30px;
    height: 30px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============ MODAL DEL CARRITO ============ */
.modal-dialog-bottom.modal-fullscreen-sm-down {
    margin: 0;
}

.modal-content {
    border: 1px solid var(--card-border);
    background-color: var(--bg-dark);
    color: var(--text-light);
    max-height: 70vh;
    overflow-y: auto;
}

.modal-header {
    border-bottom: 1px solid var(--card-border);
    background-color: var(--card-bg);
}

.modal-footer {
    border-top: 1px solid var(--card-border);
    background-color: var(--card-bg);
}

/* Scrollbar personalizado */
.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: var(--card-bg);
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: 3px;
}

/* ============ MEDIA QUERIES ============ */
/* Pantallas pequeñas (< 400px) */
@media (max-width: 400px) {
    .card-image {
        flex: 0 0 90px;
        max-width: 90px;
    }
    
    .card-info {
        padding: 10px;
    }
    
    .product-title {
        font-size: 0.8rem;
    }
    
    .product-description {
        font-size: 0.7rem;
    }
    
    .product-price {
        font-size: 0.9rem;
    }
    
    .cart-item h6 {
        font-size: 0.9rem;
    }
}

/* Tablet (≥ 576px) */
@media (min-width: 576px) {
    .card-image {
        flex: 0 0 150px;
        max-width: 150px;
    }
    
    .product-title {
        font-size: 1rem;
    }
    
    .product-description {
        font-size: 0.8rem;
    }
    
    .cart-btn {
        padding: 7px 14px;
        font-size: 0.8rem;
    }
}

/* Tablet grande (≥ 768px) */
@media (min-width: 768px) {
    .card-image {
        flex: 0 0 150px;
        max-width: 150px;
    }
    
    .product-title {
        font-size: 1.1rem;
    }
    
    .product-description {
        font-size: 0.85rem;
    }
    
    .product-price {
        font-size: 1.2rem;
    }
    
    .cart-btn {
        padding: 8px 16px;
    }
    
    .cart-item {
        padding: 0.75rem 1rem;
    }
}


/* Desktop (≥ 992px) */
@media (min-width: 992px) {
    .card-image {
        flex: 0 0 130px;
        max-width: 130px;
    }
    
    .product-title {
        font-size: 1rem;
    }
    
    .product-description {
        font-size: 0.8rem;
    }
    
    .cart-floating-btn {
        display: none !important;
    }
    
    .modal-dialog-bottom.modal-fullscreen-sm-down {
        max-width: 500px;
        margin: 1.75rem auto;
    }
    
    .modal-dialog-bottom.modal-fullscreen-sm-down .modal-content {
        border-radius: 15px;
    }
}

/* Móvil - Modal desde abajo */
@media (max-width: 991.98px) {
    .modal-dialog-bottom.modal-fullscreen-sm-down {
        position: fixed;
        bottom: 0;
        width: 100%;
        max-width: 100%;
    }
    
    .modal-dialog-bottom.modal-fullscreen-sm-down .modal-content {
        border-radius: 15px 15px 0 0;
        min-height: 60vh;
    }
}

/* Grid de productos */
.cards-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

@media (min-width: 768px) {
    .cards-container {
        grid-template-columns: 1fr
    }
}
@media (min-width: 991px) {
    .cards-container {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (min-width: 1200px) {
    .cards-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1400px) {
    .cards-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Animaciones */
@keyframes addToCart {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.cart-badge.added {
    animation: addToCart 0.3s ease;
}
/* Agrega esto a tu style.css */
.cart-item-image {
    width: 60px;
    height: 60px;
    background-size: cover;
    background-position: center;
    border-radius: 5px;
    border: 1px solid var(--card-border);
}

.cart-item .row {
    align-items: center;
}

.cart-item h6 {
    margin-bottom: 0.25rem;
}

.cart-item .text-secondary {
    font-size: 0.8rem;
}

/* Ajustes para móvil */
@media (max-width: 767.98px) {
    .cart-item-image {
        width: 50px;
        height: 50px;
    }
}
/* ============ MODAL MEJORADO ============ */
.modal-content.bg-dark {
    background: linear-gradient(145deg, #1a1a1a, #0f0f0f) !important;
    border: 1px solid #444 !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.modal-header.border-secondary {
    border-bottom: 1px solid #444 !important;
    padding: 1.25rem 1.5rem;
    background: rgba(30, 30, 30, 0.8);
    backdrop-filter: blur(10px);
}

.modal-footer.border-secondary {
    border-top: 1px solid #444 !important;
    background: rgba(30, 30, 30, 0.8);
    backdrop-filter: blur(10px);
}

/* Items del carrito mejorados */
.cart-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.02);
}

.cart-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 70px;
    height: 70px;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    border: 2px solid #444;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.cart-item:hover .cart-item-image {
    transform: scale(1.03);
    border-color: #666;
}

.cart-item-info h6 {
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: #fff;
}

.cart-item-info .text-secondary {
    font-size: 0.85rem;
    color: #aaa !important;
}

/* Controles de cantidad mejorados */
.cart-item-controls .btn-outline-secondary {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid #555;
    color: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.cart-item-controls .btn-outline-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: #777;
    transform: translateY(-1px);
}

.cart-item-controls .quantity {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
    color: #fff;
    font-size: 1rem;
}

.cart-item-total {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffc107;
}

/* Botón de WhatsApp mejorado */
#checkoutBtn {
    background: linear-gradient(135deg, #25D366, #128C7E);
    border: none;
    padding: 1rem;
    border-radius: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

#checkoutBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
    background: linear-gradient(135deg, #25D366, #0d8e7a);
}

#checkoutBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Estado vacío mejorado */
#emptyCartMessage {
    padding: 3rem 1.5rem;
}

#emptyCartMessage .fa-shopping-basket {
    color: #444;
}

/* Scrollbar personalizado */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #555, #333);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #666, #444);
}

/* Animación de entrada */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cart-item {
    animation: slideInUp 0.3s ease forwards;
}

.cart-item:nth-child(1) { animation-delay: 0.05s; }
.cart-item:nth-child(2) { animation-delay: 0.1s; }
.cart-item:nth-child(3) { animation-delay: 0.15s; }
.cart-item:nth-child(4) { animation-delay: 0.2s; }

/* Responsive */
@media (max-width: 991.98px) {
    .modal-dialog-bottom.modal-fullscreen-sm-down .modal-content {
        border-radius: 20px 20px 0 0;
        min-height: 70vh;
    }
    
    .cart-item {
        padding: 0.75rem 1rem;
    }
    
    .cart-item-image {
        width: 60px;
        height: 60px;
    }
}

@media (min-width: 992px) {
    .modal-dialog-bottom.modal-fullscreen-sm-down {
        max-width: 500px;
        margin: 1.75rem auto;
    }
    
    .modal-dialog-bottom.modal-fullscreen-sm-down .modal-content {
        border-radius: 15px;
        max-height: 80vh;
    }
}

/* BUSCADOR */
.search-form .form-control:focus {
    border-color: #ffc107;
    box-shadow: 0 0 0 0.25rem rgba(255, 193, 7, 0.25);
}

/* PAGINACIÓN */
.pagination .page-item .page-link {
    background-color: #1e1e1e;
    border-color: #444;
    color: #fff;
    transition: all 0.3s ease;
}

.pagination .page-item .page-link:hover {
    background-color: #333;
    border-color: #666;
    transform: translateY(-1px);
}

.pagination .page-item.active .page-link {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #000;
    font-weight: 600;
}

.pagination .page-item.disabled .page-link {
    background-color: #2a2a2a;
    border-color: #444;
    color: #666;
}

/* ALERTA DE BÚSQUEDA */
.alert-info.bg-dark {
    background-color: rgba(13, 202, 240, 0.1) !important;
    border: 1px solid rgba(13, 202, 240, 0.3);
    color: #6bd4f5 !important;
}

/* RESPONSIVE */
@media (max-width: 576px) {
    .pagination .page-link {
        padding: 0.375rem 0.5rem;
        font-size: 0.875rem;
    }
    
    .search-form .btn {
        padding: 0.375rem 0.75rem;
    }
}

.btn-outline-warning {
    color: #ffffff;
    border-color: #ffffff;
    transition: all 0.3s ease;
}

.btn-outline-warning:hover {
    background-color: rgba(255, 193, 7, 0.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 193, 7, 0.2);
    color: white;
}

.btn-warning {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #000;
    font-weight: 600;
    box-shadow: 0 4px 8px rgba(255, 193, 7, 0.3);
}

.btn-warning:hover {
    background-color: #e0a800;
    border-color: #e0a800;
    transform: translateY(-1px);
}

/* RESPONSIVE PARA BOTONES */
@media (max-width: 768px) {
    .d-flex.flex-wrap.gap-2 {
        gap: 0.5rem !important;
    }
    
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 576px) {
    .d-flex.flex-wrap.gap-2 {
        justify-content: center;
    }
}
.text-light a{
    color: white;
    text-decoration: none;
}
/* ============ IMAGEN CLICKABLE ============ */
.clickable-image, .clickable-title {
    cursor: pointer;
    transition: all 0.3s ease;
}

.clickable-image:hover {
    transform: scale(1.02);
}

.clickable-title:hover {
    color: #ffc107 !important;
    text-decoration: underline;
}

/* Efecto de overlay en imagen hover */
.image-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
    pointer-events: none;
}

.image-background:hover::after {
    background: rgba(0, 0, 0, 0.2);
}

/* Icono de lupa en hover */
.image-background::before {
    content: '\f002';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    color: white;
    font-size: 1.5rem;
    z-index: 2;
    opacity: 0;
    transition: all 0.3s ease;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.image-background:hover::before {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Lightbox style */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-overlay.active {
    display: flex;
    opacity: 1;
}

.lightbox-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.lightbox-overlay.active .lightbox-image {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    background: none;
    border: none;
    z-index: 10000;
}

.lightbox-title {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    text-align: center;
    color: white;
    padding: 0 20px;
    font-size: 1.2rem;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}