/* Berudah Trip Affiliate Hub — all selectors are intentionally scoped. */
.btah,
.btah * {
    box-sizing: border-box;
}

.btah {
    --btah-primary: #0b63ce;
    --btah-accent: #d9a300;
    --btah-text: #10213d;
    --btah-muted: #61738b;
    --btah-border: #dce5f0;
    --btah-surface: #ffffff;
    --btah-soft: #f4f7fb;
    --btah-shadow: 0 24px 70px rgba(9, 37, 77, 0.18);
    color: var(--btah-text);
    font-family: inherit;
    line-height: 1.5;
}

.btah--hub,
.btah--service {
    width: min(100%, 1440px);
    margin-right: auto;
    margin-left: auto;
    border: 1px solid rgba(16, 33, 61, 0.08);
    border-radius: 22px;
    background: var(--btah-surface);
    box-shadow: var(--btah-shadow);
    overflow: hidden;
}

.btah--full {
    max-width: 1180px;
}

.btah--compact {
    max-width: 820px;
    border-radius: 16px;
    box-shadow: 0 14px 38px rgba(9, 37, 77, 0.12);
}

.btah--hero {
    position: relative;
    z-index: 4;
}

.btah-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0;
    padding: 8px;
    border-bottom: 1px solid var(--btah-border);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.btah-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 64px;
    padding: 14px 18px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: #718198;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.btah-tab::after {
    position: absolute;
    right: 22%;
    bottom: 5px;
    left: 22%;
    height: 3px;
    border-radius: 10px;
    background: transparent;
    content: "";
    transition: background-color 180ms ease, left 180ms ease, right 180ms ease;
}

.btah-tab:hover {
    color: var(--btah-primary);
    background: rgba(11, 99, 206, 0.06);
}

.btah-tab.is-active {
    color: var(--btah-primary);
    background: rgba(11, 99, 206, 0.09);
}

.btah-tab.is-active::after {
    right: 13%;
    left: 13%;
    background: var(--btah-accent);
}

.btah-tab:focus-visible,
.btah-button:focus-visible,
.btah-help-link:focus-visible,
.btah-widget-fallback-link:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--btah-accent) 55%, transparent);
    outline-offset: 3px;
}

.btah-icon {
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
}

.btah-panel[hidden] {
    display: none !important;
}

.btah-service-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 28px 34px 20px;
}

.btah-service-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--btah-primary) 10%, white);
    color: var(--btah-primary);
}

.btah-service-icon .btah-icon {
    width: 26px;
    height: 26px;
}

.btah-service-heading {
    min-width: 0;
}

.btah-service-heading h2 {
    margin: 0 0 5px;
    color: var(--btah-text);
    font: inherit;
    font-size: clamp(22px, 2vw, 30px);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.btah-service-heading p {
    max-width: 800px;
    margin: 0;
    color: var(--btah-muted);
    font-size: 15px;
}

.btah--hero .btah-service-header {
    padding-top: 24px;
    padding-bottom: 16px;
}

.btah--hero .btah-service-heading h2 {
    font-size: clamp(20px, 1.7vw, 26px);
}

.btah-widget {
    --btah-widget-height: 520px;
    --btah-widget-mobile-height: var(--btah-widget-height);
    position: relative;
    margin: 0 28px;
    border: 1px solid var(--btah-border);
    border-radius: 16px;
    background: #ffffff;
    overflow: hidden;
}

.btah-widget::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1;
    height: 3px;
    background: linear-gradient(90deg, var(--btah-primary), var(--btah-accent));
    content: "";
    pointer-events: none;
}

.btah-widget iframe {
    display: block;
    width: 100%;
    height: var(--btah-widget-height);
    min-height: var(--btah-widget-height);
    border: 0;
    background: #ffffff;
}

/* The homepage hero uses Trip.com's own interface without duplicate headings. */
.btah--hero .btah-service-content--hero-widget .btah-widget {
    margin: 0;
    border: 0;
    border-radius: 0;
}

.btah--hero .btah-service-content--hero-widget .btah-widget::before {
    display: none;
}

.btah--hero .btah-service-content--hero-widget .btah-widget iframe {
    background: transparent;
}

.btah-fallback {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 0 28px;
    padding: 24px;
    border: 1px dashed color-mix(in srgb, var(--btah-primary) 35%, var(--btah-border));
    border-radius: 16px;
    background:
        radial-gradient(circle at 95% 10%, color-mix(in srgb, var(--btah-accent) 14%, transparent), transparent 34%),
        linear-gradient(135deg, color-mix(in srgb, var(--btah-primary) 7%, white), #ffffff);
}

.btah-fallback-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    border-radius: 18px;
    background: var(--btah-primary);
    color: #ffffff;
    box-shadow: 0 10px 24px color-mix(in srgb, var(--btah-primary) 28%, transparent);
}

.btah-fallback strong {
    display: block;
    margin-bottom: 3px;
    color: var(--btah-text);
    font-size: 17px;
}

.btah-fallback p {
    margin: 0;
    color: var(--btah-muted);
}

.btah-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 22px 28px 16px;
}

