/* Printed Tape Calculator: banner + persistent live configurator.
   Both the visual language AND the display logic follow [W] RSC Box Configurator
   (rsc-box-configurator/assets/css/frontend.css): flat panels, thin "ink" borders,
   sharp corners, one accent colour, Big Shoulders Display for the big price
   number, IBM Plex Sans for everything else - and no button/popup: controls, the
   3D preview and the price panel sit side by side and update live as the visitor
   changes anything (see tapecalc-front.js). Colours the admin "Widget Layout"/
   "Results Panel" tabs expose stay driven by inline styles from PHP
   (tapecalc_dynamic_css() and per-element style="" attributes) - this file only
   sets what those settings don't cover: layout, borders, radii, fonts. */

.tpc-wrap {
    --ink: #14202b;
    --muted: #546472;
    --line: rgba(20, 32, 43, .22);
    --accent: #1f5fd6;
    --accent-ink: #ffffff;
    --accent-soft: rgba(31, 95, 214, .12);
    --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
    --text: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-family: var(--text);
    color: var(--ink);
}
.tpc-wrap *, .tpc-wrap *::before, .tpc-wrap *::after { box-sizing: border-box; }

/* ---------- optional banner header (image / title / highlight / sub-text) ---------- */
.tpc-container {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 16px 20px;
    margin: 0 0 14px;
    gap: 25px;
    flex-wrap: wrap;
}

.tpc-left-group { display: flex; align-items: center; flex: 0 0 auto; }
.tpc-banner-section { display: flex; align-items: center; flex: 0 0 auto; }
.tpc-icon-img { height: auto; object-fit: contain; display: block; }

.tpc-title-block h2 {
    margin: 0;
    font-size: inherit;
    color: inherit;
    line-height: 1.15;
    font-weight: 800;
    text-align: left;
}

.tpc-right-group { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 240px; }
.tpc-highlight-top { font-weight: 700; display: block; }
.tpc-subtext { margin: 0; line-height: 1.4; }

.tpc-divider { width: 1px; height: 44px; background-color: var(--line); flex: 0 0 auto; }

/* ---------- the configurator itself: controls | 3D preview | price, all live ---------- */
.tpc-configurator {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr) 300px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #ffffff;
    overflow: hidden;
    align-items: stretch;
}
.tpc-panel, .tpc-price { display: flex; flex-direction: column; min-width: 0; }
.tpc-panel { border-right: 1px solid var(--line); }
.tpc-price { border-left: 1px solid var(--line); }
.tpc-panel .tpc-scroll, .tpc-price .tpc-scroll { padding: 16px; }
.tpc-panel section, .tpc-price section { padding: 12px 0; border-bottom: 1px dashed var(--accent); }
.tpc-panel section:first-child, .tpc-price section:first-child { padding-top: 0; }
.tpc-panel section:last-child, .tpc-price section:last-child { border-bottom: 0; padding-bottom: 0; }

.tpc-stage-col { padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }

@media (max-width: 900px) {
    .tpc-configurator { grid-template-columns: 1fr; }
    .tpc-stage-col { order: 0; }
    .tpc-panel { order: 1; border-right: 0; border-top: 1px solid var(--line); }
    .tpc-price { order: 2; border-left: 0; border-top: 1px solid var(--line); }
}

.tpc-input-group { display: flex; flex-direction: column; gap: 3px; margin: 0 0 10px; }
.tpc-input-group:last-child { margin-bottom: 0; }
.tpc-input-group label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .02em;
    margin: 0;
    line-height: 1.2;
}
.tpc-input-group input,
.tpc-input-group select {
    padding: 0 12px;
    border-style: solid;
    border-width: 1px;
    border-radius: 3px;
    margin: 0;
    box-shadow: none;
    font-family: inherit;
    font-variant-numeric: tabular-nums;
    line-height: normal;
}
.tpc-input-group select { padding-right: 28px; cursor: pointer; }
.tpc-input-group input::placeholder { color: var(--muted); opacity: .7; }
.tpc-input-group input:focus,
.tpc-input-group select:focus {
    border-color: var(--accent);
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    box-shadow: none;
}
.tpc-input-group select option:disabled { color: var(--muted); opacity: .6; }

