/* components.css — shared components. Minimal black-and-white: white page, neutral-100
   cards, black pill buttons, centred headings, a light header with a slide-in menu, a dark
   footer. Slimtech red marks the current page and a few small details only.
   States: hover, focus-visible, active, disabled, busy, invalid, pressed. */

/* Buttons: pills. Primary is black (white in dark mode); ghost is an outline. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 48px; padding: var(--s3) var(--s6); border: 2px solid transparent; border-radius: var(--pill);
  background: var(--btn-bg); color: var(--btn-ink); font-weight: 500; line-height: 1.2;
  text-decoration: none; white-space: nowrap; transition: background var(--fast), color var(--fast), transform var(--fast), border-color var(--fast);
}
.btn:hover { background: var(--btn-hover); color: var(--btn-ink); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn[aria-busy="true"] { cursor: progress; opacity: .8; }
.btn--dark { background: var(--btn-bg); color: var(--btn-ink); }
.btn--ghost, .btn--light { background: transparent; color: var(--ink); border-color: currentColor; }
.btn--ghost:hover, .btn--light:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn--sm { min-height: 44px; padding: var(--s2) var(--s5); font-size: var(--t-xs); }

/* Text links with a quiet underline that darkens on hover (calls to action outside buttons) */
.link { color: var(--ink); font-weight: 500; text-decoration: underline; text-underline-offset: .3em; text-decoration-color: var(--rule); text-decoration-thickness: 1px; transition: text-decoration-color var(--fast); }
.link:hover { color: var(--ink); text-decoration-color: currentColor; }

/* Header: logo left, two-line menu button centred, tools right */
.masthead { position: sticky; top: 0; z-index: 50; background: var(--bg); }
.masthead__bar { position: relative; display: flex; align-items: center; justify-content: space-between; gap: var(--s4); min-height: 4.5rem; padding-inline: var(--gutter); }
.brand { flex-shrink: 0; display: inline-flex; }
.brand img { height: 40px; width: auto; background: none; }
.masthead__tools { display: flex; align-items: center; gap: var(--s3); }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--ink); transition: background var(--fast); }
.icon-btn:hover { background: var(--card); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; }
.theme-toggle .i-sun, :root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
@media (max-width: 639px) { .masthead__cta { display: none; } }
@media (min-width: 1200px) { .masthead__tools { margin-left: var(--s3); } }

/* Nav: a row of links on the right from 1200px; below that, a list that opens under the header */
.nav__list { display: flex; align-items: center; gap: var(--s1); list-style: none; padding: 0; }
.nav__list li { max-width: none; }
.nav__list a { position: relative; display: block; padding: var(--s2) var(--s3); color: var(--ink); font-size: var(--t-xs); font-weight: 400; text-decoration: none; white-space: nowrap; transition: color var(--fast); }
.nav__list a:hover { color: var(--ink-soft); }
.nav__list a[aria-current="page"] { font-weight: 500; }
.nav__list a[aria-current="page"]::after { content: ""; position: absolute; left: 50%; bottom: -2px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--brand-red); }
.nav__extra { display: none; }
.menu-btn { display: none; flex-direction: column; align-items: center; justify-content: center; gap: 5px; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; }
.menu-btn span { display: block; width: 22px; height: 1.5px; border-radius: 2px; background: var(--ink); transition: transform var(--med) var(--ease-out), width var(--med) var(--ease-out); }
.menu-btn:hover span { width: 18px; }
.menu-btn[aria-expanded="true"] span { width: 22px; }
.menu-btn[aria-expanded="true"] span:first-child { transform: translateY(3.25px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-3.25px) rotate(-45deg); }
@media (min-width: 1200px) {
  .nav { margin-left: auto; }
}
@media (max-width: 1199px) {
  .js .menu-btn { display: inline-flex; }
  .masthead__tools { margin-left: auto; }
  .js .nav { position: absolute; top: 100%; left: 0; right: 0; max-height: calc(100vh - 4.5rem); overflow-y: auto; padding: var(--s3) var(--gutter) var(--s6); background: var(--bg); box-shadow: 0 1px 0 var(--surface), 0 16px 32px rgba(0, 0, 0, .08); }
  .js .nav:not(.open) { display: none; }
  .nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav__list a { padding: var(--s3) 0; font-size: var(--t-md); box-shadow: 0 1px 0 var(--card); }
  .nav__list a[aria-current="page"]::after { left: auto; right: 0; bottom: auto; top: 50%; margin: -2.5px 0 0; }
  .nav__extra { display: block; margin-top: var(--s5); }
  .nav__contact { list-style: none; padding: 0; margin-top: var(--s5); display: grid; gap: var(--s2); font-size: var(--t-xs); }
  .nav__contact a { color: var(--ink-soft); }
  html:not(.js) .masthead__bar { flex-wrap: wrap; }
  html:not(.js) .nav { order: 3; width: 100%; padding-bottom: var(--s3); }
  html:not(.js) .nav__list { flex-direction: row; flex-wrap: wrap; }
  html:not(.js) .nav__list a { padding: var(--s1) var(--s3) var(--s1) 0; font-size: var(--t-xs); box-shadow: none; }
  html:not(.js) .nav__extra { display: none; }
}

