/**
 * Sandeepan Partners Frontend Styles
 * Responsive, accessible, 60fps marquee ticker with rock-solid compatibility
 * Supports 3 Card Display Styles:
 * 1. Horizontal (Logo Left, Text Right)
 * 2. Vertical Stacked (Prominent Big Logo Top, Text Bottom)
 * 3. Logo Hero + Subtitle Badge (Minimal & Impactful)
 */

:root {
    --sp-speed: 35s;
    --sp-card-gap: 18px;
}

.sp-showcase-section {
    --sp-logo-height: var(--sp-logo-height-base, 45px);
    --sp-logo-max-width: var(--sp-logo-max-width-base, 120px);
    --sp-title-size: var(--sp-title-size-base, 14px);
    --sp-sub-size: var(--sp-sub-size-base, 10px);
    --sp-card-pad-v: var(--sp-card-pad-v-base, 14px);
    --sp-card-pad-h: var(--sp-card-pad-h-base, 22px);
    --sp-card-inner-gap: 16px;
    --sp-glow-color: rgba(30, 115, 190, 0.2);

    width: 100%;
    max-width: 100%;
    min-width: 0;
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
    background: var(--sp-sec-bg, transparent);
    padding: var(--sp-sec-pad-v, 28px) 0;
}

/*
 * Elementor flexbox containers: a widget is a flex item with min-width:auto, so the
 * very wide marquee row (width:max-content) stretched the widget to thousands of px
 * and caused horizontal page scroll. Force the widget holding the showcase to stay
 * the container's width.
 */
.elementor-widget:has(.sp-showcase-section) {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex-grow: 1;
}
.elementor-widget:has(.sp-showcase-section) > .elementor-widget-container {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.sp-inner-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px;
    box-sizing: border-box;
}

/* Section Heading */
.sp-section-heading {
    margin-bottom: var(--sp-heading-spacing, 20px);
    text-align: var(--sp-heading-align, center);
}

.sp-heading-text {
    font-family: inherit;
    font-size: var(--sp-heading-size, 13px);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--sp-heading-color, #718096);
    display: inline-block;
}

/* Marquee Outer Wrapper */
.sp-marquee-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding-block: 8px;
    mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
}

/* Marquee Track Container */
.sp-marquee-slider {
    display: flex;
    width: max-content;
    will-change: transform;
}

/* Track animation with full vendor prefixes & longhand properties to bypass minifier bugs */
.sp-marquee-track {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    will-change: transform;
    gap: var(--sp-card-gap, 18px);
    padding-right: var(--sp-card-gap, 18px);

    -webkit-animation-name: spMarqueeScrollLeft;
    animation-name: spMarqueeScrollLeft;
    -webkit-animation-duration: var(--sp-speed, 35s);
    animation-duration: var(--sp-speed, 35s);
    -webkit-animation-timing-function: linear;
    animation-timing-function: linear;
    -webkit-animation-iteration-count: infinite;
    animation-iteration-count: infinite;
}

/* Direction: Left to Right */
.sp-marquee-slider.sp-dir-right .sp-marquee-track {
    -webkit-animation-name: spMarqueeScrollRight;
    animation-name: spMarqueeScrollRight;
}

/*
 * No-JS fallback pause. Limited to real hover devices: on phones :hover "sticks"
 * after a tap, which used to freeze the marquee until the visitor tapped elsewhere.
 */
@media (hover: hover) {
    .sp-marquee-wrapper.sp-pause-on-hover:hover .sp-marquee-track {
        -webkit-animation-play-state: paused;
        animation-play-state: paused;
    }
}
.sp-marquee-wrapper.is-paused .sp-marquee-track {
    -webkit-animation-play-state: paused;
    animation-play-state: paused;
}

/*
 * JS engine active: frontend.js moves .sp-marquee-slider with an inline transform,
 * so the CSS keyframes are switched off. This is what makes the marquee immune to
 * theme / Elementor reduced-motion resets that force animation-duration to ~0.
 */
.sp-marquee-wrapper.sp-js-marquee .sp-marquee-track {
    -webkit-animation: none !important;
    animation: none !important;
    will-change: auto;
}

