/* ============================================
   طراحی مینیمال و تمیز - پخش‌ساز
   رنگ‌بندی: Minimal Clean Theme
   ============================================ */

:root {
  /* رنگ‌های اصلی */
  --primary: #1a1a1a;
  --primary-dark: #000000;
  --primary-light: #4a4a4a;
  --secondary: #6b6b6b;
  --secondary-dark: #4a4a4a;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  /* رنگ‌های پس‌زمینه */
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f5;
  --bg-tertiary: #e5e5e5;
  --bg-gradient: #1a1a1a;

  /* رنگ‌های متن */
  --text-primary: #1a1a1a;
  --text-secondary: #6b6b6b;
  --text-muted: #9ca3af;

  /* سایه‌ها */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 12px 32px rgba(0, 0, 0, 0.15);

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Vazirmatn', 'Shabnam', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  direction: rtl;
  font-size: 14px;
}

/* ============================================
   Typography
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
}

/* ============================================
   Buttons
   ============================================ */

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-sm);
  font-weight: 500;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: white;
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-success {
  background: var(--success);
  color: white;
  box-shadow: var(--shadow-sm);
  font-weight: 500;
}

.btn-success:hover {
  background: #059669;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: white;
}

.btn-outline-primary {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline-primary:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
}

.btn-outline-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 2px solid var(--text-muted);
}

.btn-outline-secondary:hover {
  background: var(--text-secondary);
  color: white;
  border-color: var(--text-secondary);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

.btn:disabled,
.btn.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* ============================================
   Cards
   ============================================ */

.card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: none;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-4px);
}

.card-header {
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--bg-tertiary);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0;
}

/* ============================================
   Forms
   ============================================ */

.form-control {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid var(--bg-tertiary);
  border-radius: var(--radius-md);
  font-size: 1rem;
  transition: var(--transition);
  background: var(--bg-primary);
  color: var(--text-primary);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.1);
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.input-group {
  display: flex;
  align-items: stretch;
}

.input-group-text {
  padding: 0.875rem 1rem;
  background: var(--bg-tertiary);
  border: 2px solid var(--bg-tertiary);
  border-left: none;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--text-secondary);
  font-weight: 600;
}