.btah-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 50px;
    padding: 13px 24px;
    border: 1px solid transparent;
    border-radius: 13px;
    text-align: center;
    text-decoration: none !important;
    font: inherit;
    font-weight: 800;
    line-height: 1.2;
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.btah-button--primary {
    border-color: color-mix(in srgb, var(--btah-accent) 80%, #6a4f00);
    background: var(--btah-accent);
    color: #172133 !important;
    box-shadow: 0 10px 24px color-mix(in srgb, var(--btah-accent) 28%, transparent);
}

.btah-button--primary:hover {
    color: #111827 !important;
    filter: brightness(1.04);
    transform: translateY(-2px);
    box-shadow: 0 14px 28px color-mix(in srgb, var(--btah-accent) 35%, transparent);
}

.btah-button-arrow {
    font-size: 20px;
    line-height: 1;
    transition: transform 180ms ease;
}

.btah-button:hover .btah-button-arrow {
    transform: translateX(3px);
}

.btah-help-link {
    color: var(--btah-primary) !important;
    text-decoration: none !important;
    font-weight: 700;
}

.btah-help-link:hover {
    text-decoration: underline !important;
}

.btah-actions--widget {
    justify-content: space-between;
    min-height: 42px;
    padding: 9px 24px 8px;
    border-top: 1px solid var(--btah-border);
    background: #ffffff;
}

.btah-widget-fallback-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--btah-primary) !important;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none !important;
}

.btah-widget-fallback-link:hover {
    text-decoration: underline !important;
}

.btah-meta {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 0 28px 25px;
    color: var(--btah-muted);
}

.btah-powered {
    white-space: nowrap;
    font-size: 13px;
    font-weight: 700;
}

.btah-disclosure {
    display: block;
    max-width: 760px;
    text-align: right;
    font-size: 12px;
    line-height: 1.45;
}

.btah-meta--widget {
    gap: 14px;
    padding: 0 24px 12px;
    font-size: 11px;
}

.btah-meta--widget .btah-powered,
.btah-meta--widget .btah-disclosure {
    font-size: 11px;
}

.btah-noscript {
    margin: 0;
    padding: 12px 28px 24px;
    color: var(--btah-muted);
    font-size: 13px;
}

.btah-noscript p {
    margin: 0 0 10px;
}

.btah-noscript-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.btah-noscript-link {
    display: inline-flex;
    padding: 8px 12px;
    border: 1px solid var(--btah-border);
    border-radius: 8px;
    background: var(--btah-soft);
    color: var(--btah-primary) !important;
    text-decoration: none !important;
    font-weight: 700;
}

.btah-admin-notice {
    max-width: 900px;
    margin: 12px auto;
    padding: 14px 18px;
    border-left: 4px solid var(--btah-accent);
    border-radius: 8px;
    background: #fff8dc;
    color: #4c3b00;
    box-shadow: 0 8px 22px rgba(16, 33, 61, 0.08);
}

/* Standalone compact button shortcode. */
.btah.btah-button {
    width: auto;
    margin: 0;
    vertical-align: middle;
}

.btah.btah-button .btah-icon {
    width: 21px;
    height: 21px;
}

.btah--compact .btah-service-header {
    padding: 22px 24px 16px;
}

.btah--compact .btah-widget,
.btah--compact .btah-fallback {
    margin-right: 20px;
    margin-left: 20px;
}

.btah--compact .btah-actions {
    padding-right: 20px;
    padding-left: 20px;
}

.btah--compact .btah-meta {
    padding-right: 20px;
    padding-left: 20px;
}

@media (max-width: 767px) {
    .btah-widget iframe {
        height: var(--btah-widget-mobile-height);
        min-height: var(--btah-widget-mobile-height);
    }

    .btah--hero .btah-service-content--hero-widget .btah-widget {
        margin-right: 0;
        margin-left: 0;
    }

    .btah--hub,
    .btah--service {
        border-radius: 16px;
    }

    .btah-tabs {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 8px;
    }

    .btah-tab {
        justify-content: flex-start;
        min-height: 50px;
        padding: 11px 14px;
    }

    .btah-tab::after {
        top: 12px;
        right: auto;
        bottom: 12px;
        left: 4px;
        width: 3px;
        height: auto;
    }

    .btah-tab.is-active::after {
        right: auto;
        left: 4px;
    }

    .btah-service-header {
        gap: 12px;
        padding: 22px 18px 15px;
    }

    .btah-service-icon {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
        border-radius: 12px;
    }

    .btah-service-heading h2 {
        font-size: 21px;
    }

    .btah-widget,
    .btah-fallback,
    .btah--compact .btah-widget,
    .btah--compact .btah-fallback {
        margin-right: 14px;
        margin-left: 14px;
    }

    .btah-fallback {
        align-items: flex-start;
        padding: 19px;
    }

    .btah-fallback-icon {
        width: 46px;
        height: 46px;
        flex-basis: 46px;
        border-radius: 14px;
    }

    .btah-actions,
    .btah--compact .btah-actions {
        flex-direction: column;
        align-items: stretch;
        padding: 18px 14px 14px;
    }

    .btah-button {
        width: 100%;
    }

    .btah-help-link {
        text-align: center;
    }

    .btah-actions--widget {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 10px 18px;
        padding: 10px 14px;
        text-align: center;
    }

    .btah-widget-fallback-link {
        justify-content: center;
    }

    .btah-meta,
    .btah--compact .btah-meta {
        flex-direction: column;
        gap: 8px;
        padding: 0 14px 20px;
    }

    .btah-disclosure {
        text-align: left;
    }

    .btah-powered {
        white-space: normal;
    }
}

@media (prefers-reduced-motion: reduce) {
    .btah-tab,
    .btah-tab::after,
    .btah-button,
    .btah-button-arrow {
        transition: none !important;
    }
}