/* Breadcrumbs */
.crumbs ol { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s1) var(--s2); list-style: none; padding: 0; font-size: var(--t-xs); color: var(--ink-soft); }
.crumbs li + li::before { content: "/"; margin-right: var(--s2); }
.crumbs a { color: inherit; text-decoration-color: var(--rule); }
.crumbs a:hover { color: var(--ink); }
.crumbs [aria-current="page"] { color: var(--ink); }

/* Inner page heading: centred, on the white page (no panel) */
.page-head { padding-top: var(--s7); }
.banner { text-align: center; padding-bottom: var(--s5); }
.banner h1 { margin: var(--s5) auto 0; max-width: 18ch; font-size: clamp(2.25rem, 1.4rem + 3.6vw, 4.5rem); font-weight: 600; letter-spacing: -.02em; line-height: 1.05; }
.banner .lede { margin: var(--s5) auto 0; max-width: 40rem; color: var(--ink); }
.banner .row { justify-content: center; }
.page-head + .sec { padding-top: var(--s8); }

/* Bands: sections share the white page; spacing separates them */
.band-section { padding-block: var(--section); background: var(--bg); }
.band-section--cream { background: var(--bg); }

/* Panels and cards */
.panel { background: var(--card); border-radius: var(--r-md); box-shadow: var(--shadow); padding: var(--pad-lg); }
.panel > * + * { margin-top: var(--s4); }
.panel h2, .panel h3 { font-size: var(--t-lg); }

.card { position: relative; display: flex; flex-direction: column; height: 100%; padding: var(--s3); background: var(--card); border-radius: var(--r-md); box-shadow: var(--shadow); transition: box-shadow var(--med), transform var(--med); }
.card:hover { box-shadow: var(--shadow-lift); transform: translateY(-3px); }
.card__pic { overflow: hidden; border-radius: calc(var(--r-md) - 4px); aspect-ratio: 4 / 3; background: var(--surface-2); }
.card__pic img, .card__pic .ph-img { width: 100%; height: 100%; object-fit: cover; }
.card__body { display: flex; flex-direction: column; flex: 1; padding: var(--s4) var(--s2) var(--s2); }
.card__body h2, .card__body h3 { font-size: var(--t-md); font-weight: 700; }
.card__body p { margin-top: var(--s2); color: var(--ink-soft); }
.card__link { margin-top: auto; padding-top: var(--s4); color: var(--ink); font-weight: 500; text-decoration-color: var(--rule); text-underline-offset: .3em; }
.card:hover .card__link { text-decoration-color: currentColor; }
.card__link::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-md); }
.card:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }
.card__link:focus-visible { outline: none; }
.label { display: block; color: var(--ink-soft); font-size: var(--t-xs); font-weight: 400; }
.card h3 + .label { margin-top: var(--s1); }

