/* ================================================================
   CBS GLOBAL — Design Tokens + Reset + Base Components
   CBS Compresores · cbscompresores.com.mx
   ================================================================ */

/* ── Design Tokens ── */
:root {
    /* Brand colors */
    --cbs-blue:       #25377B;
    --cbs-blue-dark:  #1a2855;
    --cbs-blue-light: #2d4399;
    --cbs-red:        #C82333;
    --cbs-red-dark:   #a71d2a;
    --cbs-orange:     #E8731A;
    --cbs-white:      #FFFFFF;

    /* Neutrals */
    --cbs-gray-50:   #F9FAFB;
    --cbs-gray-100:  #F0F2F5;
    --cbs-gray-200:  #E5E7EB;
    --cbs-gray-300:  #D1D5DB;
    --cbs-gray-400:  #9CA3AF;
    --cbs-gray-500:  #6B7280;
    --cbs-gray-600:  #4B5563;
    --cbs-gray-700:  #374151;
    --cbs-gray-800:  #1F2937;
    --cbs-gray-900:  #111827;

    /* Typography */
    --font-main: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --text-xs:   0.75rem;
    --text-sm:   0.875rem;
    --text-base: 1rem;
    --text-lg:   1.125rem;
    --text-xl:   1.25rem;
    --text-2xl:  1.5rem;
    --text-3xl:  clamp(1.5rem, 3vw + 0.5rem, 2rem);
    --text-4xl:  clamp(1.75rem, 3vw + 0.5rem, 2.5rem);
    --text-5xl:  clamp(2rem, 4vw + 0.5rem, 3.5rem);

    /* Spacing */
    --space-xs:  0.25rem;
    --space-sm:  0.5rem;
    --space-md:  1rem;
    --space-lg:  1.5rem;
    --space-xl:  2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 6rem;

    /* Layout */
    --content-max: 1140px;
    --content-wide: 1320px;
    --radius-sm:   4px;
    --radius-md:   8px;
    --radius-lg:   12px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm:  0 1px 2px rgba(0,0,0,.05);
    --shadow-md:  0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
    --shadow-lg:  0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
    --shadow-xl:  0 20px 25px -5px rgba(0,0,0,.1), 0 8px 10px -6px rgba(0,0,0,.1);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
    --transition-theme: 250ms ease;

    /* Semantic tokens (light mode default) */
    --bg-body:        #FFFFFF;
    --bg-surface:     #F9FAFB;
    --bg-card:        #FFFFFF;
    --text-body:      #111827;
    --text-heading:   #25377B;
    --text-secondary: #4B5563;
    --text-muted:     #6B7280;
    --text-on-brand:  #FFFFFF;
    --border-color:   #E5E7EB;
}

/* ── Dark Mode ── */
[data-theme="dark"] {
    --bg-body:        #0f172a;
    --bg-surface:     #1e293b;
    --bg-card:        #1e293b;
    --text-body:      #e2e8f0;
    --text-heading:   #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted:     #64748b;
    --text-on-brand:  #FFFFFF;
    --border-color:   #334155;

    /* DO NOT override --cbs-white — it breaks white text on hero/buttons */
    --cbs-gray-50:   #1e293b;
    --cbs-gray-100:  #1e293b;
    --cbs-gray-200:  #334155;
    --cbs-gray-300:  #475569;
    --cbs-gray-400:  #64748b;
    --cbs-gray-500:  #94a3b8;
    --cbs-gray-600:  #cbd5e1;
    --cbs-gray-700:  #e2e8f0;
    --cbs-gray-800:  #f1f5f9;
    --cbs-gray-900:  #f8fafc;

    --shadow-sm:  0 1px 2px rgba(0,0,0,.3);
    --shadow-md:  0 4px 6px -1px rgba(0,0,0,.4), 0 2px 4px -2px rgba(0,0,0,.3);
    --shadow-lg:  0 10px 15px -3px rgba(0,0,0,.4), 0 4px 6px -4px rgba(0,0,0,.3);
    --shadow-xl:  0 20px 25px -5px rgba(0,0,0,.5), 0 8px 10px -6px rgba(0,0,0,.4);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--text-body, var(--cbs-gray-900));
    background: var(--bg-body, var(--cbs-white));
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    transition: background-color var(--transition-theme), color var(--transition-theme);
}

