/**
 * Hover Image Carousel Widget Styles
 *
 * Horizontal scrollable carousel of image cards with toggle button.
 * Apple product-strip inspired layout.
 *
 * @package Imagelet_Product_Types
 */

/* ========================================
   Container
   ======================================== */
.ipt-hover-carousel {
    position: relative;
    width: 100%;
    overflow: visible;
}

/* ========================================
   Track (scrollable strip)
   ======================================== */
.ipt-hover-carousel__track {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    gap: 20px;
    --cards-per-view: 2.5;
    --card-gap: 20px;

    /* Hide scrollbar */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.ipt-hover-carousel__track::-webkit-scrollbar {
    display: none;
}

/* ========================================
   Card
   ======================================== */
.ipt-hover-carousel__card {
    flex: 0 0 calc((100% - (var(--cards-per-view) - 1) * var(--card-gap)) / var(--cards-per-view));
    min-width: 0;
    background-color: transparent;
    border-radius: 0;
    padding: 0 !important;
    margin: 0;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
    transition: none;
}

.ipt-hover-carousel__card:hover {
    box-shadow: none;
}

/* ========================================
   Card Image Container
   ======================================== */
.ipt-hover-carousel__card-image {
    position: relative;
    line-height: 0;
    margin: 0;
    padding: 0;
}

.ipt-hover-carousel__card-image a {
    display: block;
    line-height: 0;
    text-decoration: none;
}

.ipt-hover-carousel__card-image img {
    display: block;
    width: 100%;
    height: auto;
    margin: 0;
    padding: 0;
    border: 0;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

.ipt-hover-carousel__card-image picture {
    display: block;
    line-height: 0;
    margin: 0;
    padding: 0;
}

/* ========================================
   Hover Image (hidden by default)
   ======================================== */
.ipt-hover-carousel__hover-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: none;
}

.ipt-hover-carousel__hover-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* When toggled — show second image, hide default */
.ipt-hover-carousel__card-image.is-toggled .ipt-hover-carousel__hover-img {
    opacity: 1;
    visibility: visible;
}

.ipt-hover-carousel__card-image.is-toggled .ipt-hover-carousel__default-img {
    opacity: 0;
    visibility: hidden;
}

/* ========================================
   Card Title
   ======================================== */
.ipt-hover-carousel__card-title {
    font-size: 18px;
    font-weight: 700;
    color: #1d1d1f;
    line-height: 1.3;
    text-align: center;
    padding: 12px 10px 4px;
    margin: 0;
    position: relative;
    z-index: 5;
    background: none;
    border: none;
}

.ipt-hover-carousel__card-title a {
    color: inherit;
    text-decoration: none;
}

.ipt-hover-carousel__card-title a:hover {
    text-decoration: underline;
}

/* ========================================
   Card Actions Row (toggle button + shop button)
   ======================================== */
.ipt-hover-carousel__card-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px;
    padding: 8px 10px 4px;
    margin: 0;
}

.ipt-hover-carousel__shop-btn {
    padding: 10px 20px !important;
    font-size: 14px !important;
    font-family: Helvetica, Arial, sans-serif !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    border-radius: 0 !important;
    white-space: nowrap !important;
    text-decoration: none !important;
}

/* ========================================
   Toggle Button (overlaid on image, bottom center, below title)
   ======================================== */
.ipt-hover-carousel__toggle-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 10px 20px !important;
    margin: 0 !important;
    background: #fff !important;
    background-color: #fff !important;
    border: none !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    color: #444 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    max-height: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -webkit-touch-callout: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    outline: none !important;
    text-decoration: none !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12) !important;
    animation: ipt-carousel-btn-pulse 1.8s ease-in-out infinite !important;
}

@keyframes ipt-carousel-btn-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    }
}

.ipt-hover-carousel__toggle-btn svg {
    width: 24px !important;
    height: 24px !important;
    fill: #444 !important;
    stroke: none !important;
    flex-shrink: 0 !important;
    pointer-events: none !important;
    display: inline-block !important;
}

.ipt-hover-carousel__toggle-btn span {
    pointer-events: none !important;
    display: inline !important;
    font-size: 16px !important;
    color: #444 !important;
}

.ipt-hover-carousel__toggle-btn:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25) !important;
    background: #fff !important;
    background-color: #fff !important;
}

.ipt-hover-carousel__toggle-btn:active,
.ipt-hover-carousel__toggle-btn.is-active {
    animation: none !important;
    transform: scale(0.95) !important;
    background: #f0f0f0 !important;
    background-color: #f0f0f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

/* ========================================
   Navigation Arrows
   ======================================== */
.ipt-hover-carousel__nav {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    border-radius: 50% !important;
    background: #fff !important;
    background-color: #fff !important;
    border: 1px solid #ddd !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.2s ease !important;
    padding: 0 !important;
    margin: 0 !important;
    outline: none !important;
    line-height: 1 !important;
    font-size: 0 !important;
    color: transparent !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    text-decoration: none !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

.ipt-hover-carousel__nav svg {
    width: 18px !important;
    height: 18px !important;
    stroke: #333 !important;
    fill: none !important;
    stroke-width: 2 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
    display: block !important;
}

.ipt-hover-carousel__nav--prev {
    left: 12px !important;
}

.ipt-hover-carousel__nav--next {
    right: 12px !important;
}

.ipt-hover-carousel__nav:hover:not(:disabled) {
    background: #f5f5f5 !important;
    background-color: #f5f5f5 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15) !important;
}

.ipt-hover-carousel__nav:disabled {
    opacity: 0 !important;
    cursor: default !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 1024px) {
    .ipt-hover-carousel__nav--prev {
        left: 8px;
    }
    .ipt-hover-carousel__nav--next {
        right: 8px;
    }
}

/* Ensure Elementor wrappers don't add spacing */
.elementor-widget-ipt_hover_image_carousel .elementor-widget-container {
    overflow: visible;
}

@media (max-width: 767px) {
    .ipt-hover-carousel__nav {
        width: 32px;
        height: 32px;
    }

    .ipt-hover-carousel__nav svg {
        width: 16px;
        height: 16px;
    }

    .ipt-hover-carousel__card-title {
        font-size: 15px;
    }

    .ipt-hover-carousel__card-actions {
        flex-wrap: wrap !important;
        gap: 8px !important;
        padding: 6px 8px 10px !important;
    }

    .ipt-hover-carousel__toggle-btn {
        font-size: 12px !important;
        padding: 8px 12px !important;
    }

    .ipt-hover-carousel__toggle-btn svg {
        width: 18px !important;
        height: 18px !important;
    }

    .ipt-hover-carousel__toggle-btn span {
        font-size: 12px !important;
    }

    .ipt-hover-carousel__shop-btn {
        padding: 8px 14px !important;
        font-size: 12px !important;
    }
}