/* "Stop for reduced motion" setting: swipeable static row instead of motion */
.sp-marquee-wrapper.sp-motion-off {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.sp-marquee-wrapper.sp-motion-off::-webkit-scrollbar {
    display: none;
}
.sp-marquee-wrapper.sp-motion-off .sp-marquee-track-duplicate,
.sp-marquee-wrapper.sp-motion-off .sp-marquee-track-duplicate-2,
.sp-marquee-wrapper.sp-motion-off .sp-pause-toggle-btn {
    display: none;
}
@media (prefers-reduced-motion: reduce) {
    /* Same result when JS has not run */
    .sp-rm-stop .sp-marquee-track {
        -webkit-animation: none !important;
        animation: none !important;
    }
    .sp-rm-stop .sp-marquee-wrapper {
        overflow-x: auto;
        scrollbar-width: none;
    }
    .sp-rm-stop .sp-marquee-track-duplicate,
    .sp-rm-stop .sp-marquee-track-duplicate-2,
    .sp-rm-stop .sp-pause-toggle-btn {
        display: none;
    }
}

/* Accessible Pause Button (WCAG 2.2.2) */
.sp-pause-toggle-btn {
    position: absolute;
    right: 12px;
    bottom: 8px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    cursor: pointer;
    z-index: 10;
    opacity: 0.7;
    transition: opacity 0.2s, background 0.2s;
    line-height: 1;
}

.sp-pause-toggle-btn:hover,
.sp-pause-toggle-btn:focus {
    opacity: 1;
    background: #ffffff;
}

.sp-pause-toggle-btn .sp-icon-play {
    display: none;
}

.sp-marquee-wrapper.is-paused .sp-pause-toggle-btn .sp-icon-pause {
    display: none;
}

.sp-marquee-wrapper.is-paused .sp-pause-toggle-btn .sp-icon-play {
    display: inline;
}

/* Keyframes with full WebKit and standard support */
@-webkit-keyframes spMarqueeScrollLeft {
    0% {
        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
    }
    100% {
        -webkit-transform: translate3d(-100%, 0, 0);
        transform: translate3d(-100%, 0, 0);
    }
}

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

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

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

/* Base Partner Card Styling */
.sp-partner-card {
    display: inline-flex;
    align-items: center;
    background-color: var(--sp-card-bg, #ffffff);
    border: var(--sp-card-border-width, 1px) solid var(--sp-card-border-color, #edf2f7);
    border-radius: var(--sp-card-border-radius, 14px);
    padding: var(--sp-card-pad-v) var(--sp-card-pad-h);
    text-decoration: none;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
    white-space: nowrap;
    box-sizing: border-box;
    flex-shrink: 0;
}

/* Semantic cursor rules */
a.sp-partner-card {
    cursor: pointer;
}
div.sp-partner-card {
    cursor: default;
}

/* Shadow Variations */
.sp-shadow-none .sp-partner-card {
    box-shadow: none;
}
.sp-shadow-soft .sp-partner-card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.sp-shadow-medium .sp-partner-card {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

/* Hover Variations */
.sp-hover-none .sp-partner-card:hover {
    transform: none;
}
.sp-hover-lift .sp-partner-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}
.sp-hover-glow .sp-partner-card:hover {
    border-color: #1e73be;
    box-shadow: 0 0 14px var(--sp-glow-color);
}

/* STYLE 1: Horizontal Layout (Logo Left, Text Right) */
.sp-card-style-horizontal .sp-partner-card {
    flex-direction: row;
    gap: var(--sp-card-inner-gap, 16px);
}

.sp-card-style-horizontal .sp-card-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: var(--sp-logo-height);
    max-width: var(--sp-logo-max-width);
    min-width: var(--sp-logo-height);
    width: auto;
    flex-shrink: 0;
}

.sp-card-style-horizontal .sp-card-logo img,
.sp-card-style-horizontal .sp-card-logo .sp-partner-img {
    max-height: var(--sp-logo-height);
    max-width: var(--sp-logo-max-width);
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.sp-card-style-horizontal .sp-card-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
}

/* STYLE 2: Vertical Stacked (Prominent Big Logo Top, Text Bottom) */
.sp-card-style-vertical .sp-partner-card {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 12px;
    min-width: 180px;
    padding: var(--sp-card-pad-v) var(--sp-card-pad-h);
}

.sp-card-style-vertical .sp-card-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: var(--sp-logo-height);
    max-width: var(--sp-logo-max-width);
    width: 100%;
    margin: 0 auto;
}

.sp-card-style-vertical .sp-card-logo img,
.sp-card-style-vertical .sp-card-logo .sp-partner-img {
    max-height: var(--sp-logo-height);
    max-width: var(--sp-logo-max-width);
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.sp-card-style-vertical .sp-card-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.sp-card-style-vertical .sp-partner-subtitle {
    margin-top: 2px;
}

/* STYLE 3: Logo Hero + Subtitle Badge */
.sp-card-style-logo_badge .sp-partner-card {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 12px;
    min-width: 170px;
    padding: var(--sp-card-pad-v) var(--sp-card-pad-h);
}

.sp-card-style-logo_badge .sp-card-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: var(--sp-logo-height);
    max-width: var(--sp-logo-max-width);
    width: 100%;
}

.sp-card-style-logo_badge .sp-card-logo img,
.sp-card-style-logo_badge .sp-card-logo .sp-partner-img {
    max-height: var(--sp-logo-height);
    max-width: var(--sp-logo-max-width);
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.sp-card-style-logo_badge .sp-card-info {
    display: flex;
    align-items: center;
    justify-content: center;
}

.sp-card-style-logo_badge .sp-partner-subtitle {
    background: #f1f5f9;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: var(--sp-sub-size);
    letter-spacing: 0.5px;
    display: inline-block;
}

/* Fallback Initial Badge */
.sp-logo-badge {
    width: var(--sp-logo-height);
    height: var(--sp-logo-height);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 700;
    font-size: 14px;
    border-radius: 8px;
    line-height: 1;
    letter-spacing: 0.5px;
    box-sizing: border-box;
}

/* Text Typography */
.sp-partner-name {
    font-size: var(--sp-title-size);
    font-weight: var(--sp-title-weight, 700);
    color: var(--sp-title-color, #1a202c);
    line-height: 1.25;
    margin-bottom: 3px;
    display: block;
}

.sp-partner-subtitle {
    font-size: var(--sp-sub-size);
    font-weight: var(--sp-sub-weight, 600);
    color: var(--sp-sub-color, #718096);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    line-height: 1.2;
    display: block;
}

/* Grid Layout Mode */
.sp-layout-grid .sp-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--sp-card-gap, 18px);
    width: 100%;
}

.sp-layout-grid .sp-partner-card {
    white-space: normal;
    flex-shrink: 1;
    max-width: 100%;
}

/* Manual Slider Layout */
.sp-slider {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
}

.sp-slider-viewport {
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    padding-block: 8px; /* room for the hover lift and shadow */
    outline: none;
    cursor: grab;
}
.sp-slider-viewport::-webkit-scrollbar {
    display: none;
}
.sp-slider-viewport:focus-visible {
    outline: 2px solid var(--sp-title-color, #1a202c);
    outline-offset: 2px;
    border-radius: 6px;
}
.sp-slider.sp-dragging .sp-slider-viewport {
    scroll-snap-type: none;
    cursor: grabbing;
    user-select: none;
}
.sp-slider.sp-dragging .sp-partner-card {
    pointer-events: none;
}

.sp-slider-track {
    display: flex;
    align-items: stretch;
    gap: var(--sp-card-gap, 18px);
    width: max-content;
}

.sp-slider-track .sp-partner-card {
    scroll-snap-align: start;
}

.sp-slider-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--sp-card-border-color, #edf2f7);
    background: var(--sp-card-bg, #ffffff);
    color: var(--sp-title-color, #1a202c);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s, opacity 0.2s;
}
.sp-slider-btn:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}
.sp-slider-btn:focus-visible {
    outline: 2px solid var(--sp-title-color, #1a202c);
    outline-offset: 2px;
}
.sp-slider-btn:disabled {
    opacity: 0.35;
    cursor: default;
    box-shadow: none;
}
/* Everything fits on screen: arrows are not needed */
.sp-slider.sp-slider-static .sp-slider-btn {
    display: none;
}
.sp-slider.sp-slider-static .sp-slider-track {
    margin-inline: auto;
}

/* Responsive fluid scaling of variables on Mobile */
@media (max-width: 768px) {
    .sp-showcase-section {
        --sp-logo-height: max(28px, calc(var(--sp-logo-height-base, 45px) * 0.8));
        --sp-logo-max-width: max(60px, calc(var(--sp-logo-max-width-base, 120px) * 0.75));
        --sp-title-size: max(12px, calc(var(--sp-title-size-base, 14px) * 0.9));
        --sp-sub-size: max(10px, calc(var(--sp-sub-size-base, 10px) * 0.95));
        --sp-card-pad-v: max(8px, calc(var(--sp-card-pad-v-base, 14px) * 0.75));
        --sp-card-pad-h: max(12px, calc(var(--sp-card-pad-h-base, 22px) * 0.75));
        --sp-card-inner-gap: 10px;
    }

    .sp-heading-text {
        font-size: 11px;
        letter-spacing: 1px;
    }

    .sp-card-style-vertical .sp-partner-card,
    .sp-card-style-logo_badge .sp-partner-card {
        min-width: 140px;
    }

    .sp-slider {
        gap: 6px;
    }

    .sp-slider-btn {
        width: 32px;
        height: 32px;
    }
}
