/* ============================================================
   Renee — Components
   Buttons, cards, badges, inputs, toasts, drawers.
   ============================================================ */

/* ─── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 46px;
  padding-inline: var(--space-5);
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--t-base) var(--ease);
  border: 1px solid transparent;
  white-space: nowrap;
  font-family: inherit;
}
[dir="rtl"] .btn {
  letter-spacing: 0;
  text-transform: none;
  font-family: var(--font-ar-body);
  font-weight: 600;
}

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

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

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-ghost:hover {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}

.btn-light {
  background: var(--white);
  color: var(--ink);
}
.btn-light:hover {
  background: var(--ink);
  color: var(--white);
}

.btn-sm { height: 36px; padding-inline: var(--space-4); font-size: var(--fs-xs); }
.btn-lg { height: 54px; padding-inline: var(--space-6); font-size: var(--fs-base); }
.btn-block { width: 100%; }

/* ─── Badges ───────────────────────────────────────────────── */
.badge-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--white);
  color: var(--ink);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--r-pill);
  font-family: var(--font-en-body);
}
[dir="rtl"] .badge-tag { letter-spacing: 0; text-transform: none; }

.badge-sale {
  background: var(--sale);
  color: var(--white);
}
.badge-new {
  background: var(--primary-dark);
  color: var(--white);
}

/* ─── Product card ─────────────────────────────────────────── */
.product-card {
  background: var(--surface);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: transform var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease);
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.product-card .card-media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--bg-soft);
  overflow: hidden;
}
.product-card .card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms var(--ease-out);
}
.product-card:hover .card-media img {
  transform: scale(1.05);
}

.product-card .card-badges {
  position: absolute;
  inset-block-start: var(--space-3);
  inset-inline-start: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  z-index: 2;
}

.product-card .wishlist-btn {
  position: absolute;
  inset-block-start: var(--space-3);
  inset-inline-end: var(--space-3);
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  border-radius: var(--r-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-mute);
  z-index: 2;
  transition: all var(--t-fast) var(--ease);
}
.product-card .wishlist-btn:hover {
  background: var(--white);
  color: var(--sale);
  transform: scale(1.08);
}
.product-card .wishlist-btn svg { width: 16px; height: 16px; }

.product-card .quick-add {
  position: absolute;
  inset-block-end: 0;
  inset-inline: 0;
  background: var(--ink);
  color: var(--white);
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-block: 12px;
  text-align: center;
  transform: translateY(100%);
  transition: transform var(--t-base) var(--ease);
  font-weight: 500;
  font-family: var(--font-en-body);
}
[dir="rtl"] .product-card .quick-add {
  letter-spacing: 0;
  text-transform: none;
  font-family: var(--font-ar-body);
}
.product-card:hover .quick-add {
  transform: translateY(0);
}

.product-card .card-body {
  padding: var(--space-4) var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1;
}
.product-card .card-brand {
  font-size: var(--fs-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-family: var(--font-en-body);
}
[dir="rtl"] .product-card .card-brand {
  letter-spacing: 0;
  text-transform: none;
  font-family: var(--font-ar-body);
}
.product-card .card-title {
  font-family: inherit;
  font-size: var(--fs-base);
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.8em;
  letter-spacing: 0;
}
[dir="rtl"] .product-card .card-title { font-family: var(--font-ar-body); font-weight: 600; }

.product-card .card-rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-xs);
  color: var(--ink-mute);
}
.stars {
  display: inline-flex;
  gap: 1px;
  color: var(--parchment);
}
.stars svg { width: 12px; height: 12px; fill: currentColor; }
.stars .empty { color: var(--line-strong); }

.product-card .card-price {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin-block-start: auto;
}
.card-price .now {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--ink);
  font-family: var(--font-en-body);
}
[dir="rtl"] .card-price .now { font-family: var(--font-ar-body); }
.card-price .was {
  font-size: var(--fs-sm);
  color: var(--ink-mute);
  text-decoration: line-through;
  font-family: var(--font-en-body);
}
[dir="rtl"] .card-price .was { font-family: var(--font-ar-body); }
.card-price .off {
  font-size: 10px;
  font-weight: 600;
  color: var(--sale);
  letter-spacing: 0.06em;
  font-family: var(--font-en-body);
}

/* ─── Toast ────────────────────────────────────────────────── */
.toast-root {
  position: fixed;
  inset-block-end: var(--space-5);
  inset-inline-end: var(--space-5);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}
.toast {
  background: var(--ink);
  color: var(--white);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  box-shadow: var(--shadow-lg);
  min-width: 240px;
  pointer-events: auto;
  animation: toastIn var(--t-base) var(--ease-out);
}
.toast.is-out { animation: toastOut var(--t-base) var(--ease) forwards; }
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }

/* ─── Skeleton ─────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-alt) 25%, var(--bg-soft) 50%, var(--bg-alt) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite linear;
  border-radius: var(--r-sm);
}

/* ── Password input wrapper ─────────────────────────────────────────────── */
.input-password-wrap {
  position: relative;
}
.input-password-wrap .input {
  padding-inline-end: 48px;
}
.toggle-pw {
  position: absolute;
  inset-inline-end: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--ink-muted);
  opacity: 0.5;
  line-height: 0;
  transition: opacity 200ms;
}
.toggle-pw:hover { opacity: 1; }

/* ── Password strength bar ──────────────────────────────────────────────── */
.pw-strength { margin-block: var(--space-2) var(--space-3); }
.pw-bar { height: 4px; background: var(--off-white); border-radius: 2px; overflow: hidden; margin-block-end: 4px; }
.pw-fill { height: 100%; border-radius: 2px; width: 0; transition: width .4s ease, background .4s ease; }
.pw-label { font-size: var(--fs-xs); color: var(--ink-muted); }

/* ── Alerts / flash messages ────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  margin-block-end: var(--space-4);
}
.alert svg { flex-shrink: 0; margin-block-start: 1px; }
.alert.is-error   { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert.is-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.alert.is-info    { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.alert ul { margin: 0; padding-inline-start: var(--space-4); }

/* ── Auth form: password hint ───────────────────────────────────────────── */
.password-hint {
  display: block;
  font-size: var(--fs-xs);
  color: var(--ink-muted);
  margin-block-start: var(--space-1);
}
