/* Kansal Electronics: working stylesheet. The designer can replace this file. */
:root {
  --ink: #0a2540;
  --ink-2: #425466;
  --muted: #6b7c93;
  --line: #e3e8ee;
  --bg: #f6f9fc;
  --white: #fff;
  --primary: #0066cc;
  --primary-dark: #004f9e;
  --accent: #00b4d8;
  --ok: #0f9d58;
  --warn: #b26a00;
  --danger: #c62828;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(10, 37, 64, 0.06), 0 4px 14px rgba(10, 37, 64, 0.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.55; font-size: 16px; }
img { max-width: 100%; height: auto; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 0.5em; }
h1 { font-size: clamp(1.6rem, 2.5vw, 2.2rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
table { border-collapse: collapse; width: 100%; }
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea {
  width: 100%; padding: 0.6em 0.75em; border: 1px solid var(--line); border-radius: 8px; background: var(--white);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
textarea { resize: vertical; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.container { width: min(1200px, 100% - 32px); margin-inline: auto; }
.narrow { max-width: 860px; }
.section { padding: 40px 0; }
.section-tight { margin-top: 32px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 100; }
.skip-link:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.note { color: var(--muted); font-size: 0.85rem; margin-top: 12px; }
.req { color: var(--danger); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.page-loading { padding: 80px 0; color: var(--muted); text-align: center; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 0.6em 1.1em; border-radius: 8px; border: 1px solid var(--line); background: var(--white);
  color: var(--ink); font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; border-color: #c8d1dc; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-light { background: #fff; color: var(--ink); border-color: #fff; }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.5); }
.btn-large { padding: 0.8em 1.4em; font-size: 1.05rem; }
.btn-small { padding: 0.35em 0.8em; font-size: 0.875rem; }
.btn-link { border-color: transparent; background: transparent; color: var(--danger); }

/* header */
.announcement { background: var(--accent); color: var(--ink); text-align: center; padding: 6px 12px; font-weight: 600; font-size: 0.9rem; }
.site-header { background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 20; }
.header-row { display: flex; align-items: center; gap: 20px; min-height: 68px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 1.15rem; }
.brand:hover { text-decoration: none; }
.brand img { background: #fff; border-radius: 8px; padding: 2px; }
.header-search { flex: 1; display: flex; gap: 8px; min-width: 260px; }
.header-search input { border-color: transparent; }
.site-nav { display: flex; gap: 18px; align-items: center; }
.site-nav a { color: #dbe7f3; font-weight: 600; font-size: 0.95rem; }
.site-nav a:hover { color: #fff; }
.rfq-link { display: inline-flex; align-items: center; gap: 6px; }
.badge { background: var(--accent); color: var(--ink); border-radius: 999px; padding: 0 8px; font-size: 0.8rem; font-weight: 800; }
.nav-toggle { display: none; background: transparent; border: 1px solid rgba(255, 255, 255, 0.4); color: #fff; border-radius: 8px; padding: 6px 12px; }

/* hero */
.hero { background: linear-gradient(135deg, #0a2540 0%, #12395f 60%, #0b4a6e 100%); color: #fff; padding: 64px 0 56px; }
.hero h1 { font-size: clamp(1.9rem, 4vw, 3rem); max-width: 820px; }
.lead { font-size: 1.15rem; color: #d3e3f3; max-width: 720px; }
.lead-sm { color: var(--ink-2); max-width: 760px; }
.hero-search { display: flex; gap: 10px; max-width: 760px; margin: 24px 0 16px; }
.hero-search input { font-size: 1.1rem; padding: 0.8em 1em; border: 0; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* blocks */
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.highlights { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.highlight { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.highlight p { color: var(--ink-2); margin: 0; }
.grid.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.product-card { display: flex; flex-direction: column; }
.card-link { display: block; padding: 16px; color: inherit; flex: 1; }
.card-link:hover { text-decoration: none; }
.card-link:hover .mpn { color: var(--primary); }
.thumb { height: 110px; display: grid; place-items: center; background: var(--bg); border-radius: 8px; margin-bottom: 12px; overflow: hidden; }
.thumb img { max-height: 100px; object-fit: contain; }
.mpn { font-family: var(--mono); font-weight: 700; word-break: break-word; }
.maker { color: var(--muted); margin: 0 0 6px; font-size: 0.9rem; }
.desc { color: var(--ink-2); font-size: 0.88rem; margin: 0; }
.card-foot { border-top: 1px solid var(--line); padding: 10px 16px; display: flex; justify-content: space-between; gap: 8px; font-size: 0.85rem; }
.chip-icon { width: 46px; height: 46px; border-radius: 8px; background: var(--ink); position: relative; display: inline-block; }
.chip-icon::after { content: ""; position: absolute; inset: 12px; border-radius: 4px; background: var(--accent); }
.chip-icon.large { width: 96px; height: 96px; }
.chip-icon.large::after { inset: 26px; }
.stock.in { color: var(--ok); font-weight: 600; }
.stock.req { color: var(--warn); }
.price { font-weight: 700; }
.count { color: var(--muted); font-weight: 400; font-size: 0.85em; }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.cat-block { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.cat-title { font-weight: 700; color: var(--ink); }
.cat-block ul { list-style: none; padding: 0; margin: 8px 0 0; }
.cat-block li { padding: 2px 0; }
.brand-strip { display: flex; flex-wrap: wrap; gap: 10px; }
.brand-chip { background: var(--white); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; color: var(--ink); font-weight: 600; display: inline-flex; align-items: center; }
.brand-chip img { max-height: 26px; }
.cta { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; display: flex; gap: 24px; align-items: center; justify-content: space-between; box-shadow: var(--shadow); flex-wrap: wrap; }
.cta p { margin: 0; color: var(--ink-2); max-width: 680px; }

/* search */
.crumbs { font-size: 0.875rem; color: var(--muted); margin-bottom: 12px; }
.search-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.search-meta { display: flex; gap: 16px; align-items: center; color: var(--ink-2); }
.search-meta select { width: auto; margin-left: 6px; }
.search-layout { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; }
.filters { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; }
.filters h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 16px 0 6px; }
.filters ul { list-style: none; padding: 0; margin: 0; }
.filters ul ul { padding-left: 14px; }
.filters li a { display: block; padding: 3px 0; color: var(--ink); font-size: 0.92rem; }
.filters li a.on { color: var(--primary); font-weight: 700; }
.check-link::before { content: ""; display: inline-block; width: 13px; height: 13px; border: 1.5px solid #9fb0c3; border-radius: 3px; margin-right: 7px; vertical-align: -1px; }
.check-link.on::before { background: var(--primary); border-color: var(--primary); }
.filter-search label { font-size: 0.85rem; color: var(--muted); }
.check { display: flex; gap: 8px; align-items: center; margin-top: 12px; font-size: 0.95rem; }
.check input { width: auto; }
.maker-intro { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 16px; }

.results-table { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.results-table th { text-align: left; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); background: #fafcfe; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.results-table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 0.93rem; }
.results-table tr:last-child td { border-bottom: 0; }
.results-table .actions { text-align: right; }
.results-table input { min-width: 80px; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 16px; color: var(--ink-2); }
.empty { background: var(--white); border: 1px dashed #c8d1dc; border-radius: var(--radius); padding: 36px; text-align: center; }

/* product */
.product-grid { display: grid; grid-template-columns: 340px 1fr; gap: 32px; align-items: start; }
.product-media { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; text-align: center; }
.product-media img { max-height: 300px; object-fit: contain; }
.media-placeholder { height: 240px; display: grid; place-items: center; }
.product-main h1 { font-family: var(--mono); }
.availability { margin: 12px 0; font-size: 1.05rem; }
.price-table { max-width: 360px; background: var(--white); border: 1px solid var(--line); border-radius: 8px; margin: 12px 0 4px; }
.price-table th, .price-table td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.add-form { display: flex; gap: 10px; align-items: center; margin-top: 18px; flex-wrap: wrap; }
.add-form input { width: 120px; }
.authorised { color: var(--ok); font-weight: 600; font-size: 0.9rem; margin: 10px 0 0; }
.spec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 32px; }
.kv { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.kv th, .kv td { padding: 9px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 0.93rem; }
.kv th { width: 42%; color: var(--ink-2); font-weight: 600; background: #fafcfe; }
.kv tr:last-child th, .kv tr:last-child td { border-bottom: 0; }
.alternates { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { background: #eaf3ff; color: var(--primary); border-radius: 999px; padding: 4px 12px; font-family: var(--mono); font-size: 0.88rem; }

/* manufacturers */
.maker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.maker-card { padding: 18px; color: var(--ink); }
.maker-card:hover { text-decoration: none; border-color: var(--accent); }
.maker-card img { max-height: 40px; margin-bottom: 8px; }
.maker-card h3 { margin: 0; }

/* forms */
.stack { display: grid; gap: 14px; }
.stack label, .form-grid label { display: grid; gap: 4px; font-weight: 600; font-size: 0.92rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.file-label { font-weight: 400 !important; color: var(--ink-2); }
.file-label input { border: 0; padding: 4px 0; }
.rfq-layout { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: start; }
.add-line { display: grid; grid-template-columns: 2fr 2fr 1fr auto; gap: 8px; margin-top: 12px; }
.success { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 36px; text-align: center; box-shadow: var(--shadow); }
.ref { font-family: var(--mono); background: #eaf3ff; padding: 2px 8px; border-radius: 6px; }
.contact-layout { display: grid; grid-template-columns: 1fr 1.4fr; gap: 32px; align-items: start; }
.contact-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.prose p { color: var(--ink-2); font-size: 1.05rem; }

/* footer */
.site-footer { background: var(--ink); color: #c9d6e3; margin-top: 48px; padding: 40px 0 24px; }
.site-footer a { color: #dbe7f3; }
.site-footer h4 { color: #fff; font-size: 0.95rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { padding: 3px 0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.2fr; gap: 24px; }
.footer-brand { color: #fff; font-weight: 800; font-size: 1.1rem; margin-bottom: 4px; }
.site-footer .muted { color: #9fb3c8; }
.copyright { grid-column: 1 / -1; border-top: 1px solid rgba(255, 255, 255, 0.12); padding-top: 16px; margin: 8px 0 0; }

/* toasts */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); transition: opacity 0.4s; max-width: 90vw; }
.toast-ok { background: var(--ok); }
.toast-error { background: var(--danger); }
.toast-out { opacity: 0; }

/* responsive */
@media (max-width: 960px) {
  .search-layout, .product-grid, .rfq-layout, .contact-layout, .spec-grid { grid-template-columns: 1fr; }
  .filters { position: static; max-height: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .nav-toggle { display: inline-block; margin-left: auto; }
  .site-nav { display: none; width: 100%; flex-direction: column; align-items: flex-start; padding: 8px 0 16px; gap: 10px; }
  .site-nav.open { display: flex; }
  .header-row { padding: 10px 0; }
  .header-search { order: 3; width: 100%; min-width: 0; }
  .hero-search { flex-direction: column; }
  .form-grid, .add-line { grid-template-columns: 1fr; }
  .results-table thead { display: none; }
  .results-table, .results-table tbody, .results-table tr, .results-table td { display: block; width: 100%; }
  .results-table tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  .results-table td { border: 0; padding: 4px 12px; }
  .results-table td[data-label]::before { content: attr(data-label); display: block; font-size: 0.75rem; color: var(--muted); text-transform: uppercase; }
  .results-table .actions { text-align: left; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* Filters: a collapsible box on phones and tablets, always open on wide screens. */
details.filters > summary { cursor: pointer; font-weight: 700; padding: 10px 0; list-style: none; }
details.filters > summary::-webkit-details-marker { display: none; }
details.filters > summary::after { content: " \25B8"; color: var(--muted); }
details.filters[open] > summary::after { content: " \25BE"; }
@media (min-width: 961px) { details.filters > summary { display: none; } }
.subcats { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.form-error { color: var(--danger); font-weight: 600; margin: 0; }
[aria-invalid="true"] { border-color: var(--danger) !important; }
#toasts:empty { display: none; }
