/**
 * Ford Vehicles Showcase / Tabs Widget Styles
 * Theme: Ford Indonesia v2
 */

/* Overwrite body padding-top on mobile without altering main.css */
@media screen and (max-width: 768px) {

    body.page:not(.home):not(.has-main-banner),
    body.single-gallery:not(.has-main-banner),
    body.single-post:not(.has-main-banner) {
        padding-top: 60px !important;
    }
}

.ford-vehicles-tabs-container {
    width: 100%;
    position: relative;
    box-sizing: border-box;
}

/* ==========================================
   1. BANNER
   ========================================== */
.fvts-banner-wrap {
    width: 100%;
    position: relative;
    overflow: hidden;
    margin-bottom: 24px;
    box-sizing: border-box;
}

.fvts-banner-link {
    display: block;
    width: 100%;
    text-decoration: none;
}

.fvts-banner-picture {
    display: block;
    width: 100%;
}

.fvts-banner-img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    vertical-align: middle;
}

/* ==========================================
   CONTENT WRAPPER (EXCLUDES MAIN HERO BANNER)
   ========================================== */
.fvts-content-wrap {
    width: 100%;
    max-width: var(--fvts-content-max-width, 1800px);
    margin-left: auto;
    margin-right: auto;
    padding: 0 1rem;
    box-sizing: border-box;
}

/* ==========================================
   2. HEADER (TITLE & SUBTITLE)
   ========================================== */
.fvts-header {
    margin-bottom: 28px;
    box-sizing: border-box;
}

.fvts-title {
    color: #00095B;
    font-size: 36px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 6px 0;
    font-family: inherit;
}

.fvts-subtitle {
    color: #00095B;
    font-size: 36px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
    font-family: inherit;
}

@media (min-width: 768px) {
    .fvts-banner-wrap {
        margin-bottom: 64px;
        min-height: unset !important;
    }

    .fvts-banner-img {
        width: 100%;
        height: auto !important;
        min-height: unset !important;
        object-fit: cover;
    }

    .fvts-header {
        margin-bottom: 32px;
    }

    .fvts-title {
        font-size: 46px !important;
        line-height: 1.15;
    }

    .fvts-subtitle {
        font-size: 46px !important;
        line-height: 1.15;
    }
}

/* ==========================================
   3. DESKTOP VIEW (> 767px)
   ========================================== */
@media (max-width: 767.98px) {
    .fvts-desktop-view {
        display: none !important;
    }
}

.fvts-tabs-nav-wrap {
    width: 100%;
    border-bottom: 1px solid #066fef;
    margin-bottom: 28px;
    overflow-x: auto;
    scrollbar-width: none;
}

.fvts-tabs-nav-wrap::-webkit-scrollbar {
    display: none;
}

.fvts-tabs-nav {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0;
    max-width: 100%;
}

.fvts-tab-btn {
    appearance: none;
    -webkit-appearance: none;
    flex: 0 0 190px;
    width: 190px;
    min-width: 150px;
    box-sizing: border-box;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-right: 2px solid #ffffff;
    border-bottom: none;
    background-color: #f3f2f2;
    color: #00095B;
    font-size: 14px;
    font-weight: 400;
    padding: 12px 16px;
    cursor: pointer;
    border-radius: 0;
    transition: background-color 0.25s ease, color 0.25s ease;
    outline: none;
    line-height: 1.4;
    white-space: nowrap;
}

.fvts-tab-btn:last-child {
    border-right: none;
}

.fvts-tab-btn:hover {
    background-color: #066fef;
    color: #ffffff;
}

.fvts-tab-btn.active {
    background-color: #066fef;
    border-color: #ffffff;
    color: #ffffff;
    font-weight: 700 !important;
}

/* Desktop Tab Panes Wrapper (> 1024px) */
.fvts-tab-panes {
    width: 100%;
    max-width: var(--fvts-tab-panes-max-width, 1660px);
    margin-left: 0;
    margin-right: auto;
    padding-top: 1.5rem !important;
    padding-left: 4rem;
    box-sizing: border-box;
}

/* Tablet (768px - 1024.98px) */
@media (max-width: 1024.98px) and (min-width: 768px) {
    .fvts-tab-panes {
        padding-left: 2rem;
    }
}

