/* ===== صفحه لیست علاقه‌مندی‌ها ===== */

.fav-page {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1rem 3rem;
  direction: rtl;
  font-family: inherit;
}

.fav-page-head {
  background: #ffffff;
  border-radius: 1.5rem;
  padding: 1.5rem 1.75rem;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.4);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.fav-page-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 .25rem;
}

.fav-page-subtitle {
  margin: 0;
  font-size: .875rem;
  color: #64748b;
}

/* ===== تولبار جستجو و مرتب‌سازی ===== */

.fav-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
}

.fav-toolbar-item {
  position: relative;
}

.fav-search-input {
  min-width: 230px;
  padding: .5rem .75rem;
  border-radius: .9rem;
  border: 1px solid rgba(148,163,184,.6);
  font-size: .875rem;
  background: #f8fafc;
  outline: none;
  transition: all .2s ease;
}

.fav-search-input:focus {
  background: #ffffff;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 2px rgba(14,165,233,0.25);
}

.fav-sort-select {
  padding: .5rem .75rem;
  border-radius: .9rem;
  border: 1px solid rgba(148,163,184,.6);
  font-size: .875rem;
  background: #f8fafc;
  outline: none;
  cursor: pointer;
  transition: all .2s ease;
}

.fav-sort-select:focus {
  background: #ffffff;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 2px rgba(14,165,233,0.25);
}

/* ===== لیست ===== */

.fav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  background: #ffffff;
  border-radius: 1.5rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
}

.fav-item {
  display: grid;
  grid-template-columns: 110px minmax(0, 1.8fr) minmax(0, 1fr) auto;
  gap: 1rem;
  padding: 1rem 1.25rem;
  align-items: center;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  transition: background .18s ease, box-shadow .18s ease, transform .18s ease;
}

.fav-item:last-child {
  border-bottom: none;
}

.fav-item:hover {
  background: #f8fafc;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

/* تصویر */

.fav-item-thumb a {
  display: block;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid rgba(226,232,240,0.9);
  background: #f8fafc;
}

.fav-item-thumb img {
  display: block;
  width: 100%;
  height: 88px;
  object-fit: cover;
  transition: transform .25s ease;
}

.fav-item:hover .fav-item-thumb img {
  transform: scale(1.03);
}

/* اطلاعات محصول */

.fav-item-main {
  min-width: 0;
}

.fav-item-title {
  font-size: .95rem;
  font-weight: 700;
  color: #0f172a;
  text-decoration: none;
  display: block;
  margin-bottom: .25rem;
  line-height: 1.6;
}

.fav-item-title:hover {
  color: #0ea5e9;
}

.fav-item-subtitle {
  font-size: .8rem;
  color: #64748b;
  margin-bottom: .4rem;
}

.fav-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

.fav-item-chip {
  font-size: .75rem;
  padding: .15rem .55rem;
  border-radius: 999px;
  background: rgba(14,165,233,0.08);
  color: #0369a1;
  border: 1px solid rgba(125,211,252,0.6);
}

.fav-item-chip--muted {
  background: rgba(148,163,184,0.08);
  color: #475569;
  border-color: rgba(148,163,184,0.5);
}

/* قیمت */

.fav-item-price {
  text-align: left;
  min-width: 0;
}

.fav-price-label {
  font-size: .85rem;
  color: #ea580c;
  font-weight: 600;
}

.fav-price-old {
  font-size: .8rem;
  color: #94a3b8;
  text-decoration: line-through;
  margin-bottom: .1rem;
}

.fav-price-discount {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  padding: .15rem .5rem;
  border-radius: 999px;
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 700;
  margin-bottom: .15rem;
}

.fav-price-current {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .25rem;
}

.fav-price-value {
  font-size: .95rem;
  font-weight: 800;
  color: #0f172a;
}

.fav-price-unit {
  font-size: .7rem;
  color: #64748b;
}

/* اکشن‌ها */

.fav-item-actions {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  align-items: stretch;
}

.fav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  font-size: .8rem;
  border-radius: .9rem;
  padding: .4rem .7rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .18s ease;
  white-space: nowrap;
}

