


/* ============ Custom Scrollbar ============ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg, #f7f8fa); }
::-webkit-scrollbar-thumb {
  background: var(--border, #e2e5e9);
  border-radius: 10px;
  border: 2px solid var(--bg, #f7f8fa);
}
::-webkit-scrollbar-thumb:hover { background: var(--accent, #4a7fb5); }
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border, #e2e5e9) var(--bg, #f7f8fa);
}

html { min-height: 100vh; }
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
}

.site-header { flex-shrink: 0; }
.site-main { flex: 1; width: 100%; }
.site-footer { flex-shrink: 0; }

.hazard-strip {
  height: 3px;
  width: 100%;
  background: var(--accent);
}
.hazard-strip--fixed {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
}

/* ============ Header ============ */
.site-header {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  transition: box-shadow 0.25s, padding 0.25s;
}
.site-header--scrolled {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}
.site-header--scrolled .site-header__inner { padding-block: 10px; }
.site-header__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 28px;
  position: relative;
  transition: padding 0.25s;
}

.main-nav {
  display: flex;
  gap: 22px;
  flex-shrink: 0;
}
.main-nav a {
  font-size: 14px;
  color: var(--text-muted);
  transition: color 0.15s;
  position: relative;
}
.main-nav a:hover { color: var(--text); }
.main-nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  right: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.2s;
}
.main-nav a:hover::after { width: 100%; }

.header-search {
  flex: 1;
  max-width: 380px;
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 6px 4px 14px;
}
.header-search input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 13.5px;
  color: var(--text);
  padding: 6px 4px;
}
.header-search input:focus { outline: none; }
.header-search button {
  background: var(--accent);
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.header-actions { display: flex; gap: 8px; margin-right: auto; }
.header-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  background: var(--panel-raised);
  transition: background 0.15s, color 0.15s;
}
.header-icon-btn:hover { background: var(--accent); color: #fff; }

.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.mobile-toggle span { width: 20px; height: 2px; background: var(--text); border-radius: 2px; }

@media (max-width: 900px) {
  .main-nav, .header-search { display: none; }
  .mobile-toggle { display: flex; }
  .site-header__inner { gap: 8px; padding: 10px 14px; }
  .header-actions { margin-right: 0; gap: 6px; }

  .main-nav--open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    gap: 14px;
    z-index: 60;
  }
}


/* ============ Footer ============ */
.site-footer {
  background: var(--panel);
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.site-footer__grid {
  max-width: 1280px;
  margin: 0 auto;
  padding: 50px 24px 30px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 32px;
}
@media (max-width: 860px) {
  .site-footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 500px) {
  .site-footer__grid { grid-template-columns: 1fr; }
}

.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col .brand-mark { margin-bottom: 6px; }
.footer-col p { font-size: 13px; color: var(--text-muted); line-height: 1.8; margin: 0; }
.footer-col a { font-size: 13.5px; color: var(--text-muted); transition: color 0.15s; }
.footer-col a:hover { color: var(--accent); }
.footer-col__title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  margin: 0 0 6px;
}
.footer-col__note { margin-bottom: 4px; }

.footer-social { display: flex; gap: 10px; margin-top: 6px; }
.footer-social a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: border-color 0.2s, color 0.2s, transform 0.2s, background 0.2s;
}
.footer-social a svg { flex-shrink: 0; }
.footer-social a:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: scale(1.1);
  background: rgba(74, 127, 181, 0.06);
}

/* Mobile refinements */
@media (max-width: 480px) {
  .footer-social { 
    gap: 10px; 
    justify-content: center;  /* Center on mobile */
    margin-top: 16px;
  }
  .footer-social a { 
    width: 44px;  /* Meet 44px minimum */
    height: 44px; 
    font-size: 13px;
  }
}

@media (max-width: 380px) {
  .footer-social a { 
    width: 36px; 
    height: 36px; 
  }
  .footer-social a svg { width: 16px; height: 16px; }
}
}

/* RTL footer social */
[dir="rtl"] .footer-social {
  flex-direction: row-reverse;  /* Reverse icon order for RTL */
}

[dir="rtl"] .footer-col {
  align-items: flex-end;  /* Right-align content in RTL */
}

