/* Estilo catálogo filtrado Elementor */
.price-flex {
    display: flex;
    padding: .5rem;
    vertical-align: top;
}
.info-offer {
    background: #85A8B2;
    border-radius: 15px;
    font-size: .8rem;
    color: #fff;
    padding: .3rem 1rem;
}
.info-offer.discount {
    background: #Ff6352;
    color:#fff !important;
}
.no-tag .info-offer  {
    display:none;
}
.elementor-wc-products .minimal-exist{
    font-size: .8rem;
}
.elementor-wc-products .info-offer {
    font-size: .8rem;
    margin: 0 .5rem;
    color: #90AFB8;
}

/* Estilos de precios */
.product-price .info-offer {
    vertical-align: middle !important;
    white-space: nowrap;
}
.product-price {
    display: flex;
    align-items: center;
}
.product-size-B {
    font-family: "Euclid Circular", Sans-serif;
    font-size: 33px;
    font-weight: bold;
    color: #3B3B63;
    margin-bottom: 1.5rem;
}
.product-size-B > *:not(:first-child) {
    margin-left: .5rem;
}
.product-size-B .price-flex {
    vertical-align: text-bottom;
}
.product-size-B .small {
    font-size: 23px;
    color: #85A8B2;
    margin-right: .5rem;
}
.product-size-B .regular {
    font-size: 26px;
    text-decoration:line-through;
}
.product-size-B .offer {
    color: #F5B09C;
}

@media screen and (max-width: 817px) {
    .product-size-B {
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
    }
}

/* Estilos Slider */

/*Superior*/
.image-top-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    overflow-x: hidden;
    position: relative;
}
.image-top-container {
    text-align: center;
}
.image-top-container img {
    max-width: 450px !important;
    max-height: 450px;
    padding: 5px;
    width: 100% !important;
}

/* Pinch to Zoom In-Place */
.happymami-zoom-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2147483600;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
}

.happymami-zoom-overlay.active {
    visibility: visible;
    pointer-events: auto;
}

/* Compatibilidad con estilos antiguos - mantener por si acaso */
.pinch-zoom-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.pinch-zoom-overlay.active {
    opacity: 1;
    visibility: visible;
}

.pinch-zoom-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    touch-action: none;
}

.pinch-zoom-container.active {
    opacity: 1;
    visibility: visible;
}

.pinch-zoom-container img {
    max-width: 100%;
    max-height: 100%;
    transform-origin: center center;
    transition: transform 0.1s ease-out;
}

.pinch-zoom-close {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.pinch-zoom-close.active {
    opacity: 1;
    visibility: visible;
}

/* Slider - Estilo Amazon */
.slider-container {
    width: 100%; /* Ocupa todo el ancho disponible */
    overflow: hidden; /* Oculta imágenes desbordadas */
}

.image-gallery {
    display: flex; /* Coloca las imágenes en una fila horizontal */
    gap: 10px;
    flex-wrap: nowrap;
}

.slider-image {
    width: calc(20% - 8px); /* Ajusta el ancho para mostrar 5 elementos (4 + overlay) */
    height: auto;
    flex-shrink: 0; /* Previene que las imágenes se encojan */
    background-color: #F7F6ED;
    transition: transform 0.3s ease;
}

.slider-image:hover, .slider-image.active {
    transform: scale(1.05);
    cursor: pointer;
}

/* Overlay del 5º elemento */
.gallery-overlay {
    position: relative;
    width: calc(20% - 8px);
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.gallery-overlay:hover {
    transform: scale(1.05);
}

.gallery-overlay .fifth-image {
    width: 100%;
    display: block;
}

.overlay-dark {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.gallery-overlay:hover .overlay-dark {
    background-color: rgba(0, 0, 0, 0.85);
}

.overlay-text {
    color: #fff;
    font-size: 2.5rem;
    font-weight: bold;
    font-family: "Euclid Circular", Sans-serif;
}

/* Modal de galería */
.happymami-modal {
    display: none;
    position: fixed;
    z-index: 2147483500;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background-color: #fff;
    overflow: hidden;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
}

.happymami-modal:not([style*="display: none"]) {
    display: flex;
}

.modal-content {
    position: relative;
    margin: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.modal-close {
    position: absolute;
    top: calc(10px + env(safe-area-inset-top));
    right: calc(20px + env(safe-area-inset-right));
    font-size: 3rem;
    font-weight: bold;
    color: #3B3B63;
    cursor: pointer;
    z-index: 2147483605;
    line-height: 1;
}

.modal-close:hover {
    color: #F5B09C;
}

.modal-gallery-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
    flex: 1;
    height: auto;
    min-height: 0;
}

.modal-main-image {
    flex: 1;
    text-align: center;
    padding: 0;
    position: relative;
    overflow: hidden;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
}

.modal-main-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: none;
}

.modal-main-image img.slide-out-left,
.variant-image.slide-out-left {
    animation: slideOutLeft 0.3s ease-out forwards;
}

.modal-main-image img.slide-out-right,
.variant-image.slide-out-right {
    animation: slideOutRight 0.3s ease-out forwards;
}

.modal-main-image img.slide-in-left,
.variant-image.slide-in-left {
    animation: slideInLeft 0.3s ease-out forwards;
}

.modal-main-image img.slide-in-right,
.variant-image.slide-in-right {
    animation: slideInRight 0.3s ease-out forwards;
}

@keyframes slideOutLeft {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: transparent;
    color: #87a1b2;
    border: 2px solid #87a1b2;
    font-size: 3rem;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s ease;
    z-index: 10;
}

.modal-nav:hover {
    border-color: #f49898;
    color: #f49898;
}

.modal-nav.prev {
    left: 10px;
}

.modal-nav.next {
    right: 10px;
}

.modal-thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 10px calc(16px + env(safe-area-inset-bottom));
    width: 100%;
    margin: 0;
    flex-wrap: nowrap;
}

body.happymami-modal-open {
    overflow: hidden;
    touch-action: none;
}

.modal-thumb {
    width: 80px;
    height: 80px;
    min-width: 80px;
    object-fit: cover;
    cursor: pointer;
    border: 3px solid transparent;
    border-radius: 5px;
    transition: all 0.3s ease;
    background-color: #F7F6ED;
}

.modal-thumb:hover {
    border-color: #85A8B2;
    transform: scale(1.1);
}

.modal-thumb.active {
    border-color: #3B3B63;
    transform: scale(1.1);
}

/* Responsive */
@media screen and (max-width: 768px) {
    .slider-image,
    .gallery-overlay {
        width: calc(25% - 7.5px); /* 4 elementos en móvil */
    }
    
    .modal-content {
        width: 100%;
        margin: 0;
        padding: 0;
    }
    
    .modal-gallery-container {
        height: auto;
    }
    
    .modal-main-image {
        padding: 0;
    }
    
    .modal-main-image img {
        max-height: 100%;
        max-width: 100%;
        width: auto;
        height: auto;
    }
    
    .modal-nav {
        display: none;
    }
    
    .modal-main-image {
        padding: 0;
    }

    .modal-thumbnails {
        padding-bottom: calc(24px + env(safe-area-inset-bottom));
    }
    
    .modal-thumb {
        width: 60px;
        height: 60px;
        min-width: 60px;
    }
    
    .overlay-text {
        font-size: 1.8rem;
    }
}