.fav-btn i {
  font-size: .8rem;
}

.fav-btn--ghost {
  background: #f8fafc;
  color: #ef4444;
  border-color: rgba(248, 113, 113, 0.5);
}

.fav-btn--ghost:hover {
  background: #fee2e2;
  border-color: #ef4444;
}

.fav-btn--primary {
  background: #0ea5e9;
  color: #ffffff;
  border-color: #0ea5e9;
}

.fav-btn--primary:hover {
  background: #0284c7;
  border-color: #0284c7;
}

.fav-btn--outline {
  background: #ffffff;
  color: #0f172a;
  border-color: rgba(148, 163, 184, 0.7);
}

.fav-btn--outline:hover {
  background: #f1f5f9;
}

/* دکمه داخل فرم (افزودن به سبد) */
.fav-item-actions form {
  margin: 0;
}

/* ===== وضعیت خالی ===== */

.fav-empty {
  background: #ffffff;
  border-radius: 1.5rem;
  border: 1px dashed rgba(148,163,184,0.7);
  padding: 2.5rem 1.5rem;
  text-align: center;
  box-shadow: 0 12px 30px rgba(148,163,184,0.18);
}

.fav-empty--inline {
  margin-top: 1.5rem;
}

.fav-empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: rgba(248, 113, 113, 0.08);
  margin: 0 auto .75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fav-empty-icon i {
  color: #ef4444;
  font-size: 1.4rem;
}

.fav-empty-title {
  margin: 0 0 .5rem;
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
}

.fav-empty-text {
  margin: 0 0 1rem;
  font-size: .85rem;
  color: #64748b;
}

.fav-empty-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .5rem 1rem;
  border-radius: 999px;
  background: #0ea5e9;
  color: #ffffff;
  font-size: .8rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 10px 22px rgba(14,165,233,0.35);
  transition: all .18s ease;
}

.fav-empty-btn:hover {
  background: #0284c7;
  box-shadow: 0 10px 26px rgba(8, 47, 73, 0.35);
}

/* ===== ریسپانسیو ===== */

@media (max-width: 992px) {
  .fav-item {
    grid-template-columns: 90px minmax(0, 1.6fr) minmax(0, 1.2fr);
    grid-template-rows: auto auto;
    grid-auto-flow: row;
  }

  .fav-item-actions {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .fav-page {
    margin-top: 1.25rem;
  }

  .fav-page-head {
    padding: 1.1rem 1rem;
  }

  .fav-item {
    grid-template-columns: 80px minmax(0, 1fr);
    grid-template-rows: auto auto auto;
  }

  .fav-item-price {
    grid-column: 2 / 3;
    text-align: right;
  }

  .fav-item-actions {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
    gap: .35rem;
  }

  .fav-btn {
    flex: 1 1 48%;
  }
}
/* ===== آلرت‌ها در صفحه علاقه‌مندی‌ها ===== */

.fav-alert-container {
  position: relative;
  margin-bottom: 0.75rem;
}

.fav-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  font-size: .8rem;
  border-radius: .9rem;
  padding: .5rem .75rem;
  margin-bottom: .25rem;
  border-width: 1px;
  border-style: solid;
  animation: favAlertIn .2s ease-out;
}

.fav-alert--success {
  background: #ecfdf5;
  border-color: #4ade80;
  color: #166534;
}

.fav-alert--error {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.fav-alert--info {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.fav-alert-msg {
  flex: 1 1 auto;
}

.fav-alert-close {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 .25rem;
}

.fav-alert--hide {
  opacity: 0;
  transform: translateY(-4px);
  transition: all .2s ease-out;
}

@keyframes favAlertIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.fav-btn.is-loading {
  opacity: .7;
  pointer-events: none;
}
