/* 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;
}

/* Product reviews shortcode colors */
.rate-link {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.rate-link .hm-review-star,
.rate-link .hm-review-star .eicon-star {
    color: #FFC107;
}

.rate-link .hm-review-star {
    display: inline-flex;
    margin: 0;
}

.rate-link .hm-review-score,
.rate-link .hm-review-meta {
    /* color: #773232; */
    color: #3a4249;
}

.rate-link .hm-review-meta {
    font-size: 12px;
}

@media screen and (max-width: 817px) {
    .product-size-B {
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
    }
}

/* Skeleton shimmer animation */
@keyframes hm-skeleton-shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Estilos Slider */

/*Superior*/
.image-top-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    overflow-x: hidden;
    position: relative;
    aspect-ratio: 1 / 1;
    min-height: 220px;
    background: #f7f6ed;
}
.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;
    aspect-ratio: 1 / 1;
    min-height: 70px;
}

.slider-image:hover, .slider-image.active {
    transform: scale(1.05);
    cursor: pointer;
}

/* New Happymami slider style */
.happymami-product-gallery.happymami-style-new_happymami {
    width: 100%;
    --hm-thumb-size: 82px;
}

.happymami-product-gallery.happymami-style-new_happymami .image-top-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    background: transparent;
}

.happymami-product-gallery.happymami-style-new_happymami .image-top-container::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(90deg, #e8e8e0 25%, #f2f2ea 50%, #e8e8e0 75%);
    background-size: 200% 100%;
    animation: hm-skeleton-shimmer 1.4s ease-in-out infinite;
}

.happymami-product-gallery.happymami-style-new_happymami.hm-has-swipe-track .image-top-container::before {
    display: none;
}

.happymami-product-gallery.happymami-style-new_happymami.hm-has-swipe-track .slider-container::before {
    display: none;
}

.happymami-product-gallery.happymami-style-new_happymami.hm-has-swipe-track .image-top-container > img.variant-image {
    display: none !important;
}

.happymami-product-gallery.happymami-style-new_happymami .hm-swipe-track {
    display: flex;
    width: 100%;
    will-change: transform;
    position: relative;
    z-index: 1;
}

.happymami-product-gallery.happymami-style-new_happymami .hm-swipe-track.hm-swipe-snapping {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.happymami-product-gallery.happymami-style-new_happymami .hm-swipe-slide {
    width: 100%;
    flex-shrink: 0;
}

.happymami-product-gallery.happymami-style-new_happymami .hm-swipe-slide img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

.happymami-product-gallery.happymami-style-new_happymami .slider-container {
    width: 100%;
    overflow: hidden;
    margin-bottom: 0;
    position: relative;
    min-height: var(--hm-thumb-size);
}

.happymami-product-gallery.happymami-style-new_happymami .slider-container::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(90deg, #e8e8e0 25%, #f2f2ea 50%, #e8e8e0 75%);
    background-size: 200% 100%;
    animation: hm-skeleton-shimmer 1.4s ease-in-out infinite;
    border-radius: 4px;
}

.happymami-product-gallery.happymami-style-new_happymami .image-gallery {
    width: 100%;
    gap: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
    position: relative;
    z-index: 1;
}

.happymami-product-gallery.happymami-style-new_happymami .image-gallery.hm-gallery-dragging {
    cursor: grabbing;
    user-select: none;
}

.happymami-product-gallery.happymami-style-new_happymami .slider-image {
    width: var(--hm-thumb-size);
    min-width: var(--hm-thumb-size);
    height: var(--hm-thumb-size);
    object-fit: cover;
    scroll-snap-align: start;
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    border: 1px solid transparent;
    background: transparent;
}

.happymami-product-gallery.happymami-style-new_happymami .slider-image.active {
    transform: none;
    border-color: #f49898;
    outline: 1px solid #f49898;
    outline-offset: -1px;
    box-shadow: none;
    z-index: 10;
}

@media (hover: hover) and (pointer: fine) {
    .happymami-product-gallery.happymami-style-new_happymami .slider-image:hover {
        transform: none;
        border-color: #f49898;
        outline: 1px solid #f49898;
        outline-offset: -1px;
        box-shadow: none;
        z-index: 10;
    }
}

.happymami-product-gallery.happymami-style-new_happymami .gallery-overlay {
    display: none !important;
}

/* 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;
    }

    .happymami-product-gallery.happymami-style-new_happymami {
        width: 100%;
        --hm-thumb-size: 64px;
        margin-left: 0;
        margin-right: 0;
    }

    .happymami-product-gallery.happymami-style-new_happymami .image-top-container {
        width: min(82vw, 380px);
        aspect-ratio: 1 / 1;
        height: auto;
        min-height: 0;
        margin-left: auto;
        margin-right: auto;
    }

    .happymami-product-gallery.happymami-style-new_happymami .image-top-container img.variant-image,
    .happymami-product-gallery.happymami-style-new_happymami .hm-swipe-slide img {
        width: 100% !important;
        height: 100% !important;
        max-width: none !important;
        max-height: none !important;
        object-fit: contain !important;
    }

    .happymami-product-gallery.happymami-style-new_happymami .slider-image {
        width: var(--hm-thumb-size);
        min-width: var(--hm-thumb-size);
        height: var(--hm-thumb-size);
    }
}

/* Desktop gallery positioning */
@media screen and (min-width: 769px) {
    .happymami-product-gallery.happymami-style-new_happymami {
        position: sticky;
        top: 20px;
        align-self: flex-start;
    }

    .happymami-product-gallery.happymami-style-new_happymami .image-top-container {
        width: 100%;
        aspect-ratio: 1 / 1;
    }

    .happymami-product-gallery.happymami-style-new_happymami .image-top-container img.variant-image,
    .happymami-product-gallery.happymami-style-new_happymami .hm-swipe-slide img {
        width: 100% !important;
        height: 100% !important;
        max-width: none !important;
        max-height: none !important;
        object-fit: contain !important;
    }

    .happymami-product-gallery.happymami-style-new_happymami .slider-container {
        width: 100%;
    }
}