/* Bustan Holding brand: blue #0065A2 · navy #03476E · charcoal #2D2E32 · greys #EEEEEE / #CED6D9 */
:root {
  --blue: #0065A2; --blue-dark: #03476E; --ink: #2D2E32; --muted: #6B7280; --line: #CED6D9;
  --soft: #F2F5F7; --white: #fff; --ok: #1E7F4F; --warn: #A15C00; --bad: #B42318; --radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: "Source Sans 3", "Segoe UI", Arial, sans-serif; color: var(--ink); background: var(--soft); font-size: 16px; line-height: 1.45; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
h1, h2, h3 { color: var(--blue-dark); letter-spacing: .04em; text-transform: uppercase; font-weight: 700; }
h1 { font-size: 1.6rem; margin: 28px 0 6px; }
h2 { font-size: 1.15rem; margin: 22px 0 10px; }
.lead { color: var(--muted); margin: 0 0 20px; }

/* header */
.topbar { background: var(--white); border-bottom: 3px solid var(--blue); position: sticky; top: 0; z-index: 10; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; flex-wrap: wrap; }
.brand img { height: 42px; display: block; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { padding: 8px 12px; border-radius: 8px; color: var(--ink); font-weight: 600; font-size: .95rem; }
.nav a.active, .nav a:hover { background: var(--soft); color: var(--blue); text-decoration: none; }
.cart-link { background: var(--blue); color: #fff !important; }
.cart-link:hover { background: var(--blue-dark) !important; }
.badge { display: inline-block; min-width: 22px; padding: 0 6px; border-radius: 11px; background: #fff; color: var(--blue); font-size: .8rem; text-align: center; margin-left: 4px; }
.subbar { background: var(--blue-dark); color: #E6EEF4; font-size: .9rem; }
.subbar a { color: #fff; text-decoration: underline; }
.subbar-inner { display: flex; justify-content: space-between; align-items: center; min-height: 36px; gap: 12px; flex-wrap: wrap; }
.subbar .muted { color: #B9CCDA; }
form.inline { display: inline; margin: 0; }
button.link { background: none; border: 0; color: #fff; text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }

/* building blocks */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.grid { display: grid; gap: 14px; }
.cols-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.products { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border-radius: 8px; border: 1px solid var(--blue); background: var(--blue); color: #fff; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none !important; }
.btn:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn.secondary { background: #fff; color: var(--blue); }
.btn.secondary:hover { background: var(--soft); }
.btn.small { padding: 6px 12px; font-size: .9rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; width: 100%; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(0,101,162,.35); border-color: var(--blue); }
label { display: block; font-weight: 600; margin: 12px 0 6px; font-size: .95rem; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1 1 200px; }
.notice { padding: 12px 16px; border-radius: 8px; margin: 14px 0; border: 1px solid; }
.notice.ok { background: #E8F5EE; border-color: #A7D7BC; color: var(--ok); }
.notice.warn { background: #FFF4E0; border-color: #F2C879; color: var(--warn); }
.notice.bad { background: #FDECEA; border-color: #F5B7B1; color: var(--bad); }
.notice.info { background: #E6F0F7; border-color: #9BC2DD; color: var(--blue-dark); }
.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--soft); color: var(--blue-dark); border: 1px solid var(--line); }
.chip.ok { background: #E8F5EE; color: var(--ok); border-color: #A7D7BC; }
.chip.warn { background: #FFF4E0; color: var(--warn); border-color: #F2C879; }
.chip.bad { background: #FDECEA; color: var(--bad); border-color: #F5B7B1; }
.chip.info { background: #E6F0F7; color: var(--blue-dark); border-color: #9BC2DD; }

/* sign-in */
.auth { max-width: 420px; margin: 56px auto; }
.auth .card { padding: 28px; }
.code-input { font-size: 1.8rem; letter-spacing: .5em; text-align: center; }

/* company choice */
.company { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; height: 100%; }
.company img { height: 64px; }
.company h3 { margin: 4px 0 0; }

/* shop */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 16px; }
.toolbar input { flex: 1 1 260px; }
.toolbar select { flex: 0 1 240px; }
.product { display: flex; flex-direction: column; gap: 6px; }
.product .name { font-weight: 600; min-height: 2.8em; }
.product .meta { font-size: .85rem; color: var(--muted); }
.product .price { font-size: 1.25rem; font-weight: 700; color: var(--blue-dark); margin-top: auto; }
.product .price small { font-size: .8rem; font-weight: 400; color: var(--muted); }
.qty { display: flex; gap: 6px; }
.qty input { width: 72px; flex: 0 0 72px; text-align: center; }
.in-cart { font-size: .85rem; color: var(--ok); font-weight: 600; min-height: 1.2em; }
.pager { display: flex; gap: 8px; justify-content: center; align-items: center; margin: 22px 0; }

/* tables */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { padding: 10px 12px; border-bottom: 1px solid #E5EAEE; text-align: left; vertical-align: middle; }
th { background: var(--soft); color: var(--blue-dark); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.total-row td { font-weight: 700; font-size: 1.05rem; }
.searchable { display: flex; flex-direction: column; gap: 6px; min-width: 240px; }
[dir=auto] { unicode-bidi: plaintext; }

.footer { margin-top: 48px; padding: 20px 0 28px; font-size: .85rem; color: var(--muted); border-top: 1px solid var(--line); background: #fff; }

@media (max-width: 640px) {
  h1 { font-size: 1.3rem; }
  .brand img { height: 34px; }
  .nav { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 6px; }
  .nav a { white-space: nowrap; }
  .products { grid-template-columns: 1fr 1fr; gap: 10px; }
  .card { padding: 14px; }
  th, td { padding: 8px; }
}
.spaced { margin-top: 16px; }
.actions { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }
.check { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; }
.check input { width: auto; }
.shrink { flex: 0 0 auto !important; }
.qty-cell { width: 90px; text-align: center; }
.company .btn { margin-top: auto; }

/* ---- shop experience ---- */
.shop-head { margin: 22px 0 6px; }
.search-hero { display: flex; gap: 10px; }
.search-box { position: relative; flex: 1; }
.search-box input { font-size: 1.05rem; padding: 14px 16px; border-width: 2px; }
.suggest { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 28px rgba(3,71,110,.15); overflow: hidden; }
.sg { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; color: var(--ink); border-bottom: 1px solid #EEF2F5; }
.sg:hover { background: var(--soft); text-decoration: none; }
.sg.brand { color: var(--blue-dark); background: #F7FAFC; }
.brand-strip { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; }
.brand-chip { color: var(--blue-dark); }
.brand-chip:hover, .brand-chip.selected { background: var(--blue); color: #fff; border-color: var(--blue); text-decoration: none; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin: 18px 0 12px; flex-wrap: wrap; }
.tabs a, .tab-btn { padding: 10px 16px; font-weight: 600; color: var(--muted); border: 0; background: none; font: inherit; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tabs a.active { color: var(--blue); border-bottom-color: var(--blue); text-decoration: none; }
.tabs a:hover, .tab-btn:hover { color: var(--blue); text-decoration: none; }
.tab-btn { margin-left: auto; color: var(--blue); }
.quick { margin-bottom: 16px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.filters select { flex: 1 1 200px; max-width: 320px; }
.result-line { margin: 8px 0 14px; }
.brand-tag { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--blue); }
.usual { font-size: .8rem; color: var(--ok); background: #E8F5EE; border-radius: 6px; padding: 3px 8px; }
.price-kind { display: inline-block; font-size: .7rem; font-weight: 600; padding: 1px 6px; border-radius: 4px; margin-left: 4px; vertical-align: middle; }
.price-kind.yours { background: #E8F5EE; color: var(--ok); }
.price-kind.indicative { background: var(--soft); color: var(--muted); }
.qty { align-items: center; }
.qty .step { width: 34px; height: 38px; border: 1px solid var(--line); background: #fff; border-radius: 8px; font-size: 1.1rem; cursor: pointer; color: var(--blue-dark); }
.qty .step:hover { background: var(--soft); }
.qty input { width: 60px; flex: 0 0 60px; padding: 8px 4px; }
.qty .add { flex: 1; }
.brand-filter { max-width: 360px; margin-bottom: 14px; }
.brand-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.brand-tile { display: flex; flex-direction: column; gap: 4px; padding: 16px; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.brand-tile:hover { border-color: var(--blue); box-shadow: 0 4px 14px rgba(0,101,162,.12); text-decoration: none; }
.brand-name { font-weight: 700; color: var(--blue-dark); }
.icon-btn { border: 1px solid var(--line); background: #fff; color: var(--bad); border-radius: 6px; width: 32px; height: 32px; cursor: pointer; }
.icon-btn:hover { background: #FDECEA; }
.small-text { font-size: .8rem; }
@media (max-width: 640px) {
  .search-hero { flex-direction: column; }
  .tab-btn { margin-left: 0; }
  .qty .step { width: 30px; }
}
.price-kind.last { background: #E6F0F7; color: var(--blue-dark); }

/* ---- product pictures + cards / table views ---- */
.pimg { margin: -20px -20px 6px; aspect-ratio: 4 / 3; background: #fff; border-bottom: 1px solid #EEF2F5;
        border-radius: var(--radius) var(--radius) 0 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.pimg img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.ph { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-size: 2.6rem; font-weight: 700;
      color: #9BB8CE; background: linear-gradient(135deg, #F2F5F7, #E6EEF4); letter-spacing: 0; }
.result-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.view-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.view-toggle a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; font-size: .88rem; font-weight: 600; color: var(--muted); }
.view-toggle a + a { border-left: 1px solid var(--line); }
.view-toggle a.on { background: var(--blue); color: #fff; }
.view-toggle a:hover { text-decoration: none; color: var(--blue); }
.view-toggle a.on:hover { color: #fff; }
.view-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.plist td { padding: 8px 12px; }
.plist .thumb { width: 64px; }
.plist .thumb img, .plist .thumb .ph { width: 52px; height: 52px; border-radius: 8px; border: 1px solid #EEF2F5; object-fit: contain; background: #fff; }
.plist .thumb .ph { font-size: 1.2rem; }
.plist .pname { min-width: 220px; font-weight: 600; }
.plist .pname .brand-tag { display: block; font-size: .7rem; }
.plist .pname .usual { display: inline-block; margin-top: 3px; font-weight: 600; }
.plist .pcode { white-space: nowrap; font-size: .9rem; }
.plist .pprice { font-weight: 700; color: var(--blue-dark); white-space: nowrap; }
.plist .pprice small { font-weight: 400; color: var(--muted); }
.plist .pprice .price-kind { display: block; width: fit-content; margin: 2px 0 0 auto; }
.plist .pqty { width: 260px; }
.plist .pqty .in-cart { min-height: 0; margin-top: 2px; }
.plist tbody tr:hover { background: #FAFCFD; }
.cart-thumb { width: 44px; height: 44px; border-radius: 6px; border: 1px solid #EEF2F5; object-fit: contain; background: #fff; vertical-align: middle; }
@media (max-width: 640px) {
  .pimg { margin: -14px -14px 6px; }
  .plist .pcode, .plist th:nth-child(3) { display: none; }
  .plist .pqty { width: auto; min-width: 200px; }
}
.cart-prod { display: flex; gap: 10px; align-items: center; }
@media (max-width: 640px) {
  .plist, .plist tbody { display: block; }
  .plist thead { display: none; }
  .plist tr { display: grid; grid-template-columns: 56px 1fr auto; column-gap: 10px; padding: 10px 12px; border-bottom: 1px solid #E5EAEE; align-items: start; }
  .plist td { border: 0; padding: 0; }
  .plist .thumb { width: auto; }
  .plist .pname { min-width: 0; font-size: .95rem; }
  .plist .pqty { grid-column: 1 / -1; margin-top: 8px; min-width: 0; }
  .plist .pprice { text-align: right; }
}
.credit { margin: 12px 0 0; }
/* who the order is for */
.subbar .for { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 6px 0; }
.subbar .lbl { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #9CC8E6; }
.subbar .cust { font-size: 1.02rem; color: #fff; }
.subbar .cno { font-size: .78rem; font-weight: 700; color: var(--blue-dark); background: #fff; border-radius: 999px; padding: 1px 9px; }
.subbar .from { color: #D6E7F3; }
.subbar .who { white-space: nowrap; }
.order-for { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; background: #E6F0F7; border: 1px solid #9BC2DD;
             border-radius: 10px; padding: 12px 16px; margin: 0 0 14px; color: var(--blue-dark); }
.order-for .k { font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #5b7a92; display: block; }
.order-for b { font-size: 1.02rem; }
