/* ==========================================================================
   Tharaa's Natural Care - Professional Instagram Image Carousel / Slider
   ========================================================================== */

.insta-carousel-section {
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
    position: relative;
    background-color: #ffffff;
    margin: 60px 0 0 0;
    padding: 20px 0 30px 0;
    box-sizing: border-box;
}

/* Ensure no gap or interference from parent containers */
.insta-carousel-section * {
    box-sizing: border-box;
}

.insta-carousel {
    width: 100%;
    overflow: hidden;
    position: relative;
    padding: 10px 0 15px 0;
    user-select: none;
    -webkit-user-select: none;
    touch-action: pan-y;
    cursor: grab;
}

.insta-carousel:active,
.insta-carousel.is-dragging {
    cursor: grabbing;
}

/* Continuous Marquee Track */
.insta-carousel__track {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    width: max-content !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 0 !important;
    will-change: transform;
    animation: instaMarquee 34s linear infinite;
    -webkit-animation: instaMarquee 34s linear infinite;
}

/* Pause animation on hover */
.insta-carousel:hover .insta-carousel__track {
    animation-play-state: paused !important;
    -webkit-animation-play-state: paused !important;
}

.insta-carousel__track.is-dragging {
    animation: none !important;
    -webkit-animation: none !important;
    transition: none !important;
}

/* Keyframes: Right to Left infinite linear scroll */
@keyframes instaMarquee {
    0% {
        transform: translate3d(0, 0, 0);
    }
    100% {
        transform: translate3d(-50%, 0, 0);
    }
}

@-webkit-keyframes instaMarquee {
    0% {
        -webkit-transform: translate3d(0, 0, 0);
    }
    100% {
        -webkit-transform: translate3d(-50%, 0, 0);
    }
}

/* Individual Slide Card - Separate Cards with Equal Spacing & Rounded Corners */
.insta-carousel__slide {
    flex: 0 0 260px !important;
    width: 260px !important;
    height: 260px !important;
    aspect-ratio: 1 / 1;
    margin: 0 22px 0 0 !important;
    padding: 0 !important;
    display: block !important;
    position: relative !important;
    border-radius: 18px !important;
    overflow: hidden !important;
    text-decoration: none !important;
    background-color: #f7f7f7;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
    -webkit-transition: -webkit-transform 0.35s ease, box-shadow 0.35s ease;
}

.insta-carousel__slide:hover {
    transform: translateY(-4px);
    -webkit-transform: translateY(-4px);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.14), 0 4px 10px rgba(0, 0, 0, 0.06);
}

/* Image Wrapper */
.insta-carousel__img-wrap {
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

/* Image element: object-fit cover with smooth zoom on hover */
.insta-carousel__img-wrap img {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover !important;
    display: block !important;
    border-radius: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    pointer-events: none;
    transform: scale(1);
    -webkit-transform: scale(1);
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    -webkit-transition: -webkit-transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.insta-carousel__slide:hover .insta-carousel__img-wrap img {
    transform: scale(1.06);
    -webkit-transform: scale(1.06);
}

/* Global center badge completely disabled */
.insta-carousel__center-badge {
    display: none !important;
}

/* Individual Slide Hover Overlay */
.insta-carousel__hover {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.25);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 3;
    transition: opacity 0.35s ease, visibility 0.35s ease;
    -webkit-transition: opacity 0.35s ease, visibility 0.35s ease;
}
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.22);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 3;
    transition: opacity 0.35s ease, visibility 0.35s ease;
    -webkit-transition: opacity 0.35s ease, visibility 0.35s ease;
}

/* Centered Instagram semi-transparent frosted badge */
.insta-carousel__hover-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    color: #ffffff;
    transform: scale(0.85);
    -webkit-transform: scale(0.85);
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    -webkit-transition: -webkit-transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.insta-carousel__hover-icon {
    width: 32px;
    height: 32px;
    display: block;
    color: #ffffff;
    stroke: #ffffff;
}

/* Independent hover display for each slide on pointer/desktop devices */
@media (hover: hover) and (pointer: fine) {
    .insta-carousel__slide:hover .insta-carousel__hover {
        opacity: 1 !important;
        visibility: visible !important;
    }

    .insta-carousel__slide:hover .insta-carousel__hover-badge {
        transform: scale(1);
        -webkit-transform: scale(1);
    }
}

/* Mobile & Touch Devices: Keep clean gallery without persistent or sticky hover overlays */
@media (hover: none), (pointer: coarse) {
    .insta-carousel__hover {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
}

/* Neutralize legacy CSS overrides from style.css and responsive.css */
.insta-carousel-section .insta-photos,
.insta-carousel .insta-photos,
.insta-photos.insta-carousel {
    flex-wrap: nowrap !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
    width: 100% !important;
}

.insta-carousel-section .insta-photo,
.insta-carousel .insta-photo {
    flex-shrink: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

/* Large screens (>= 1600px) */
@media screen and (min-width: 1600px) {
    .insta-carousel__slide {
        flex: 0 0 280px !important;
        width: 280px !important;
        height: 280px !important;
        margin: 0 25px 0 0 !important;
        border-radius: 20px !important;
    }
    .insta-carousel__img-wrap,
    .insta-carousel__img-wrap img,
    .insta-carousel__hover {
        border-radius: 20px !important;
    }
}

/* Tablets / Medium screens (max-width: 1200px) */
@media screen and (max-width: 1200px) {
    .insta-carousel-section {
        margin-top: 50px;
        padding: 15px 0 25px 0;
    }
    .insta-carousel__slide {
        flex: 0 0 220px !important;
        width: 220px !important;
        height: 220px !important;
        margin: 0 20px 0 0 !important;
        border-radius: 16px !important;
    }
    .insta-carousel__img-wrap,
    .insta-carousel__img-wrap img,
    .insta-carousel__hover {
        border-radius: 16px !important;
    }
    .insta-carousel__hover-badge {
        width: 50px;
        height: 50px;
        border-radius: 12px;
    }
    .insta-carousel__hover-icon {
        width: 28px;
        height: 28px;
    }
}

/* Small tablets / Large phones (max-width: 768px) */
@media screen and (max-width: 768px) {
    .insta-carousel-section {
        margin-top: 35px;
        padding: 12px 0 20px 0;
    }
    .insta-carousel__slide {
        flex: 0 0 175px !important;
        width: 175px !important;
        height: 175px !important;
        margin: 0 16px 0 0 !important;
        border-radius: 14px !important;
    }
    .insta-carousel__img-wrap,
    .insta-carousel__img-wrap img,
    .insta-carousel__hover {
        border-radius: 14px !important;
    }
    .insta-carousel__hover-badge {
        width: 44px;
        height: 44px;
        border-radius: 11px;
    }
    .insta-carousel__hover-icon {
        width: 24px;
        height: 24px;
    }
}

/* Mobile phones (max-width: 480px) */
@media screen and (max-width: 480px) {
    .insta-carousel-section {
        margin-top: 25px;
        padding: 10px 0 18px 0;
    }
    .insta-carousel__slide {
        flex: 0 0 145px !important;
        width: 145px !important;
        height: 145px !important;
        margin: 0 14px 0 0 !important;
        border-radius: 12px !important;
    }
    .insta-carousel__img-wrap,
    .insta-carousel__img-wrap img,
    .insta-carousel__hover {
        border-radius: 12px !important;
    }
    .insta-carousel__hover-badge {
        width: 38px;
        height: 38px;
        border-radius: 10px;
    }
    .insta-carousel__hover-icon {
        width: 20px;
        height: 20px;
    }
}
