/* استایل مودال سبد خرید */
.cart-modal {
  position: fixed;
  bottom: -100%;
  left: 50%;
  transform: translateX(-50%) translateY(20px); /* افکت محو شدن آرام */
  width: 100%;
  max-width: 480px; /* هماهنگ با mobile-wrapper در base.css */
  height: 100%;
  background: var(--theme-color);
  z-index: 1002;
  transition: all 0.8s cubic-bezier(0.25, 0.8, 0.25, 1); /* انیمیشن بسیار نرم */
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.2);
  border-radius: 20px 20px 0 0;
  opacity: 0;
}

.cart-modal.active {
  bottom: 0;
  transform: translateX(-50%) translateY(0); /* بازگشت به حالت عادی */
  opacity: 1;
}

.cart-modal-content {
  width: 100%;
  height: 100%;
  padding: 15px; /* پدینگ کمتر برای موبایل */
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  direction: rtl;
  background: var(--items-color);
  transition: background 0.5s cubic-bezier(0.25, 0.8, 0.25, 1); /* نرم‌تر کردن تغییر پس‌زمینه */
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  transition: border-color 0.5s cubic-bezier(0.25, 0.8, 0.25, 1); /* نرم‌تر کردن تغییر خط */
}

.cart-header h2 {
  font-size: 1.4rem; /* کمی کوچکتر برای موبایل */
  font-weight: 700;
  color: var(--text-color);
  margin: 0;
  transition: color 0.5s cubic-bezier(0.25, 0.8, 0.25, 1); /* نرم‌تر کردن تغییر رنگ */
}

.close-cart-btn {
  background: var(--theme-color-adjusted-10);
  border: none;
  width: 36px; /* کمی کوچکتر برای موبایل */
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1); /* نرم‌تر کردن تغییرات */
}

.close-cart-btn:hover {
  background: var(--theme-color);
  transform: scale(1.08); /* افکت مقیاس کمتر برای نرمی */
}

.close-cart-btn i {
  font-size: 1.3rem; /* کمی کوچکتر برای موبایل */
  color: var(--text-color);
  transition: color 0.5s cubic-bezier(0.25, 0.8, 0.25, 1); /* نرم‌تر کردن تغییر رنگ آیکن */
}

.cart-guide {
  padding: 8px 0;
  text-align: center;
  transition: opacity 0.5s cubic-bezier(0.25, 0.8, 0.25, 1); /* نرم‌تر کردن تغییر شفافیت */
}

.cart-guide p {
  font-size: 0.85rem; /* کوچکتر برای موبایل */
  color: var(--text-color-adjusted-10);
  margin: 0;
  transition: color 0.5s cubic-bezier(0.25, 0.8, 0.25, 1); /* نرم‌تر کردن تغییر رنگ */
}

.cart-items {
  flex-grow: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px; /* پدینگ کمتر برای موبایل */
  background: var(--items-color-adjusted-20);
  border-radius: 12px;
  margin-bottom: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1); /* نرم‌تر کردن تغییرات آیتم */
}

.cart-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cart-item img {
  width: 50px; /* کوچکتر برای موبایل */
  height: 50px;
  object-fit: cover;
  border-radius: 8px;
  margin-left: 8px;
  transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1); /* نرم‌تر کردن تغییر تصویر */
}

.cart-item img:hover {
  transform: scale(1.08); /* افکت زوم کمتر برای نرمی */
}

.cart-item-details {
  flex-grow: 1;
  margin-left: 8px;
}

.cart-item-details h3 {
  font-size: 1rem; /* کوچکتر برای موبایل */
  font-weight: 600;
  color: var(--text-color);
  margin: 0 0 4px 0;
  transition: color 0.5s cubic-bezier(0.25, 0.8, 0.25, 1); /* نرم‌تر کردن تغییر رنگ */
}

