/* =========================================================
   Americars & Trucks — interactive tools (shared styles)
   Used by assets/js/tools/*.js — mount: <div id="tool-mount" data-tool="…" data-lang="…" data-country="…">
   ========================================================= */
.at-tool {
    font-family: var(--dm-sans, sans-serif);
    background: var(--white, #fff);
    border: 1px solid var(--light-gray, #dadada);
    border-radius: 20px;
    padding: 24px 18px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .06);
    color: var(--dark, #0d0d0d);
}
@media (min-width: 768px) { .at-tool { padding: 32px; } }
.at-tool * { box-sizing: border-box; }
.at-tool h3, .at-tool__title { font-size: 1.25rem; font-weight: 700; text-transform: uppercase; margin: 0 0 16px; }
.at-tool__lead { color: var(--dark--light, #333); margin: 0 0 20px; font-size: .95rem; }

/* tabs */
.at-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.at-tab {
    border: 1px solid var(--light-gray, #dadada); background: var(--light, #f7f7f7);
    border-radius: 999px; padding: 8px 14px; font-size: .85rem; font-weight: 600; cursor: pointer;
    color: var(--dark, #0d0d0d); transition: all .2s;
}
.at-tab:hover { border-color: var(--primary, #d40000); }
.at-tab[aria-selected="true"] { background: var(--primary, #d40000); border-color: var(--primary, #d40000); color: #fff; }

/* form grid */
.at-grid { display: grid; grid-template-columns: 1fr; gap: 14px 16px; }
@media (min-width: 576px) { .at-grid--2 { grid-template-columns: 1fr 1fr; } .at-grid--3 { grid-template-columns: 1fr 1fr 1fr; } }
.at-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.at-field label, .at-label { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: var(--dark--light, #333); }
.at-field input, .at-field select {
    width: 100%; height: 48px; border: 1px solid var(--light-gray, #dadada); border-radius: 10px;
    padding: 0 12px; font-size: 1rem; background: #fff; color: var(--dark, #0d0d0d);
    -webkit-appearance: none; appearance: none;
}
.at-field select { background-image: linear-gradient(45deg, transparent 50%, #666 50%), linear-gradient(135deg, #666 50%, transparent 50%); background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.at-field input:focus, .at-field select:focus { outline: none; border-color: var(--primary, #d40000); box-shadow: 0 0 0 3px rgba(212, 0, 0, .12); }
.at-field small, .at-hint { font-size: .78rem; color: #666; }
.at-check { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.at-check input { width: 18px; height: 18px; accent-color: var(--primary, #d40000); }
.at-inline { display: flex; gap: 8px; }
.at-inline > * { flex: 1; min-width: 0; }

.at-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--primary, #d40000); color: #fff; border: 0; border-radius: 10px;
    height: 48px; padding: 0 22px; font-weight: 700; text-transform: uppercase; font-size: .9rem; cursor: pointer;
}
.at-btn:hover { background: #b00000; color: #fff; }
.at-btn--ghost { background: transparent; color: var(--primary, #d40000); border: 1px solid var(--primary, #d40000); }
.at-btn--ghost:hover { background: rgba(212, 0, 0, .06); color: var(--primary, #d40000); }

/* results */
.at-result { margin-top: 22px; border-radius: 16px; background: var(--light, #f7f7f7); padding: 18px; }
.at-result:empty { display: none; }
.at-kpis { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 576px) { .at-kpis { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); } }
.at-kpi { background: #fff; border-radius: 12px; padding: 14px; border: 1px solid #ececec; }
.at-kpi__label { font-size: .75rem; text-transform: uppercase; font-weight: 700; color: #666; }
.at-kpi__value { font-family: var(--bebas-neue, sans-serif); font-size: 2rem; line-height: 1.1; color: var(--dark, #0d0d0d); word-break: break-word; }
.at-kpi--main .at-kpi__value { color: var(--primary, #d40000); }
.at-table { width: 100%; border-collapse: collapse; font-size: .92rem; margin-top: 12px; background: #fff; border-radius: 12px; overflow: hidden; }
.at-table th, .at-table td { padding: 9px 12px; border-bottom: 1px solid #eee; text-align: left; vertical-align: top; }
.at-table td.num, .at-table th.num { text-align: right; white-space: nowrap; }
.at-table tr:last-child td { border-bottom: 0; }
.at-table tfoot td { font-weight: 700; }
.at-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.at-note { font-size: .8rem; color: #555; margin-top: 12px; }
.at-alert { border-left: 4px solid var(--yellow, #f3c10e); background: #fffbea; padding: 10px 12px; border-radius: 8px; font-size: .88rem; margin-top: 12px; }
.at-alert--ok { border-color: #1a7f37; background: #effaf1; }
.at-alert--err { border-color: var(--primary, #d40000); background: #fff1f1; }
.at-cta { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.at-cta p { margin: 0; flex: 1 1 260px; font-size: .9rem; }

/* converter */
.at-conv { display: grid; grid-template-columns: 1fr; gap: 10px; align-items: end; }
@media (min-width: 576px) { .at-conv { grid-template-columns: 1fr auto 1fr; } }
.at-conv__swap { height: 48px; width: 48px; border-radius: 50%; border: 1px solid var(--light-gray, #dadada); background: #fff; cursor: pointer; font-size: 1.1rem; justify-self: center; }
.at-conv__swap:hover { border-color: var(--primary, #d40000); color: var(--primary, #d40000); }
.at-refs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.at-ref { font-size: .8rem; background: #fff; border: 1px solid #e5e5e5; border-radius: 999px; padding: 5px 10px; cursor: pointer; }
.at-ref:hover { border-color: var(--primary, #d40000); }

/* tyre visual */
.at-tyres { display: flex; align-items: flex-end; justify-content: center; gap: 24px; margin: 8px 0 4px; }

.at-tyres figcaption { text-align: center; font-size: .8rem; font-weight: 700; }

/* VIN */
.at-vin-input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .12em; text-transform: uppercase; }
.at-vin-chars { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.at-vin-chars span { font-family: ui-monospace, Menlo, Consolas, monospace; background: #fff; border: 1px solid #e5e5e5; border-radius: 6px; padding: 4px 6px; font-weight: 700; min-width: 26px; text-align: center; }
.at-vin-chars span.err { border-color: var(--primary, #d40000); color: var(--primary, #d40000); }
.at-spinner { display: inline-block; width: 18px; height: 18px; border: 3px solid #ddd; border-top-color: var(--primary, #d40000); border-radius: 50%; animation: at-spin .8s linear infinite; vertical-align: middle; }
@keyframes at-spin { to { transform: rotate(360deg); } }

/* page section wrapper */
.tool-section { padding: 48px 0; background: var(--light, #f7f7f7); }
.tool-section .at-tool { max-width: 980px; margin: 0 auto; }

/* sticky mobile CTA (QUALITY-STANDARDS 1.3) */
.tool-sticky-cta { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 50; justify-content: center; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
@media (min-width: 992px) { .tool-sticky-cta { display: none !important; } }
.seo-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; font-size: .95rem; }
.seo-table th, .seo-table td { padding: 10px 12px; border-bottom: 1px solid #eee; text-align: left; vertical-align: top; }
.seo-table thead th { background: var(--dark, #0d0d0d); color: #fff; font-weight: 700; text-transform: uppercase; font-size: .8rem; }
.seo-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 16px 0 8px; }
.at-tyres figure { width: 160px; margin: 0; }
.at-tyres svg { width: 100%; max-width: 160px; }
.at-tool input.at-vin-input, .at-tool .at-inline > input { width: 100%; height: 48px; border: 1px solid var(--light-gray, #dadada); border-radius: 10px; padding: 0 12px; font-size: 1rem; background: #fff; }
.at-tool input.at-vin-input:focus { outline: none; border-color: var(--primary, #d40000); box-shadow: 0 0 0 3px rgba(212, 0, 0, .12); }
@media (max-width: 575.98px) { .at-kpis { grid-template-columns: 1fr 1fr; } .at-kpi__value { font-size: 1.6rem; } .tool-sticky-cta { width: auto; } }
