/* ============================================
   Brand Logo Marquee - Elementor Addon
   Prefix: prbm- (to avoid theme conflicts)
   ============================================ */

.prbm-brand-section {
    position: relative;
    overflow: hidden;
}

.prbm-brand-container {
    width: 100%;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header */
.prbm-brand-header {
    margin-bottom: 28px;
}

.prbm-section-title {
    margin: 0 0 10px;
    padding: 0;
}

.prbm-section-description {
    margin: 0 auto 28px;
    padding: 0;
    max-width: 820px;
}

/* Marquee Container */
.prbm-brand-marquee {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    background: linear-gradient(180deg, #fafafa 0%, #f5f5f5 100%);
    border: 1px solid rgba(0, 0, 0, 0.06);
    padding: 22px 0;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.05);
}

/* Fade Edges — color overridable via Elementor style control */
.prbm-brand-marquee::before,
.prbm-brand-marquee::after {
    content: "";
    position: absolute;
    top: 0;
    width: 90px;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.prbm-brand-marquee::before {
    left: 0;
    background: linear-gradient(90deg, #f5f5f5 0%, rgba(245, 245, 245, 0) 100%);
}

.prbm-brand-marquee::after {
    right: 0;
    background: linear-gradient(270deg, #f5f5f5 0%, rgba(245, 245, 245, 0) 100%);
}

/* Animation Track */
.prbm-brand-track {
    display: flex;
    align-items: center;
    gap: 18px;
    width: max-content;
    padding: 0 18px;
    animation: prbmMarqueeLeft 28s linear infinite;
    will-change: transform;
}

/* Brand Cards */
.prbm-brand-card {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 170px;
    min-height: 96px;
    padding: 18px 24px;
    background: #fff;
    border-radius: 18px;
    border: 1px solid rgba(0, 0, 0, 0.07);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
    text-decoration: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    position: relative;
}

.prbm-brand-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.12);
}

/* Logo Image */
.prbm-brand-card img {
    display: block;
    width: 100%;
    max-width: 120px;
    max-height: 46px;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.9;
    transition: filter 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
}

.prbm-brand-card:hover img {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.03);
}

/* Brand Name */
.prbm-brand-name {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    text-align: center;
    margin-top: 8px;
}

/* Name Position Layouts */
.prbm-name-left,
.prbm-name-right {
    flex-direction: row;
    gap: 10px;
}

.prbm-name-above,
.prbm-name-below {
    flex-direction: column;
    gap: 8px;
}

.prbm-name-left .prbm-brand-name,
.prbm-name-right .prbm-brand-name {
    margin-top: 0;
}

/* Tooltip */
.prbm-has-tooltip {
    cursor: pointer;
}

.prbm-brand-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    background: #1a1a1a;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.prbm-brand-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1a1a1a;
}

.prbm-brand-card:hover .prbm-brand-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Tooltip Positions */
.prbm-tooltip-bottom {
    bottom: auto;
    top: calc(100% + 10px);
    transform: translateX(-50%) translateY(-5px);
}

.prbm-tooltip-bottom::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: #1a1a1a;
}

.prbm-tooltip-left {
    bottom: auto;
    left: auto;
    right: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%) translateX(5px);
}

.prbm-tooltip-left::after {
    top: 50%;
    left: 100%;
    bottom: auto;
    transform: translateY(-50%);
    border-top-color: transparent;
    border-left-color: #1a1a1a;
}

.prbm-tooltip-right {
    bottom: auto;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%) translateX(-5px);
}

.prbm-tooltip-right::after {
    top: 50%;
    left: auto;
    right: 100%;
    bottom: auto;
    transform: translateY(-50%);
    border-top-color: transparent;
    border-right-color: #1a1a1a;
}

/* Image Link Wrapper */
.prbm-brand-image-link {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

/* ── Animation Keyframes ──────────────────────────────────────────────────── */
@keyframes prbmMarqueeLeft {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes prbmMarqueeRight {
    0%   { transform: translateX(-50%); }
    100% { transform: translateX(0); }
}

/* Direction classes */
.prbm-direction-left .prbm-brand-track {
    animation-name: prbmMarqueeLeft;
}

.prbm-direction-right .prbm-brand-track {
    animation-name: prbmMarqueeRight;
}

/* ── Pause States ────────────────────────────────────────────────────────── */
/* Pause on hover */
.prbm-pause-hover.prbm-brand-marquee:hover .prbm-brand-track,
.prbm-pause-hover.prbm-brand-marquee.is-paused .prbm-brand-track {
    animation-play-state: paused;
}

/* Pause on touch (was missing — fixed) */
.prbm-pause-touch.prbm-brand-marquee.is-paused .prbm-brand-track {
    animation-play-state: paused;
}

/* ── Reduced Motion ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .prbm-reduced-motion .prbm-brand-track {
        animation: none;
        transform: none;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .prbm-reduced-motion .prbm-brand-track::-webkit-scrollbar {
        display: none;
    }
    .prbm-reduced-motion .prbm-brand-card {
        scroll-snap-align: start;
    }
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 991px) {
    .prbm-brand-card {
        min-width: 150px;
        min-height: 88px;
        padding: 16px 20px;
    }
    .prbm-brand-track {
        gap: 14px;
    }
    .prbm-brand-marquee::before,
    .prbm-brand-marquee::after {
        width: 55px;
    }
}

@media (max-width: 767px) {
    .prbm-brand-marquee {
        border-radius: 22px;
        padding: 16px 0;
    }
    .prbm-brand-card {
        min-width: 132px;
        min-height: 78px;
        padding: 14px 16px;
        border-radius: 14px;
    }
    .prbm-brand-card img {
        max-width: 98px;
        max-height: 38px;
    }
    .prbm-brand-marquee::before,
    .prbm-brand-marquee::after {
        width: 35px;
    }
}
