/* Bolboring — design direction B "Clean Engineering". Tokens first, then components. */
:root:root {
  --bb-bg: #f6f7fb;
  --bb-surface: #ffffff;
  --bb-text: #1d2140;
  --bb-muted: #5c6283;
  --bb-primary: #272b52;   /* logo navy */
  --bb-primary-600: #1a1d3b;
  --bb-primary-soft: #e8e9f3;
  --bb-accent: #d0202e;     /* red accent: actions and highlights (matches the red parts of the products) */
  --bb-accent-600: #a8161f;
  --bb-accent-soft: #fdecee;
  --bb-dark: #1d2140;
  --bb-border: #e2e4ee;
  --bb-ok: #16a34a;
  --bb-ok-soft: #dcfce7;
  --bb-danger: #b42318;
  --bb-radius: 12px;
  --bb-shadow: 0 2px 10px rgba(20, 30, 50, .07);
  --bb-shadow-lg: 0 6px 24px rgba(39, 43, 82, .14);
  --bb-font: "Vazirmatn", Tahoma, sans-serif;
  --bb-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Map onto Blocksy's palette so its own components follow the brand. */
  --theme-palette-color-1: var(--bb-primary);
  --theme-palette-color-2: var(--bb-primary-600);
  --theme-palette-color-3: var(--bb-muted);
  --theme-palette-color-4: var(--bb-text);
  --theme-palette-color-5: var(--bb-border);
  --theme-palette-color-6: #f1f2f8;
  --theme-palette-color-7: var(--bb-bg);
  --theme-palette-color-8: #ffffff;
  --theme-font-family: var(--bb-font);
  --theme-button-border-radius: 999px;
}

body { font-family: var(--bb-font); background: var(--bb-bg); color: var(--bb-text); }
h1, h2, h3, h4, h5, h6, button, input, select, textarea { font-family: var(--bb-font); }
.bb-mono { font-family: var(--bb-mono); direction: ltr; unicode-bidi: isolate; }
.bb-link { background: none; border: 0; padding: 0; color: var(--bb-primary); cursor: pointer; text-decoration: underline; font: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--bb-primary) 45%, transparent); outline-offset: 2px; }

