﻿/* Ficha profesional del producto (clic en foto) */
.fondo-ficha-producto {
    position: fixed;
    inset: 0;
    background: rgba(9, 20, 68, 0.72);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0.28s ease;
    z-index: -1;
    pointer-events: none;
    touch-action: none;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.fondo-ficha-producto.active {
    opacity: 1;
    visibility: visible;
    z-index: 1050;
    pointer-events: auto;
    touch-action: auto;
}

.eja-ficha-producto {
    position: fixed;
    top: 50%;
    left: 50%;
    width: min(920px, calc(100vw - 1.5rem));
    max-height: calc(100vh - 2rem);
    transform: translate(-50%, -50%) scale(0.94);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0.28s ease, transform 0.28s ease;
    z-index: -1;
    pointer-events: none;
    touch-action: none;
    display: flex;
    flex-direction: column;
}

.eja-ficha-producto.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
    z-index: 1051;
    pointer-events: auto;
    touch-action: auto;
}

.eja-ficha-producto__cerrar {
    position: absolute;
    top: 0.65rem;
    right: 0.75rem;
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    border-radius: 50%;
    background: rgba(9, 20, 68, 0.08);
    color: #091444;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    z-index: 5;
    transition: background 0.15s ease, color 0.15s ease;
}

.eja-ficha-producto__cerrar:hover {
    background: #091444;
    color: #fff;
}

.eja-ficha-producto__body {
    overflow-y: auto;
    max-height: calc(100vh - 2rem);
    padding: 1.25rem 1.35rem 1.35rem;
}

.eja-ficha-producto__loading {
    text-align: center;
    padding: 3rem 1rem;
    color: #555;
    font-family: Arial, Helvetica, sans-serif;
}

.eja-ficha-producto__grid {
    display: grid;
    grid-template-columns: minmax(240px, 42%) 1fr;
    gap: 1.35rem;
    align-items: start;
}

.eja-ficha-producto__col-media {
    background: #f4f6fb;
    border-radius: 12px;
    padding: 0.75rem;
    position: sticky;
    top: 0;
}

.eja-ficha-producto__media-unica {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 220px;
}

.eja-ficha-producto__img {
    max-width: 100%;
    max-height: min(420px, 55vh);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
}

.eja-ficha-producto__swiper {
    width: 100%;
    min-height: 220px;
    height: auto;
}

.eja-ficha-producto__swiper .swiper-wrapper {
    align-items: center;
}

.eja-ficha-producto__swiper .swiper-slide {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    height: auto !important;
    min-height: 200px;
    box-sizing: border-box;
}

.eja-ficha-producto__swiper .swiper-slide .eja-ficha-producto__img {
    display: block;
    margin: 0 auto;
}

.eja-ficha-producto__swiper .swiper-button-next,
.eja-ficha-producto__swiper .swiper-button-prev {
    color: #091444;
}

.eja-ficha-producto__swiper .swiper-pagination-bullet-active {
    background: #df7f31;
}

.eja-ficha-producto__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.eja-ficha-producto__badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-radius: 4px;
    font-family: Arial, Helvetica, sans-serif;
}

.eja-ficha-producto__badge--ofer {
    background: #df7f31;
    color: #fff;
}

.eja-ficha-producto__badge--nuevo {
    background: #091444;
    color: #fff;
}

.eja-ficha-producto__badge--sinstk {
    background: #888;
    color: #fff;
}

.eja-ficha-producto__aviso-precio {
    margin: 0.75rem 0 0;
    padding: 0.65rem 0.75rem;
    background: #fff8f0;
    border-radius: 8px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.9rem;
    color: #8a4b12;
    font-weight: 600;
}

.eja-ficha-producto__cod {
    margin: 0 0 0.35rem;
    font-size: 0.88rem;
    color: #666;
    font-family: Arial, Helvetica, sans-serif;
}

.eja-ficha-producto__titulo {
    margin: 0 0 0.5rem;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #091444;
    line-height: 1.3;
}

.eja-ficha-producto__rubro {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    color: #df7f31;
    font-weight: 600;
    font-family: Arial, Helvetica, sans-serif;
}

.eja-ficha-producto__sec-titulo {
    margin: 0 0 0.55rem;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #091444;
    border-bottom: 2px solid #e8ecf4;
    padding-bottom: 0.35rem;
}

