/* ===========================================================
   استایل سفارشی فروشگاه — بر پایه‌ی Bootstrap 5 RTL
   رنگ‌ها از متغیرهای پویای theme_settings تزریق می‌شوند.
   =========================================================== */

:root {
  --shop-radius: 12px;
  --shop-shadow: 0 6px 24px rgba(0, 0, 0, .05);
  --shop-shadow-hover: 0 12px 36px rgba(0, 0, 0, .12);
  --shop-transition: .22s ease;
}

body {
  font-family: 'Vazirmatn', -apple-system, "Segoe UI", sans-serif;
  background: var(--bs-body-bg);
  color: var(--bs-body-color);
  font-size: .9rem;
}

/* ---- Header ---- */
.topbar-promo {
  font-size: .8rem;
  letter-spacing: .03em;
}
.header-main .logo-img {
  height: 38px;
  width: auto;
  max-width: 100%;
}
.shop-name {
  color: var(--bs-primary);
}
.search-form .form-control {
  border-radius: 999px 0 0 999px;
  border-left: 0;
}
.search-form .btn {
  border-radius: 0 999px 999px 0;
}
.site-header .navbar .nav-link {
  color: #333;
  font-weight: 500;
}
.site-header .navbar .nav-link.active,
.site-header .navbar .nav-link:hover {
  color: var(--bs-primary);
}

/* ---- Hero/Slider ---- */
.hero-slider .carousel-item {
  min-height: 380px;
  border-radius: var(--shop-radius);
  overflow: hidden;
  position: relative;
}
.hero-slider .carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}
.hero-slider .carousel-caption {
  right: 8%;
  left: 8%;
  text-align: right;
  bottom: 25%;
}
.hero-slider .carousel-caption h2 {
  font-size: 2rem;
  font-weight: 800;
  text-shadow: 0 2px 12px rgba(0,0,0,.4);
}
.hero-slider .carousel-caption p {
  font-size: 1.1rem;
}
.hero-slider .carousel-control-prev,
.hero-slider .carousel-control-next {
  width: 5%;
}

/* ---- Product card ---- */
.product-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: var(--shop-radius);
  overflow: hidden;
  transition: var(--shop-transition);
  height: 100%;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  box-shadow: var(--shop-shadow-hover);
  transform: translateY(-2px);
  border-color: var(--bs-primary);
}
.product-card .product-image {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #f5f5f5;
  overflow: hidden;
}
.product-card .product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--shop-transition);
}
.product-card:hover .product-image img {
  transform: scale(1.06);
}
.product-card .product-badges {
  position: absolute;
  top: 8px;
  inset-inline-start: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.product-card .badge-discount {
  background: #ef4444;
  color: #fff;
  font-size: .7rem;
  padding: 4px 8px;
  border-radius: 6px;
}
.product-card .badge-new {
  background: #22c55e;
  color: #fff;
  font-size: .7rem;
  padding: 4px 8px;
  border-radius: 6px;
}
.product-card .product-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.product-card .product-title {
  font-weight: 600;
  font-size: .9rem;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}
.product-card .product-title a {
  color: #1f2937;
}
.product-card .product-brand {
  font-size: .75rem;
  color: #6b7280;
  margin-bottom: 8px;
}
.product-card .product-price-row {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.product-card .price-final {
  font-weight: 800;
  font-size: 1rem;
  color: var(--bs-primary);
}
.product-card .price-original {
  font-size: .8rem;
  text-decoration: line-through;
  color: #9ca3af;
}
.product-card .btn-add-to-cart {
  background: var(--bs-primary);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: .8rem;
}
.product-card .btn-add-to-cart:hover {
  filter: brightness(.95);
}
.product-card .out-of-stock-tag {
  position: absolute;
  bottom: 8px;
  inset-inline-end: 8px;
  background: rgba(0,0,0,.5);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: .7rem;
}

/* ---- Section heading ---- */
.section-heading {
  text-align: center;
  margin: 40px 0 25px;
}
.section-heading h2 {
  font-size: 1.5rem;
  font-weight: 800;
  position: relative;
  display: inline-block;
  padding-bottom: 10px;
}
.section-heading h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 50%;
  transform: translateX(50%);
  width: 50px;
  height: 3px;
  background: var(--bs-primary);
  border-radius: 2px;
}
.section-heading p {
  color: #6b7280;
  margin-top: 6px;
}

/* ---- Filters sidebar ---- */
.filter-widget {
  background: #fff;
  border: 1px solid #eee;
  border-radius: var(--shop-radius);
  padding: 16px;
  margin-bottom: 14px;
}
.filter-widget h6 {
  font-weight: 700;
  font-size: .9rem;
  margin-bottom: 12px;
  border-bottom: 1px solid #eee;
  padding-bottom: 8px;
}
.filter-widget .form-check {
  margin-bottom: 6px;
}
.filter-widget .form-check-label {
  font-size: .85rem;
  color: #4b5563;
  cursor: pointer;
}
.price-input-group input {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: .8rem;
}

/* ---- Pagination ---- */
.pagination .page-link {
  color: var(--bs-primary);
}
.pagination .page-item.active .page-link {
  background: var(--bs-primary);
  border-color: var(--bs-primary);
}

/* ---- Product detail ---- */
.product-detail .gallery-main {
  aspect-ratio: 1 / 1;
  background: #f5f5f5;
  border-radius: var(--shop-radius);
  overflow: hidden;
}
.product-detail .gallery-main img {
  width: 100%; height: 100%; object-fit: cover;
}
.product-detail .gallery-thumbs {
  display: flex; gap: 8px; margin-top: 8px;
}
.product-detail .gallery-thumb {
  width: 80px; height: 80px; border-radius: 8px; overflow: hidden;
  cursor: pointer; border: 2px solid transparent;
}
.product-detail .gallery-thumb.active {
  border-color: var(--bs-primary);
}
.product-detail .gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-detail .product-title {
  font-size: 1.5rem; font-weight: 800;
}
.product-detail .product-price {
  font-size: 1.4rem; font-weight: 800; color: var(--bs-primary);
}
.product-detail .product-price .original {
  font-size: 1rem; text-decoration: line-through; color: #9ca3af; margin-inline-end: 8px;
}
.product-detail .qty-input {
  width: 80px;
}
.product-detail .attribute-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  font-size: .9rem;
}

