:root {
    --ink: #101820;
    --muted: #5c6670;
    --line: #d6dbe0;
    --surface: #f4f6f7;
    --white: #ffffff;
    --red: #c8102e;
    --red-dark: #980b22;
    --blue: #123652;
    --success: #167347;
    --danger: #a32222;
    --shadow: 0 14px 36px rgba(16, 24, 32, 0.10);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--white);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--white); color: var(--ink); line-height: 1.55; }
a { color: var(--red-dark); text-underline-offset: 3px; }
img { max-width: 100%; height: auto; }
button, input, textarea { font: inherit; }
.container { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.narrow { width: min(780px, calc(100% - 40px)); }

.site-header { border-bottom: 1px solid var(--line); background: var(--white); position: relative; z-index: 10; }
.header-inner { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 20px; color: var(--ink); text-decoration: none; font-weight: 800; letter-spacing: .08em; }
.brand img { display: block; max-height: 54px; width: auto; }
.brand span { border-left: 1px solid var(--line); padding-left: 20px; }
.header-label { color: var(--muted); font-size: .9rem; }

.hero { color: var(--white); background: linear-gradient(115deg, rgba(16,24,32,.97), rgba(18,54,82,.92)), url("oferta-subestacion.png") center/cover; border-bottom: 5px solid var(--red); }
.hero-grid { min-height: 470px; display: grid; grid-template-columns: 1.5fr .8fr; gap: 70px; align-items: center; padding-block: 70px; }
.hero h1 { max-width: 820px; margin: 6px 0 20px; font-size: clamp(2.35rem, 5vw, 4.7rem); line-height: 1.02; letter-spacing: -.045em; }
.lead { max-width: 780px; margin: 0; color: #e5e9ec; font-size: 1.16rem; }
.eyebrow { margin: 0 0 8px; color: var(--red); font-size: .78rem; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
.hero .eyebrow { color: #ff738b; }
.hero-panel { border-left: 1px solid rgba(255,255,255,.3); padding-left: 36px; }
.hero-panel ol { list-style: none; margin: 0; padding: 0; }
.hero-panel li { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.18); font-weight: 650; }
.hero-panel li span { color: #ff738b; font-size: .75rem; letter-spacing: .1em; }

.catalog-section { padding-block: 72px; }
.section-heading { display: grid; grid-template-columns: 1fr minmax(300px, 440px); align-items: end; gap: 50px; margin-bottom: 34px; }
.section-heading h2, .quote-heading h1, .form-section h2, .confirmation h1, .diagnostic-page h1 { margin: 0; line-height: 1.12; letter-spacing: -.025em; }
.section-heading h2 { font-size: clamp(2rem, 4vw, 3rem); }
input, textarea { width: 100%; border: 1px solid #aeb6be; border-radius: 0; padding: 12px 13px; background: var(--white); color: var(--ink); }
input:focus, textarea:focus { outline: 3px solid rgba(200,16,46,.18); border-color: var(--red); }
button, .button { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; border: 1px solid var(--red); border-radius: 0; padding: 10px 20px; background: var(--red); color: var(--white); font-weight: 780; text-decoration: none; cursor: pointer; transition: background .15s ease; }
button:hover, .button:hover { background: var(--red-dark); border-color: var(--red-dark); }
.button-full { width: 100%; }

.legal-note, .notice { margin-top: 34px; border-left: 4px solid var(--red); padding: 18px 20px; background: var(--surface); color: #39434c; }
.notice-error { border-color: var(--danger); }

.quote-page { padding-block: 28px 70px; }
.breadcrumb { display: flex; gap: 9px; padding: 8px 0 28px; color: var(--muted); font-size: .88rem; }
.quote-heading { display: grid; grid-template-columns: 1fr 310px; gap: 60px; align-items: end; margin-bottom: 34px; }
.quote-heading h1 { font-size: clamp(2.1rem, 4vw, 3.6rem); }
.quote-heading p:not(.eyebrow) { max-width: 720px; color: var(--muted); }
.quote-form { display: grid; gap: 24px; }
.form-section { border: 1px solid var(--line); padding: clamp(22px, 4vw, 38px); background: var(--white); }
.form-section-title { display: flex; gap: 18px; margin-bottom: 25px; }
.form-section-title > span { color: var(--red); font-weight: 900; letter-spacing: .08em; }
.form-section-title p { margin: 6px 0 0; color: var(--muted); }
.consent input { width: 18px; height: 18px; accent-color: var(--red); }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.field-grid label { color: #303b44; font-size: .84rem; font-weight: 750; }
.field-grid input, .field-grid textarea { display: block; margin-top: 6px; font-weight: 400; }
.field-wide { grid-column: 1 / -1; }
.consent { display: flex; gap: 11px; align-items: flex-start; margin-top: 24px; color: var(--muted); font-size: .86rem; }
.consent input { flex: 0 0 auto; margin-top: 2px; }
.submit-bar { display: flex; justify-content: space-between; align-items: center; gap: 30px; padding: 24px; background: var(--ink); color: var(--white); }
.submit-bar p { margin: 0; color: #d5dce1; }
.honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

.confirmation-page, .diagnostic-page { padding-block: 70px; }
.confirmation { border-top: 5px solid var(--red); padding: clamp(28px, 6vw, 60px); box-shadow: var(--shadow); }
.confirmation h1 { max-width: 650px; font-size: clamp(2rem, 5vw, 3.4rem); }
.folio { margin: 30px 0; padding: 18px 20px; background: var(--ink); color: var(--white); }
.folio small, .folio strong { display: block; }
.folio strong { font-size: 1.6rem; letter-spacing: .04em; }
.summary-list { margin: 0; }
.summary-list > div { display: grid; grid-template-columns: 190px 1fr; gap: 20px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.summary-list dt { color: var(--muted); }
.summary-list dd { margin: 0; font-weight: 700; }
.check-list { list-style: none; margin: 30px 0; padding: 0; border-top: 1px solid var(--line); }
.check-list li { display: flex; justify-content: space-between; gap: 20px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.check-list .ok strong { color: var(--success); }
.check-list .error strong { color: var(--danger); }

.site-footer { border-top: 1px solid var(--line); padding: 34px 0; background: var(--surface); color: var(--muted); font-size: .88rem; }
.footer-grid { display: flex; justify-content: space-between; gap: 30px; }
.footer-grid p { margin: 0; }

@media (max-width: 920px) {
    .hero-grid, .section-heading, .quote-heading { grid-template-columns: 1fr; gap: 30px; }
    .hero-grid { min-height: 0; }
    .hero-panel { border-left: 0; border-top: 1px solid rgba(255,255,255,.3); padding: 18px 0 0; }
}

@media (max-width: 650px) {
    .container, .narrow { width: min(100% - 24px, 1180px); }
    .header-inner { min-height: 70px; }
    .brand span, .header-label { display: none; }
    .brand img { max-height: 46px; }
    .hero-grid { padding-block: 52px; }
    .hero h1 { font-size: 2.45rem; }
    .catalog-section { padding-block: 48px; }
    .field-grid { grid-template-columns: 1fr; }
    .field-wide { grid-column: auto; }
    .search-row { grid-template-columns: 1fr; gap: 8px; }
    .form-section { padding: 20px 16px; }
    .submit-bar, .footer-grid { align-items: stretch; flex-direction: column; }
    .summary-list > div { grid-template-columns: 1fr; gap: 3px; }
}

@media (prefers-reduced-motion: reduce) {
    * { scroll-behavior: auto !important; transition: none !important; }
}

/* Selección pública multitablero en tabla compacta */
.hero-compact .hero-grid { min-height: 190px; padding-block: 16px; }
.table-catalog-section { padding-top: 54px; }
.table-page-heading { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 5px; }
.table-page-heading h2 { margin: 0; font-size: clamp(1.8rem, 3.5vw, 2.7rem); line-height: 1.12; letter-spacing: -.025em; }
.table-page-heading p:not(.eyebrow) { margin: 8px 0 0; color: var(--muted); }
.table-search-bar { max-width: 620px; margin-bottom: 10px; }
.table-search-bar > label { display: block; margin-bottom: 6px; color: #34404a; font-size: .8rem; font-weight: 750; }
.table-search-bar > div { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.table-search-bar input { min-height: 42px; padding: 9px 11px; }
.button-secondary { min-height: 42px; border-color: #9da8b2; padding: 8px 16px; background: var(--white); color: var(--ink); }
.button-secondary:hover { border-color: var(--blue); background: #eaf0f5; color: var(--ink); }
.table-selection-tools { display: flex; justify-content: space-between; align-items: center; gap: 24px; border: 1px solid var(--line); border-bottom: 0; padding: 1px 3px; background: #f8fafb; font-size: .8rem; }
.select-all-control { display: inline-flex; align-items: center; gap: 9px; font-weight: 750; cursor: pointer; }
.select-all-control input, .table-checkbox input { width: 17px; height: 17px; margin: 0; accent-color: var(--red); }
.table-selection-tools > span { color: var(--muted); }
.board-table-wrap { overflow-x: auto; border: 1px solid var(--line); background: var(--white); }
.board-table { width: 100%; min-width: 690px; border-collapse: collapse; table-layout: fixed; }
.board-table th { border-bottom: 1px solid #cbd2d9; padding: 5px 5px; background: #e9edf2; color: #26333e; text-align: left; font-size: .7rem; font-weight: 850; letter-spacing: .035em; text-transform: uppercase; }
.board-table td { border-bottom: 1px solid #dfe4e8; padding: 1px 1px; background: var(--white); vertical-align: middle; font-size: .86rem; transition: background .12s ease; }
.board-table tbody tr:last-child td { border-bottom: 0; }
.board-table tbody tr:hover td { background: #f7f9fb; }
.board-table tbody tr.is-selected td { background: #eef5fa; }
.board-table .column-check { width: 105px; text-align: center; }
.board-table .column-quantity { width: 120px; text-align: center; }
.board-table .column-status { width: 140px; }
.table-checkbox { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; min-height: 30px; cursor: pointer; }
.table-checkbox span { display: none; }
.board-name strong { color: var(--ink); font-size: .9rem; }
.column-quantity input { width: 82px; min-height: 34px; padding: 5px 8px; text-align: center; }
.column-quantity input:disabled { border-color: #cfd5da; background: #edf0f2; color: #7c858d; cursor: not-allowed; }
.row-status { display: inline-block; border: 1px solid #b5bdc5; padding: 3px 8px; background: var(--white); color: var(--muted); font-size: .68rem; font-weight: 750; text-transform: uppercase; }
.row-status.is-active { border-color: #7baac8; background: #e8f4fb; color: var(--blue); }
.empty-search { margin: 0; border: 1px solid var(--line); border-top: 0; padding: 22px; background: var(--surface); color: var(--muted); text-align: center; }
.selection-bar { position: sticky; bottom: 0; z-index: 8; display: flex; justify-content: space-between; align-items: center; gap: 28px; margin-top: 25px; padding: 19px 22px; border-top: 4px solid var(--red); background: var(--ink); color: var(--white); box-shadow: 0 -8px 24px rgba(16,24,32,.16); }
.selection-bar p { margin: 0; }
.selection-bar strong, .selection-bar span { display: block; }
.selection-bar span { color: #c8d0d6; font-size: .8rem; }
.selection-bar button:disabled { border-color: #5f6870; background: #5f6870; color: #d9dde0; cursor: not-allowed; }
.contact-heading { align-items: center; }
.selection-summary-count { border-top: 4px solid var(--red); padding: 18px 20px; background: var(--ink); color: var(--white); }
.selection-summary-count small, .selection-summary-count strong, .selection-summary-count span { display: block; }
.selection-summary-count small, .selection-summary-count span { color: #bcc6ce; }
.selection-summary-count strong { margin: 3px 0; font-size: 1.3rem; }
.selected-board-list { border-top: 1px solid var(--line); }
.selected-board-list > div, .confirmation-boards > div { display: grid; grid-template-columns: 1fr auto; gap: 22px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.selected-board-list strong, .confirmation-boards strong { white-space: nowrap; color: var(--blue); }
.text-action { display: inline-block; margin-top: 18px; font-weight: 750; }
.confirmation-boards { margin-top: 30px; }
.confirmation-boards h2 { margin: 0 0 12px; font-size: 1.2rem; }

@media (max-width: 650px) {
    .hero-compact .hero-grid { padding-block: 42px; }
    .table-catalog-section { padding-top: 40px; }
    .table-search-bar > div { grid-template-columns: 1fr; }
    .table-selection-tools { align-items: flex-start; flex-direction: column; gap: 6px; }
    .board-table { min-width: 640px; }
    .selection-bar { align-items: stretch; flex-direction: column; gap: 14px; }
    .selection-bar button { width: 100%; }
}

/* TES-COT v1.3.0: catálogo CFE */
.board-table .column-code { width: 180px; }
.board-code strong { color: var(--blue); font-size: .92rem; letter-spacing: .01em; }
.board-name span { color: var(--ink); line-height: 1.35; }
.selected-code { color: var(--blue); letter-spacing: .01em; }
@media (max-width: 650px) {
    .board-table { min-width: 880px; }
}
