:root {
  --bg: #0b0f1a;
  --bg-soft: #141a2c;
  --brand: #f2c14e;
  --brand-dark: #c8972f;
  --text: #f4f6fb;
  --muted: #9aa4ba;
  --card: #131a2c;
  --glass: rgba(19, 26, 44, 0.78);
  --accent: #7dd3fc;
  --danger: #fb7185;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  --font: "Vazirmatn", "Sahel", "Shabnam", "Samim", "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  background: var(--bg-pattern, radial-gradient(circle at top, var(--bg-grad-start) 0%, var(--bg-grad-end) 55%));
  color: var(--text);
  font-family: var(--font);
  padding: 32px 6vw 48px;
  position: relative;
  overflow-x: hidden;
}

img,
svg,
video,
canvas {
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

.bg-orbit {
  position: absolute;
  top: -160px;
  left: -120px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--orbit) 0%, transparent 70%);
  filter: blur(2px);
  z-index: 0;
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  z-index: 0;
  pointer-events: none;
}

.topbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 48px;
  max-width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  min-width: 0;
}

.brand-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  color: var(--muted);
  min-width: 0;
}

.nav-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.nav-link:hover {
  color: var(--brand);
}

.icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}

.icon-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn.icon-only {
  width: 42px;
  height: 42px;
  padding: 0;
}

.btn.icon-only.has-items {
  color: var(--brand);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  min-width: 0;
}

.role-badge {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(68, 210, 168, 0.2);
  color: var(--accent);
  font-weight: 600;
}

.btn {
  border: 1px solid transparent;
  padding: 10px 18px;
  border-radius: 14px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: var(--text);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.2);
}

.btn.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #151515;
}

.btn.ghost {
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text);
}

.btn.wide {
  width: 100%;
  margin-top: 18px;
  background: var(--accent);
  color: #0f151b;
}

.hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 48px;
  align-items: center;
}

.hero-search {
  margin-top: 28px;
  position: relative;
  z-index: 1;
}

.search-title {
  font-weight: 700;
  margin-bottom: 12px;
}

.search-advanced .search-title {
  margin-top: 6px;
}

.search-inline {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 12px;
  border-radius: 16px;
}

.search-inline .free-input {
  flex: 1;
  min-width: 220px;
  background: transparent;
  border: 0;
  color: var(--text);
  font-size: 1rem;
  outline: none;
}

.search-inline .free-input::placeholder {
  color: var(--muted);
}

