/* ══════════════════════════════════════════════════════════
   Facebook Promoted Carousel
   ══════════════════════════════════════════════════════════ */

/* ── Section container ── */
.fb-carousel-section {
    background: var(--ae-surface);
    border: 1px solid var(--ae-border);
    border-radius: 1rem;
    padding: 1.25rem 1.25rem 1.5rem;
}

/* ── Header row ── */
.fb-carousel-header {
    gap: .75rem;
}

.fb-carousel-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ae-text);
    margin: 0;
}

/* Facebook icon link */
.fb-carousel-fb-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: transform .15s;
}

.fb-carousel-fb-link:hover {
    transform: scale(1.15);
}

/* "Vizitează pagina noastră" text link */
.fb-carousel-page-link {
    font-size: .75rem;
    font-weight: 500;
    color: #1877F2;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    transition: color .15s;
}

.fb-carousel-page-link:hover {
    color: #1464d8;
    text-decoration: underline;
}

.fb-carousel-page-link i {
    font-size: .65rem;
}

/* ── Info tooltip ── */
.fb-carousel-info-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.fb-carousel-info-btn {
    background: none;
    border: none;
    color: var(--ae-muted);
    font-size: .95rem;
    padding: 0 2px;
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    transition: color .15s;
}

.fb-carousel-info-btn:hover {
    color: var(--ae-primary);
}

.fb-carousel-tooltip {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: var(--ae-surface);
    border: 1px solid var(--ae-border);
    border-radius: .6rem;
    padding: .75rem 1rem;
    font-size: .78rem;
    line-height: 1.5;
    color: var(--ae-text);
    width: 270px;
    box-shadow: 0 6px 20px rgba(0,0,0,.1);
    z-index: 300;
}

.fb-carousel-info-wrap:hover .fb-carousel-tooltip,
.fb-carousel-info-wrap.tooltip-open .fb-carousel-tooltip {
    display: block;
}

/* ── CTA Button ── */
.btn-fb-cta {
    background: var(--ae-primary);
    color: #fff !important;
    border: 1px solid var(--ae-primary-700);
    border-radius: .6rem;
    font-size: .78rem;
    font-weight: 600;
    padding: .4rem .9rem;
    white-space: nowrap;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    transition: background .15s, transform .12s, box-shadow .12s;
    box-shadow: 0 4px 12px var(--ae-ring);
}

.btn-fb-cta:hover {
    background: var(--ae-primary-600);
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px var(--ae-ring);
}

.btn-fb-cta:active {
    transform: translateY(0);
}

/* ── Carousel outer wrapper ── */
.fb-carousel-wrapper {
    position: relative;
    padding: 0 52px;
}

/* ── Scrollable track (single row) ── */
.fb-carousel-track {
    display: flex;
    flex-wrap: nowrap;
    gap: 1rem;
    overflow-x: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 4px 0;
    justify-content: center;
}

.fb-carousel-track::-webkit-scrollbar {
    display: none;
}

/* When overflowing (JS adds this class), allow scroll and left-align */
.fb-carousel-track.is-scrollable {
    overflow-x: auto;
    justify-content: flex-start;
}

/* ── Card slots — show max 4 per row ── */
.fb-carousel-item {
    flex: 0 0 calc((100% - 3rem) / 4);
    min-width: 170px;
    max-width: 280px;
}

/* Make the card inside fill the slot */
.fb-carousel-item .card {
    height: 100%;
}

/* ── Arrow buttons — same style as .cat-arrow ── */
.fb-carousel-arrow {
    display: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: #fff;
    border: 1px solid rgba(0,0,0,.15);
    border-radius: 50%;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(0,0,0,.12);
    transition: box-shadow .15s, transform .12s;
    color: inherit;
    font-size: 1rem;
    padding: 0;
}

.fb-carousel-arrow.visible {
    display: inline-flex;
}

.fb-carousel-arrow:hover {
    box-shadow: 0 12px 26px rgba(0,0,0,.18);
    transform: translateY(-50%) scale(1.05);
}

.fb-carousel-arrow--prev {
    left: 6px;
}

.fb-carousel-arrow--next {
    right: 6px;
}

/* Mobile ── */
@media (max-width: 767.98px) {
    .fb-carousel-wrapper {
        padding: 0 44px;
    }
    .fb-carousel-track {
        overflow-x: auto;
        justify-content: flex-start;
    }
    .fb-carousel-item {
        flex: 0 0 170px;
        min-width: 170px;
    }
    /* Anchor tooltip to the button's right edge so it opens leftward and stays on screen */
    .fb-carousel-tooltip {
        left: auto;
        right: 0;
    }
}

/* ── Facebook badge on card ── */
.listing-badge-facebook {
    background: #1877F2;
    color: #fff;
    font-size: .6rem;
    font-weight: 700;
    letter-spacing: .02em;
    padding: .2rem .4rem;
    border-radius: .3rem;
    position: absolute;
    top: .4rem;
    right: .4rem;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    z-index: 5;
    pointer-events: none;
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