.cart-item-details p {
  font-size: 0.8rem; /* کوچکتر برای موبایل */
  color: var(--text-color-adjusted-10);
  margin: 0;
  transition: color 0.5s cubic-bezier(0.25, 0.8, 0.25, 1); /* نرم‌تر کردن تغییر رنگ */
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cart-item-controls button {
  background: var(--theme-color);
  border: none;
  width: 28px; /* کوچکتر برای موبایل */
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1); /* نرم‌تر کردن تغییرات دکمه */
}

.cart-item-controls button:hover {
  background: var(--theme-color-adjusted-10);
  transform: scale(1.12); /* افکت مقیاس کمی بیشتر برای وضوح */
}

.cart-item-controls button i {
  color: var(--text-color);
  font-size: 0.9rem; /* کوچکتر برای موبایل */
  transition: color 0.5s cubic-bezier(0.25, 0.8, 0.25, 1); /* نرم‌تر کردن تغییر رنگ آیکن */
}

.cart-item-controls span {
  font-size: 0.9rem; /* کوچکتر برای موبایل */
  color: var(--text-color);
  min-width: 18px;
  text-align: center;
  transition: color 0.5s cubic-bezier(0.25, 0.8, 0.25, 1); /* نرم‌تر کردن تغییر رنگ */
}

.cart-footer {
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  transition: border-color 0.5s cubic-bezier(0.25, 0.8, 0.25, 1); /* نرم‌تر کردن تغییر خط */
}

.clear-cart-btn {
  background: var(--theme-color-adjusted-10);
  color: var(--text-color);
  border: none;
  padding: 8px 16px; /* کوچکتر برای موبایل */
  border-radius: 8px;
  font-size: 0.9rem; /* کوچکتر برای موبایل */
  font-weight: 600;
  cursor: pointer;
  transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1); /* نرم‌تر کردن تغییرات دکمه */
}

.clear-cart-btn:hover {
  background: var(--theme-color);
  transform: scale(1.06); /* افکت مقیاس کمتر برای نرمی */
}

.cart-total {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-grow: 1;
  padding: 8px;
  background: var(--items-color-adjusted-30);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1); /* نرم‌تر کردن تغییرات */
}

.total-price {
  font-size: 1.1rem; /* کوچکتر برای موبایل */
  font-weight: 700;
  color: var(--text-color);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.5s cubic-bezier(0.25, 0.8, 0.25, 1); /* نرم‌تر کردن تغییر رنگ */
}

.total-price::before {
  content: "\e0f1"; /* آیکن سبد خرید از Bootstrap Icons */
  font-family: "bootstrap-icons";
  font-size: 1.2rem; /* کوچکتر برای موبایل */
  color: var(--text-color);
  transition: color 0.5s cubic-bezier(0.25, 0.8, 0.25, 1); /* نرم‌تر کردن تغییر رنگ آیکن */
}

/* استایل برای آیتم‌های سبد خرید */
.item-name {
  font-size: 1rem; /* کوچکتر برای موبایل */
  font-weight: 600;
  color: var(--text-color);
  transition: color 0.5s cubic-bezier(0.25, 0.8, 0.25, 1); /* نرم‌تر کردن تغییر رنگ */
}

.item-quantity {
  font-size: 0.8rem; /* کوچکتر برای موبایل */
  color: var(--text-color-adjusted-10);
  transition: color 0.5s cubic-bezier(0.25, 0.8, 0.25, 1); /* نرم‌تر کردن تغییر رنگ */
}

.item-price {
  font-size: 0.9rem; /* کوچکتر برای موبایل */
  font-weight: 600;
  color: var(--text-color);
  transition: color 0.5s cubic-bezier(0.25, 0.8, 0.25, 1); /* نرم‌تر کردن تغییر رنگ */
}

/* اسکرول‌بار سفارشی */
.cart-items::-webkit-scrollbar {
  width: 5px; /* نازک‌تر برای موبایل */
}

.cart-items::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
  transition: background 0.5s cubic-bezier(0.25, 0.8, 0.25, 1); /* نرم‌تر کردن تغییر رنگ */
}

.cart-items::-webkit-scrollbar-thumb:hover {
  background: var(--text-color-adjusted-10);
}