/* HAFI Technologies shop: black theme, white text, light gray accents (same look as /electronica-2026) */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Inter+Tight:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg: #000000;
    --fg: #ffffff;
    --muted: #ffffff;
    --line: #333333;
    --bg-lt: #111111;
    --danger: #FCA5A5;
    --accent: #C4C4C4;
    --accent-lt: #D9D9D9;
    --accent-dim: rgba(196,196,196,.2);
    --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
    --pad: 23px;
    --r: 4px;
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
    --font-d: 'Inter Tight', 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: #000; color-scheme: dark; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--fg); }
img { display: block; max-width: 100%; border-radius: 0; }
::selection { background: var(--accent-dim); color: var(--fg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r); }

/* ---------- page frame ---------- */
.page { flex: 1; width: 100%; max-width: 1440px; margin: 0 auto; padding: 56px var(--pad) 70px; }

.page-title {
    font-family: var(--font-d); font-size: 48px; font-weight: 700; line-height: 1.05;
    text-align: center; margin: 0 0 14px; letter-spacing: -.03em; color: var(--fg);
}
.lead { max-width: 640px; margin: 0 auto 36px; text-align: center; color: var(--muted); font-size: 15px; line-height: 1.7; }
@media (max-width: 700px) { .page-title { font-size: 32px; } .page { padding-top: 40px; } }