/* 3D preview */
.tpc-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #ffffff;
    overflow: hidden;
}
@supports not (aspect-ratio: 4 / 3) { .tpc-stage { height: 0; padding-bottom: 75%; } .tpc-stage > * { position: absolute; inset: 0; } }
.tpc-stage-msg {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    padding: 20px; text-align: center; color: var(--muted); font-size: 14px;
}
.tpc-stage:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

.tpc-views {
    display: flex; flex-wrap: wrap;
    border: 1px solid var(--ink); border-radius: 3px; overflow: hidden;
    width: max-content; max-width: 100%;
}
.tpc-views button {
    font: inherit; font-size: 13px; font-weight: 500;
    color: var(--ink); background: transparent;
    border: 0; border-right: 1px solid var(--ink); border-radius: 0;
    padding: 7px 12px; cursor: pointer; line-height: 1.2;
    text-transform: none; letter-spacing: 0; min-height: 0;
}
.tpc-views button:last-child { border-right: 0; }
.tpc-views button:hover { background: var(--accent-soft); }
.tpc-views button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.tpc-views button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.tpc-customize .tpc-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 12px; }
.tpc-customize .tpc-row:last-child { margin-bottom: 0; }
.tpc-customize .tpc-row > span { font-size: 12px; font-weight: 700; color: var(--ink); width: 100%; }
.tpc-swatches { display: flex; gap: 8px; }
.tpc-inks { display: flex; gap: 8px; }
.tpc-swatch {
    width: 28px; height: 28px; padding: 0; border-radius: 50%; cursor: pointer;
    border: 1px solid var(--line); background: var(--c); min-height: 0;
}
.tpc-swatch.clear { background: linear-gradient(135deg, #ffffff 0 45%, var(--c) 45% 100%); }
.tpc-swatch[aria-checked="true"] { outline: 2px solid var(--accent); outline-offset: 2px; }
.tpc-swatch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tpc-ink {
    width: 36px; height: 30px; padding: 0; cursor: pointer;
    border: 1px solid var(--line); border-radius: 3px; background: #fff;
}
.tpc-text-input {
    width: 100%; height: 36px; padding: 0 10px;
    border: 1px solid var(--line); border-radius: 3px; font: inherit; font-size: 14px; color: var(--ink); background: #fff;
    margin: 0; box-shadow: none;
}
.tpc-text-input:focus { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 1px; box-shadow: none; }
.tpc-note { font-size: 12px; color: var(--muted); margin: 0; line-height: 1.45; }

/* price panel */
.tpc-result-title { margin: 0 0 8px; font-weight: 700; line-height: 1.25; }
.tpc-result-title:empty { display: none; }
.tpc-spec { font-size: 13px; color: var(--muted); margin: 0 0 10px; line-height: 1.45; }
.tpc-price-big {
    font-family: var(--display);
    font-weight: 800;
    line-height: 1.05;
    margin: 0 0 4px;
    font-variant-numeric: tabular-nums;
    letter-spacing: .005em;
}
.tpc-price-big small { font-family: var(--text); font-size: 15px; font-weight: 600; color: var(--muted); }
.tpc-total { font-size: 15px; margin: 0 0 14px; color: var(--muted); }
.tpc-total strong { font-weight: 800; color: var(--ink); }
.tpc-facts { width: 100%; border-collapse: collapse; font-size: 14px; margin: 0 0 14px; border: 0; }
.tpc-facts td { padding: 7px 0; border: 0; border-top: 1px solid var(--line); color: var(--ink); background: none; }
.tpc-facts td:last-child { text-align: right; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 12px; }
.tpc-moq { margin: 0 0 14px; padding: 10px 12px; border-radius: 3px; border-style: solid; font-size: 13px; }
.tpc-moq.ok { background: #e6f4ea !important; color: #1d5a36 !important; border-color: #b7dfc3 !important; }
.tpc-vat { font-size: 12px; color: var(--muted); margin: 0 0 12px; }
.tpc-cta {
    display: block; width: 100%; padding: 12px 18px; font-weight: 600;
    text-decoration: none; border-radius: 3px; text-align: center; transition: filter 0.2s;
}
.tpc-cta:hover { filter: brightness(1.08); }
.tpc-cta:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

@media (max-width: 768px) {
    .tpc-container { flex-direction: column; align-items: stretch; }
    .tpc-divider { display: none; }
    .tpc-left-group { justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) { .tpc-price-big { transition: none; } }

/* keep hidden parts hidden even when a display rule applies */
.tpc-wrap [hidden] { display: none !important; }
