@font-face {
  font-family: 'Shabnam';
  src: url('../css/fonts/Shabnam.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #07111f;
  --surface: rgba(255, 255, 255, .08);
  --surface-2: rgba(255, 255, 255, .05);
  --text: #ecf3ff;
  --muted: #aab8d6;
  --border: rgba(255, 255, 255, .14);
  --shadow: 0 18px 60px rgba(0, 0, 0, .25);
  --radius: 22px;
  --primary: #6b5cff;
  --accent: #22d3ee;
  --success: #29d38f;
  --danger: #ff6b86;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Shabnam', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background:
    radial-gradient(circle at top left, rgba(107, 92, 255, .22), transparent 35%),
    radial-gradient(circle at top right, rgba(34, 211, 238, .15), transparent 32%),
    linear-gradient(180deg, #040812 0%, #07111f 100%);
  color: var(--text);
  line-height: 1.8;
  padding-bottom: 60px; /* فضای نوار پایین موبایل */
}

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

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(1200px, calc(100% - 32px));
  margin-inline: auto;
}

.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.badge,
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .3rem .65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .12);
  font-size: .8rem;
}

.chip-alt {
  background: rgba(34, 211, 238, .16);
}

span.chip.chip-alt
 {
    margin-top: 40px;
}

.chip-success {
  background: rgba(41, 211, 143, .18);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}

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

.brand strong {
  display: block;
  font-size: 1.05rem;
}

.brand small {
  display: block;
  color: var(--muted);
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-weight: 700;
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand {
  min-width: 0;
}

.brand strong,
.brand small {
  overflow-wrap: anywhere;
}

.nav a,
.side-nav a {
  padding: .55rem .9rem;
  border-radius: 14px;
  color: var(--text);
  border: 1px solid transparent;
}

.nav a:hover,
.side-nav a:hover {
  background: rgba(255, 255, 255, .08);
  border-color: var(--border);
}

.nav-toggle {
  display: none;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: .65rem .85rem;
}

.hero {
  padding: 34px 0 10px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 20px;
  align-items: stretch;
}

.hero-copy,
.hero-slider,
.product-card,
.card,
.panel,
.install-card,
.sidebar-card,
.login-card,
.admin-top {
  border-radius: var(--radius);
}

.hero-copy {
  padding: 30px;
}

.hero-copy h1 {
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1.1;
  margin: .3rem 0 1rem;
}

.hero-copy p,
.muted {
  color: var(--muted);
}

.eyebrow {
  color: var(--accent);
  font-size: .9rem;
}

.hero-actions,
.card-actions,
.toolbar,
.row-actions,
.inline-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .8rem 1rem;
  border-radius: 16px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: .2s ease;
  font-family: inherit;
}

.btn-small {
  padding: .58rem .8rem;
  border-radius: 14px;
  font-size: .92rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
}

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

.btn:hover {
  transform: translateY(-1px);
}

.hero-slider {
  padding: 16px;
  overflow: hidden;
}

.slider {
  position: relative;
  min-height: 100%;
  height: 100%;
}

.slide {
  display: none;
  grid-template-rows: 1fr auto;
  gap: 14px;
  height: 100%;
}

.slide.active {
  display: grid;
}

.slide-image {
  border-radius: 20px;
  overflow: hidden;
  min-height: 300px;
  background: rgba(255, 255, 255, .06);
}

.slide-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slide-content {
  padding: 4px 4px 10px;
}

.section {
  padding: 20px 0;
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.product-card,
.card,
.panel,
.login-card,
.install-card,
.sidebar-card {
  padding: 16px;
}

.product-card {
  display: grid;
  gap: 12px;
}

.product-thumb {
  position: relative;
  display: block;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, .05);
  aspect-ratio: 1.1/1;
}

.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}

.product-card:hover .product-thumb img {
  transform: scale(1.04);
}

.product-thumb .chip {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
}

.product-thumb .chip-success {
  position: absolute;
  top: 12px;
  left: 12px;
  right: auto;
}

.product-body h3 {
  margin: .1rem 0 .2rem;
  font-size: 1.03rem;
}

.product-body p {
  color: var(--muted);
  margin: .2rem 0 .6rem;
  font-size: .93rem;
  min-height: 52px;
}

.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.price-row del {
  color: #95a2bf;
}

.hero-slider .slide-content strong {
  font-size: 1.25rem;
}

.toolbar {
  margin: 16px 0;
}

.input,
input,
select,
textarea {
  width: 100%;
  padding: .82rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(5, 10, 20, .65);
  color: var(--text);
  outline: none;
  font-family: inherit;
}