img, video, svg { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, h5, h6 { margin: 0; line-height: 1.2; font-weight: 700; }
p { margin: 0 0 var(--space-md); }
p:last-child { margin-bottom: 0; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }

/* ── Montserrat Self-Hosted ── */
@font-face {
    font-family: 'Montserrat';
    src: url('../fonts/montserrat-v31-latin-regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Montserrat';
    src: url('../fonts/montserrat-v31-latin-600.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Montserrat';
    src: url('../fonts/montserrat-v31-latin-700.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ── Layout ── */
.cbs-container {
    width: 100%;
    max-width: var(--content-max);
    margin-inline: auto;
    padding-inline: var(--space-md);
}

.cbs-container--wide {
    max-width: var(--content-wide);
}

.cbs-section {
    padding-block: var(--space-xl);
}

.cbs-section--gray {
    background: var(--cbs-gray-50);
}

.cbs-section--blue {
    background: var(--cbs-blue);
    color: #FFFFFF;
}

.cbs-section--dark {
    background: var(--cbs-blue-dark);
    color: #FFFFFF;
}

/* ── Grid ── */
.cbs-grid {
    display: grid;
    gap: var(--space-lg);
}

.cbs-grid-2 { grid-template-columns: repeat(2, 1fr); }
.cbs-grid-3 { grid-template-columns: repeat(3, 1fr); }
.cbs-grid-4 { grid-template-columns: repeat(4, 1fr); }
.cbs-grid-6 { grid-template-columns: repeat(6, 1fr); gap: var(--space-md); }

@media (max-width: 768px) {
    .cbs-grid-2,
    .cbs-grid-3,
    .cbs-grid-4 { grid-template-columns: 1fr; }
    .cbs-grid-6 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .cbs-grid-3 { grid-template-columns: repeat(2, 1fr); }
    .cbs-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .cbs-grid-6 { grid-template-columns: repeat(3, 1fr); }
}

/* ── Typography ── */
.cbs-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--text-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--cbs-red);
    margin-bottom: var(--space-sm);
}
.cbs-eyebrow::before {
    content: '';
    display: inline-block;
    width: 40px;
    height: 2px;
    background: var(--cbs-red);
}

.cbs-eyebrow--center {
    justify-content: center;
}

.cbs-eyebrow--center::after {
    content: '';
    display: inline-block;
    width: 40px;
    height: 2px;
    background: var(--cbs-red);
}

[data-theme="dark"] .cbs-eyebrow {
    color: #FFFFFF;
}
[data-theme="dark"] .cbs-eyebrow::before {
    background: var(--cbs-red);
}
[data-theme="dark"] .cbs-eyebrow--center::after {
    background: var(--cbs-red);
}

/* Mobile: center headers, add ::after line, justify text, center buttons */
@media (max-width: 768px) {
    .cbs-section__header,
    .cbs-section__header > div {
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }
    .cbs-section__header > * {
        width: 100%;
    }
    .cbs-eyebrow {
        justify-content: center;
    }
    .cbs-eyebrow::after {
        content: '';
        display: inline-block;
        width: 40px;
        height: 2px;
        background: var(--cbs-red);
    }
    .cbs-heading {
        text-align: center;
    }
    .cbs-empresa__text {
        text-align: center;
    }
    .cbs-empresa__desc {
        text-align: justify;
    }
    .cbs-empresa__text .cbs-btn {
        display: inline-flex;
        justify-content: center;
    }
    .cbs-card__body {
        text-align: justify;
    }
    .cbs-card__body .cbs-btn {
        align-self: center;
        text-align: center;
    }
}

.cbs-heading {
    font-size: var(--text-4xl);
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: var(--space-md);
}

.cbs-heading--white { color: #FFFFFF; }
.cbs-heading--center { text-align: center; }

.cbs-section__desc {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 640px;
}

.cbs-text-lead {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ── Buttons ── */
.cbs-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 12px 28px;
    font-size: var(--text-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 2px solid transparent;
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
    white-space: nowrap;
    text-align: center;
    line-height: 1.2;
}

.cbs-btn--primary {
    background: var(--cbs-red);
    color: var(--cbs-white);
    border-color: var(--cbs-red);
}
.cbs-btn--primary:hover {
    background: var(--cbs-red-dark);
    border-color: var(--cbs-red-dark);
}

.cbs-btn--outline {
    background: transparent;
    color: var(--text-heading);
    border-color: var(--text-heading);
}
.cbs-btn--outline:hover {
    background: var(--cbs-blue);
    color: #FFFFFF;
}

.cbs-btn--outline-white {
    background: transparent;
    color: #FFFFFF;
    border-color: #FFFFFF;
}
.cbs-btn--outline-white:hover {
    background: #FFFFFF;
    color: var(--cbs-blue);
}

.cbs-btn--orange {
    background: var(--cbs-orange);
    color: var(--cbs-white);
    border-color: var(--cbs-orange);
}
.cbs-btn--orange:hover {
    background: #d06615;
    border-color: #d06615;
}

.cbs-btn--sm {
    padding: 8px 20px;
    font-size: var(--text-xs);
}

.cbs-btn--lg {
    padding: 16px 36px;
    font-size: var(--text-base);
}

/* ── Cards ── */
.cbs-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.cbs-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.cbs-card__img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
}

.cbs-card__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: var(--space-lg);
}

.cbs-card__title {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: var(--space-sm);
}

.cbs-card__text {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ── Product Card (Catalog) ── */
.cbs-product-card {
    display: flex;
    flex-direction: row;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: box-shadow var(--transition-base);
}

.cbs-product-card:hover {
    box-shadow: var(--shadow-lg);
}

.cbs-product-card__img {
    flex: 0 0 45%;
    object-fit: contain;
    padding: var(--space-md);
    background: var(--cbs-gray-50);
}

.cbs-product-card__body {
    flex: 1;
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (max-width: 768px) {
    .cbs-product-card { flex-direction: column; }
    .cbs-product-card__img { flex: none; aspect-ratio: 16/9; }
}

/* ── Breadcrumbs ── */
.cbs-breadcrumbs {
    padding: var(--space-md) 0;
    font-size: var(--text-sm);
    color: var(--cbs-gray-500);
    background: var(--cbs-gray-50);
}

.cbs-breadcrumbs a {
    color: var(--text-heading);
    transition: color var(--transition-fast);
}
.cbs-breadcrumbs a:hover { color: var(--cbs-red); }

.cbs-breadcrumb-sep {
    margin-inline: var(--space-sm);
    color: var(--cbs-gray-300);
}

/* ── Forms ── */
.cbs-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--cbs-gray-300);
    border-radius: var(--radius-sm);
    font-size: var(--text-base);
    transition: border-color var(--transition-fast);
}

.cbs-input:focus {
    outline: none;
    border-color: var(--cbs-blue);
    box-shadow: 0 0 0 3px rgba(37, 55, 123, .1);
}

/* ── CTA Banner ── */
.cbs-cta-banner {
    background: var(--cbs-blue);
    color: #FFFFFF;
    padding: var(--space-3xl) 0;
    text-align: center;
}

.cbs-cta-banner .cbs-heading {
    color: #FFFFFF;
}

/* ── Callbox CTA (shared component) ── */
.cbs-callbox-wrap {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--cbs-blue-dark, #1a2855);
    border-radius: 0;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    margin-top: 0;
    margin-bottom: 0;
    padding: 0 calc(50vw - 50%);
    overflow: visible;
}

.cbs-callbox-wrap:first-child {
    margin-top: calc(-1 * var(--space-3xl));
    min-height: 180px;
}

.cbs-callbox-photo {
    flex: 0 0 22%;
    align-self: flex-end;
    margin-top: -40px;
    margin-bottom: 0;
    z-index: 2;
    display: flex;
    justify-content: center;
}

.cbs-callbox-photo img {
    display: block;
    height: 220px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 8px 24px rgba(0,0,0,.25));
}

.cbs-callbox {
    flex: 1;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm) var(--space-xl);
    padding: var(--space-lg) var(--space-xl);
    text-align: left;
}

.cbs-callbox-text {
    flex: 1;
    min-width: 280px;
}

.cbs-callbox-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
}