/* Item cards (products, projects, catalog): photo, title, meta, text, specs, actions */
.item { display: flex; flex-direction: column; height: 100%; padding: var(--s3); background: var(--card); border-radius: var(--r-md); box-shadow: var(--shadow); }
.item__pic { position: relative; overflow: hidden; border-radius: calc(var(--r-md) - 4px); aspect-ratio: 4 / 3; background: var(--surface-2); }
.item__pic img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--slow) ease; }
.item:hover .item__pic img { transform: scale(1.04); }
.item__body { display: flex; flex-direction: column; flex: 1; padding: var(--s4) var(--s2) var(--s2); }
.item h3, .item h4 { font-size: var(--t-md); font-weight: 700; line-height: 1.3; }
.item h3 a, .item h4 a { color: var(--ink); text-decoration: none; }
.item h3 a:hover, .item h4 a:hover { color: var(--ink-soft); }
.meta { display: block; margin-top: var(--s1); color: var(--ink-soft); font-size: var(--t-xs); line-height: 1.5; }
.item p { margin-top: var(--s2); color: var(--ink-soft); }
.item .row { margin-top: auto; padding-top: var(--s4); }
.badge { position: absolute; top: var(--s3); left: var(--s3); padding: 2px var(--s3); border-radius: var(--r-sm); background: var(--ink); color: var(--card); font-size: var(--t-xs); font-weight: 400; }
.specs { margin-top: var(--s3); display: grid; gap: var(--s1); font-size: var(--t-xs); line-height: 1.5; }
.specs div { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: var(--s3); }
.specs dt { color: var(--ink-soft); }
.ph-img { display: grid; place-items: center; width: 100%; height: 100%; padding: var(--s4); text-align: center; font-size: var(--t-xs); color: var(--ink); background: var(--surface-2); }

/* Grids */
.grid-2, .grid-3, .grid-4, .grid-5 { list-style: none; padding: 0; display: grid; gap: var(--gap); }
.grid-2 > li, .grid-3 > li, .grid-4 > li, .grid-5 > li { max-width: none; }
@media (min-width: 600px) { .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .grid-3, .grid-4, .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* Segmented toggle (filters, tabs): dark pill track, white active pill */
.toggle { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: var(--s1); padding: var(--s1); border-radius: var(--pill); background: var(--ink); list-style: none; }
.toggle button { min-height: 40px; padding: var(--s2) var(--s5); border: 0; border-radius: var(--pill); background: transparent; color: var(--card); font-size: var(--t-xs); font-weight: 400; transition: background var(--fast), color var(--fast); }
.toggle button:hover { background: rgba(255, 255, 255, .14); }
.toggle button[aria-pressed="true"] { background: var(--bg); color: var(--ink); font-weight: 500; }
.toggle-row { display: flex; justify-content: center; margin-bottom: var(--s7); }

/* Accordion / FAQ: active question turns red */
.accordion { display: grid; gap: var(--s3); }
.accordion details { background: var(--card); border-radius: var(--r-sm); box-shadow: var(--shadow); overflow: hidden; }
.accordion summary { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); padding: var(--s4) var(--s5); cursor: pointer; list-style: none; font-weight: 500; transition: background var(--fast), color var(--fast); }
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { content: "+"; flex-shrink: 0; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--btn-bg); color: var(--btn-ink); font-size: 1.25rem; line-height: 1; transition: transform var(--med); }
.accordion details[open] summary { background: var(--btn-bg); color: var(--btn-ink); }
.accordion details[open] summary::after { transform: rotate(45deg); background: var(--btn-ink); color: var(--btn-bg); }
.accordion summary:hover { background: var(--surface); }
.accordion details[open] summary:hover { background: var(--btn-hover); }
.accordion .acc-body { padding: var(--s4) var(--s5) var(--s5); }
.accordion .acc-body > * + * { margin-top: var(--s3); }
.accordion .acc-body h4 { margin-top: var(--s4); }
.accordion .acc-body ol, .accordion .acc-body ul { padding-left: var(--s5); }
.accordion .acc-body li + li { margin-top: var(--s2); }
.accordion .acc-body li::marker { color: var(--ink-soft); }

/* Steps: numbered rings joined by arrows (a real sequence: the installation process) */
.steps { list-style: none; padding: 0; display: grid; gap: var(--s7) var(--gap); counter-reset: step; }
@media (min-width: 600px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .steps { grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); } }
.steps li { position: relative; text-align: center; max-width: none; counter-increment: step; }
.steps__ring { position: relative; display: grid; place-items: center; width: 112px; height: 112px; margin: 0 auto; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); font-family: var(--font-display); font-size: 2rem; color: var(--accent); }
.steps__ring::before { content: counter(step, decimal-leading-zero); }
.steps__ring::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 3px solid transparent; border-top-color: var(--accent); border-right-color: var(--accent); transform: rotate(-20deg); }
@media (min-width: 1000px) {
  .steps li:not(:last-child)::after { content: ""; position: absolute; top: 56px; left: calc(50% + 72px); right: calc(-50% + 72px); height: 2px; background: var(--accent); opacity: .5; }
}
.steps h3 { margin-top: var(--s5); }
.steps p { margin: var(--s2) auto 0; color: var(--ink-soft); font-size: var(--t-xs); max-width: 28ch; }