/* ---------- form controls ---------- */
input[type=text], input[type=search], input[type=email], input[type=number], textarea, select {
    width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r);
    background: #111; color: var(--fg); font: inherit; font-size: 15px;
    transition: border-color .2s, background .2s;
}
input::placeholder, textarea::placeholder { color: #8A8A8A; }
input:focus, textarea:focus, select:focus {
    outline: none; border-color: var(--accent); background: #111; box-shadow: 0 0 0 3px var(--accent-dim);
}
textarea { resize: vertical; min-height: 100px; }
.btn {
    display: inline-block; background: var(--accent); color: #000; border: none;
    padding: 12px 28px; font: inherit; font-size: 14px; font-weight: 600; letter-spacing: .04em;
    text-transform: uppercase; text-align: center; text-decoration: none; cursor: pointer;
    transition: background .2s, transform .15s; border-radius: var(--r);
}
.btn:hover { background: var(--accent-lt); transform: translateY(-1px); }
.btn:active { opacity: .9; transform: none; }
.btn-outline {
    display: inline-block; background: transparent; color: var(--fg); border: 1px solid var(--line);
    padding: 12px 28px; font: inherit; font-size: 14px; text-align: center; text-decoration: none; cursor: pointer;
    transition: border-color .2s, background .2s; border-radius: var(--r);
}
.btn-outline:hover { border-color: var(--fg); background: var(--bg-lt); }

/* ---------- search ---------- */
.search { display: flex; max-width: 640px; margin: 0 auto 52px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.search input {
    flex: 1; min-width: 0; border: none; border-radius: 0; background: #111;
    padding: 11px 14px; font-size: 15px;
}
.search input:focus { box-shadow: none; }
.search .btn { border-left: 1px solid var(--line); padding: 10px 22px; border-radius: 0; font-size: 13px; }

/* ---------- shop layout ---------- */
.shop { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 44px; align-items: start; }
.filter { position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow-y: auto; scrollbar-width: thin; padding-right: 6px; }
.filter-toggle { display: none; }
.filter h2, .filter-title {
    margin: 0 0 14px; font-size: 11px; font-weight: 700; letter-spacing: .12em;
    text-transform: uppercase; color: var(--muted);
}
.filter ul { list-style: none; margin: 0; padding: 0; }
.filter li a {
    display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; text-decoration: none;
    border-bottom: 1px solid var(--line); font-size: 14px; color: var(--fg); transition: color .2s;
}
.filter li a span:last-child { color: var(--muted); font-size: 12px; }
.filter li a:hover span:first-child { color: var(--accent); }
.filter li a.is-active span:first-child { color: var(--accent); font-weight: 600; }
.filter li a.is-active { border-bottom-color: var(--accent); }

@media (max-width: 900px) {
    .shop { grid-template-columns: 1fr; gap: 24px; }
    .filter { position: static; max-height: none; overflow: visible; padding: 0; }
    .filter-toggle {
        display: flex; justify-content: space-between; align-items: center; width: 100%; cursor: pointer;
        background: var(--bg-lt); color: var(--fg); border: 1px solid var(--line);
        padding: 11px 14px; font: inherit; font-size: 14px; font-weight: 500; text-align: left;
        border-radius: var(--r);
    }
    .filter-toggle::after { content: "+"; font-size: 18px; line-height: 1; color: var(--accent); }
    .filter.is-open .filter-toggle::after { content: "–"; }
    .filter-body { border: 1px solid var(--line); border-top: 0; padding: 14px; max-height: 340px; overflow-y: auto; border-radius: 0 0 var(--r) var(--r); }
    .js .filter:not(.is-open) .filter-body { display: none; }
    .filter-title { display: none; }
}

.results-bar { display: flex; justify-content: space-between; gap: 16px; margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.results-bar a { color: var(--accent); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 20px; }
.card {
    display: flex; flex-direction: column; text-decoration: none; color: var(--fg);
    border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
    transition: border-color .2s, box-shadow .2s;
}
.card:hover { border-color: var(--accent); }
.card-img { position: relative; aspect-ratio: 1 / 1; background: var(--bg-lt); overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: contain; padding: 14px; }
.card-img.is-empty { background: #111; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: center; }
.card-img.is-empty svg, .gal-main.is-empty svg { width: 46%; height: auto; stroke: #777; }
.card-body { padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 4px; background: #000; }
.pn { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); overflow-wrap: anywhere; }
.card .name { font-size: 14px; line-height: 1.35; color: var(--fg); font-weight: 500; }
.card .mf { color: var(--muted); font-size: 13px; }

.empty { border: 1px solid var(--line); padding: 48px 24px; text-align: center; background: var(--bg-lt); border-radius: var(--r); }
.empty p { margin: 0 0 18px; color: var(--muted); }

/* pagination */
.pager { margin-top: 40px; }
.pager ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; list-style: none; padding: 0; margin: 0; }
.pager a, .pager span {
    display: block; min-width: 36px; padding: 7px 10px; text-align: center; text-decoration: none;
    border: 1px solid var(--line); border-radius: var(--r); font-size: 13px; color: var(--fg); transition: border-color .2s;
}
.pager a:hover { border-color: var(--accent); color: var(--accent); }
.pager .active a { background: var(--accent); color: #000; border-color: var(--accent); }
.pager .disabled span { color: #777; }

/* ---------- product page ---------- */
.crumbs { margin: 0 0 28px; color: var(--muted); font-size: 13px; }
.crumbs a { color: var(--muted); text-decoration: none; transition: color .2s; }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { margin: 0 8px; }

.pd { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; align-items: start; }
@media (max-width: 900px) { .pd { grid-template-columns: 1fr; gap: 32px; } }

.gal-main {
    aspect-ratio: 1 / 1; background: var(--bg-lt); display: flex; align-items: center; justify-content: center;
    overflow: hidden; border: 1px solid var(--line); border-radius: var(--r);
}
.gal-main img { width: 100%; height: 100%; object-fit: contain; padding: 24px; }
.gal-main.is-empty { background: #111; }
.gal-thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.gal-thumbs button {
    width: 76px; height: 76px; padding: 0; background: var(--bg-lt); border: 1px solid var(--line);
    cursor: pointer; opacity: .7; border-radius: var(--r); transition: opacity .2s, border-color .2s;
}
.gal-thumbs button img { width: 100%; height: 100%; object-fit: contain; padding: 5px; }
.gal-thumbs button:hover, .gal-thumbs button.is-active { opacity: 1; border-color: var(--accent); }

.pd-title {
    font-family: var(--font-d); font-size: 32px; font-weight: 700; line-height: 1.1;
    margin: 4px 0 14px; letter-spacing: -.025em; color: var(--fg);
}
@media (max-width: 700px) { .pd-title { font-size: 24px; } }
.pd-short { font-size: 15px; margin: 0 0 22px; color: var(--muted); line-height: 1.65; }
.meta { margin: 0 0 8px; border-top: 1px solid var(--line); }
.meta div { display: grid; grid-template-columns: 140px 1fr; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; overflow-wrap: anywhere; }

.block { margin-top: 44px; }
.block h2 { margin: 0 0 14px; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.prose p { margin: 0 0 12px; max-width: 70ch; color: var(--fg); line-height: 1.72; }
.specs { width: 100%; border-collapse: collapse; }
.specs th, .specs td { text-align: left; vertical-align: top; padding: 10px 0; border-top: 1px solid var(--line); font-weight: 400; font-size: 14px; }
.specs tr:last-child th, .specs tr:last-child td { border-bottom: 1px solid var(--line); }
.specs th { width: 40%; color: var(--muted); padding-right: 16px; }

/* quote box */
.quote-box { background: var(--bg-lt); border: 1px solid var(--line); border-radius: var(--r); padding: 28px; margin-top: 28px; }
.quote-box h2 { margin: 0 0 6px; font-family: var(--font-d); font-size: 22px; font-weight: 700; letter-spacing: -.018em; color: var(--fg); text-transform: none; }
.quote-box > p { margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; color: var(--fg); }
.field .opt { color: var(--muted); }
.field .err { color: var(--danger); margin-top: 5px; font-size: 13px; }
.field.has-error input, .field.has-error textarea { border-color: var(--danger); background: #1A0B0B; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 520px) { .row2 { grid-template-columns: 1fr; gap: 0; } .meta div { grid-template-columns: 100px 1fr; } }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.notice { border: 1px solid var(--line); padding: 14px 18px; margin-bottom: 18px; border-radius: var(--r); font-size: 14px; background: #111; color: var(--fg); }
.notice.is-error { background: #1A0B0B; border-color: rgba(252,165,165,.4); color: var(--danger); }
.quote-box .btn { width: 100%; justify-content: center; }

/* error page */
.error-page { text-align: center; padding: 60px 0; }
.error-page p { margin: 0 0 22px; color: var(--muted); }

/* phones: two product columns */
@media (max-width: 560px) {
    .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .card-body { padding: 10px 10px 12px; }
    .card .name { font-size: 13px; }
    .card-img img { padding: 8px; }
    .search .btn { padding: 10px 14px; }
}

.btn-dl { display: block; width: 100%; margin-top: 20px; }

/* search tips + type-ahead */
.search-tips { max-width: 640px; margin: -40px auto 44px; text-align: center; color: var(--muted); font-size: 13px; }
.suggest {
    position: absolute; left: 0; right: 0; top: 100%; z-index: 40;
    background: #111; border: 1px solid var(--line); border-top: 0;
    box-shadow: 0 8px 24px rgba(0,0,0,.6); border-radius: 0 0 var(--r) var(--r);
}
.suggest[hidden] { display: none; }
.suggest a {
    display: grid; grid-template-columns: minmax(0, 11em) 1fr; gap: 14px;
    padding: 10px 14px; text-decoration: none; border-top: 1px solid var(--line);
    color: var(--fg); transition: background .15s;
}
.suggest a:first-child { border-top: 0; }
.suggest a:hover, .suggest a.is-active { background: var(--bg-lt); }
.suggest .s-pn { font-weight: 600; overflow-wrap: anywhere; color: var(--fg); }
.suggest .s-name { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) { .suggest a { grid-template-columns: 1fr; gap: 0; } .search-tips { margin-top: -36px; } }

/* Manufacturer logos strip */
.mfr-strip { margin: 0 0 44px; padding: 20px 0 22px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.mfr-strip-title { margin: 0 0 16px; text-align: center; font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.mfr-marquee {
    position: relative; height: 62px; overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #fff 7%, #fff 93%, transparent);
    mask-image: linear-gradient(90deg, transparent, #fff 7%, #fff 93%, transparent);
}
.mfr-track { position: absolute; left: 0; top: 0; display: flex; width: max-content; margin: 0; padding: 0; list-style: none; animation: mfr-scroll 60s linear infinite; }
.mfr-marquee:hover .mfr-track, .mfr-marquee:focus-within .mfr-track { animation-play-state: paused; }
.mfr-track li { flex: none; margin-right: 44px; }
.mfr-track a, .mfr-track .mfr-tile {
    display: flex; align-items: center; justify-content: center;
    width: 138px; height: 62px; padding: 9px 16px;
    background: var(--bg-lt); border: 1px solid var(--line); text-decoration: none;
    transition: border-color .2s, background .2s; border-radius: var(--r);
}
.mfr-track a:hover { border-color: var(--accent); }
.mfr-track img { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
@keyframes mfr-scroll { to { transform: translateX(-50%); } }
@media (max-width: 560px) { .mfr-track li { margin-right: 28px; } .mfr-marquee { height: 52px; } .mfr-track a, .mfr-track .mfr-tile { width: 112px; height: 52px; padding: 7px 12px; } }
