/**
 * =============================================================================
 * CATALOG PRODUCT GALLERY
 * =============================================================================
 * Image hover gallery with navigation arrows in product catalog
 */

/* -----------------------------------------------------------------------------
 * Gallery Navigation Arrows
 * -------------------------------------------------------------------------- */

.catalog-gallery-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    pointer-events: none;
    z-index: 20;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Show arrows on hover */
.product-image-section:hover .catalog-gallery-nav {
    opacity: 1;
}

.catalog-gallery-arrow {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    padding: 0;
    color: #333;
}

.catalog-gallery-arrow:hover {
    background: rgba(0, 124, 186, 0.95);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

.catalog-gallery-arrow:active {
    transform: scale(0.95);
}

.catalog-gallery-arrow svg {
    width: 12px;
    height: 16px;
    display: block;
}

/* Prevent navigation from blocking product link */
.catalog-gallery-nav button {
    position: relative;
    z-index: 21;
}

/* -----------------------------------------------------------------------------
 * Image Transition Effects - Smooth Crossfade
 * -------------------------------------------------------------------------- */

.product-image-section .jet-woo-product-thumbnail img,
.product-image-section .product-image-link img {
    transition: opacity 0.12s ease-out, transform 0.3s ease;
    will-change: opacity;
}

.product-card:hover .jet-woo-product-thumbnail img,
.product-card:hover .product-image-link img {
    transform: scale(1.02);
}

/* Loading state */
.product-card.loading {
    opacity: 0.6;
    pointer-events: none;
}

.product-card.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

/* -----------------------------------------------------------------------------
 * Video in Catalog Gallery
 * -------------------------------------------------------------------------- */

.catalog-video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 5;
}

.catalog-video-container iframe,
.catalog-video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    object-fit: cover;
}

/* -----------------------------------------------------------------------------
 * Color Variant Interactive States
 * -------------------------------------------------------------------------- */

/* Make color swatches more interactive in catalog */
.product-card .color-link {
    display: block;
    transition: transform 0.2s ease;
}

.product-card .color-link:hover {
    transform: scale(1.15);
}

.product-card .color {
    cursor: pointer;
    transition: all 0.2s ease;
}

.product-card .color:hover {
    border-color: #007cba;
    transform: scale(1.1);
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.3);
}

/* Active color state */
.product-card .color.active,
.product-card .color-link.active .color {
    border-color: #007cba;
    border-width: 3px;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.5);
}

/* Visual feedback on color change */
@keyframes colorChangeFlash {
    0% {
        background-color: rgba(0, 124, 186, 0.1);
    }
    50% {
        background-color: rgba(0, 124, 186, 0.05);
    }
    100% {
        background-color: transparent;
    }
}

/* -----------------------------------------------------------------------------
 * Mobile Responsive Adjustments
 * -------------------------------------------------------------------------- */

@media (max-width: 768px) {
    /* Smaller arrows on mobile */
    .catalog-gallery-arrow {
        width: 28px;
        height: 28px;
    }

    .catalog-gallery-arrow svg {
        width: 10px;
        height: 14px;
    }

    /* Touch-friendly spacing */
    .catalog-gallery-nav {
        padding: 0 8px;
    }

    /* Always show arrows on mobile (no hover state) */
    .product-image-section:hover .catalog-gallery-nav,
    .catalog-gallery-nav {
        opacity: 0;
    }

    /* Show arrows only when actively touching */
    .product-image-section.touching .catalog-gallery-nav {
        opacity: 1;
    }
}

@media (max-width: 480px) {
    /* Even smaller arrows on small phones */
    .catalog-gallery-arrow {
        width: 24px;
        height: 24px;
    }

    .catalog-gallery-arrow svg {
        width: 8px;
        height: 12px;
    }

    .catalog-gallery-nav {
        padding: 0 6px;
    }
}

/* -----------------------------------------------------------------------------
 * Accessibility
 * -------------------------------------------------------------------------- */

/* Focus states for keyboard navigation */
.catalog-gallery-arrow:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.catalog-gallery-arrow:focus:not(:focus-visible) {
    outline: none;
}

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* -----------------------------------------------------------------------------
 * Prevent conflicts with existing styles
 * -------------------------------------------------------------------------- */

/* Ensure arrows don't interfere with badges */
.catalog-gallery-nav {
    pointer-events: none;
}

.catalog-gallery-nav button {
    pointer-events: auto;
}

/* Ensure product link still works */
.product-image-link {
    display: block;
    position: relative;
    z-index: 1;
}

/* Gallery navigation has higher z-index */
.catalog-gallery-nav {
    z-index: 20;
}

/* But badges should be even higher */
.free-shipping-banner,
.discount-badges,
.marketing-badges,
.manufacturer-logo {
    z-index: 25;
}
