.ffs-dd-directory {
    width: 100%;
    margin: 0;
    padding: var(--ffs-dd-pad-top) var(--ffs-dd-pad-x) var(--ffs-dd-pad-bottom);
    background: var(--ffs-dd-bg);
    color: var(--ffs-dd-text);
    box-sizing: border-box;
}

.ffs-dd-directory *,
.ffs-dd-directory *::before,
.ffs-dd-directory *::after {
    box-sizing: border-box;
}

.ffs-dd-inner {
    width: 100%;
    max-width: var(--ffs-dd-max);
    margin: 0 auto;
}

.ffs-dd-intro {
    max-width: 840px;
}

.ffs-dd-intro h1 {
    margin: 0 0 28px;
    color: inherit;
    font-size: var(--ffs-dd-title-desktop);
    font-weight: 900;
    line-height: 1.02;
    letter-spacing: -0.025em;
    text-transform: uppercase;
}

.ffs-dd-description {
    color: inherit;
    font-size: var(--ffs-dd-description-size);
    line-height: 1.85;
}

.ffs-dd-description p {
    margin: 0;
}

.ffs-dd-divider {
    width: 100%;
    margin: 48px 0 22px;
}

.ffs-dd-divider img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}

.ffs-dd-team {
    margin-top: 34px;
}

.ffs-dd-team h2 {
    margin: 0 0 22px;
    color: var(--ffs-dd-team-color);
    font-size: var(--ffs-dd-team-desktop);
    font-weight: 900;
    line-height: 1.04;
    letter-spacing: -0.025em;
    text-transform: uppercase;
}

.ffs-dd-grid {
    display: grid;
    grid-template-columns: repeat(var(--ffs-dd-cols-desktop), minmax(0, 1fr));
    column-gap: var(--ffs-dd-gap-x);
    row-gap: var(--ffs-dd-gap-y);
}

.ffs-dd-card {
    position: relative;
    display: block;
    min-width: 0;
    color: inherit;
    text-decoration: none !important;
    transition: transform 180ms ease, opacity 180ms ease;
}

.ffs-dd-card:hover,
.ffs-dd-card:focus-visible {
    transform: translateY(-3px);
    opacity: 0.94;
}

.ffs-dd-card img {
    display: block;
    width: 100%;
    height: auto;
    margin: 0;
    object-fit: cover;
}

.ffs-dd-card.is-not-linked:hover {
    transform: none;
    opacity: 1;
}

.ffs-dd-empty-admin {
    margin: 20px;
    padding: 16px;
    border: 1px dashed #c3c4c7;
    background: #fff8e5;
    color: #1d2327;
}

