/* Distributors CMS page styles */
@font-face { font-family: 'Gotham'; src: url('../fonts/Gotham-Thin.woff2') format('woff2');             font-weight: 100; font-style: normal; font-display: swap; }
@font-face { font-family: 'Gotham'; src: url('../fonts/Gotham-ThinItalic.woff2') format('woff2');       font-weight: 100; font-style: italic; font-display: swap; }
@font-face { font-family: 'Gotham'; src: url('../fonts/Gotham-ExtraLight.woff2') format('woff2');       font-weight: 200; font-style: normal; font-display: swap; }
@font-face { font-family: 'Gotham'; src: url('../fonts/Gotham-ExtraLightItalic.woff2') format('woff2'); font-weight: 200; font-style: italic; font-display: swap; }
@font-face { font-family: 'Gotham'; src: url('../fonts/Gotham-Light.woff2') format('woff2');            font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'Gotham'; src: url('../fonts/Gotham-Book.woff2') format('woff2');             font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Gotham'; src: url('../fonts/Gotham-Medium.woff2') format('woff2');           font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Gotham'; src: url('../fonts/Gotham-Bold.woff2') format('woff2');             font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Gotham'; src: url('../fonts/Gotham-BoldItalic.woff2') format('woff2');       font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: 'Gotham'; src: url('../fonts/Gotham-Black.woff2') format('woff2');            font-weight: 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Gotham'; src: url('../fonts/Gotham-Ultra.woff2') format('woff2');            font-weight: 950; font-style: normal; font-display: swap; }


/* Layout reference overlay — toggle on while positioning */
body {
    background: black !important;
}

#maincontent {
    padding: 0;
    font-family: 'Gotham', sans-serif;
    font-weight: 400;
    background-size: 100% auto;
    background-repeat: no-repeat;
    background-position: center -120px;
    min-height: 1704px;
    background-color: black !important;
}
#maincontent .columns { 
    padding: 0; 
    background: none !important; 
    width: 100%;
    margin: 0;
}
#maincontent .columns > * {
    display: none;
}
#maincontent .column.main { 
    display: block;
    padding: 0; 
    float: none;
    width: 100%;
}

#m-navigation-product-list-wrapper {
    display: none;
}

/* ---------- Aftertreatment page ---------- */
.aftertreatment-page {
    --brand-green: #2ea83a;
    --dark-bg: #0a0a0a;
    --panel-bg: #f3f3f3;
    --card-bg: #ffffff;
    --muted: #666;
    --rule: #e2e2e2;
    --divider: #d8d8d8;
    color: #fff;
    font-family: 'Gotham', sans-serif;
    background-color: black !important;
    position: relative;
}

/* Reset — wins over theme element rules (h1 / .h1 / p) by class specificity,
   no !important needed. Your own `.at-*` rules (also one class) come later in
   this file and win by source order, so they don't need !important either. */
.aftertreatment-page :where(h1, h2, h3, h4, h5, h6, p, ul, ol, li, figure, blockquote, hr) {
    margin: 0;
    padding: 0;
    font-weight: inherit;
    line-height: inherit;
}
.aftertreatment-page :where(ul, ol) { list-style: none; }
.aftertreatment-page :where(h1, h2, h3, h4, h5, h6) { font-weight: 700; letter-spacing: 0.02em; }
.aftertreatment-page img { display: block; max-width: 100%; height: auto; }
.aftertreatment-page a { color: inherit; text-decoration: none; }
.at-arrow { display: inline-block; margin-left: 4px; font-weight: 700; }