/* Forms */
.field { display: grid; gap: var(--s2); align-content: start; }
.field label { font-weight: 400; }
.req { color: var(--accent); }
.field input, .field textarea { width: 100%; min-height: 50px; padding: var(--s3) var(--s4); border: 1.5px solid var(--line); border-radius: var(--r-sm); background: var(--bg); color: var(--ink); transition: border-color var(--fast); }
.field textarea { min-height: 9rem; resize: vertical; }
.field input:hover, .field textarea:hover { border-color: var(--ink); }
.field input:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--ink); }
.field [aria-invalid="true"] { border-color: var(--error); }
.hint { font-size: var(--t-xs); line-height: 1.5; color: var(--ink-soft); }
.error { font-size: var(--t-xs); line-height: 1.5; color: var(--error); font-weight: 400; }
.error:empty, .status:empty { display: none; }
.check { display: flex; gap: var(--s3); align-items: flex-start; }
.check input { width: 22px; height: 22px; min-height: 0; margin-top: var(--s1); flex-shrink: 0; accent-color: var(--accent); }
.status { padding: var(--s3) var(--s4); border-radius: var(--r-sm); background: var(--surface); font-weight: 400; }
.status[data-state="success"] { color: var(--success); }
.status[data-state="error"] { color: var(--error); }
.form { display: grid; gap: var(--s5); align-self: start; }
.form > * + * { margin-top: 0; }
.form__row { display: grid; gap: var(--s5); }
@media (min-width: 640px) { .form__row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.form .btn { justify-self: start; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* CTA strip: centred sentence and one action on a neutral band */
.strip { padding-block: var(--s8); background: var(--card); color: var(--ink); text-align: center; }
.strip__row { display: flex; flex-direction: column; align-items: center; gap: var(--s5); }
.strip h2 { font-size: var(--t-lg); color: var(--ink); max-width: 34ch; }

/* Footer: dark ground, frosted brand card */
.colophon { background: var(--dark); color: var(--dark-ink); padding-block: var(--s9) var(--s5); margin-top: auto; }
.colophon a { color: var(--dark-ink); }
.colophon a:hover { color: var(--dark-accent); }
.colophon__grid { display: grid; gap: var(--s7) var(--col-gap); }
@media (min-width: 900px) { .colophon__grid { grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr)); } }
.colophon__card { padding: var(--pad-lg); border-radius: var(--r-md); background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }
.colophon__card img { height: 40px; width: auto; background: none; }
.colophon__card p { margin-top: var(--s4); color: var(--dark-soft); }
.colophon h2 { font-size: var(--t-md); color: var(--dark-ink); margin-bottom: var(--s4); }
.colophon address { font-style: normal; color: var(--dark-soft); }
.colophon ul { list-style: none; padding: 0; display: grid; gap: var(--s2); }
.colophon li { color: var(--dark-soft); }
.colophon__base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s4); margin-top: var(--s8); padding-top: var(--s5); box-shadow: 0 -1px 0 rgba(255, 255, 255, .12); color: var(--dark-soft); font-size: var(--t-xs); }

/* Items whose text sits directly in .item (catalog, products, portfolio) get the same inset as .item__body */
.item > h3, .item > h4, .item > .meta, .item > p, .item > .specs, .item > .row { margin-inline: var(--s2); }
.item > h3, .item > h4 { margin-top: var(--s4); }
.item > :last-child { margin-bottom: var(--s2); }
/* Anchor links styled as a toggle (product jump links) */
.toggle a { display: inline-flex; align-items: center; min-height: 40px; padding: var(--s2) var(--s5); border-radius: var(--pill); color: var(--card); font-size: var(--t-xs); text-decoration: none; }
.toggle a:hover { background: var(--bg); color: var(--ink); }

/* Phones: segmented toggles stay on one line and scroll sideways instead of wrapping into a blob */
@media (max-width: 899px) {
  .toggle { flex-wrap: nowrap; justify-content: flex-start; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .toggle::-webkit-scrollbar { display: none; }
  .toggle button, .toggle a { white-space: nowrap; flex-shrink: 0; }
  .toggle-row, .jump, .toolbar, :has(> .toggle) { max-width: 100%; min-width: 0; }
}
