/* DBM/public_html/assets/css/index.css */

/* ========================================
   BANNER PRINCIPAL
   ======================================== */
#main-banner {
    width: 100%;
}

.whooping-banner {
    background: none !important;
}

/* Banner principal mobile - oculto por defecto */
#main-banner-mobile {
    display: none;
}

@media (max-width: 767.98px) {
    /* Cuando hay banner mobile, mostrarlo y ocultar desktop */
    .whooping-banner.has-mobile-banner #main-banner-mobile {
        display: block;
    }
    .whooping-banner.has-mobile-banner #main-banner {
        display: none;
    }

    /* Fallback: si NO hay banner mobile, recortar el desktop para mayor altura */
    .whooping-banner:not(.has-mobile-banner) #main-banner .carousel-item img {
        object-fit: cover;
    }
}

/* ========================================
   CATEGORIAS DESTACADAS
   ======================================== */
div#contenedorCategoriasDestacadas svg {
    font-size: 25px;
}

div#contenedorCategoriasDestacadas i {
    font-size: 31px;
}

a.icon-nav-item.d-flex.flex-column.align-items-center {
    max-width: 93px;
    line-height: 1.1;
}

/* ========================================
   PUBLICIDAD
   ======================================== */
.bg-holder.banner-section-publi1 {
    background-size: cover;
    background-position: center;
    will-change: unset !important;
    -webkit-backface-visibility: unset !important;
}

/* Cuando hay publi, ajustar el listado */
.listado1-content.has-publi {
    flex: 0 0 auto;
    width: 75%;
}

@media (min-width: 1400px) {
    .listado1-content.has-publi {
        width: 83.333333%;
    }
}

/* ========================================
   TITULO DE LISTADOS
   ======================================== */
.listado-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0.25rem;
}

.listado-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--phoenix-navbar-vertical-link-active-color);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.listado-title i {
    font-size: 1.25rem;
    opacity: 0.7;
}

/* Legacy support */
.lisado-title-index {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--phoenix-navbar-vertical-link-active-color) !important;
}

@media (max-width: 575px) {
    .listado-title,
    .lisado-title-index {
        font-size: 1.25rem;
    }
}

/* ========================================
   EMBLA CAROUSEL - LISTADOS
   ======================================== */
.embla--listado {
    position: relative;
    --slide-spacing: 0.75rem;
}

.embla--listado .embla__viewport {
    overflow: hidden;
}

.embla--listado .embla__container {
    display: flex;
    gap: var(--slide-spacing);
    touch-action: pan-y pinch-zoom;
}

/* ========================================
   SLIDES RESPONSIVOS
   Mobile-first: 2 productos por pantalla
   ======================================== */
.embla--listado .embla__slide {
    flex: 0 0 calc(50% - var(--slide-spacing) / 2);
    min-width: 0;
}

/* Tablets pequeñas: 3 productos */
@media (min-width: 576px) {
    .embla--listado .embla__slide {
        flex: 0 0 calc(33.333% - var(--slide-spacing) * 2 / 3);
    }
}

/* Tablets: 4 productos */
@media (min-width: 768px) {
    .embla--listado .embla__slide {
        flex: 0 0 calc(25% - var(--slide-spacing) * 3 / 4);
    }
}

/* Desktop: 5 productos */
@media (min-width: 992px) {
    .embla--listado .embla__slide {
        flex: 0 0 calc(20% - var(--slide-spacing) * 4 / 5);
    }
}

/* Desktop grande: 6 productos */
@media (min-width: 1400px) {
    .embla--listado .embla__slide {
        flex: 0 0 calc(16.666% - var(--slide-spacing) * 5 / 6);
    }
}

/* ========================================
   PRODUCT CARD - MODERNO
   ======================================== */
.embla--listado .product-card {
    height: 100%;
    background: var(--phoenix-card-bg);
    border-radius: 12px;
    padding: 0 .75rem;
    transition: all 0.25s ease;
    border: 1px solid transparent;
}

.embla--listado .product-card:hover {
    box-shadow: 0 8px 24px rgba(var(--bs-primary-rgb), 0.15);
    transform: translateY(-4px);
}

/* Imagen del producto */
.embla--listado .m-prd {
    aspect-ratio: 1;
    width: 100%;
    height: auto;
    min-height: 140px;
    max-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--phoenix-body-bg);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.embla--listado .m-prd-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.5rem;
    transition: transform 0.3s ease;
}

.embla--listado .product-card:hover .m-prd-img {
    transform: scale(1.05);
}

/* Nombre del producto */
.product-name {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--phoenix-body-color);
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (min-width: 576px) {
    .product-name {
        font-size: 0.9375rem;
        -webkit-line-clamp: 3;
    }
}

/* ========================================
   PRECIOS
   ======================================== */
.product-price {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.product-price-current {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--phoenix-body-emphasis-color);
}

.product-price-original {
    font-size: 0.8125rem;
    color: var(--bs-secondary);
    text-decoration: line-through;
}

.product-discount-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    background: var(--bs-success);
    color: white;
    border-radius: 4px;
}