/* Buttons */
.bb-btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; padding: .6em 1.2em; border-radius: 999px; border: 0; font-weight: 700; line-height: 1.4; text-decoration: none; cursor: pointer; transition: background .15s, transform .05s; }
.bb-btn:active { transform: translateY(1px); }
.bb-btn--primary { background: var(--bb-accent); color: #fff; }
.bb-btn--primary:hover { background: var(--bb-accent-600); color: #fff; }
.bb-btn--soft { background: var(--bb-primary-soft); color: var(--bb-primary); }
.bb-btn--soft:hover { background: #dcdeee; color: var(--bb-primary-600); }
.bb-btn--wa { background: var(--bb-ok-soft); color: var(--bb-ok); }
.bb-btn--wa:hover { background: #c7f5d6; color: #0f7a37; }

/* Dimensions d × D × B */
.bb-dims { display: flex; gap: 4px; margin: 6px 0; }
.bb-dims span { flex: 1; background: #f1f2f8; border-radius: 6px; text-align: center; padding: 3px 0; line-height: 1.2; }
.bb-dims small { display: block; color: var(--bb-muted); font-size: 10px; }
.bb-dims b { font-size: 13px; font-weight: 700; }
.bb-dims--big span { background: var(--bb-primary-soft); padding: 8px 0; border-radius: 10px; }
.bb-dims--big b { font-size: 22px; color: var(--bb-primary); }
.bb-dims--big small { font-size: 11px; }

.bb-price-inquiry { color: var(--bb-muted); font-weight: 600; }

/* Top bar */
.bb-topbar { background: var(--bb-dark); color: #c9cde2; font-size: 13px; border-bottom: 3px solid var(--bb-accent); }
.bb-topbar__inner { max-width: 1290px; margin: 0 auto; padding: 6px 16px; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.bb-topbar a { color: #fff; text-decoration: none; }
.bb-topbar__quote { margin-inline-start: auto; }
.bb-quote-count { display: inline-flex; min-width: 1.4em; height: 1.4em; padding: 0 .35em; border-radius: 999px; background: var(--bb-accent); color: #fff; font-size: 11px; align-items: center; justify-content: center; }
.bb-quote-count[hidden] { display: none; }
@media (max-width: 767px) { .bb-topbar__hours, .bb-topbar__ship { display: none; } }

/* Footer (Blocksy's footer hidden) */
.ct-footer { display: none !important; }
.bb-footer { background: var(--bb-dark); color: #c9d3e2; margin-top: 48px; }
.bb-footer__inner { max-width: 1290px; margin: 0 auto; padding: 40px 16px 24px; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; }
.bb-footer a { color: #e6ecf5; text-decoration: none; display: block; margin: 4px 0; }
.bb-footer a:hover { color: #fff; text-decoration: underline; }
.bb-footer__brand { color: #fff; font-weight: 800; font-size: 18px; margin: 0 0 8px; }
.bb-footer__title { color: #fff; font-weight: 700; margin: 0 0 8px; }
.bb-footer__trust img { background: #fff; border-radius: 8px; padding: 4px; }
.bb-footer__copy { text-align: center; font-size: 12px; padding: 12px 16px 16px; margin: 0; border-top: 1px solid rgba(255, 255, 255, .08); }
@media (max-width: 767px) { .bb-footer__inner { grid-template-columns: 1fr 1fr; } .bb-footer__about { grid-column: 1 / -1; } }

/* Mobile bar */
.bb-mobilebar { display: none; }
@media (max-width: 767px) {
  body { padding-bottom: 64px; }
  .bb-mobilebar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; inset-inline: 0; bottom: 0; z-index: 90; background: var(--bb-surface); border-top: 1px solid var(--bb-border); box-shadow: 0 -4px 16px rgba(20, 30, 50, .08); padding-bottom: env(safe-area-inset-bottom); }
  .bb-mobilebar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0; font-size: 12px; color: var(--bb-text); text-decoration: none; position: relative; }
  .bb-mobilebar a span[aria-hidden] { font-size: 18px; }
  .bb-mobilebar .bb-quote-count { position: absolute; top: 4px; inset-inline-start: calc(50% + 6px); }
  .bb-mobilebar__wa { color: var(--bb-ok) !important; font-weight: 700; }
}

/* Finder */
.bb-finder { background: var(--bb-surface); border-radius: var(--bb-radius); box-shadow: var(--bb-shadow-lg); padding: 12px; }
.bb-finder__tabs { display: flex; gap: 16px; margin-bottom: 10px; border-bottom: 1px solid var(--bb-border); }
.bb-finder__tab { background: none; border: 0; padding: 6px 2px; color: var(--bb-muted); cursor: pointer; font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.bb-finder__tab[aria-selected="true"] { color: var(--bb-primary); border-bottom-color: var(--bb-accent); }
.bb-finder__form { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.bb-finder__form[hidden] { display: none; }
.bb-finder__input { flex: 1; min-width: 0; background: #f1f2f8; border: 1px solid transparent; border-radius: 10px; padding: 10px 12px; font-size: 16px; text-align: left; }
.bb-finder__input:focus { border-color: var(--bb-primary); background: #fff; }
.bb-finder__dims { display: flex; gap: 8px; flex: 1; min-width: 0; }
.bb-finder__dims label { flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--bb-muted); min-width: 0; }
.bb-finder__tol { flex-basis: 100%; order: 3; font-size: 13px; color: var(--bb-muted); }
.bb-finder__submit { padding-inline: 1.6em; }
.bb-finder__results:not(:empty) { margin-top: 12px; }
.bb-finder__results[aria-busy="true"] { opacity: .5; }
.bb-finder__error { color: var(--bb-danger); }

/* Results */
.bb-results__title { font-size: 15px; margin: 12px 0 8px; }
.bb-results__count { color: var(--bb-muted); font-weight: 400; }
.bb-results__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.bb-item { background: var(--bb-surface); border: 1px solid var(--bb-border); border-radius: var(--bb-radius); padding: 10px; display: flex; gap: 10px; }
.bb-item__thumb img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; background: #eef0f6; }
.bb-item__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bb-item__title { font-weight: 700; color: var(--bb-text); text-decoration: none; font-size: 14px; }
.bb-item__meta { color: var(--bb-muted); font-size: 12px; }
.bb-item__brand { color: var(--bb-primary); font-weight: 700; }
.bb-item__price { font-weight: 700; font-size: 14px; }
.bb-item .bb-btn { margin-top: 4px; padding: .35em .9em; font-size: 13px; align-self: flex-start; }
.bb-empty { background: var(--bb-primary-soft); border-radius: var(--bb-radius); padding: 16px; text-align: center; }
.bb-empty__title { font-weight: 800; font-size: 16px; color: var(--bb-primary); margin: 0 0 4px; }

/* Quote */
.bb-quote { display: grid; gap: 24px; }
.bb-quote__table { width: 100%; border-collapse: collapse; background: var(--bb-surface); border-radius: var(--bb-radius); overflow: hidden; margin-bottom: 10px; }
.bb-quote__table th, .bb-quote__table td { padding: 10px; border-bottom: 1px solid var(--bb-border); text-align: start; }
.bb-quote__table input[type="number"] { width: 90px; }
.bb-quote__empty { background: var(--bb-surface); border-radius: var(--bb-radius); padding: 16px; }
.bb-quote__add-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.bb-quote__add-line input { flex: 1; min-width: 180px; }
.bb-quote-form { background: var(--bb-surface); border-radius: var(--bb-radius); box-shadow: var(--bb-shadow); padding: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.bb-quote-form h2, .bb-quote-form .bb-notice--error, .bb-quote-form button, .bb-quote-form .bb-field:has(textarea), .bb-quote-form .bb-field:has(input[type="file"]) { grid-column: 1 / -1; }
.bb-field { display: flex; flex-direction: column; gap: 4px; margin: 0 0 12px; }
.bb-field input, .bb-field select, .bb-field textarea { border: 1px solid var(--bb-border); border-radius: 10px; padding: 10px; background: #fff; font-size: 16px; }
.bb-field--error input, .bb-field--error select, .bb-field--error textarea { border-color: var(--bb-danger); }
.bb-field__error { color: var(--bb-danger); font-size: 13px; }
.bb-notice--error { background: #fef3f2; color: var(--bb-danger); border-radius: 10px; padding: 10px; }
.bb-hp { position: absolute !important; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.bb-quote-done { background: var(--bb-surface); border-radius: var(--bb-radius); box-shadow: var(--bb-shadow); padding: 24px; text-align: center; }
.bb-quote-done__title { font-size: 20px; font-weight: 800; color: var(--bb-ok); }
@media (max-width: 767px) { .bb-quote-form { grid-template-columns: 1fr; } .bb-quote__table th:nth-child(2), .bb-quote__table td:nth-child(2) { display: none; } }

/* Product actions & add-to-quote */
.bb-product-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.bb-product-actions .bb-btn { flex: 1; min-width: 150px; }
.bb-quote-add { display: flex; gap: 8px; align-items: center; }
.bb-quote-add__qty { width: 80px; border-radius: 999px; border: 1px solid var(--bb-border); padding: 8px 12px; text-align: center; }

/* Priced-only toggle */
.bb-priced-toggle { display: flex; align-items: center; gap: 8px; color: var(--bb-text); text-decoration: none; }
.bb-priced-toggle__box { width: 18px; height: 18px; border-radius: 5px; border: 2px solid var(--bb-border); background: #fff; }
.bb-priced-toggle.is-active .bb-priced-toggle__box { background: var(--bb-primary); border-color: var(--bb-primary); box-shadow: inset 0 0 0 3px #fff; }

/* Brands */
.bb-brands--grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.bb-brands--grid .bb-brand { background: var(--bb-surface); border-radius: var(--bb-radius); box-shadow: var(--bb-shadow); padding: 16px; display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--bb-text); }
.bb-brand__name { font-weight: 800; font-size: 20px; letter-spacing: .5px; }
.bb-brand__count { color: var(--bb-primary); font-size: 13px; }
.bb-brand__desc { color: var(--bb-muted); font-size: 13px; }
.bb-brands--strip { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; background: var(--bb-surface); border-radius: var(--bb-radius); padding: 16px 20px; }
.bb-brands--strip .bb-brand { color: #8593a8; font-weight: 800; font-size: 18px; letter-spacing: 1px; text-decoration: none; }
.bb-brands--strip .bb-brand:hover { color: var(--bb-primary); }

/* Red accent on WooCommerce / Blocksy buy buttons */
.single_add_to_cart_button, .add_to_cart_button, .checkout-button, #place_order, .wc-block-components-checkout-place-order-button {
  --theme-button-background-initial-color: var(--bb-accent);
  --theme-button-background-hover-color: var(--bb-accent-600);
}
.woocommerce span.onsale, .ct-woo-badge-onsale { background: var(--bb-accent); color: #fff; }
.woocommerce-message, .woocommerce-info { border-top-color: var(--bb-accent); }

/* Brand: logo when the brand has one, otherwise a name badge */
.bb-brand-mark { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; }
.bb-brand-mark .bb-brand-logo { height: 22px; width: auto; max-width: 90px; object-fit: contain; }
.bb-card-brand { display: inline-block; background: var(--bb-primary-soft); color: var(--bb-primary); border-radius: 6px; padding: 0 6px; font-size: 11px; font-weight: 700; }
.bb-brand .bb-brand-logo { display: block; height: 40px; width: auto; max-width: 120px; object-fit: contain; margin: 0 auto 6px; }
.bb-brands--strip .bb-brand--logo .bb-brand__name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Header: logo beside the shop name */
header .site-branding[data-logo] { display: flex; flex-direction: row; align-items: center; gap: 10px; }
header .site-branding .site-logo-container img { max-height: 56px; width: auto; }
@media (max-width: 999px) { header .site-branding .site-logo-container img { max-height: 42px; } }

/* Spec tooltips: "؟" next to each spec name; shows on hover, keyboard focus and tap */
.bb-tip { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-inline-start: 6px; padding: 0; border: 1px solid var(--bb-border); border-radius: 50%; background: var(--bb-surface); color: var(--bb-muted); font: 700 11px/1 var(--bb-font); cursor: help; vertical-align: middle; }
.bb-tip:hover, .bb-tip:focus { color: #fff; background: var(--bb-primary); border-color: var(--bb-primary); }
.bb-tip__box { position: absolute; z-index: 30; top: calc(100% + 8px); inset-inline-start: -8px; width: max-content; max-width: min(280px, 80vw); padding: 10px 12px; border-radius: 10px; background: var(--bb-dark); color: #fff; font: 400 13px/1.8 var(--bb-font); text-align: start; white-space: normal; box-shadow: var(--bb-shadow-lg); opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .15s, transform .15s; pointer-events: none; }
.bb-tip__box::after { content: ""; position: absolute; bottom: 100%; inset-inline-start: 12px; border: 6px solid transparent; border-bottom-color: var(--bb-dark); }
.bb-tip:hover .bb-tip__box, .bb-tip:focus .bb-tip__box { opacity: 1; visibility: visible; transform: none; }

/* Catalog link */
.bb-catalog { display: inline-flex; align-items: center; gap: 4px; color: var(--bb-primary); font-weight: 600; text-decoration: none; }
.bb-catalog:hover { color: var(--bb-accent); text-decoration: underline; }
.bb-catalog--small { font-size: 12px; margin-top: 4px; }
.bb-catalog--button { margin: 12px 0; padding: 8px 16px; border: 1px solid var(--bb-border); border-radius: 999px; background: var(--bb-surface); }
.bb-catalog--button:hover { border-color: var(--bb-accent); text-decoration: none; }