[dir="rtl"] .footer-col--brand {
  align-items: flex-end;
}

[dir="rtl"] .footer-col--brand .footer-social {
  flex-direction: row-reverse;
}

.newsletter-form { display: flex; gap: 8px; }
.newsletter-form input {
  flex: 1;
  min-width: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text);
}
.newsletter-form input:focus { outline: none; border-color: var(--accent); }
.newsletter-form button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 0 16px;
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
}
.newsletter-form button:hover { background: var(--accent-dim, #3a6690); }

.footer-contact-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 8px;
}
.footer-contact-line svg { flex-shrink: 0; margin-top: 3px; }
.footer-contact-line a { color: var(--text-muted); text-decoration: none; }
.footer-contact-line a:hover { color: var(--accent); }
.footer-contact-line--hours { margin-top: 4px; }

.site-footer__bottom {
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 8px;
}
.site-footer__badge {
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent);
  border: 1px dashed var(--border);
  padding: 4px 10px;
  border-radius: 20px;
}
.footer-social a svg { flex-shrink: 0; }
/* Social media brand colors */
.footer-social a:has(svg) {
  background: transparent;
}

.footer-social a[aria-label*="Instagram" i],
.footer-social a[title*="Instagram" i] {
  color: #E4405F;
}

.footer-social a[aria-label*="Telegram" i],
.footer-social a[title*="Telegram" i] {
  color: #26A5E4;
}

.footer-social a[aria-label*="WhatsApp" i],
.footer-social a[title*="WhatsApp" i] {
  color: #25D366;
}
/* ============ Language Toggle ============ */
.lang-toggle { display: flex; align-items: center; }
.lang-toggle__btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--panel-raised);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.lang-toggle__btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ============ LTR Support ============ */
[dir="ltr"] .main-nav a::after {
  right: auto;
  left: 0;
}
[dir="ltr"] .header-actions {
  margin-right: 0;
  margin-left: auto;
}

[dir="ltr"] .header-search {
  padding: 4px 14px 4px 6px;
}
[dir="ltr"] .site-footer__bottom {
  direction: ltr;
}
[dir="ltr"] .breadcrumb {
  direction: ltr;
}
[dir="ltr"] .breadcrumb-sep {
  margin: 0 8px 0 0;
}
@media (max-width: 900px) {
  [dir="ltr"] .header-actions { margin-left: 0; }
}

/* RTL header actions */
[dir="rtl"] .header-actions {
  margin-right: auto;
  margin-left: 0;
}

/* ─── Social Floating Widget ─── */
.social-widget {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 900;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-start;
  gap: 0;
}
[dir="ltr"] .social-widget {
  left: 24px;
  align-items: flex-start;
}
[dir="rtl"] .social-widget {
  right: 24px;
  left: auto;
  align-items: flex-end;
}

.social-widget__toggle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(74,127,181,0.35);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.3s;
  position: relative;
  z-index: 2;
}
.social-widget__toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(74,127,181,0.45);
}
.social-widget__toggle:active {
  transform: scale(0.95);
}
.social-widget__close {
  display: none;
}
.social-widget.is-open .social-widget__toggle svg:first-child {
  display: none;
}
.social-widget.is-open .social-widget__close {
  display: block;
}
.social-widget.is-open .social-widget__toggle {
  transform: rotate(90deg);
}