textarea {
  resize: vertical;
  min-height: 120px;
}

label {
  display: block;
  margin-bottom: .35rem;
  color: #d8e3ff;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.alert,
.notice {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .06);
  margin-bottom: 14px;
}

.alert.success,
.notice.good {
  border-color: rgba(41, 211, 143, .35);
  background: rgba(41, 211, 143, .12);
}

.alert.danger,
.notice.bad {
  border-color: rgba(255, 107, 134, .35);
  background: rgba(255, 107, 134, .12);
}

.footer {
  padding: 28px 0 36px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  margin-top: 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 16px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  text-align: right;
  vertical-align: top;
}

th {
  color: #dbe6ff;
  font-weight: 700;
}

.badge.ok {
  background: rgba(41, 211, 143, .15);
}

.badge.warn {
  background: rgba(255, 198, 61, .14);
}

.badge.bad {
  background: rgba(255, 107, 134, .15);
}

/* سبد خرید */
.cart-layout {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 18px;
}

.cart-item {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.cart-item img {
  border-radius: 14px;
  aspect-ratio: 1/1;
  object-fit: cover;
}

.summary {
  position: sticky;
  top: 92px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: .5rem 0;
  flex-wrap: wrap;
  align-items: center;
}
.summary-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.summary-row .btn {
  flex-shrink: 0;
}

/* صفحه محصول */
.product-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.gallery {
  display: grid;
  gap: 10px;
}

.gallery-main {
  border-radius: 24px;
  overflow: hidden;
  min-height: 360px;
}

.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.gallery-thumbs button {
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
}

.gallery-thumbs img {
  width: 100%;
  height: 88px;
  object-fit: cover;
}

.specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.spec {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .08);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(1, 5, 13, .72);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 80;
  padding: 18px;
}

.modal.open {
  display: flex;
}

.modal-card {
  width: min(760px, 100%);
  border-radius: 28px;
  padding: 18px;
}

.modal-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
}

.modal-grid img {
  border-radius: 20px;
  object-fit: cover;
  width: 100%;
  height: 100%;
}

/* ادمین */
.nav-open .nav {
  display: flex;
}

.sidebar {
  width: 290px;
  padding: 18px;
  position: sticky;
  top: 18px;
  height: calc(100vh - 36px);
}

.admin-shell {
  display: grid;
  grid-template-columns: 290px 1fr;
  min-height: 100vh;
}

.admin-main {
  padding: 18px;
}

.admin-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  margin-bottom: 16px;
}

.side-nav {
  display: grid;
  gap: 6px;
  margin: 14px 0;
}

.sidebar-card {
  margin-top: 16px;
}

.brand-admin .brand-mark {
  width: 42px;
  height: 42px;
}

.page {
  padding: 22px 0;
}

.list-unstyled {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* منوی کشویی موبایل */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 55;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.drawer-open .drawer-overlay {
  opacity: 1;
  visibility: visible;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 300px;
  max-width: 85vw;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 60;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.drawer-open .mobile-drawer {
  transform: translateX(0);
}

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

.drawer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drawer-links a {
  padding: 12px;
  border-radius: 12px;
  transition: background 0.2s;
  font-size: 1rem;
}

.drawer-links a:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* نوار پایین موبایل */
.mobile-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 10px 0 6px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 50;
}

.mobile-bottom-bar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #ffffff;
  font-size: 0.7rem;
  text-decoration: none;
  gap: 2px;
  transition: color 0.2s;
}

.mobile-bottom-bar a.active,
.mobile-bottom-bar a:hover {
  color: var(--accent);
}

.mobile-bottom-bar .badge {
  font-size: 0.65rem;
  padding: 0.15rem 0.35rem;
  margin-top: 2px;
  background: var(--accent);
  color: #fff;
  border: none;
}

@media (min-width: 981px) {
  .mobile-bottom-bar {
    display: none;
  }

  body {
    padding-bottom: 0;
  }

  .drawer-overlay,
  .mobile-drawer {
    display: none;
  }
}

/* دکمه تغییر تم */
.icon-btn.theme-toggle {
  font-size: 1.4rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  transition: background 0.2s;
  line-height: 1;
}

.icon-btn.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* سایدبار فیلتر */
.products-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  align-items: start;
}

.filter-sidebar {
  position: sticky;
  top: 100px;
}

@media (max-width: 980px) {
  .products-layout {
    display: flex;
    flex-direction: column;
  }

  .filter-sidebar {
    width: -webkit-fill-available;
    position: static;
    order: -1;
  }
}