.cbs-callbox-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--text-xs);
    font-weight: 600;
    color: rgba(255,255,255,.75);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: var(--space-xs);
}

.cbs-callbox-title {
    font-size: clamp(1.2rem, 2.2vw, 1.5rem);
    font-weight: 800;
    color: #fff;
    margin: 0 0 var(--space-sm);
    line-height: 1.25;
}

.cbs-callbox-desc {
    font-size: var(--text-sm);
    color: rgba(255,255,255,.7);
    margin: 0;
    max-width: none;
    line-height: 1.5;
}

.cbs-callbox-tel {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    color: #fff;
    text-decoration: none;
    transition: transform .15s, opacity .15s;
    margin-bottom: 0;
}

.cbs-callbox-tel:hover { transform: translateY(-1px); opacity: .9; }

.cbs-callbox-tel i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--cbs-red, #C82333);
    color: #fff;
    font-size: .95rem;
}

.cbs-callbox-tel span {
    font-size: clamp(1rem, 2vw, 1.2rem);
    font-weight: 900;
    color: #fff;
}

/* Dual Pill Button */
.cbs-pill-dual {
    display: inline-flex;
    border-radius: 999px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
    margin-bottom: var(--space-sm);
}

.cbs-pill-dual__btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .6rem 1.3rem;
    font-size: var(--text-sm);
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: filter .15s, transform .15s;
    white-space: nowrap;
    line-height: 1;
}