.social-widget__list {
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  padding-bottom: 12px;
  pointer-events: none;
  visibility: hidden;
  height: 0;
  overflow: hidden;
}
.social-widget__item {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(0,0,0,0.18);
  opacity: 0;
  transform: scale(0.3) translateY(20px);
  transition: opacity 0.3s cubic-bezier(0.34,1.56,0.64,1),
              transform 0.3s cubic-bezier(0.34,1.56,0.64,1),
              box-shadow 0.2s;
  pointer-events: none;
}
.social-widget.is-open .social-widget__list {
  pointer-events: auto;
  visibility: visible;
  height: auto;
  overflow: visible;
}
.social-widget.is-open .social-widget__item {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

/* staggered entrance — bottom item appears first */
.social-widget.is-open .social-widget__item:nth-child(1) { transition-delay: 0s; }
.social-widget.is-open .social-widget__item:nth-child(2) { transition-delay: 0.05s; }
.social-widget.is-open .social-widget__item:nth-child(3) { transition-delay: 0.1s; }
.social-widget.is-open .social-widget__item:nth-child(4) { transition-delay: 0.15s; }

/* reverse stagger on close */
.social-widget:not(.is-open) .social-widget__item:nth-child(1) { transition-delay: 0.12s; }
.social-widget:not(.is-open) .social-widget__item:nth-child(2) { transition-delay: 0.08s; }
.social-widget:not(.is-open) .social-widget__item:nth-child(3) { transition-delay: 0.04s; }
.social-widget:not(.is-open) .social-widget__item:nth-child(4) { transition-delay: 0s; }

.social-widget__item:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.social-widget__item--telegram { background: #0088cc; }
.social-widget__item--instagram { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.social-widget__item--whatsapp { background: #25d366; }
.social-widget__item--rubika { background: #5c3d99; }

@media (prefers-reduced-motion: reduce) {
  .social-widget__toggle,
  .social-widget__list,
  .social-widget__item {
    transition: none !important;
  }
}

@media (max-width: 768px) {
  .social-widget { bottom: 16px; left: 16px; }
  [dir="rtl"] .social-widget { left: auto; right: 16px; }
  .social-widget__toggle { width: 46px; height: 46px; }
  .social-widget__item { width: 40px; height: 40px; }
}

/* ============ Mobile Refinements (320-430px) ============ */

/* --- Header: Mobile search in dropdown, touch targets --- */
@media (max-width: 900px) {
  .main-nav--open .header-search {
    display: flex;
    width: 100%;
    max-width: none;
    margin-top: 8px;
    padding: 10px 12px;
  }
  .main-nav--open .header-search input { font-size: 16px; }
  .main-nav--open .header-search button { width: 40px; height: 40px; }
  .main-nav--open .lang-toggle { width: 100%; margin-top: 8px; }
  .main-nav--open .lang-toggle__btn { width: 100%; text-align: center; }

  .header-icon-btn { width: 44px; height: 44px; }
  .mobile-toggle { width: 44px; height: 44px; }
}

/* --- Touch targets: Minimum 44x44px for all interactive elements --- */
@media (max-width: 480px) {
  .header-icon-btn { width: 40px; height: 40px; }
  .mobile-toggle { width: 40px; height: 40px; gap: 3px; }
  .mobile-toggle span { width: 18px; }
  .lang-toggle__btn { padding: 4px 10px; font-size: 10px; }
  .filter-toggle { width: 40px; height: 40px; }
  .btn-primary,
  .btn-outline,
  .btn-secondary,
  .btn-ghost {
    min-height: 48px;
    min-width: 48px;
  }
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="password"],
  input[type="search"],
  textarea,
  select {
    min-height: 48px;
    font-size: 16px; /* Prevents zoom on iOS */
  }
  .qty-selector button,
  .qty-selector--bom button { width: 48px; height: 48px; }
  .checkout-radio-card,
  .workorder-radio-card { padding: 16px; }
  .payment-bank-card__copy { width: 44px; height: 44px; }
  .receipt-upload-btn button { min-height: 48px; }
}

/* --- Footer refinements for ultra-small screens --- */
@media (max-width: 380px) {
  .site-footer__grid { padding: 32px 16px 20px; gap: 24px; }
  .footer-col__title { font-size: 10px; }
  .footer-col a { font-size: 12.5px; }
  .footer-col p { font-size: 12px; }
  .footer-social a { width: 36px; height: 36px; }
  .footer-social a svg { width: 16px; height: 16px; }
  .newsletter-form { flex-direction: column; }
  .newsletter-form button { width: 100%; padding: 12px; }
  .footer-contact-line { font-size: 11.5px; }
  .site-footer__bottom { padding: 14px 16px; font-size: 11px; }
  .site-footer__badge { font-size: 10px; padding: 3px 8px; }
}

/* --- Ultra-compact header at ≤360px --- */
@media (max-width: 360px) {
  .site-header__inner { gap: 6px; padding: 8px 10px; }
  .header-actions { gap: 4px; }
  .header-icon-btn { width: 36px; height: 36px; }
  .header-icon-btn svg { width: 16px; height: 16px; }
  .mobile-toggle { width: 36px; height: 36px; gap: 2px; }
  .mobile-toggle span { width: 16px; height: 2px; }
  .lang-toggle__btn { padding: 3px 8px; font-size: 9px; }
  .brand-mark { font-size: 13px; letter-spacing: 0.1em; }
}

/* --- Social widget for ultra-small screens --- */
@media (max-width: 430px) {
  .social-widget { bottom: 12px; left: 12px; }
  [dir="rtl"] .social-widget { left: auto; right: 12px; }
  .social-widget__toggle { width: 44px; height: 44px; }
  .social-widget__item { width: 38px; height: 38px; }
}

@media (max-width: 360px) {
  .social-widget { bottom: 10px; left: 10px; }
  [dir="rtl"] .social-widget { left: auto; right: 10px; }
  .social-widget__toggle { width: 40px; height: 40px; }
  .social-widget__item { width: 36px; height: 36px; }
}

/* --- Language toggle in mobile menu --- */
@media (max-width: 900px) {
  .main-nav--open .lang-toggle { display: flex; }
}

/* --- Breadcrumb overflow prevention --- */
@media (max-width: 480px) {
  .breadcrumb { overflow-x: auto; white-space: nowrap; padding-bottom: 4px; }
  .breadcrumb::-webkit-scrollbar { height: 4px; }
}

/* --- Page hero title scaling --- */
@media (max-width: 430px) {
  .page-hero__title,
  .hero__title,
  .form-title,
  .order-hero__title,
  .checkout-header__title,
  .workorder-hero__title,
  .workorder-payment-card__title {
    font-size: clamp(22px, 5.5vw, 28px);
  }
}

/* --- Gauge SVG scaling for small screens --- */
@media (max-width: 430px) {
  .workorder-gauge,
  .schematic-gauge,
  .hero-gauge svg,
  .workorder-gauge svg {
    max-width: 100%;
    height: auto;
  }
  .hero-gauge { max-width: 160px; }
}

/* --- Trust bar scaling --- */
@media (max-width: 380px) {
  .trust-bar { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .trust-item__value { font-size: 20px; }
  .trust-item__label { font-size: 10px; }
}

/* --- CTA banner stacking --- */
@media (max-width: 480px) {
  .cta-banner { flex-direction: column; text-align: center; gap: 16px; }
  .cta-banner__btn { width: 100%; }
}

/* --- Form field rows stack earlier --- */
@media (max-width: 480px) {
  .field-row { grid-template-columns: 1fr; gap: 0; }
}

/* --- Receipt upload zone --- */
@media (max-width: 430px) {
  .receipt-upload-zone { padding: 32px 16px; }
  .receipt-upload-zone__hint { font-size: 11px; }
}

/* ============ Mobile Filter Drawer ============ */
.filter-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.filter-toggle:hover { background: var(--accent); color: #fff; }

@media (max-width: 900px) {
  body.has-filter-drawer .filter-toggle { display: flex; }
  
  .filter-drawer {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 320px;
    max-width: 85vw;
    background: var(--panel);
    border-left: 1px solid var(--border);
    z-index: 1000;
    overflow-y: auto;
    box-shadow: -4px 0 24px rgba(0,0,0,0.1);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
  }
  
  [dir="rtl"] .filter-drawer {
    right: auto;
    left: 0;
    border-left: none;
    border-right: 1px solid var(--border);
    transform: translateX(-100%);
  }
  
  .filter-drawer.is-open {
    display: block;
    transform: translateX(0);
  }
  
  .filter-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--panel);
    z-index: 1;
  }
  
  .filter-drawer__title {
    font-family: 'Oswald', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
  }
  
  .filter-drawer__close {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
  }
  
  .filter-drawer__close:hover { background: var(--bg); }
  
  .filter-drawer__body { padding: 20px; }
  
  .filter-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 999;
  }
  .filter-overlay.is-open { display: block; }
}

@media (max-width: 480px) {
  .filter-drawer { width: 100%; max-width: 100%; }
}

