/* ==============================
   IMÁGENES
   ============================== */

/* Estilo para la imagen dentro del modal */
.modal-body img.img-fluid {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    margin: 0 auto;
}

/* Estilo para la imagen dentro de la tarjeta de producto */
.product-image-container img.product-image {
    width: 100%;
    height: 180px;
    object-fit: contain;
    display: block;
}

/* Imagen dentro de la tarjeta */
.product-card img {
    max-width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 5px;
}

/* ==============================
   MENSAJE NO RESULTADOS
   ============================== */

#noResultsMessage {
    background-color: #ffffff;
    color: #000000;
    padding: 5px;
    border-radius: 5px;
    border: 2px solid #ffa500;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    width: auto;
    max-width: 50%;
    box-sizing: border-box;
    margin-left: auto;
    margin-right: auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 768px) {
    #noResultsMessage {
        max-width: 90%;
        font-size: 12px;
    }
}

/* ==============================
   CATÁLOGO - GRID RESPONSIVE
   ============================== */

#catalog {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    padding: 10px;
    margin: 0 auto;
    max-width: 1400px;
}

/* Tarjeta de producto */
.product-card {
    background-color: #ffebcd;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    transition: transform 0.2s ease;
    flex: 0 0 calc(25% - 16px);
    max-width: calc(25% - 16px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Imagen */
.product-card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 8px;
}

/* ==============================
   TEXTOS PRODUCTO - COLORES FIJOS
   ============================== */

/* Referencia */
.product-card .product-refo {
    color: black !important;
}

/* Nombre del producto */
.product-card .product-name {
    color: black !important;
    font-weight: bold !important;
}

/* Precio */
.product-card .product-price {
    color: black !important;
    font-weight: bold !important;
}

.product-price small {
    font-weight: normal !important;
    color: #555 !important;
}

/* Oferta del producto */
.product-card .product-offer {
    color: white !important;
    background-color: red !important;
    font-weight: bold !important;
    font-size: 0.75rem !important;
    padding: 4px 10px !important;
    border-radius: 20px !important;
    display: inline-block !important;
    margin-bottom: 6px !important;
}

/* Pedido UND / Order */
.product-card .order-label {
    color: black !important;
    font-weight: bold !important;
    font-size: 0.75rem !important;
}

/* Span dentro de order-section si hace falta */
.product-card .order-section-ui span,
.product-card .order-section-ui small {
    color: black !important;
}

/* Icono zoom */
.zoom-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}

.zoom-icon:hover {
    background: #000;
    transform: scale(1.15);
}

/* Badge categoría */
.product-category-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background-color: #dc3545;
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    z-index: 10;
}

/* Producto vendido */
.vendido-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.vendido-label {
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    background: #dc3545;
    padding: 6px 16px;
    border-radius: 12px;
    position: relative;
}

.vendido-line {
    position: absolute;
    top: 50%;
    left: -10%;
    width: 120%;
    height: 4px;
    background: #dc3545;
    transform: rotate(-15deg);
}

/* ==============================
   RESPONSIVE
   ============================== */

/* Tablet: 3 por fila */
@media (max-width: 992px) {
    .product-card {
        flex: 0 0 calc(33.333% - 16px);
        max-width: calc(33.333% - 16px);
    }
}

/* MÓVIL: SCROLL HORIZONTAL */
@media (max-width: 768px) {
    #catalog {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        gap: 12px;
        padding: 15px 0 25px;
        margin: 0;
        background: #000;
        justify-content: flex-start;
    }

    #catalog::before,
    #catalog::after {
        content: "";
        flex: 0 0 24px;
    }

    .product-card {
        flex: 0 0 calc(50% - 6px);
        max-width: calc(50% - 6px);
        scroll-snap-align: center;
        min-width: 0;
        padding: 10px;
    }

    .product-card img {
        height: 120px;
        object-fit: cover;
        border-radius: 5px;
    }

    .product-name,
    .product-price {
        font-size: 0.85rem;
        margin: 4px 0;
    }

    .product-offer {
        font-size: 0.7rem;
        padding: 3px 8px;
    }

    .zoom-icon {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .product-category-badge {
        font-size: 0.65rem;
        padding: 2px 6px;
    }

    #catalog::-webkit-scrollbar {
        display: none;
    }

    #catalog {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
}

/* MÓVIL PEQUEÑO */
@media (max-width: 576px) {
    #catalog {
        gap: 10px;
        padding: 10px 0 20px;
    }

    #catalog::before,
    #catalog::after {
        flex: 0 0 20px;
    }

    .product-card {
        flex: 0 0 calc(50% - 5px);
        max-width: calc(50% - 5px);
        scroll-snap-align: center;
        padding: 8px;
    }

    .product-card img {
        height: 95px;
    }

    .product-name,
    .product-price {
        font-size: 0.75rem;
        margin: 3px 0;
    }

    .product-offer {
        font-size: 0.65rem;
        padding: 2px 6px;
    }

    .zoom-icon {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }

    .product-category-badge {
        font-size: 0.6rem;
        padding: 2px 5px;
    }
}

/* ==============================
   MENSAJE SIN RESULTADOS
   ============================== */

#noResultsMessage {
    background-color: #ffffff;
    color: #000000;
    padding: 12px;
    border-radius: 8px;
    border: 2px solid #ffa500;
    font-weight: bold;
    text-align: center;
    max-width: 50%;
    margin: 20px auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    #noResultsMessage {
        max-width: 90%;
        font-size: 0.9rem;
    }
}

/* ==============================
   FILTROS
   ============================== */

.menu-filter {
    margin-bottom: 20px;
    text-align: center;
    overflow-x: auto;
    white-space: nowrap;
    padding: 10px 0;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.menu-filter::-webkit-scrollbar {
    display: none;
}

.menu-filter button {
    margin: 5px;
    padding: 10px 20px;
    background-color: orange;
    color: black;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 100px;
    font-size: 0.9rem;
}

.menu-filter button:hover {
    background-color: #ff8c00;
}

.menu-filter button.active {
    background-color: red;
    color: white;
}

/* ==============================
   MODAL
   ============================== */

.modal-content {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.modal-header {
    background-color: #007bff;
    color: white;
    border-bottom: none;
    padding: 12px 20px;
}

.modal-title {
    font-size: 1.3rem;
    font-weight: bold;
    margin: 0;
}

.modal-body {
    padding: 20px;
    text-align: center;
}

.modal-body img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.modal-body p {
    margin: 8px 0;
    font-size: 1rem;
    color: #333;
    line-height: 1.6;
}

.modal-body strong {
    color: #000 !important;
}

.modal-body .text-danger {
    font-weight: bold;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
    padding: 12px;
    justify-content: center;
}

.close-modal,
.modal-footer .btn {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: bold;
    transition: all 0.2s;
}

.close-modal:hover,
.modal-footer .btn:hover {
    background-color: #c82333;
    transform: scale(1.05);
}

/* ==============================
   BOTÓN CERRAR
   ============================== */

.modal-header .close {
    color: white;
    opacity: 1;
    font-size: 1.5rem;
    font-weight: bold;
}

.modal-header .close:hover {
    opacity: 0.8;
}

/* ==============================
   TEXTOS ESPECIALES
   ============================== */

.ref-text {
    color: #dc3545;
    font-weight: bold;
}