/* ---- Cart ---- */
.cart-item {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 12px;
  display: grid;
  grid-template-columns: 80px 1fr auto auto;
  gap: 12px;
  align-items: center;
}
.cart-item .ci-img {
  width: 80px; height: 80px; border-radius: 8px; overflow: hidden;
}
.cart-item .ci-img img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Order tracking ---- */
.order-status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
}
.order-status-pending { background: #fef3c7; color: #92400e; }
.order-status-paid, .order-status-processing { background: #dbeafe; color: #1e40af; }
.order-status-shipped { background: #e0e7ff; color: #4338ca; }
.order-status-delivered { background: #dcfce7; color: #166534; }
.order-status-canceled, .order-status-rejected { background: #fee2e2; color: #991b1b; }

/* ---- Admin sidebar ---- */
.sidebar {
  min-height: calc(100vh - 50px);
  background: #fff;
  border-left: 1px solid #eee;
}
.sidebar-group {
  margin-bottom: 12px;
}
.sidebar-title {
  letter-spacing: .05em;
}
.sidebar .nav-link {
  color: #4b5563;
  border-radius: 8px;
  margin: 2px 8px;
  font-size: .85rem;
}
.sidebar .nav-link:hover {
  background: #f3f4f6;
}
.sidebar .nav-link.active {
  background: var(--bs-primary);
  color: #fff !important;
}

/* ---- Tables ---- */
.table > :not(caption) > * > * {
  padding: 10px 12px;
}
.table thead th {
  background: #f9fafb;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .03em;
}

/* ---- Bulk edit ---- */
.bulk-edit-table input.form-control-sm,
.bulk-edit-table select.form-select-sm {
  font-size: .8rem;
  padding: 4px 8px;
}

/* ---- Buttons ---- */
.btn-primary {
  --bs-btn-bg: var(--bs-primary);
  --bs-btn-border-color: var(--bs-primary);
  --bs-btn-hover-bg: var(--bs-primary);
  --bs-btn-hover-border-color: var(--bs-primary);
  filter: brightness(.95);
}
.btn-outline-primary {
  --bs-btn-color: var(--bs-primary);
  --bs-btn-border-color: var(--bs-primary);
  --bs-btn-hover-bg: var(--bs-primary);
  --bs-btn-hover-border-color: var(--bs-primary);
}

/* ---- Alerts ---- */
.alert {
  font-size: .9rem;
}

/* ---- Footer ---- */
.site-footer {
  margin-top: 50px;
}
.site-footer a:hover {
  color: #fff !important;
}

/* ---- Misc ---- */
.text-muted-2 {
  color: #9ca3af;
}
.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: #9ca3af;
}
.empty-state .icon {
  font-size: 4rem;
  margin-bottom: 12px;
}

/* ---- Toast / quick notifications ---- */
.toast-container {
  position: fixed;
  top: 80px;
  z-index: 1080;
  width: 100%;
  pointer-events: none;
}

@media (max-width: 768px) {
  .cart-item {
    grid-template-columns: 60px 1fr;
    grid-template-rows: auto auto auto;
  }
  .cart-item .ci-actions {
    grid-column: 1 / -1;
    text-align: left;
  }
  .hero-slider .carousel-item {
    min-height: 240px;
  }
  .hero-slider .carousel-caption h2 {
    font-size: 1.2rem;
  }
}