.cbs-pill-dual__btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.cbs-pill-dual__btn--form {
    background: var(--cbs-red, #C82333);
    color: #fff;
    border-radius: 999px 0 0 999px;
    padding-left: 1.5rem;
}

.cbs-pill-dual__btn--wa {
    background: #25D366;
    color: #fff;
    border-radius: 0 999px 999px 0;
    padding-right: 1.5rem;
    border-left: 1px solid rgba(255,255,255,.25);
}

.cbs-pill-dual__btn i {
    line-height: 1;
    display: inline-flex;
    align-items: center;
}
.cbs-pill-dual__btn--wa i { font-size: 1.15em; }

@media (max-width: 768px) {
    .cbs-callbox-wrap {
        flex-direction: column;
        align-items: center;
        padding: var(--space-xl) var(--space-md) var(--space-2xl);
    }

    /* Hide photo on mobile */
    .cbs-callbox-photo {
        display: none;
    }

    /* Content stacks */
    .cbs-callbox {
        flex-direction: column;
        text-align: center;
        padding: var(--space-sm) 0 0;
        gap: var(--space-md);
    }
    .cbs-callbox-text {
        text-align: center;
        min-width: 0;
    }

    /* Eyebrow icon: large centered circle above text */
    .cbs-callbox-eyebrow {
        flex-direction: column;
        gap: var(--space-sm);
        font-size: var(--text-xs);
        margin-bottom: var(--space-md);
    }
    .cbs-callbox-eyebrow i {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: var(--cbs-red, #C82333);
        color: #fff;
        font-size: 1.4rem;
        box-shadow: 0 4px 16px rgba(200,35,51,.35);
    }

    /* Phone: larger */
    .cbs-callbox-tel i {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    .cbs-callbox-tel span {
        font-size: 1.15rem;
    }

    /* Pill buttons: full-width */
    .cbs-callbox-actions {
        width: 100%;
    }
    .cbs-callbox-actions .cbs-pill-dual {
        width: 100%;
        display: flex;
    }
    .cbs-callbox-actions .cbs-pill-dual__btn {
        flex: 1;
        justify-content: center;
        padding: .85rem 1rem;
        font-size: var(--text-sm);
    }
}

/* ── Callbox dark mode: white bg, dark text ── */
[data-theme="dark"] .cbs-callbox-wrap {
    background: #FFFFFF;
    box-shadow: 0 2px 20px rgba(0,0,0,.3);
}
[data-theme="dark"] .cbs-callbox-eyebrow { color: var(--cbs-red); }
[data-theme="dark"] .cbs-callbox-title { color: var(--cbs-blue-dark, #1a2855); }
[data-theme="dark"] .cbs-callbox-desc { color: #4B5563; }
[data-theme="dark"] .cbs-callbox-tel span { color: var(--cbs-blue-dark, #1a2855); }
[data-theme="dark"] .cbs-callbox-photo img { filter: drop-shadow(0 8px 24px rgba(0,0,0,.15)); }
[data-theme="dark"] .cbs-pill-dual { box-shadow: 0 4px 16px rgba(0,0,0,.1); }

/* ── Skip link (a11y) ── */
.cbs-skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 10000;
    padding: 8px 16px;
    background: var(--cbs-blue);
    color: var(--cbs-white);
    font-weight: 600;
}
.cbs-skip-link:focus {
    left: 0;
}

/* ── Screen reader only ── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── WP alignment classes ── */
.aligncenter { text-align: center; }
.alignleft { float: left; margin-right: var(--space-md); margin-bottom: var(--space-md); }
.alignright { float: right; margin-left: var(--space-md); margin-bottom: var(--space-md); }
.alignwide { max-width: var(--content-wide); margin-inline: auto; }
.alignfull { width: 100%; max-width: 100%; }

/* ── Main content area ── */
.cbs-main {
    min-height: 50vh;
}

/* ── Pagination ── */
.cbs-pagination {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-xl) 0;
}

.cbs-pagination a,
.cbs-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--cbs-gray-300);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    font-weight: 600;
    transition: all var(--transition-fast);
}

.cbs-pagination a:hover {
    background: var(--cbs-blue);
    color: var(--cbs-white);
    border-color: var(--cbs-blue);
}

.cbs-pagination .current {
    background: var(--cbs-blue);
    color: var(--cbs-white);
    border-color: var(--cbs-blue);
}