/* Mobile (<= 767.98px) */
@media (max-width: 767.98px) {
    .fvts-tab-panes {
        padding-left: 0;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Desktop Tab Panes */
.fvts-tab-pane {
    display: none;
    width: 100%;
    box-sizing: border-box;
}

.fvts-tab-pane.is-active {
    display: block;
    animation: fvtsFadeIn 0.3s ease;
}

@keyframes fvtsFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tab "All": 4 Vertical Columns Going Downward */
.fvts-desktop-all-columns {
    display: grid;
    grid-template-columns: repeat(var(--fvts-cols-desktop, 4), minmax(0, 1fr));
    gap: 20px;
    align-items: start;
    width: 100%;
    box-sizing: border-box;
}

.fvts-desktop-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
}

/* Category Tabs (SUVs, Pickup Trucks, Performance): Horizontal Rows */
.fvts-desktop-grid {
    display: grid;
    grid-template-columns: repeat(var(--fvts-cols-desktop, 4), minmax(0, 1fr));
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 1199.98px) and (min-width: 768px) {

    .fvts-desktop-all-columns,
    .fvts-desktop-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 899.98px) and (min-width: 768px) {

    .fvts-desktop-all-columns,
    .fvts-desktop-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.fvts-card-item {
    box-sizing: border-box;
    width: 100%;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.fvts-card-item.fvts-is-hidden {
    display: none !important;
}

/* ==========================================
   4. VEHICLE CARD DESIGN
   ========================================== */
.fvts-card {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    height: auto;
    border-radius: 16px;
    overflow: hidden;
    background-color: transparent;
    box-sizing: border-box;
}

.fvts-card.is-clickable {
    cursor: pointer;
}

.fvts-card-img-wrap {
    position: relative;
    width: 100%;
    height: auto;
    z-index: 1;
    overflow: hidden;
    border-radius: 16px;
    line-height: 0;
}

.fvts-card-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 16px;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: auto;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.fvts-card-gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg,
            rgba(0, 0, 0, 0.65) 0%,
            rgba(0, 0, 0, 0.08) 32%,
            rgba(0, 0, 0, 0.12) 65%,
            rgba(0, 0, 0, 0.68) 100%);
    pointer-events: none;
    z-index: 2;
}

.fvts-card-content-top {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 3;
    padding: 20px 18px 0 18px;
    box-sizing: border-box;
}

.fvts-card-title {
    color: #ffffff;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.25;
    text-transform: uppercase;
    margin: 0;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
    font-family: inherit;
    letter-spacing: 0.2px;
}

.fvts-card-content-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 3;
    padding: 0 18px 18px 18px;
    box-sizing: border-box;
    display: flex;
    justify-content: flex-start;
}

.fvts-card-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 16px;
    border-radius: 24px;
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
    text-decoration: none;
    background-color: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: all 0.25s ease;
    line-height: 1.3;
}

.fvts-card:hover .fvts-card-btn,
.fvts-card-btn:hover {
    background-color: #066fef !important;
    border-color: #066fef !important;
    color: #ffffff !important;
}

.fvts-stretched-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 4;
    text-decoration: none;
}

/* ==========================================
   5. MOBILE VIEW (<= 767px) - ACCORDION & SLIDER
   ========================================== */
@media (min-width: 768px) {
    .fvts-mobile-view {
        display: none !important;
    }
}