/* توست */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: 20px;
  background: var(--primary);
  color: #fff;
  z-index: 200;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
}

@media (min-width: 981px) {
  .toast {
    bottom: 30px;
  }
}

/* بنر نصب PWA */
.install-banner {
  position: fixed;
  bottom: 80px;
  left: 16px;
  right: 16px;
  padding: 14px 18px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  z-index: 100;
  max-width: 500px;
  margin: 0 auto;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

/* کارت بانکی */
.payment-card {
  background: linear-gradient(135deg, rgba(107, 92, 255, .42), rgba(34, 211, 238, .18));
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 26px;
  padding: 18px;
  display: grid;
  gap: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .22);
}

.payment-chip {
  font-size: .85rem;
  color: #fff;
  opacity: .9;
}

.payment-number {
  font-size: 1.5rem;
  letter-spacing: .12em;
  font-weight: 700;
  word-break: break-all;
}

.payment-name {
  font-size: 1rem;
  opacity: .95;
}

.payment-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* حالت روشن (Light Mode) */
html[data-theme="light"] body {
  --bg: #ffffff;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-2: rgba(255, 255, 255, 0.7);
  --text: #1a1f36;
  --muted: #5b6480;
  --border: rgba(0, 0, 0, 0.1);
  background:
    radial-gradient(circle at top left, rgba(107, 92, 255, .08), transparent 35%),
    radial-gradient(circle at top right, rgba(34, 211, 238, .08), transparent 32%),
    linear-gradient(180deg, #f8faff 0%, #eef3fb 100%);
}

html[data-theme="light"] .glass,
html[data-theme="light"] .panel,
html[data-theme="light"] .card,
html[data-theme="light"] .product-card,
html[data-theme="light"] .sidebar-card,
html[data-theme="light"] .admin-top,
html[data-theme="light"] .modal-card,
html[data-theme="light"] .install-banner {
  background: rgba(255, 255, 255, .86);
}

html[data-theme="light"] .topbar {
  border-bottom-color: rgba(0, 0, 0, .06);
}

html[data-theme="light"] .nav a,
html[data-theme="light"] .drawer-links a,
html[data-theme="light"] .side-nav a {
  color: var(--text);
}

html[data-theme="light"] .btn-ghost {
  background: rgba(0, 0, 0, .03);
  border-color: rgba(0, 0, 0, .1);
}

html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  background: #fff;
  border-color: rgba(0, 0, 0, .12);
  color: var(--text);
}

html[data-theme="light"] label {
  color: #4a5075;
}

html[data-theme="light"] .chip {
  background: rgba(0, 0, 0, .05);
  border-color: rgba(0, 0, 0, .1);
}

html[data-theme="light"] .chip-success {
  background: rgba(41, 211, 143, .15);
}

html[data-theme="light"] .product-thumb {
  background: rgba(0, 0, 0, .03);
}

html[data-theme="light"] .price-row del {
  color: #7e859e;
}

html[data-theme="light"] .muted {
  color: var(--muted);
}

/* حالت روشن: نوار پایین موبایل */
html[data-theme="light"] .mobile-bottom-bar {
  background: rgba(255, 255, 255, 0.95);
  border-top-color: rgba(0, 0, 0, 0.1);
}

html[data-theme="light"] .mobile-bottom-bar a {
  color: var(--text);
}

/* حالت روشن: دکمه تغییر تم */
html[data-theme="light"] .icon-btn.theme-toggle {
  border-color: rgba(0, 0, 0, 0.15);
}

html[data-theme="light"] .icon-btn.theme-toggle:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* ریسپانسیو */
@media (max-width: 980px) {
  .hero-grid,
  .grid.cols-4,
  .grid.cols-3,
  .grid.cols-2,
  .cart-layout,
  .product-page,
  .modal-grid,
  .footer-grid,
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    width: auto;
    height: auto;
  }

  .summary {
    position: relative;
    top: auto;
  }
}

@media (max-width: 980px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    padding-top: 12px;
  }

  .nav-wrap {
    flex-wrap: wrap;
  }

  .form-grid.two,
  .form-grid.three {
    grid-template-columns: 1fr;
  }

  .gallery-thumbs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .cart-item {
    grid-template-columns: 72px 1fr;
  }

  .cart-item > div:last-child {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
  }

  .nav-actions {
    display: flex;
    gap: 8px;
  }

  .summary-row {
    flex-wrap: wrap;
    align-items: center;
  }

  .summary-row strong {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .summary-row .btn {
    flex-shrink: 0;
  }
}