﻿/* === PRODUCTO.CSS MODERNO === */
.container-fluid {
    margin: 0;
    padding: 0;
}
/* VISTA INICIAL */
.productos-hero {
    background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('../img/fondos/3.jpg') center center no-repeat;
    background-size: cover;
    height: 85vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--texto-claro);
    text-align: center;
}

.productos-hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.productos-hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

section.full-width {
    width: 100%;
    padding: 60px 5%;
}

/* CARD GENERAL */
.producto-card {
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    background-color: var(--fondo-claro);
    display: flex;
    flex-direction: column;
    height: 100%;
}

    .producto-card:hover {
        transform: translateY(-6px);
        box-shadow: 0 15px 30px rgba(0,0,0,0.15);
    }

/* IMAGEN Y OVERLAY */
.card-img-top-wrapper {
    position: relative;
    overflow: hidden;
    height: 220px;
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
}

.producto-hover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, filter 0.5s ease;
}

.overlay-ver-detalle {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.35);
    color: var(--texto-claro);
    opacity: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 0.25rem;
    transition: all 0.4s ease;
    pointer-events: none;
    z-index: 1 !important;
}

.card-img-top-wrapper:hover .producto-hover {
    transform: scale(1.1);
    filter: brightness(0.85);
}

.card-img-top-wrapper:hover .overlay-ver-detalle {
    opacity: 1;
}

/* BADGES DISPONIBILIDAD */
.badge-stock {
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
    position: absolute;
    top: 10px;
    right: 10px;
    color: var(--texto-claro) !important;
    z-index: 2;
}

    .badge-stock.disponible {
        background-color: var(--exito) !important;
    }

    .badge-stock.agotado {
        background-color: var(--error) !important;
    }

/* CARD BODY */
.card-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

    .card-body h5 {
        font-size: 1.15rem;
        font-weight: 600;
        margin-bottom: 0.4rem;
    }

    .card-body p {
        font-size: 0.95rem;
        margin-bottom: 0.4rem;
    }

    .card-body .text-success {
        font-size: 1.1rem;
        font-weight: 700;
    }

    .card-body .text-muted {
        font-size: 0.9rem;
    }

/* BOTONES */
.btn-primary, .btn-secondary, .btn-warning, .btn-danger {
    border-radius: 0.5rem;
    transition: all 0.2s ease-in-out;
}

    .btn-primary:hover,
    .btn-warning:hover,
    .btn-danger:hover {
        transform: translateY(-2px);
    }

/* ANIMACIONES */
.animate-card {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* SECCIONES MODERNAS */
.section-ofertas .row > .col {
    flex: 0 0 25%;
    max-width: 25%;
}

.section-categoria-mosaico .row > .col:nth-child(odd) {
    flex: 0 0 60%;
    max-width: 60%;
}

.section-categoria-mosaico .row > .col:nth-child(even) {
    flex: 0 0 40%;
    max-width: 40%;
}

.section-categoria-cuadricula .row > .col {
    flex: 0 0 33.333%;
    max-width: 33.333%;
}

.section-categoria-cuadricula-alt .row > .col {
    flex: 0 0 20%;
    max-width: 20%;
}

/* H2 PRINCIPAL */
h2 {
    font-size: 3rem;
    font-weight: 700;
    color: var(--texto-claro);
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    margin-top: 20px;
    margin-bottom: 40px;
    position: relative;
}

    h2::after {
        content: "";
        display: block;
        width: 60px;
        height: 4px;
        background-color: var(--color-primario);
        margin: 10px auto 0;
        border-radius: 2px;
    }

    h2:hover {
        color: var(--color-primario);
        transition: color 0.3s ease;
    }

/* RESPONSIVE */
@media (max-width: 1024px) {
    .section-ofertas .row > .col {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .section-categoria-mosaico .row > .col:nth-child(odd),
    .section-categoria-mosaico .row > .col:nth-child(even),
    .section-categoria-cuadricula .row > .col {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (max-width: 768px) {
    .card-img-top-wrapper {
        height: 180px;
    }

    .section-categoria-mosaico .row > .col:nth-child(odd),
    .section-categoria-mosaico .row > .col:nth-child(even),
    .section-categoria-cuadricula .row > .col {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* === MODAL FIX === */
.modal-backdrop {
    z-index: 1040 !important;
    background-color: rgba(0,0,0,0.5) !important;
}

.modal {
    z-index: 1050 !important;
}

.modal-content {
    position: relative;
    z-index: 1060 !important;
    border-radius: 1rem;
    box-shadow: var(--sombra-fuerte);
}

.modal-header {
    background-color: var(--error);
    color: var(--texto-claro);
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
}

.modal-footer {
    background-color: var(--fondo-claro);
}

.modal-body {
    font-size: 1.05rem;
    color: #333;
}

/* Z-INDEX FIX */
.card, .producto-card {
    z-index: auto;
}

/* OFERTAS SCROLL */
.ofertas-scroll-wrapper {
    overflow: hidden;
    background-color: #fff4e6;
    padding: 10px;
    border-radius: 1rem;
}

.ofertas-scroll-track {
    display: flex;
    flex-wrap: nowrap;
    animation: scroll-left 30s linear infinite;
}

.oferta-scroll-item {
    flex: 0 0 auto;
    width: 120px;
    margin: 0 5px;
    position: relative;
}

.oferta-img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 50%;
    transition: transform 0.3s ease;
    margin-bottom: 0.5rem;
}

    .oferta-img:hover {
        transform: scale(1.1);
    }

.icon-oferta {
    position: absolute;
    top: 0;
    left: 0;
    font-size: 1.2rem;
    z-index: 10;
}

/* Precio y nombre */
.precio-oferta .nombre-oferta {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 2px;
}

.precio-oferta .precio-oferta-actual {
    font-size: 0.95rem;
    color: var(--exito);
    font-weight: 700;
}

.precio-oferta .precio-original {
    font-size: 0.8rem;
    text-decoration: line-through;
    color: #888;
}

.precio-original {
    font-size: 0.85rem;
    color: #888;
    text-decoration: line-through;
    margin-bottom: 0;
    display: block;
}

.precio-oferta-actual {
    font-size: 1rem;
    font-weight: 700;
    color: var(--exito);
    margin-top: 2px;
}

/* Animación scroll infinito */
@keyframes scroll-left {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

@media (max-width: 768px) {
    .oferta-scroll-item {
        width: 90px;
    }

    .oferta-img {
        width: 70px;
        height: 70px;
    }

    .icon-oferta {
        font-size: 1rem;
    }
}

/* === SECCIONES DESTACADAS === */
.section-wrapper {
    background-color: #e6f0ff;
    border-radius: 1.2rem;
    padding: 20px;
    margin-bottom: 40px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.05);
}

.section-title-full {
    width: 100%;
    text-align: center;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--texto-claro);
    padding: 1rem 0;
    background: linear-gradient(90deg, var(--color-primario), var(--color-accento));
    position: relative;
    z-index: 2;
    border-radius: 1rem 1rem 0 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.section-title-bg {
    width: 100%;
    height: 40px;
    background-color: #edf3ff;
    margin-top: -5px;
    border-bottom-left-radius: 1rem;
    border-bottom-right-radius: 1rem;
    z-index: 1;
}
