/* ====================================================================
   فایل: cart.css
   توضیح: استایل آیکون سبد خرید توی هدر + صفحه‌ی cart.html
   ==================================================================== */

/* ---- آیکون سبد خرید در هدر ---- */
.cart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 0, 170, 0);
  border: 1.5px solid rgba(255, 0, 170, 0);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
  flex-shrink: 0;
}

.cart-btn:hover {
  background: rgba(0, 242, 255, 0.2);
  border-color: rgba(255, 174, 0, 0.5);
  color: var(--neon-purple-light);
  transform: translateY(-1px);
}

.cart-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

/* badge تعداد آیتم‌ها */
#cartBadge {
  position: absolute;
  top: -7px;
  left: -7px;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--neon-purple);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  box-shadow: 0 0 8px #f0c88b;
  animation: popIn 0.25s ease;
}

@keyframes popIn {
  0%   { transform: scale(0.4); }
  70%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* ---- لوگوی تصویری / SVG در هدر ---- */
.header-logo-img {
  height: 36px;
  width: auto;
  border-radius: 8px;
  object-fit: contain;
}

/* ---- صفحه‌ی سبد خرید (cart.html) ---- */
.cart-page-wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 16px;
}

/* حالت خالی بودن سبد */
.cart-empty {
  text-align: center;
  padding: 80px 24px;
}

.cart-empty svg {
  width: 64px;
  height: 64px;
  stroke: var(--text-muted);
  margin-bottom: 20px;
}

.cart-empty h2 {
  font-size: 20px;
  margin-bottom: 10px;
}

.cart-empty p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* لیست آیتم‌های سبد */
.cart-items-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}

.cart-item-card {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 16px;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid rgba(255, 213, 0, 0.15);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: border-color var(--transition-fast);
}

.cart-item-card:hover {
  border-color: #f0c88b84;
}

.cart-item-img {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
  background: rgba(0, 251, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

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

.cart-item-img svg {
  width: 28px;
  height: 28px;
  stroke: var(--text-muted);
}

.cart-item-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.cart-item-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-price {
  font-size: 13.5px;
  color: var(--neon-purple-light);
  font-weight: 600;
}

.cart-item-subtotal {
  font-size: 12px;
  color: var(--text-muted);
}

/* کنترل تعداد */
.cart-qty-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.cart-qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1.5px solid rgba(0, 213, 255, 0.3);
  background: transparent;
  color: var(--neon-purple-light);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  font-family: inherit;
  line-height: 1;
}

.cart-qty-btn:hover {
  background: #f0c88b30;
}

.cart-qty-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 24px;
  text-align: center;
}

/* دکمه‌ی حذف */
.cart-item-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.cart-remove-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.cart-remove-btn:hover {
  background: rgba(239, 68, 68, 0.25);
}

.cart-remove-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

/* بخش جمع‌بندی */
.cart-summary {
  background: var(--bg-card);
  border: 1px solid rgba(255, 234, 0, 0.2);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cart-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-secondary);
}

.cart-summary-row.total {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  padding-top: 10px;
  border-top: 1px solid rgba(255, 234, 0, 0.2);
}

.cart-summary-row.total .total-price {
  color: var(--neon-purple-light);
}

/* کد تخفیف در صفحه‌ی سبد */
.cart-discount-row {
  display: flex;
  gap: 10px;
  padding-top: 4px;
}

.cart-discount-row input {
  flex: 1;
  padding: 10px 14px;
  background: rgba(0, 255, 229, 0.06);
  border: 1.5px solid #f0c88b46;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13.5px;
  text-transform: uppercase;
  transition: var(--transition-fast);
}

.cart-discount-row input:focus {
  outline: none;
  border-color: var(--neon-blue);
}

.cart-discount-msg {
  font-size: 12.5px;
  margin-top: 4px;
}

/* دکمه‌ی پرداخت */
.cart-checkout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--gradient-main);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
  margin-top: 4px;
}

.cart-checkout-btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 221, 255, 0.3);
}

.cart-checkout-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

/* login gate */
.cart-login-gate {
  background: rgba(255, 0, 168, 0.07);
  border: 1.5px dashed #f0c88b;
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
}

.cart-login-gate a {
  color: var(--neon-purple-light);
  font-weight: 700;
  text-decoration: none;
}

.cart-login-gate a:hover {
  text-decoration: underline;
}

/* ---- افزودن به سبد روی صفحه‌ی محصول ---- */
.btn-add-cart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: auto;
  border-radius: var(--radius-sm);
  border: 1.5px solid #f0c88b30;
  background: #8bedf01c;
  color: var(--neon-purple-light);
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition-fast);
  width: 40%;
  margin-top: 12px;
}

.btn-add-cart:hover {
  background: #f0c88b5b;
  border-color: #8bedf034;
}

.btn-add-cart svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

.btn-add-cart.added {
  background: rgba(74, 222, 128, 0.12);
  border-color: rgba(74, 222, 128, 0.4);
  color: #4ade80;
}
.btn-add-cart-product {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: var(--radius-sm);
  border: 1.5px solid #f0c88b30;
  background: #8bedf01c;
  color: var(--neon-purple-light);
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition-fast);
  width: 100%;
  margin-top: 12px;
}
.btn-add-cart-product:hover {
  background: #f0c88b5b;
  border-color: #8bedf034;
}

.btn-add-cart-product svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

.btn-add-cart-product.added {
  background: rgba(74, 222, 128, 0.12);
  border-color: rgba(74, 222, 128, 0.4);
  color: #4ade80;
}

@media (max-width: 560px) {
  .cart-item-card {
    grid-template-columns: 56px 1fr;
    grid-template-rows: auto auto;
  }

  .cart-item-actions {
    grid-column: 2;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}