.input-group .form-control {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

/* ============================================
   Navigation
   ============================================ */

.navbar {
  background: var(--bg-primary);
  box-shadow: var(--shadow-sm);
  padding: 1rem;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
  background: var(--bg-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================
   Product Cards
   ============================================ */

.product-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
  border: 2px solid transparent;
}

.product-card:hover {
  border-color: var(--bg-tertiary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.product-info h6 {
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  font-weight: 600;
}

.product-info small {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* ============================================
   Quantity Box
   ============================================ */

.qty-box {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-tertiary);
  padding: 0.375rem 0.5rem;
  border-radius: var(--radius-full);
  flex-wrap: nowrap;
  min-width: fit-content;
  white-space: nowrap;
}

.qty-box button {
  width: 32px;
  height: 32px;
  min-width: 32px;
  max-width: 32px;
  border: none;
  background: var(--bg-primary);
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
  padding: 0;
  white-space: nowrap;
}

.qty-box button i {
  font-size: 0.75rem;
}

.qty-box button:hover {
  background: var(--primary);
  color: white;
  transform: scale(1.05);
}

.qty-box button:active {
  transform: scale(0.95);
}

.qty-box .qty {
  min-width: 24px;
  max-width: 40px;
  width: auto;
  text-align: center;
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.875rem;
  padding: 0 0.25rem;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
}

.qty-box .delete {
  color: var(--danger);
  margin-right: 0;
  margin-left: 0.25rem;
}

.qty-box .delete:hover {
  background: var(--danger);
  color: white;
}

.qty-box .plus,
.qty-box .minus {
  font-size: 0.875rem;
}

/* ============================================
   Cart Item Card
   ============================================ */

.cart-item-card {
  border-right: 3px solid var(--bg-tertiary);
  transition: var(--transition);
}

.cart-item-card:hover {
  border-right-color: var(--primary);
  transform: translateX(-4px);
}

.cart-item-image {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

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

.cart-item-total {
  padding: 0.75rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  min-width: 120px;
  text-align: center;
  border: 1px solid var(--bg-tertiary);
}

.remove-item {
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.remove-item:hover {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
  transform: scale(1.1);
}

/* ============================================
   Cart Summary
   ============================================ */

.cart-summary {
  position: fixed;
  bottom: 0;
  right: 0;
  left: 0;
  background: var(--bg-primary);
  border-top: 2px solid var(--bg-tertiary);
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
  z-index: 100;
}

/* ============================================
   Order Cards
   ============================================ */

.order-card {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
  margin-bottom: 1rem;
  transition: var(--transition);
  border-right: 3px solid var(--bg-tertiary);
  border: 1px solid var(--bg-tertiary);
}

.order-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateX(-4px);
  border-right-color: var(--primary);
}

.order-status {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
}

.status-pending {
  background: #fef3c7;
  color: #92400e;
}

.status-done {
  background: #d1fae5;
  color: #065f46;
}

.status-processing {
  background: #dbeafe;
  color: #1e40af;
}

/* ============================================
   Payment Options
   ============================================ */

.payment-option {
  padding: 1rem;
  border: 2px solid var(--bg-tertiary);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
}

.payment-option:hover {
  border-color: var(--primary);
  background: var(--bg-secondary);
}

.payment-option input[type="radio"]:checked ~ label,
.payment-option:has(input[type="radio"]:checked) {
  border-color: var(--primary);
  background: var(--bg-secondary);
}

.payment-option:has(input[type="radio"]:checked) label {
  color: var(--primary);
  font-weight: 600;
}

.payment-option .form-check {
  margin: 0;
  cursor: pointer;
}

.payment-option .form-check-input {
  margin-top: 0.5rem;
  cursor: pointer;
}

.payment-option .form-check-label {
  cursor: pointer;
  width: 100%;
}

/* ============================================
   OTP Inputs
   ============================================ */

.otp-container {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  direction: ltr;
}

.otp-input {
  width: 56px;
  height: 64px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  border: 2px solid var(--bg-tertiary);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  transition: var(--transition);
}

.otp-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.1);
  transform: scale(1.05);
}

.otp-input::-webkit-outer-spin-button,
.otp-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.otp-input[type=number] {
  -moz-appearance: textfield;
}

/* ============================================
   Alerts
   ============================================ */

.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  border: none;
  margin-bottom: 1rem;
  font-weight: 500;
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-danger {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-warning {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

/* ============================================
   Modals
   ============================================ */

.modal-content {
  border-radius: var(--radius-xl);
  border: none;
  box-shadow: var(--shadow-xl);
}

.modal-header {
  border-bottom: 2px solid var(--bg-tertiary);
  padding: 1.5rem;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  border-top: 2px solid var(--bg-tertiary);
  padding: 1.5rem;
}

/* ============================================
   Offcanvas
   ============================================ */

.offcanvas {
  background: var(--bg-primary);
}

.offcanvas-header {
  border-bottom: 2px solid var(--bg-tertiary);
  padding: 1.5rem;
}

.offcanvas-body a {
  display: block;
  padding: 1rem;
  color: var(--text-primary);
  text-decoration: none;
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
  transition: var(--transition);
  font-weight: 500;
}

.offcanvas-body a:hover {
  background: var(--bg-secondary);
  color: var(--primary);
  transform: translateX(-4px);
}

/* ============================================
   Avatar
   ============================================ */

.avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--bg-tertiary);
  box-shadow: var(--shadow-sm);
}

/* ============================================
   Summary Box
   ============================================ */

.summary-box {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-top: 1.5rem;
  border: 1px solid var(--bg-tertiary);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--bg-tertiary);
}

.summary-row:last-child {
  border-bottom: none;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary);
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 2px solid var(--bg-tertiary);
}

/* ============================================
   Loading Spinner
   ============================================ */

.spinner-border {
  width: 1rem;
  height: 1rem;
  border-width: 2px;
}

/* ============================================
   Utilities
   ============================================ */

.text-gradient {
  color: var(--primary);
  font-weight: 700;
}

.bg-gradient {
  background: var(--primary);
}

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  .card {
    padding: 1rem;
  }

  .btn-lg {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
  }

  .cart-summary {
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
  }

  /* بهینه‌سازی qty-box در موبایل */
  .qty-box {
    gap: 0.25rem;
    padding: 0.25rem 0.375rem;
    flex-wrap: nowrap;
    flex-shrink: 0;
    max-width: 100%;
  }

  .qty-box button {
    width: 28px;
    height: 28px;
    min-width: 28px;
    max-width: 28px;
    font-size: 0.75rem;
    padding: 0;
  }

  .qty-box button i {
    font-size: 0.65rem;
  }

  .qty-box .qty {
    min-width: 18px;
    max-width: 30px;
    font-size: 0.8rem;
    padding: 0 0.125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .qty-box .delete {
    margin-left: 0.125rem;
    width: 26px;
    height: 26px;
    min-width: 26px;
    max-width: 26px;
  }

  .qty-box .plus,
  .qty-box .minus {
    width: 26px;
    height: 26px;
    min-width: 26px;
    max-width: 26px;
  }

  /* بهینه‌سازی product-card در موبایل */
  .product-card {
    padding: 1rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .product-card > div:first-child {
    width: 100%;
  }

  .product-card .action {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: center;
  }

  .product-card .qty-box {
    margin-right: 0;
    margin-left: 0;
  }

  /* بهینه‌سازی cart-item-card در موبایل */
  .cart-item-card .cart-item-image {
    width: 60px;
    height: 60px;
  }

  .cart-item-card .row {
    flex-direction: column;
  }

  .cart-item-card .cart-item-total {
    width: 100%;
    margin-top: 0.5rem;
  }

  .cart-item-card .remove-item {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
  }

  .cart-item-card .card-body {
    position: relative;
    padding-top: 2.5rem;
  }
}

/* ============================================
   Animations
   ============================================ */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

.slide-in {
  animation: slideIn 0.3s ease-out;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