@media (min-width: 1025px) {
    .ffs-dd-directory.is-hidden-desktop { display: none !important; }

    body.ffs-dd-hide-products:not(.ffs-dd-dir-hidden-desktop) .woocommerce-ordering,
    body.ffs-dd-hide-products:not(.ffs-dd-dir-hidden-desktop) .woocommerce-result-count,
    body.ffs-dd-hide-products:not(.ffs-dd-dir-hidden-desktop) ul.products,
    body.ffs-dd-hide-products:not(.ffs-dd-dir-hidden-desktop) nav.woocommerce-pagination,
    body.ffs-dd-hide-products:not(.ffs-dd-dir-hidden-desktop) .woocommerce-pagination,
    body.ffs-dd-hide-products:not(.ffs-dd-dir-hidden-desktop) .ffs-category-studio .ffs-cs-products {
        display: none !important;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .ffs-dd-directory.is-hidden-tablet { display: none !important; }

    body.ffs-dd-hide-products:not(.ffs-dd-dir-hidden-tablet) .woocommerce-ordering,
    body.ffs-dd-hide-products:not(.ffs-dd-dir-hidden-tablet) .woocommerce-result-count,
    body.ffs-dd-hide-products:not(.ffs-dd-dir-hidden-tablet) ul.products,
    body.ffs-dd-hide-products:not(.ffs-dd-dir-hidden-tablet) nav.woocommerce-pagination,
    body.ffs-dd-hide-products:not(.ffs-dd-dir-hidden-tablet) .woocommerce-pagination,
    body.ffs-dd-hide-products:not(.ffs-dd-dir-hidden-tablet) .ffs-category-studio .ffs-cs-products {
        display: none !important;
    }

    .ffs-dd-intro h1 {
        font-size: var(--ffs-dd-title-tablet);
    }

    .ffs-dd-grid {
        grid-template-columns: repeat(var(--ffs-dd-cols-tablet), minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .ffs-dd-directory.is-hidden-mobile { display: none !important; }

    body.ffs-dd-hide-products:not(.ffs-dd-dir-hidden-mobile) .woocommerce-ordering,
    body.ffs-dd-hide-products:not(.ffs-dd-dir-hidden-mobile) .woocommerce-result-count,
    body.ffs-dd-hide-products:not(.ffs-dd-dir-hidden-mobile) ul.products,
    body.ffs-dd-hide-products:not(.ffs-dd-dir-hidden-mobile) nav.woocommerce-pagination,
    body.ffs-dd-hide-products:not(.ffs-dd-dir-hidden-mobile) .woocommerce-pagination,
    body.ffs-dd-hide-products:not(.ffs-dd-dir-hidden-mobile) .ffs-category-studio .ffs-cs-products {
        display: none !important;
    }

    .ffs-dd-directory {
        padding-right: min(var(--ffs-dd-pad-x), 32px);
        padding-left: min(var(--ffs-dd-pad-x), 32px);
    }

    .ffs-dd-intro h1 {
        margin-bottom: 22px;
        font-size: var(--ffs-dd-title-mobile);
    }

    .ffs-dd-description {
        line-height: 1.75;
    }

    .ffs-dd-divider {
        margin-top: 36px;
        margin-bottom: 18px;
    }

    .ffs-dd-team {
        margin-top: 30px;
    }

    .ffs-dd-team h2 {
        margin-bottom: 18px;
        font-size: var(--ffs-dd-team-mobile);
    }

    .ffs-dd-grid {
        grid-template-columns: repeat(var(--ffs-dd-cols-mobile), minmax(0, 1fr));
    }
}

/* =========================================================
   v1.0.2 - Premium Teams & Drivers landing page
   Scoped to .ffs-dd-directory--premium, which PHP outputs ONLY for
   product-category/teams-drivers. Existing category layouts stay untouched.
   No JS is required: filters are native anchor links and all images stay lazy.
   ========================================================= */
.ffs-dd-directory--premium {
    --ffs-dd-premium-red: #ef1b24;
    background: #f7f7f7 !important;
    color: #111 !important;
    padding-top: 34px;
    padding-bottom: 52px;
}

.ffs-dd-directory--premium .ffs-dd-premium {
    width: 100%;
    max-width: min(var(--ffs-dd-max), 1180px);
    margin: 0 auto;
}

.ffs-dd-premium-intro {
    padding: 8px 0 18px;
    text-align: center;
}

.ffs-dd-premium-kicker {
    margin-bottom: 10px;
    color: #333;
    font-family: "Montserrat", Arial, sans-serif !important;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: .28em;
    text-transform: uppercase;
}

.ffs-dd-premium-title {
    margin: 0 !important;
    color: #080808 !important;
    font-family: "Montserrat", Arial, sans-serif !important;
    font-size: clamp(34px, 5vw, 58px) !important;
    font-weight: 900 !important;
    line-height: .98 !important;
    letter-spacing: -.045em !important;
    text-transform: uppercase !important;
}

.ffs-dd-premium-subtitle {
    max-width: 680px;
    margin: 12px auto 0;
    color: #747474;
    font-family: "Montserrat", Arial, sans-serif !important;
    font-size: 16px;
    line-height: 1.5;
}

.ffs-dd-premium-filters {
    display: flex;
    width: 100%;
    gap: 10px;
    margin: 14px 0 28px;
    padding: 3px 0 6px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.ffs-dd-premium-filters::-webkit-scrollbar { display: none; }

.ffs-dd-premium-filters a {
    display: inline-flex;
    min-height: 42px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 22px;
    border: 1px solid #e6e6e6;
    border-radius: 999px;
    background: #ededed;
    color: #1b1b1b !important;
    font-family: "Montserrat", Arial, sans-serif !important;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none !important;
    white-space: nowrap;
    transition: transform .16s ease, background-color .16s ease;
}

.ffs-dd-premium-filters a:first-child,
.ffs-dd-premium-filters a.is-active {
    border-color: var(--ffs-dd-premium-red);
    background: var(--ffs-dd-premium-red);
    color: #fff !important;
}

.ffs-dd-premium-filters a:hover { transform: translateY(-1px); }


.ffs-dd-premium-filter-logo {
    display: block;
    width: auto;
    height: 22px;
    max-width: 58px;
    flex: 0 0 auto;
    margin: 0 !important;
    border-radius: 0 !important;
    object-fit: contain;
    object-position: center;
}

/* v1.0.5: logo-only filter chips keep the whole horizontal logo visible.
   Width is driven by the image aspect ratio instead of forcing a square crop. */
.ffs-dd-premium-filters a.is-logo-only {
    min-width: 72px;
    padding-left: 10px;
    padding-right: 10px;
}

.ffs-dd-premium-filters a.is-logo-only .ffs-dd-premium-filter-logo {
    width: auto;
    height: 24px;
    max-width: 64px;
}


.ffs-dd-premium-teams {
    display: grid;
    gap: 24px;
}

.ffs-dd-premium-team {
    scroll-margin-top: 130px;
}

.ffs-dd-premium-team-banner {
    position: relative;
    display: block;
    min-height: 190px;
    overflow: hidden;
    border-radius: 18px;
    background:
        linear-gradient(115deg, color-mix(in srgb, var(--ffs-dd-premium-accent) 88%, #050505) 0%, var(--ffs-dd-premium-accent) 54%, #111 100%);
    box-shadow: 0 10px 30px rgba(0,0,0,.08);
    color: #fff !important;
    text-decoration: none !important;
    isolation: isolate;
}

.ffs-dd-premium-team-image {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    object-fit: cover;
    object-position: center;
    transform: scale(1.015);
}

/* If Teamname is blank, show only the configured banner/logo media.
   The banner remains clickable when a team link is available. */
.ffs-dd-premium-team-banner.is-media-only {
    /* Same team-colour gradient as the original premium banner, even when
       the visible Teamname has been intentionally left blank. */
    background:
        linear-gradient(115deg, color-mix(in srgb, var(--ffs-dd-premium-accent) 88%, #050505) 0%, var(--ffs-dd-premium-accent) 54%, #111 100%);
}

.ffs-dd-premium-team-banner.is-media-only .ffs-dd-premium-team-image {
    inset: 12px;
    width: calc(100% - 24px);
    height: calc(100% - 24px);
    object-fit: contain;
    object-position: center;
    transform: none;
}


.ffs-dd-premium-team-shade {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(90deg, rgba(0,0,0,.72) 0%, rgba(0,0,0,.46) 43%, rgba(0,0,0,.12) 75%, rgba(0,0,0,.20) 100%),
        linear-gradient(135deg, color-mix(in srgb, var(--ffs-dd-premium-accent) 54%, transparent) 0%, transparent 55%);
    pointer-events: none;
}

.ffs-dd-premium-team-copy {
    position: relative;
    z-index: 2;
    display: flex;
    min-height: 190px;
    width: min(58%, 560px);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 24px 28px;
    color: #fff;
}

.ffs-dd-premium-team-copy small,
.ffs-dd-premium-driver-copy small {
    font-family: "Montserrat", Arial, sans-serif !important;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .25em;
    text-transform: uppercase;
    opacity: .78;
}

.ffs-dd-premium-team-copy strong {
    margin-top: 4px;
    font-family: "Montserrat", Arial, sans-serif !important;
    font-size: clamp(30px, 4.2vw, 54px);
    font-weight: 900;
    line-height: .95;
    letter-spacing: -.04em;
    text-transform: uppercase;
}

.ffs-dd-premium-team-copy em {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    gap: 9px;
    margin-top: 18px;
    padding: 0 18px;
    border-radius: 999px;
    background: var(--ffs-dd-premium-red);
    color: #fff;
    font-family: "Montserrat", Arial, sans-serif !important;
    font-size: 12px;
    font-style: normal;
    font-weight: 800;
    letter-spacing: .02em;
}

.ffs-dd-premium-team-copy em span { font-size: 22px; line-height: 1; }

.ffs-dd-premium-driver-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 12px 0 0;
}

.ffs-dd-premium-driver {
    position: relative;
    display: grid;
    min-height: 138px;
    grid-template-columns: minmax(105px, 42%) minmax(0, 1fr) 28px;
    align-items: center;
    overflow: hidden;
    border: 1px solid #ececec;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 7px 22px rgba(0,0,0,.045);
    color: #101010 !important;
    text-decoration: none !important;
    transition: transform .16s ease, box-shadow .16s ease;
}

.ffs-dd-premium-driver:hover,
.ffs-dd-premium-driver:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 11px 28px rgba(0,0,0,.08);
}

.ffs-dd-premium-driver-media {
    display: block;
    align-self: stretch;
    min-width: 0;
    overflow: hidden;
    background: color-mix(in srgb, var(--ffs-dd-premium-accent) 9%, #f3f3f3);
}

.ffs-dd-premium-driver-image {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 138px;
    margin: 0 !important;
    border-radius: 0 !important;
    object-fit: cover;
    object-position: center;
}

.ffs-dd-premium-driver-copy {
    min-width: 0;
    padding: 16px 12px 16px 16px;
}

.ffs-dd-premium-driver-copy strong {
    display: block;
    margin-top: 5px;
    color: #111;
    font-family: "Montserrat", Arial, sans-serif !important;
    font-size: clamp(15px, 1.35vw, 21px);
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: -.035em;
    text-transform: uppercase;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
}

.ffs-dd-premium-driver-arrow {
    display: inline-flex;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    border-radius: 50%;
    color: #111;
    font-family: Arial, sans-serif;
    font-size: 27px;
    line-height: 1;
}

@media (max-width: 767px) {
    .ffs-dd-directory--premium {
        padding: 24px 14px 42px !important;
    }

    .ffs-dd-premium-intro {
        padding: 5px 4px 14px;
    }

    .ffs-dd-premium-kicker {
        margin-bottom: 8px;
        font-size: 9px;
        letter-spacing: .23em;
    }

    .ffs-dd-premium-title {
        font-size: clamp(28px, 9.2vw, 38px) !important;
        letter-spacing: -.04em !important;
    }

    .ffs-dd-premium-subtitle {
        margin-top: 9px;
        font-size: 13px;
        line-height: 1.45;
    }

    .ffs-dd-premium-filters {
        margin: 10px 0 18px;
        gap: 8px;
    }

    .ffs-dd-premium-filters a {
        min-height: 38px;
        gap: 6px;
        padding: 0 15px;
        font-size: 12px;
    }

    .ffs-dd-premium-filter-logo {
        width: auto;
        height: 18px;
        max-width: 48px;
        flex: 0 0 auto;
    }

    .ffs-dd-premium-filters a.is-logo-only {
        min-width: 66px;
        padding-left: 8px;
        padding-right: 8px;
    }

    .ffs-dd-premium-filters a.is-logo-only .ffs-dd-premium-filter-logo {
        width: auto;
        height: 20px;
        max-width: 56px;
    }

    .ffs-dd-premium-teams { gap: 20px; }

    .ffs-dd-premium-team-banner,
    .ffs-dd-premium-team-copy {
        min-height: 126px;
    }

    .ffs-dd-premium-team-banner { border-radius: 13px; }

    .ffs-dd-premium-team-copy {
        width: 66%;
        padding: 17px 18px;
    }

    .ffs-dd-premium-team-copy small { font-size: 8px; }

    .ffs-dd-premium-team-copy strong {
        font-size: clamp(24px, 8.2vw, 34px);
    }

    .ffs-dd-premium-team-copy em {
        min-height: 34px;
        margin-top: 11px;
        padding: 0 13px;
        font-size: 9px;
    }

    .ffs-dd-premium-team-copy em span { font-size: 18px; }

    .ffs-dd-premium-driver-grid {
        gap: 8px;
        padding-top: 8px;
    }

    .ffs-dd-premium-driver {
        min-height: 104px;
        grid-template-columns: minmax(72px, 41%) minmax(0, 1fr) 16px;
        border-radius: 12px;
    }

    .ffs-dd-premium-driver-image { min-height: 104px; }

    .ffs-dd-premium-driver-copy { padding: 10px 4px 10px 9px; }

    .ffs-dd-premium-driver-copy small {
        font-size: 7px;
        letter-spacing: .16em;
    }

    .ffs-dd-premium-driver-copy strong {
        margin-top: 4px;
        font-size: clamp(10.5px, 3.25vw, 14px);
        line-height: 1.08;
        letter-spacing: -.045em;
        overflow-wrap: normal;
        word-break: normal;
        hyphens: none;
    }

    .ffs-dd-premium-driver-arrow {
        width: 16px;
        height: 19px;
        margin-right: 3px;
        font-size: 20px;
    }
}

@supports not (background: color-mix(in srgb, red 50%, blue)) {
    .ffs-dd-premium-team-banner { background: var(--ffs-dd-premium-accent); }
    .ffs-dd-premium-team-shade { background: linear-gradient(90deg, rgba(0,0,0,.72), rgba(0,0,0,.12)); }
    .ffs-dd-premium-driver-media { background: #f3f3f3; }
}
