/* =========================================================
   PRODUCTOS RELACIONADOS - BOTONES MÁS GRANDES Y A LA DERECHA
   (SOLO TAMAÑO, SIN CAMBIAR COLORES/HOVER)
   ========================================================== */

/* Contenedor footer del producto relacionado */
.store-product-detail-page .store-product-footer {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

/* Área del precio - empuja los botones a la derecha cuando hay espacio */
.store-product-detail-page .store-product-footer > div:first-child {
    min-width: 0;
    flex: 1 1 auto;
    margin-right: auto;
}

/* Botones de acción en productos relacionados (SOLO MÁS GRANDES - SIN CAMBIAR COLORES/HOVER) */
.store-product-detail-page .store-product-action {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 12px;
    padding: 0;
    border: 0;
    font-size: 1.1rem;
}

.store-product-detail-page .store-product-action i {
    line-height: 1;
    font-size: 1.1rem;
}

/* Contenedor de botones */
.store-product-detail-page .store-product-footer .d-flex {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* =========================================================
   CUANDO EL PRECIO ES LARGO - LOS BOTONES BAJAN PERO A LA DERECHA
   ========================================================== */

@media (max-width: 480px) {
    .store-product-detail-page .store-product-footer {
        flex-direction: column;
        align-items: flex-end;
        gap: 0.6rem;
    }
    
    .store-product-detail-page .store-product-footer > div:first-child {
        margin-right: 0;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
    }
    
    .store-product-detail-page .store-product-footer .d-flex {
        width: auto;
        justify-content: flex-end;
    }
    
    .store-product-detail-page .store-product-footer .store-product-price,
    .store-product-detail-page .store-product-footer .text-muted,
    .store-product-detail-page .store-product-footer .badge,
    .store-product-detail-page .store-product-footer .store-product-stock {
        text-align: right;
        width: 100%;
    }
    
    .store-product-detail-page .store-product-footer .badge {
        align-self: flex-end;
        width: auto;
    }
}

/* Móvil pequeño - botones proporcionados */
@media (max-width: 575.98px) {
    .store-product-detail-page .store-product-action {
        width: 40px;
        height: 40px;
        min-width: 40px;
        font-size: 1rem;
    }
    
    .store-product-detail-page .store-product-action i {
        font-size: 1rem;
    }
    
    .store-product-detail-page .store-product-footer .store-product-price {
        font-size: 0.85rem;
    }
    
    .store-product-detail-page .store-product-footer .badge {
        font-size: 0.6rem;
        padding: 0.25rem 0.45rem;
    }
}

/* Pantallas muy pequeñas */
@media (max-width: 360px) {
    .store-product-detail-page .store-product-footer {
        flex-direction: column;
        align-items: flex-end;
        gap: 0.5rem;
    }
    
    .store-product-detail-page .store-product-footer > div:first-child {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
    }
    
    .store-product-detail-page .store-product-action {
        width: 36px;
        height: 36px;
        min-width: 36px;
        font-size: 0.9rem;
    }
    
    .store-product-detail-page .store-product-footer .store-product-price {
        font-size: 0.8rem;
    }
}


/* =========================================================
   BOTÓN VOLVER
========================================================== */

.store-back-nav {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1.5rem;
}

.store-back-link {
    display: inline-flex;
    align-items: center;
    gap: .65rem;

    padding: .75rem 1rem;

    border-radius: 16px;

    text-decoration: none;

    background: #ffffff;
    border: 1px solid var(--store-border);

    color: var(--store-primary);

    font-size: .9rem;
    font-weight: 800;

    box-shadow: var(--store-shadow-sm);

    transition: all .25s ease;
}

.store-back-link i {
    width: 38px;
    height: 38px;

    border-radius: 12px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--store-soft-2);

    transition: all .25s ease;
}

.store-back-link:hover {
    color: var(--store-accent);

    border-color: rgba(220, 161, 23, .25);

    transform: translateY(-2px);

    box-shadow: var(--store-shadow-md);
}

.store-back-link:hover i {
    background: rgba(220, 161, 23, .12);
    color: var(--store-accent);
}

@media (max-width: 575.98px) {

    .store-back-nav {
        justify-content: center;
        margin-bottom: 1rem;
    }

    .store-back-link {
        width: 100%;
        justify-content: center;
        font-size: .85rem;
    }

    .store-back-link i {
        width: 34px;
        height: 34px;
    }

}


/* =========================================================
   GALERÍA DE PRODUCTO - SWIPE, ANIMACIÓN, FLECHAS Y CONTADOR
   ========================================================== */

/* Aseguramos que el wrapper de la imagen principal sea el contenedor
   de referencia para las flechas y el contador */
.store-product-main-image-wrap {
    position: relative;
    overflow: hidden;
}

/* Imagen principal: base para la animación de deslizamiento */
.store-product-main-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease, opacity 0.25s ease;
    touch-action: pan-y;
}