.eja-ficha-producto__precios,
.eja-ficha-producto__detalle,
.eja-ficha-producto__en-carrito {
    margin-top: 1rem;
}

.eja-ficha-producto__precio-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.4rem 0;
    font-family: Arial, Helvetica, sans-serif;
}

.eja-ficha-producto__precio-row--dto {
    background: #fff8f0;
    margin: 0 -0.5rem;
    padding: 0.45rem 0.5rem;
    border-radius: 6px;
}

.eja-ficha-producto__precio-lbl {
    font-size: 0.9rem;
    color: #555;
}

.eja-ficha-producto__precio-val {
    font-size: 1.05rem;
    font-weight: 700;
    color: #091444;
    white-space: nowrap;
}

.eja-ficha-producto__dl {
    margin: 0;
}

.eja-ficha-producto__dl-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid #eef0f5;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.9rem;
}

.eja-ficha-producto__dl-row dt {
    margin: 0;
    color: #666;
    font-weight: 500;
}

.eja-ficha-producto__dl-row dd {
    margin: 0;
    font-weight: 600;
    color: #111;
    text-align: right;
}

.eja-ficha-producto__en-carrito {
    background: linear-gradient(135deg, #091444 0%, #0f2d6e 100%);
    color: #fff;
    border-radius: 10px;
    padding: 0.85rem 1rem;
}

.eja-ficha-producto__en-carrito .eja-ficha-producto__sec-titulo {
    color: #fdba55;
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.eja-ficha-producto__carrito-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
}

.eja-ficha-producto__dato-lbl {
    display: block;
    font-size: 0.72rem;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-family: Arial, Helvetica, sans-serif;
}

.eja-ficha-producto__dato-val {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    font-family: Arial, Helvetica, sans-serif;
    margin-top: 0.15rem;
}

.eja-ficha-producto__dato-val--dest {
    font-size: 1.15rem;
    color: #fdba55;
}

/* Catálogo móvil: galería sin Swiper (scroll horizontal) */
.eja-cat-galeria-scroll {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    gap: 0;
    width: 100%;
    min-height: 220px;
    max-height: min(50vh, 400px);
    box-sizing: border-box;
    background: #fff;
    border-radius: 8px;
}

.eja-cat-galeria-scroll__slide {
    flex: 0 0 100%;
    width: 100%;
    min-width: 100%;
    scroll-snap-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    max-height: min(50vh, 400px);
    padding: 0.35rem;
    box-sizing: border-box;
}

.eja-cat-galeria-movil {
    width: 100%;
}

.eja-cat-galeria-scroll__hint {
    margin: 0.35rem 0 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.72rem;
    color: #666;
    text-align: center;
}

.pagina-cat .eja-cat-galeria-img {
    display: block !important;
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: min(48vh, 380px) !important;
    min-height: 80px !important;
    aspect-ratio: unset !important;
    object-fit: contain !important;
    object-position: center !important;
    opacity: 1 !important;
    visibility: visible !important;
}

@media only screen and (max-width: 767px) {
    .eja-ficha-producto {
        width: calc(100vw - 1rem);
        max-height: calc(100vh - 1rem);
    }

    .eja-ficha-producto__grid {
        grid-template-columns: 1fr;
    }

    .eja-ficha-producto__col-media {
        position: static;
        min-height: 220px;
        overflow: visible;
    }

    .eja-ficha-producto__media-unica {
        min-height: 220px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .eja-cat-galeria-scroll {
        min-height: 240px;
        max-height: min(52vh, 420px);
    }

    .eja-cat-galeria-scroll__slide {
        min-height: 240px;
        max-height: min(52vh, 420px);
    }

    .pagina-cat .eja-cat-galeria-img {
        max-height: min(50vh, 360px) !important;
    }

    .eja-ficha-producto__swiper {
        min-height: min(280px, 45vh);
        height: auto !important;
    }

    .eja-ficha-producto__swiper .swiper-wrapper {
        min-height: min(260px, 42vh);
    }

    .eja-ficha-producto__swiper .swiper-slide {
        min-height: min(260px, 42vh);
    }

    .eja-ficha-producto__img {
        max-height: min(360px, 48vh);
        min-height: 120px;
        width: auto;
        max-width: 100%;
    }

    .eja-ficha-producto__carrito-grid {
        grid-template-columns: 1fr;
    }

    .eja-ficha-producto__body {
        padding: 1rem 1rem 1.15rem;
    }
}