.search-advanced {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.advanced-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.advanced-grid input,
.advanced-grid select {
  background: rgba(10, 16, 24, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 1rem;
  outline: none;
}

.advanced-grid input::placeholder {
  color: var(--muted);
}

.advanced-btn {
  align-self: flex-start;
  margin-top: 6px;
  padding: 12px 22px;
  font-size: 1rem;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .advanced-grid {
    grid-template-columns: 1fr;
  }
}

.hero-copy h1 {
  font-size: clamp(2.4rem, 3vw, 3.6rem);
  line-height: 1.2;
  margin-bottom: 16px;
}

.hero-copy h1 span {
  display: block;
  color: var(--brand);
}

.eyebrow {
  color: var(--accent);
  margin-bottom: 12px;
  letter-spacing: 1px;
}

.lead {
  color: var(--muted);
  font-size: 1.05rem;
  margin-bottom: 24px;
  max-width: 520px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.stat {
  background: var(--glass);
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-num {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}

.stat-label {
  color: var(--muted);
  font-size: 0.9rem;
}

.hero-card {
  background: var(--card);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.badge {
  background: rgba(255, 123, 123, 0.15);
  color: var(--danger);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
}

.card-body .row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}

.card-body .row:last-child {
  border-bottom: none;
}

.label {
  color: var(--muted);
}

.value.muted {
  color: var(--muted);
}

.feature-strip {
  margin-top: 60px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  position: relative;
  z-index: 1;
}

.feature {
  background: rgba(17, 29, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 20px;
  border-radius: 18px;
}

.feature h3 {
  margin-bottom: 8px;
}

.feature p {
  color: var(--muted);
  font-size: 0.95rem;
}

.footer {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  color: var(--muted);
  font-size: 0.9rem;
  position: relative;
  z-index: 1;
}

.panel {
  margin-top: 24px;
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 24px;
  position: relative;
  z-index: 1;
}

.panel-head h1 {
  margin-bottom: 8px;
}

.panel-head p {
  color: var(--muted);
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.search-block {
  grid-column: 1 / -1;
}

.search-title {
  margin-bottom: 8px;
  font-weight: 600;
}

.free-input {
  width: 100%;
  font-size: 1.1rem;
  padding: 14px 16px;
}

.search-separator {
  grid-column: 1 / -1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 6px 0 2px;
}

.advanced-search {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.brand-field.hidden {
  display: none;
}

.filters input,
.filters select {
  background: rgba(10, 16, 24, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
}

.results {
  margin-top: 24px;
  display: grid;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.part-card {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  align-items: center;
  gap: 16px;
  background: rgba(17, 29, 42, 0.6);
  border-radius: 18px;
  padding: 16px 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.part-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.add-to-cart {
  justify-self: end;
}

.part-media {
  display: flex;
  justify-content: center;
  align-items: center;
}

.part-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 8px;
}

.part-thumb-large {
  width: 96px;
  height: 96px;
  cursor: zoom-in;
}

.image-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.image-modal.open {
  display: flex;
}

.image-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.image-modal img {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  z-index: 1;
}

.cart-item-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.cart-item-name {
  font-weight: 600;
}

.cart-item-meta {
  color: var(--muted);
  font-size: 0.95rem;
}

.cart-inline-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-start;
  justify-self: start;
  white-space: nowrap;
}

.price-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-bottom: 10px;
}

.price-row {
  display: grid;
  grid-template-columns: 1fr 160px 120px;
  gap: 10px;
  align-items: center;
}

.price-row.compact {
  grid-template-columns: 1fr 180px;
}

.address-input {
  min-height: 80px;
  resize: vertical;
  background: rgba(10, 16, 24, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
}

.order-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.order-line {
  display: grid;
  grid-template-columns: max-content max-content max-content max-content;
  gap: 12px;
  align-items: center;
  font-weight: 600;
  white-space: nowrap;
}

.order-line .muted {
  font-weight: 500;
}

@media (max-width: 900px) {
  .order-line {
    grid-template-columns: 1fr;
    white-space: normal;
  }
}

.order-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.item-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.price-row .item-name {
  grid-column: 1 / 2;
}

.price-row .vin-note {
  grid-column: 1 / 4;
  font-size: 0.85rem;
}

.price-row input {
  width: 100%;
  background: rgba(10, 16, 24, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 10px;
}

.price-row input[type="number"] {
  font-size: 1.05rem;
}

.order-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.order-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

@media (max-width: 900px) {
  .price-row {
    grid-template-columns: 1fr;
  }
  .price-row input {
    width: 100%;
  }
  .order-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

.price-input {
  font-size: 1.2rem;
  font-weight: 700;
}

.part-card form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.inline-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.qty-input {
  width: 120px;
}

.price {
  font-weight: 600;
}

.price-large {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--brand);
}

.subnav {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.subnav-link {
  padding: 0.35rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: #fff;
  text-decoration: none;
  font-size: 0.9rem;
}

.subnav-link.active {
  background: rgba(255, 255, 255, 0.2);
}

.qty-changed {
  color: #ffb36b;
  margin-right: 0.4rem;
}

.receipt-block {
  margin-top: 0.5rem;
}

.spacer-top {
  margin-top: 16px;
}

.action-row {
  margin-top: 28px;
  display: flex;
  justify-content: flex-start;
}

.brand-settings {
  display: grid;
  gap: 12px;
}

.brand-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(10, 16, 24, 0.55);
}

.brand-name {
  font-weight: 600;
}

.brand-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.empty {
  padding: 20px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 12px;
}

.cart-actions {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 18px;
  flex-wrap: wrap;
}

.cart-submit-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 12, 0.75);
  display: grid;
  place-items: center;
  z-index: 50;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  width: min(420px, 92vw);
  background: rgba(15, 21, 29, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 18px;
  display: grid;
  gap: 12px;
}

.modal-card select {
  background: rgba(10, 16, 24, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.cart-delivery {
  display: grid;
  gap: 6px;
}

.cart-delivery label {
  font-size: 0.9rem;
  color: var(--muted);
}

.cart-delivery select {
  background: rgba(10, 16, 24, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
}

.cart-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  align-items: center;
}

.cart-meta label {
  font-size: 0.9rem;
}

.cart-vin {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.cart-vin input {
  background: rgba(10, 16, 24, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 10px;
  max-width: 220px;
}

@media (max-width: 900px) {
  .cart-meta {
    grid-template-columns: 1fr;
  }
}

.login-box {
  margin-top: 18px;
  display: grid;
  gap: 12px;
  max-width: 360px;
}
.settings-box {
  max-width: 760px;
}

.login-box input {
  background: rgba(10, 16, 24, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
}

.login-box select {
  background: rgba(10, 16, 24, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
}
.login-box textarea {
  background: rgba(10, 16, 24, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  resize: vertical;
  min-height: 180px;
}
.textarea-large {
  min-height: 260px;
}

.flash {
  margin-top: 16px;
  display: grid;
  gap: 8px;
  position: relative;
  z-index: 2;
}

.flash-item {
  background: rgba(68, 210, 168, 0.16);
  border: 1px solid rgba(68, 210, 168, 0.3);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
}

.flash-item.error {
  background: rgba(255, 123, 123, 0.16);
  border-color: rgba(255, 123, 123, 0.4);
}

.footer-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-bank {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: nowrap;
}

.bank-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.enamad {
  display: flex;
  align-items: center;
}

.footer-title {
  color: var(--text);
  font-weight: 700;
  margin-bottom: 6px;
}
.footer-link {
  color: #e5e7eb;
  text-decoration: none;
  margin-bottom: 6px;
  display: inline-block;
}
.footer-link:hover {
  color: #facc15;
}

.terms-box {
  margin-top: 16px;
  padding: 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  line-height: 1.9;
}

.order-card {
  display: block;
}
.order-header {
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.order-header-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 10px 12px;
}
.order-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.order-items.invoice {
  gap: 8px;
  direction: rtl;
}
.order-items-header {
  display: grid;
  grid-template-columns: var(--cols);
  gap: 6px;
  align-items: center;
  justify-items: start;
  font-weight: 700;
  color: var(--text);
  opacity: 0.9;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.order-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.order-item-row.invoice-row {
  display: grid;
  grid-template-columns: var(--cols);
  gap: 6px;
  align-items: center;
  justify-items: start;
}
.order-item-info {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
  flex: 1 1 auto;
}
.order-item-cell {
  min-width: 0;
}
.order-item-cell.align-end {
  text-align: right;
  justify-self: start;
}
.order-items .inline-form {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
}
.order-items .cart-qty-form {
  flex-direction: column;
  align-items: flex-end;
}
.order-items .qty-input {
  max-width: 84px;
}
.order-items.cart-invoice .order-items-header,
.order-items.cart-invoice .order-item-row {
  justify-items: stretch;
}
.order-items.cart-invoice .order-items-header span {
  text-align: right;
  justify-self: stretch;
}
.order-items.cart-invoice .order-item-cell:first-child,
.order-items.cart-invoice .order-items-header span:first-child {
  justify-self: stretch;
}
.order-items.cart-invoice .order-items-header {
  gap: 12px;
}
.order-items.cart-invoice .price {
  white-space: nowrap;
}
.order-item-info .item-name {
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.order-item-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  min-width: 140px;
}
.order-actions {
  margin-top: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
}
.order-footer {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  direction: rtl;
  flex-wrap: nowrap;
}
.order-footer-left {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  text-align: left;
}
.order-footer-right {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  text-align: right;
}
.order-footer > * {
  min-width: 0;
}
.order-footer-left .price,
.order-footer-right .price {
  white-space: nowrap;
}
.order-footer .btn {
  white-space: nowrap;
}
.btn.danger {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
}

@media (max-width: 1024px) {
  body {
    padding: 20px 16px 36px;
  }
  .hero {
    grid-template-columns: 1fr;
  }
  .hero-stats,
  .feature-strip {
    grid-template-columns: 1fr;
  }
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 28px;
    overflow-x: clip;
  }
  .brand,
  .nav,
  .top-actions {
    width: 100%;
  }
  .nav,
  .top-actions {
    gap: 10px;
  }
  .role-badge {
    max-width: 100%;
    overflow-wrap: anywhere;
  }
  .footer {
    grid-template-columns: 1fr;
  }
  .part-card {
    grid-template-columns: 1fr;
  }
  .order-item-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .order-item-actions {
    min-width: 0;
  }
  .order-items-header,
  .order-item-row.invoice-row {
    grid-template-columns: 1fr;
  }
}
.footer-btn-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 6px;
}

.footer-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: inherit;
  text-decoration: none;
  font-size: 0.84em;
  transition: all 0.2s ease;
}

.footer-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.footer-btn.wa-hover:hover { border-color: #25d366; color: #25d366; }
.footer-btn.tg-hover:hover { border-color: #0088cc; color: #0088cc; }
.footer-btn.insta-hover:hover { border-color: #e1306c; color: #e1306c; }
.footer-btn.map-btn {
  margin-top: 8px;
  border-color: rgba(59, 130, 246, 0.4);
  color: #60a5fa;
}
.footer-btn.map-btn:hover { background: #2563eb; color: #fff; }

/* Fixed 5-column layout on desktop, clean wrapping on mobile */
.footer {
  display: grid;
  grid-template-columns: 1.4fr 1.1fr 1.1fr 1.2fr 0.9fr;
  gap: 14px;
  padding: 24px 16px;
  align-items: start;
}

@media (max-width: 1024px) {
  .footer {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
  }
}

/* Compact contact action buttons */
.footer-btn-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 4px;
}

.footer-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: inherit;
  text-decoration: none;
  font-size: 0.8em;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.footer-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Bank Account - Larger, Clearer Font */
.footer-bank-box {
  margin-top: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bank-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bank-lbl {
  font-size: 0.78em;
  opacity: 0.75;
}

.bank-val {
  font-family: monospace, sans-serif;
  font-size: 1.05em;
  font-weight: 700;
  letter-spacing: 1px;
  direction: ltr;
  text-align: right;
  color: #fff;
}

/* Floating WhatsApp Button */
.floating-whatsapp {
  position: fixed;
  bottom: 24px;
  left: 24px; /* در قالب راست‌چین RTL، گوشه پایین سمت چپ بهترین مکان است */
  z-index: 9999; /* قرار گرفتن بالای همه عناصر و تصاویر صفحه */
  width: 58px;
  height: 58px;
  background-color: #25d366;
  color: #ffffff !important;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.45);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.floating-whatsapp svg {
  fill: #ffffff;
}

/* افکت حرکتی هنگام بردن ماوس روی دکمه */
.floating-whatsapp:hover {
  background-color: #20ba5a;
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
}

/* متن راهنمای کنار دکمه (Tooltip) */
.wa-tooltip {
  position: absolute;
  right: 68px; /* باز شدن به سمت داخل صفحه */
  background: rgba(15, 23, 42, 0.9);
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.82em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

<!-- Floating WhatsApp Widget (Standard Bottom-Left) -->
    {% if store.whatsapp_id %}
      <a href="https://wa.me/{{ store.whatsapp_id }}?text=سلام،%20برای%20استعلام%20قطعه%20پیام%20می‌دهم" 
         class="floating-whatsapp" 
         target="_blank" 
         rel="noopener" 
         title="پشتیبانی و استعلام واتس‌اپ" 
         aria-label="پشتیبانی واتس‌اپ">
        <!-- آیکون رسمی و باکیفیت واتس‌اپ -->
        <svg width="34" height="34" viewBox="0 0 24 24" fill="none">
          <path fill-rule="evenodd" clip-rule="evenodd" d="M12 2C6.477 2 2 6.477 2 12c0 1.89.525 3.66 1.438 5.176L2 22l4.966-1.405A9.957 9.957 0 0012 22c5.523 0 10-4.477 10-10S17.523 2 12 2zm5.405 14.195c-.227.637-1.326 1.222-1.848 1.272-.477.045-1.096.068-3.272-.835-2.78-1.154-4.577-3.992-4.716-4.177-.137-.184-1.127-1.502-1.127-2.864 0-1.362.714-2.032.968-2.31.254-.278.553-.347.738-.347.185 0 .37.002.532.01.171.008.4-.065.625.476.231.554.786 1.924.855 2.064.07.14.116.305.023.49-.092.186-.139.301-.277.464-.139.163-.292.363-.417.487-.138.139-.283.29-.122.568.162.277.72 1.19 1.547 1.927 1.063.948 1.96 1.242 2.238 1.381.277.139.44.116.602-.07.162-.185.694-.811.879-1.088.185-.278.37-.232.624-.139.255.093 1.62.764 1.898.903.277.14.462.209.531.325.07.116.07.672-.157 1.309z" fill="#ffffff"/>
        </svg>
        <span class="wa-tooltip">استعلام آنلاین قطعات</span>
      </a>
    {% endif %}
}

/* Enhanced Dedicated WhatsApp Inquiry Card */
.wa-inquiry-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  border: 1px solid rgba(37, 211, 102, 0.35) !important;
  background: radial-gradient(circle at top right, rgba(37, 211, 102, 0.08), transparent 70%), var(--bg-surface-alt, rgba(255, 255, 255, 0.04)) !important;
}

.wa-inquiry-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.wa-inquiry-icon-wrap {
  width: 44px;
  height: 44px;
  background: rgba(37, 211, 102, 0.15);
  border: 1px solid rgba(37, 211, 102, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wa-inquiry-hint {
  font-size: 0.78em;
  color: var(--text-muted, rgba(255, 255, 255, 0.7));
}

.wa-inquiry-desc {
  font-size: 0.85em;
  line-height: 1.6;
  color: var(--text-muted, rgba(255, 255, 255, 0.85));
  margin: 6px 0 14px;
}

#waQuickPartName {
  background: var(--input-bg, rgba(255, 255, 255, 0.06)) !important;
  color: var(--text-color, #ffffff) !important;
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.18)) !important;
  border-radius: var(--radius-sm, 6px) !important;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

#waQuickPartName::placeholder {
  color: var(--text-muted, rgba(255, 255, 255, 0.55)) !important;
}

#waQuickPartName:focus {
  border-color: var(--primary, #d4af37) !important;
  background: var(--input-focus-bg, rgba(255, 255, 255, 0.1)) !important;
}

.brand-chip-wa {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  background: var(--btn-primary-bg, var(--primary, #d4af37)) !important;
  color: var(--btn-primary-fg, #111827) !important;
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.2)) !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  transition: all 0.2s ease-in-out !important;
}

.brand-chip-wa:hover {
  background: var(--btn-primary-hover-bg, var(--primary-hover, #c59b27)) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* ==========================================
   طراحی مدرن، پاک و بزرگ‌تر فوتر سایت
   ========================================== */

.site-footer, .footer {
  background-color: #080c14;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 20px;
  padding: 30px 20px;
  align-items: start;
  color: #d1d5db;
  font-size: 1rem !important; /* افزایش اندازه پایه فونت فوتر */
}

@media (max-width: 1024px) {
  .footer {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

/* عناوین ستون‌های فوتر */
.footer-title {
  color: #ffffff;
  font-weight: 700;
  font-size: 1.15rem !important;
  margin-bottom: 10px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
}

/* متن‌ها و لینک‌های فوتر با فونت خوانا و بزرگ‌تر */
.footer-link, 
.footer-block p, 
.footer-block span {
  color: #e5e7eb;
  font-size: 1rem !important; /* خوانایی کامل متن‌ها */
  text-decoration: none;
  margin-bottom: 6px;
  display: inline-block;
  line-height: 1.8;
}

.footer-link:hover {
  color: #facc15;
}

.footer-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* حذف کامل کادرهای خشن و تبدیل به لیست تمیز و تخت */
.footer-btn-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.footer-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.03); /* پس‌زمینه بسیار محو و ملایم شیشه‌ای */
  border: none !important; /* حذف خطوط دور و کادرهای خشن */
  border-radius: 6px;
  color: #e5e7eb;
  text-decoration: none;
  font-size: 0.95rem !important; /* بزرگ‌تر شدن متن دکمه‌های تماس و شبکه‌های اجتماعی */
  transition: all 0.2s ease;
}

.footer-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.footer-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.footer-btn.wa-hover:hover { color: #25d366; }
.footer-btn.tg-hover:hover { color: #0088cc; }
.footer-btn.insta-hover:hover { color: #e1306c; }

.footer-btn.map-btn {
  margin-top: 6px;
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
}
.footer-btn.map-btn:hover { 
  background: #2563eb; 
  color: #fff; 
}

/* کادر اطلاعات بانکی در فوتر */
.footer-bank-box {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: none !important; /* حذف خط کادر خشن */
  border-radius: 6px;
  font-size: 0.95rem !important;
}

/* پاکسازی و استانداردسازی نهایی بنر صفحه اصلی */


/* --- Final Fixed Footer Style --- */
.site-footer, .footer {
  background-color: #080c14 !important;
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 20px !important;
  padding: 30px 20px !important;
  align-items: start !important;
  color: #d1d5db !important;
  font-size: 1rem !important;
}
@media (max-width: 1024px) {
  .site-footer, .footer {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
  }
}

/* --- Fix Footer First Column Width --- */
.site-footer, .footer {
  grid-template-columns: 1.6fr 1fr 1fr 1.2fr 1fr !important;
}

/* --- Fixed Footer Layout & Font Size --- */
.site-footer, .footer {
  grid-template-columns: 1.4fr 1fr 1.1fr 1.2fr 1fr !important;
  font-size: 0.85rem !important;
  gap: 16px !important;
  padding: 24px 16px !important;
}

.footer-title {
  font-size: 0.95rem !important;
  margin-bottom: 8px !important;
  padding-bottom: 4px !important;
}

.footer-link,
.footer-block p,
.footer-block span {
  font-size: 0.85rem !important;
  line-height: 1.6 !important;
  margin-bottom: 4px !important;
}

/* --- Standardized and Clean Footer Block --- */
.site-footer, .footer {
  background-color: #080c14 !important;
  display: grid !important;
  grid-template-columns: 1.4fr 1fr 1.1fr 1.2fr 1fr !important;
  font-size: 0.85rem !important;
  gap: 16px !important;
  padding: 24px 16px !important;
  align-items: start !important;
  color: #d1d5db !important;
}

@media (max-width: 1024px) {
  .site-footer, .footer {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
  }
}

.footer-title {
  color: #ffffff !important;
  font-weight: 700 !important;
  font-size: 0.95rem !important;
  margin-bottom: 8px !important;
  border-bottom: 2px solid rgba(255, 255, 255, 0.08) !important;
  padding-bottom: 4px !important;
}

.footer-link,
.footer-block p,
.footer-block span {
  color: #e5e7eb !important;
  font-size: 0.85rem !important;
  text-decoration: none !important;
  margin-bottom: 4px !important;
  display: inline-block !important;
  line-height: 1.6 !important;
}