@media (max-width: 767.98px) {
    .fvts-title {
        font-size: 26px;
    }

    .fvts-subtitle {
        font-size: 20px;
    }

    /* Make mobile accordion full width edge-to-edge with 0 gap */
    .fvts-mobile-view {
        width: calc(100% + 2rem);
        margin-left: -1rem;
        margin-right: -1rem;
    }

    .fvts-accordion {
        display: flex;
        flex-direction: column;
        gap: 0;
        width: 100%;
        box-sizing: border-box;
    }

    .fvts-accordion-item {
        width: 100%;
        border-radius: 0;
        box-sizing: border-box;
        margin-bottom: 2px !important;
        border: none !important;
    }

    .fvts-accordion-item:last-child {
        margin-bottom: 0 !important;
    }

    .fvts-accordion-item.is-active {
        margin-bottom: 0 !important;
        border: none !important;
    }

    .fvts-accordion-header {
        appearance: none;
        -webkit-appearance: none;
        width: calc(100% - 2rem) !important;
        margin-left: 1rem !important;
        margin-right: 1rem !important;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 1rem;
        background-color: #f3f2f2;
        color: #707070;
        border: none;
        cursor: pointer;
        font-size: 15px;
        font-weight: 400;
        text-align: left;
        outline: none;
        box-sizing: border-box;
        transition: background-color 0.25s ease, color 0.25s ease;
    }

    .fvts-accordion-item.is-active .fvts-accordion-header {
        position: relative;
        background-color: #066fef;
        color: #ffffff;
        font-weight: 700 !important;
        border-bottom: 1px solid #066fef;
    }

    .fvts-accordion-item.is-active .fvts-accordion-header::after {
        content: '';
        position: absolute;
        bottom: -1px;
        left: -1rem;
        right: -1rem;
        height: 1px;
        background-color: #066fef;
        pointer-events: none;
    }

    .fvts-accordion-title {
        font-family: inherit;
        font-weight: 400;
        line-height: 1.2;
    }

    .fvts-accordion-item.is-active .fvts-accordion-title {
        font-weight: 700 !important;
    }

    .fvts-accordion-icon {
        font-size: 20px;
        font-weight: 700;
        line-height: 1;
        margin-left: 12px;
        user-select: none;
        color: #066fef;
    }

    .fvts-accordion-item.is-active .fvts-accordion-icon {
        color: #ffffff;
    }

    .fvts-accordion-body {
        width: 100%;
        background-color: #ffffff;
        padding-top: 14px;
        padding-bottom: 4px;
        box-sizing: border-box;
        overflow: hidden;
    }

    .fvts-mobile-slider-wrap {
        width: 100%;
        position: relative;
        overflow: hidden;
    }

    /* 1. Prevent FOUC before slick initializes on mobile */
    .fvts-mobile-slider:not(.slick-initialized) {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: hidden !important;
        gap: 12px !important;
        margin-left: 0 !important;
        padding-left: 1rem !important;
        box-sizing: border-box !important;
    }

    .fvts-mobile-slider:not(.slick-initialized) .fvts-card-item {
        flex: 0 0 calc(85% - 12px) !important;
        max-width: calc(85% - 12px) !important;
        flex-shrink: 0 !important;
        box-sizing: border-box !important;
    }

    /* 2. Slick Carousel initialized */
    .fvts-mobile-slider.slick-slider {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        position: relative;
    }

    .fvts-mobile-slider.slick-slider .slick-list {
        overflow: hidden !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 1rem !important;
        padding-right: 0 !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        touch-action: pan-y !important;
    }

    .fvts-mobile-slider.slick-slider .slick-slide {
        padding-right: 12px !important;
        padding-left: 0 !important;
        height: auto;
        outline: none;
        box-sizing: border-box;
    }

    .fvts-mobile-slider.slick-slider .fvts-card-item {
        width: 100%;
        height: auto;
    }

    .fvts-mobile-slider.slick-slider .fvts-card {
        width: 100%;
        height: auto;
    }

    .fvts-mobile-slider .fvts-card-img {
        user-select: none;
        -webkit-user-select: none;
        -webkit-user-drag: none;
        pointer-events: none;
    }

    /* 3. Slider Nav Arrows Bottom Right */
    .fvts-slider-nav-arrows {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        gap: 6px;
        padding: 6px 1rem 4px 0;
        box-sizing: border-box;
    }

    .fvts-slider-nav-btn {
        appearance: none;
        -webkit-appearance: none;
        width: 32px;
        height: 32px;
        border: none;
        border-radius: 2px;
        background-color: #066fef;
        color: #ffffff;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        outline: none;
        padding: 0;
        transition: opacity 0.2s ease, background-color 0.2s ease;
    }

    .fvts-slider-nav-btn:hover {
        background-color: #0056b3;
    }

    .fvts-slider-nav-btn.slick-disabled,
    .fvts-slider-nav-btn:disabled {
        opacity: 0.35;
        cursor: not-allowed;
    }

    .fvts-no-vehicles {
        padding: 16px;
        color: #777777;
        font-size: 14px;
        margin: 0;
    }
}