/* 1. Hero */
.at-hero {
    position: relative;
    background-color: black;
    background-image: url('../images/distributors/hero-flag.jpg');
    background-size: 93% 107%;
    background-repeat: no-repeat;
    background-position-x: 184px;
    background-position-y: 41px;
    color: #fff;
    padding: 71px 8px 38px 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
    min-height: 520px;
}
.at-hero::before {
    display: none;
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.55) 60%, rgba(0,0,0,0) 100%);
    pointer-events: none;
}
.at-hero-content, .at-hero-media { position: relative; z-index: 1; }
.at-hero-title {
    color: white;
    font-size: 65px;
    line-height: 1;
    letter-spacing: -0.02em !important;
    padding-top: 54px;
    padding-left: 63px;
}
.at-hero-subtitle {
    color: var(--brand-green);
    font-weight: 700;
    letter-spacing: 0.05em;
    font-size: 21px;
    padding-top: 16px;
    padding-left: 63px;
}
.at-hero-description {
    font-size: 16px;
    line-height: 1.7;
    max-width: 555px;
    color: #d8d8d8;
    padding-top: 21px;
    padding-left: 63px;
}
.at-hero-features {
    display: grid;
    grid-template-columns: repeat(3, max-content);
    gap: 40px;
    margin-top: 36px !important;
    margin-left: 66px !important;
}
.at-hero-feature {
    width: 165px;
    position: relative;
}
.at-hero-feature:nth-child(3) {
    width: 205px;
}
.at-hero-feature:before {
    content: '';
    width: 1px;
    position: absolute;
    top: 0;
    bottom: 0;
    left: -39px;
    background-color: var(--rule);
}
.at-hero-feature:first-child:before {
    display: none;
}
.at-hero-feature-icon {
    width: auto !important;
    height: 50px !important;
    margin-bottom: 10px;
}
.at-hero-feature-title {
    color: white;
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 4px;
    margin-top: 19px !important;
}
.at-hero-feature-desc {
    font-size: 15px;
    line-height: 1.4;
    color: #cfcfcf;
    padding-top: 3px;

}
.at-hero-media { text-align: right; }
.at-hero-product { 
    display: inline-block; 
    max-width: 100%; 
    max-height: 460px; 
    margin-top: 15px;
}

/* 2. Components */
.at-components {
    background: #fff;
    color: #1a1a1a;
    padding: 33px 58px;
    text-align: center;
}
.at-components-title {
    font-size: 26px;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
}
.at-components-title::before,
.at-components-title::after {
    content: '';
    height: 2px;
    background: var(--brand-green);
    flex: 0 1 366px;
}
.at-components-subtitle {
    font-size: 15px;
    color: var(--muted);
}
.at-components-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 18px;
}
.at-component-card {
    background: var(--panel-bg);
    padding: 28px 22px 24px;
    text-align: left;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--rule);
}
.at-component-image-container {
    text-align: center;
    height: 166px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.at-component-image {
    width: auto;
    height: 100% !important;
    object-fit: contain;
    max-width: 222px !important;
}
.at-component-title {
    font-size: 15px;
    letter-spacing: 0.04em;
    color: #1a1a1a;
    margin-bottom: 8px;
    margin-top: 10px;
}
.at-component-desc {
    font-size: 15px;
    line-height: 1.5;
    color: var(--muted);
    flex: 1;
    margin-top: 4px;
}
.at-component-cta {
    color: var(--brand-green) !important;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-top: 15px !important;
    background: black;
    color: white !important;
    text-align: center;
    border: solid 2px black;
    padding: 10px 0;
}
.at-component-cta:hover {
    background: white;
    color: black !important;
}
.at-components-footer { 
    margin-top: 22px; 
    text-align: center; 
}
.at-browse-all {
    display: inline-block;
    border: 2px solid var(--brand-green) !important;
    color: #fff !important;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.06em;
    padding: 13px 33px;
    background: var(--brand-green);
    transition: background 0.2s, color 0.2s;
}
.at-browse-all:hover {
    background: white;
    color: var(--brand-green) !important;
}

/* 3. Built in USA */
.at-usa {
    background-color: var(--dark-bg);
    background-image: url('../images/distributors/3-0-flag.png');
    background-repeat: no-repeat;
    background-position: -174px center;
    background-size: 100% 100%; 
    color: #fff;
    padding: 19px 20px 19px 178px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 67px;
    position: relative;
}
.at-usa::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.2) 35%, rgba(0,0,0,0.9) 70%);
    pointer-events: none;
}
.at-usa-shield, .at-usa-content { position: relative; z-index: 1; }
.at-usa-shield img { width: 100%; max-width: 280px; }
.at-usa-title {
    font-size: 26px;
    letter-spacing: 0.04em;
    margin-top: 12px;
}
.at-usa-description {
    font-size: 16px;
    line-height: 1.7;
    color: #d8d8d8;
    max-width: 620px;
    margin-top: 14px;
}
.at-usa-features {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 26px;
    max-width: 720px;
    margin-top: 30px;
}
.at-usa-feature {
    display: flex;
    gap: 12px;
    position: relative;
}
.at-usa-feature:not(:first-child)::before {
    content: '';
    width: 1px;
    position: absolute;
    top: 0;
    bottom: 0;
    left: -13px;
    background-color: var(--divider);
}
.at-usa-feature-icon {
    width: auto !important;
    height: 52px !important;
    flex: 0 0 43px;
}
.at-usa-feature-label {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1.8;
    margin-top: 2px;
}