@media (max-width: 575px) {
    .product-price-current {
        font-size: 1rem;
    }
}

/* ========================================
   PROMOCIONES EN CARD
   ======================================== */
.product-promo {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--bs-success);
    margin-top: 0.25rem;
}

.product-promo i {
    font-size: 0.625rem;
}

.product-promo-pending {
    color: var(--bs-warning);
}

/* ========================================
   BOTON WISHLIST
   ======================================== */
.embla--listado .btn-wish {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 2;
}

.embla--listado .product-card:hover .btn-wish {
    opacity: 1;
}

.embla--listado .btn-wish:hover {
    background: var(--bs-danger);
    color: white;
    transform: scale(1.1);
}

.embla--listado .btn-wish.active {
    opacity: 1;
    background: var(--bs-danger);
    color: white;
}

@media (max-width: 991px) {
    .embla--listado .btn-wish {
        opacity: 1;
        width: 28px;
        height: 28px;
    }
}

/* ========================================
   BOTONES NAVEGACION CAROUSEL
   ======================================== */
.embla--listado .embla__button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: var(--phoenix-card-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    opacity: 0;
}

.embla--listado:hover .embla__button {
    opacity: 1;
}

.embla--listado .embla__button:hover:not(:disabled) {
    background: var(--bs-primary);
    color: white;
    border-color: var(--bs-primary);
    transform: translateY(-50%) scale(1.1);
}

.embla--listado .embla__button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.embla--listado .embla__button--prev {
    left: -12px;
}

.embla--listado .embla__button--next {
    right: -12px;
}

@media (max-width: 991px) {
    .embla--listado .embla__button {
        width: 36px;
        height: 36px;
        opacity: 1;
    }

    .embla--listado .embla__button--prev {
        left: 4px;
    }

    .embla--listado .embla__button--next {
        right: 4px;
    }
}

/* Dark mode */
[data-bs-theme="dark"] .embla--listado .embla__button {
    background: var(--bs-gray-800);
    border-color: var(--bs-gray-700);
}

[data-bs-theme="dark"] .embla--listado .embla__button:hover:not(:disabled) {
    background: var(--bs-primary);
    border-color: var(--bs-primary);
}

/* ========================================
   LISTADO BLOQUE
   ======================================== */
.listado-bloque {
    margin-bottom: 3rem;
}

.listado-bloque:last-child {
    margin-bottom: 0;
}

/* ========================================
   RESPONSIVE TWEAKS
   ======================================== */
@media (max-width: 575px) {
    .embla--listado {
        --slide-spacing: 0.5rem;
    }

    .embla--listado .product-card {
        padding: 0.5rem;
        border-radius: 10px;
    }

    .embla--listado .m-prd {
        min-height: 120px;
        border-radius: 6px;
    }

    .listado-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .listado-header .btn {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
}

/* ========================================
   PUBLI WRAPPERS
   ======================================== */
.publi1-wrapper.d-none + .listado1-content {
    width: 100% !important;
    flex: 0 0 100%;
}

.publi2-wrapper.d-none {
    display: none !important;
}

/* ============================================================
   Mini banners por listado (refactor 2026-04-29)
   3 modos: replace | side | background
   Mobile-first: alturas escalan en breakpoints
   ============================================================ */

/* Modo BACKGROUND — imagen detrás del título con overlay */
.listado-header--banner-bg {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 12px;
    padding: 0.85rem 1.1rem;
    min-height: 55px;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.listado-header--banner-bg .listado-title {
    text-shadow: 0 1px 3px rgba(0,0,0,.55);
    font-size: 1.4rem;
}
.listado-header--banner-bg .listado-title i {
    opacity: 0.95;
    text-shadow: 0 1px 3px rgba(0,0,0,.55);
}
@media (min-width: 992px) {
    .listado-header--banner-bg {
        min-height: 88px;
        padding: 1.25rem 1.5rem;
    }
    .listado-header--banner-bg .listado-title {
        font-size: 1.75rem;
    }
}

/* Modo REPLACE — imagen sustituye al título y es el link */
.listado-header--banner-replace {
    align-items: stretch;
    padding: 0;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.listado-banner-replace {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    max-height: 55px;
    border-radius: 10px;
    overflow: hidden;
    line-height: 0;
}
.listado-banner-replace img {
    width: 100%;
    height: 100%;
    max-height: 55px;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}
.listado-banner-replace:hover img {
    transform: scale(1.02);
}
.listado-header--banner-replace .btn {
    align-self: center;
    flex-shrink: 0;
}
@media (min-width: 992px) {
    .listado-banner-replace,
    .listado-banner-replace img {
        max-height: 88px;
    }
}

/* Modo SIDE — imagen pequeña al lado del título */
.listado-title--side {
    gap: 0.65rem;
}
.listado-banner-side {
    display: inline-flex;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}
.listado-banner-side img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
@media (min-width: 992px) {
    .listado-banner-side {
        width: 50px;
        height: 50px;
    }
}

/* Reglas body[data-bg-mode] movidas a common.css para que apliquen en toda la web (no solo home). */