/* --- Animaciones de deslizamiento --- */

/* Sale hacia la izquierda (avanzando a la siguiente imagen) */
.store-product-main-image.slide-out-left {
    transform: translateX(-30px);
    opacity: 0;
}

/* Sale hacia la derecha (retrocediendo a la imagen anterior) */
.store-product-main-image.slide-out-right {
    transform: translateX(30px);
    opacity: 0;
}

/* Entra desde la derecha (nueva imagen siguiente) */
.store-product-main-image.slide-in-right {
    animation: storeGallerySlideInRight 0.25s ease forwards;
}

/* Entra desde la izquierda (nueva imagen anterior) */
.store-product-main-image.slide-in-left {
    animation: storeGallerySlideInLeft 0.25s ease forwards;
}

@keyframes storeGallerySlideInRight {
    from {
        transform: translateX(30px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes storeGallerySlideInLeft {
    from {
        transform: translateX(-30px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* --- Flechas de navegación --- */

.store-gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%) scale(0.85);

    width: 42px;
    height: 42px;

    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;

    background: rgba(255, 255, 255, 0.75);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);

    color: var(--store-primary, #1a1a1a);

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 1.15rem;
    line-height: 1;

    cursor: pointer;

    box-shadow:
        0 4px 10px rgba(0, 0, 0, 0.12),
        0 1px 3px rgba(0, 0, 0, 0.08),
        inset 0 0 0 1px rgba(255, 255, 255, 0.4);

    opacity: 0;
    visibility: hidden;

    transition:
        opacity 0.3s ease,
        visibility 0.3s ease,
        transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
        background 0.25s ease,
        box-shadow 0.25s ease;

    z-index: 3;
}

.store-gallery-arrow i {
    position: relative;
    /* pequeño ajuste óptico: el chevron no queda 100% centrado visualmente */
    left: -1px;
}

.store-gallery-arrow-next i {
    left: 1px;
}

.store-gallery-arrow-prev {
    left: 14px;
}

.store-gallery-arrow-next {
    right: 14px;
}

/* Solo se muestran al pasar el mouse (computadora), con un pequeño "pop" */
.store-product-main-image-wrap:hover .store-gallery-arrow {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) scale(1);
}

.store-gallery-arrow:hover {
    background: #ffffff;
    color: var(--store-accent, #dca117);
    transform: translateY(-50%) scale(1.12);

    box-shadow:
        0 6px 16px rgba(0, 0, 0, 0.18),
        0 2px 6px rgba(0, 0, 0, 0.1),
        inset 0 0 0 1px rgba(220, 161, 23, 0.25);
}

.store-gallery-arrow:active {
    transform: translateY(-50%) scale(0.95);
    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.15),
        inset 0 0 0 1px rgba(220, 161, 23, 0.35);
}

/* En pantallas táctiles no mostramos las flechas: el usuario desliza */
@media (max-width: 991.98px) {
    .store-gallery-arrow {
        display: none;
    }
}

/* --- Contador de imágenes (1 / 4) --- */

.store-gallery-counter {
    position: absolute;
    bottom: 12px;
    right: 12px;

    padding: 0.25rem 0.65rem;

    background: rgba(0, 0, 0, 0.55);
    color: #fff;

    font-size: 0.75rem;
    font-weight: 600;

    border-radius: 999px;

    z-index: 3;
    pointer-events: none;
}