/* 4. Need help */
.at-help {
    background: #fff;
    color: #1a1a1a;
    padding: 29px 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    border-bottom: 1px solid var(--rule);
}
.at-help-title {
    font-size: 22px;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}
.at-help-desc {
    font-size: 14px;
    color: var(--muted);
    margin-top: 14px;
}
.at-help-actions {
    display: flex;
    gap: 14px;
    flex: 0 0 auto;
    margin-top: 8px;
}
.at-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 30px;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.06em;
    border: 2px solid var(--brand-green);
    transition: background 0.2s, color 0.2s;
    min-width: 200px;
}
.at-btn:hover {
    background: white !important;
    color: var(--brand-green) !important;
}
.at-btn-primary { background: var(--brand-green); color: #fff !important; }
.at-btn-primary:hover { background: #248c2f; border-color: #248c2f; }
.at-btn-secondary { background: #fff; color: var(--brand-green) !important; }
.at-btn-secondary:hover { background: var(--brand-green); color: #fff !important; }

/* 5. Bottom feature row */
.at-features-row {
    background: #fafafa;
    color: #1a1a1a;
    padding: 28px 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}
.at-features-row-item {
    display: flex;
    align-items: center;
    gap: 14px;
    justify-content: center;
    position: relative;
}
.at-features-row-item:not(:first-child)::before {
    content: '';
    width: 1px;
    position: absolute;
    top: 5px;
    bottom: 5px;
    left: -7px;
    background-color: var(--divider);
}
.at-features-row-icon {
    width: auto !important;
    height: 55px !important;
    flex: 0 0 38px;
}
.at-features-row-text {
    width: 201px;
}
.at-features-row-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}
.at-features-row-desc {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.4;
}

/* ---------- Responsive ---------- */

/* Tablet and below: stack hero + USA, 2-column components/features */
@media (max-width: 1024px) {
    #maincontent { min-height: auto; }

    /* Hero — single column, drop the product image, neutralize huge padding-lefts,
       drop the flag background (looks cramped at narrow widths) */
    .at-hero {
        grid-template-columns: 1fr;
        padding: 40px 24px;
        min-height: 0;
        background-image: none;
        background-color: var(--dark-bg);
    }
    .at-hero::before { display: none; } /* gradient overlay no longer needed */
    .at-hero-media { display: none; }
    .at-hero-title    { padding: 0; font-size: 48px; }
    .at-hero-subtitle { padding: 12px 0 0; }
    .at-hero-description { padding: 16px 0 0; }
    .at-hero-features {
        margin-left: 0 !important;
        margin-top: 28px !important;
    }

    /* Components — 2-col, tighter padding */
    .at-components { padding: 32px 24px; }
    .at-components-grid { grid-template-columns: repeat(2, 1fr); }
    .at-components-title::before,
    .at-components-title::after { flex: 0 1 80px; }

    /* USA — stack, center, drop the 178px left padding */
    .at-usa {
        grid-template-columns: 1fr;
        padding: 32px 24px;
        text-align: center;
        background-position: center;
        background-size: cover;
    }
    .at-usa-shield { margin: 0 auto; }
    .at-usa-shield img { max-width: 220px; margin: 0 auto; }
    .at-usa-description { margin: 14px auto 0; }
    .at-usa-features {
        grid-template-columns: repeat(2, 1fr);
        margin: 28px auto 0;
        gap: 20px;
    }
    .at-usa-feature { justify-content: center; }
    .at-usa-feature:nth-child(3)::before { display: none; } /* divider at row wrap */

    /* Help — stack */
    .at-help {
        flex-direction: column;
        align-items: stretch;
        padding: 32px 24px;
    }
    .at-help-actions { width: 100%; }

    /* Feature row — 2-col */
    .at-features-row {
        grid-template-columns: repeat(2, 1fr);
        padding: 24px 16px;
        gap: 20px 16px;
    }
    .at-features-row-item:nth-child(3)::before { display: none; }
    .at-features-row-text { width: auto; }
}

/* Phone: collapse everything to single column */
@media (max-width: 640px) {
    /* Hero */
    .at-hero { padding: 28px 16px; }
    .at-hero-title { font-size: 36px; line-height: 1.05; }
    .at-hero-subtitle { font-size: 16px; padding-top: 10px; }
    .at-hero-description { font-size: 14px; padding-top: 14px; }
    .at-hero-features {
        grid-template-columns: 1fr;
        gap: 18px;
        margin-left: 0 !important;
        margin-top: 22px !important;
    }
    .at-hero-feature {
        width: 100%;
        padding-left: 0;
        display: grid;
        grid-template-columns: 60px 1fr;   /* fixed icon column so text aligns across rows */
        column-gap: 14px;
        align-items: center;
    }
    .at-hero-feature:nth-child(3) { width: 100%; }
    .at-hero-feature:before { display: none; }       /* no vertical dividers in stack */
    .at-hero-feature-icon {
        grid-row: 1 / span 2;
        justify-self: center;
        align-self: center;
        width: 50px !important;
        height: 50px !important;
        object-fit: contain;
        margin-bottom: 0;
    }
    .at-hero-feature-title { grid-column: 2; margin-top: 0 !important; margin-bottom: 2px; }
    .at-hero-feature-desc  { grid-column: 2; padding-top: 0; }

    /* Components */
    .at-components { padding: 24px 16px; }
    .at-components-grid { grid-template-columns: 1fr; }
    .at-components-title { font-size: 18px; gap: 8px; }
    .at-components-title::before,
    .at-components-title::after { flex: 0 1 30px; }
    .at-component-card { padding: 20px; }
    .at-component-image-container { height: 140px; }
    .at-browse-all { display: block; padding: 13px 16px; }

    /* USA */
    .at-usa { padding: 28px 16px; }
    .at-usa-title { font-size: 20px; }
    .at-usa-description { font-size: 14px; }
    .at-usa-features {
        grid-template-columns: 1fr;
        gap: 16px;
        margin: 24px 0 0;       /* left-align block (override tablet `auto`) */
    }
    .at-usa-feature {
        justify-content: flex-start;
        display: grid;
        grid-template-columns: 60px 1fr;
        column-gap: 14px;
        align-items: center;
        text-align: left;
    }
    .at-usa-feature-icon {
        justify-self: center;
        align-self: center;
        width: 50px !important;
        height: 50px !important;
        object-fit: contain;
        flex: none;
    }
    .at-usa-feature:not(:first-child)::before { display: none; }

    /* Help */
    .at-help { padding: 24px 16px; gap: 10px;}
    .at-help-title { font-size: 18px; }
    .at-help-actions { flex-direction: column; gap: 10px; }
    .at-btn { width: 100%; min-width: 0; }

    /* Feature row */
    .at-features-row { grid-template-columns: 1fr; padding: 20px 16px; gap: 14px; }
    .at-features-row-item {
        justify-content: flex-start;
        display: grid;
        grid-template-columns: 60px 1fr;
        column-gap: 14px;
        align-items: center;
        text-align: left;
    }
    .at-features-row-item:not(:first-child)::before { display: none; }
    .at-features-row-icon {
        justify-self: center;
        align-self: center;
        width: 50px !important;
        height: 50px !important;
        object-fit: contain;
        flex: none;
    }
    .at-features-row-text { width: auto; max-width: 240px; }
}

.aftertreatment-page { visibility: visible !important; }
