/* ============================================================
   NAFAHAAT PERFUMES — GLOBAL COMPONENTS
   Buttons, badges, cards, forms, stars, price, toast, etc.
   ============================================================ */

/* ──────────────────────────────────────────────────────────
   SECTION LAYOUT
   ────────────────────────────────────────────────────────── */
.section {
  padding-block: var(--section-pad-y);
}

.section-sm {
  padding-block: 28px;
}

.section-dark {
  background: var(--color-secondary);
  color: #fff;
}

.section-muted {
  background: var(--color-neutral-50);
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin-inline: auto;
  margin-bottom: 28px;
}

.section-label {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-3);
}

.section-title {
  font-family: var(--font-serif);
  font-size: var(--text-h2);
  font-weight: var(--weight-semibold);
  color: var(--color-secondary);
  line-height: 1.15;
  margin-bottom: var(--space-4);
}

.section-dark .section-title { color: #fff; }

.section-subtitle {
  font-size: var(--text-xl);
  color: var(--color-neutral-400);
  line-height: 1.6;
  font-weight: var(--weight-regular);
}

/* ──────────────────────────────────────────────────────────
   BUTTONS
   ────────────────────────────────────────────────────────── */

/* Base */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 56px;
  padding-inline: var(--space-8);
  border-radius: var(--radius-btn);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.03em;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition-base);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  user-select: none;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--transition-fast);
}

.btn:hover::after {
  background: rgba(255,255,255,0.05);
}

/* Primary */
.btn-primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.btn-primary:hover {
  background: var(--color-secondary);
  border-color: var(--color-secondary);
}

.btn-primary:active {
}

/* Secondary */
.btn-secondary {
  background: transparent;
  color: var(--color-secondary);
  border-color: var(--color-secondary);
}

.btn-secondary:hover {
  background: var(--color-secondary);
  color: #fff;
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--color-secondary);
  border-color: transparent;
  height: auto;
  padding: 0;
}

.btn-ghost:hover {
  color: var(--color-primary);
}

/* White (for dark backgrounds) */
.btn-white {
  background: #fff;
  color: var(--color-secondary);
  border-color: #fff;
}

.btn-white:hover {
  background: var(--color-secondary);
  color: #fff;
  transform: translateY(-2px);
}

/* White outline */
.btn-outline-white {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,.6);
}

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

/* Danger */
.btn-danger {
  background: var(--color-error);
  color: #fff;
  border-color: var(--color-error);
}

/* Sizes */
.btn-sm { height: 44px; padding-inline: var(--space-6); font-size: var(--text-xs); }
.btn-lg { height: 64px; padding-inline: var(--space-10); font-size: var(--text-base); }
.btn-full { width: 100%; }

/* Icon button */
.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  color: var(--color-secondary);
}

.btn-icon:hover {
  background: var(--color-neutral-100);
  color: var(--color-primary);
}

.btn-icon.active {
  color: var(--color-primary);
}

/* ──────────────────────────────────────────────────────────
   BADGES
   ────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-2xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
}

.badge-new      { background: var(--color-primary); color: #fff; }
.badge-sale     { background: var(--color-error); color: #fff; }
.badge-limited  { background: var(--color-gold); color: #fff; }
.badge-best     { background: var(--color-secondary); color: #fff; }
.badge-trending { background: var(--color-warning); color: #fff; }
.badge-premium  { background: linear-gradient(135deg, var(--color-gold), var(--color-gold-light)); color: #fff; }
.badge-oos      { background: var(--color-neutral-400); color: #fff; }
.badge-coming   { background: var(--color-info); color: #fff; }
.badge-verified { background: var(--color-success); color: #fff; }

/* ──────────────────────────────────────────────────────────
   STAR RATING
   ────────────────────────────────────────────────────────── */
.star-rating {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.star-rating .star {
  font-size: 16px;
  color: var(--color-gold);
  line-height: 1;
}

.star-rating .star.empty {
  color: var(--color-neutral-200);
}

.rating-text {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-neutral-500);
  margin-left: var(--space-2);
}

/* ──────────────────────────────────────────────────────────
   PRICE DISPLAY
   ────────────────────────────────────────────────────────── */
.price-wrap {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.price-current {
  font-family: var(--font-sans);
  font-size: var(--text-h4);
  font-weight: var(--weight-bold);
  color: var(--color-secondary);
}

.price-original {
  font-size: var(--text-sm);
  color: var(--color-neutral-400);
  text-decoration: line-through;
}

.price-savings {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-error);
  background: rgba(239,68,68,.1);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* ──────────────────────────────────────────────────────────
   PRODUCT CARD
   ────────────────────────────────────────────────────────── */
.product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  border-radius: var(--radius-product);
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  cursor: pointer;
  position: relative;
  border: 1px solid var(--color-neutral-100);
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-card-hover);
  border-color: transparent;
}

/* Image area */
.product-card__image-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: var(--color-neutral-50);
  flex-shrink: 0;
}

.product-card__image-wrap a {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
}

.product-card__image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms ease, opacity 300ms ease;
}

.product-card__image-wrap .img-primary {
  position: absolute;
  inset: 0;
  opacity: 1;
  transform: scale(1);
}

.product-card:hover .img-primary {
  opacity: 0;
  transform: scale(1.05);
}

.product-card__image-wrap .img-secondary {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.05);
}

.product-card:hover .img-secondary {
  opacity: 1;
  transform: scale(1);
}

/* Card badges */
.product-card__badges {
  position: absolute;
  top: var(--space-4);
  left: var(--space-4);
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* Wishlist button */
.product-card__wishlist {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: #ffffff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-base);
  opacity: 0;
  transform: scale(0.8);
  border: none;
}

.product-card:hover .product-card__wishlist,
.product-card__wishlist.active {
  opacity: 1;
  transform: scale(1);
}

.product-card__wishlist svg {
  width: 18px;
  height: 18px;
  transition: fill var(--transition-fast);
  stroke: var(--color-error);
  fill: transparent;
}

.product-card__wishlist.wishlisted svg,
.product-card__wishlist:hover svg {
  fill: var(--color-error);
}

/* Quick view (disabled) */
.product-card__quick-view {
  display: none !important;
}

/* Card body */
.product-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: var(--space-5) var(--space-6) var(--space-6);
}

.product-card__brand {
  font-family: var(--font-sans);
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-1);
}

.product-card__name {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: var(--weight-semibold);
  color: var(--color-secondary);
  margin-bottom: var(--space-2);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 48px;
}

.product-card__family {
  font-size: var(--text-xs);
  color: var(--color-neutral-400);
  margin-bottom: var(--space-3);
  min-height: 18px;
}

.product-card__rating {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.product-card__price {
  margin-bottom: var(--space-5);
  min-height: 30px;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.product-card__price .price-current {
  font-size: 22px;
}

/* Card actions */
.product-card__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: auto;
  padding-top: var(--space-2);
}

.product-card__actions .btn-card-add {
  flex: 1;
  height: 40px;
  font-size: var(--text-xs);
  padding: 0 var(--space-3);
  white-space: nowrap;
}

.card-qty-wrap {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-neutral-200);
  border-radius: var(--radius-md);
  height: 40px;
  background: #fafafa;
  overflow: hidden;
}

.card-qty-btn {
  width: 28px;
  height: 100%;
  border: none;
  background: transparent;
  color: var(--color-secondary);
  font-weight: var(--weight-bold);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.card-qty-btn:hover {
  background: var(--color-neutral-200);
}

.card-qty-input {
  width: 28px;
  height: 100%;
  border: none;
  background: transparent;
  text-align: center;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-secondary);
  -moz-appearance: textfield;
}

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

/* Out of stock state */
.product-card.out-of-stock .product-card__image-wrap img {
  filter: grayscale(50%);
}

/* Loading skeleton */
.product-card.skeleton-card .product-card__image-wrap {
  background: var(--color-neutral-100);
}

/* ──────────────────────────────────────────────────────────
   FORMS
   ────────────────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-secondary);
}

.form-input {
  height: 52px;
  padding-inline: var(--space-5);
  border: 1.5px solid var(--color-neutral-200);
  border-radius: var(--radius-input);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-secondary);
  background: #fff;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
  width: 100%;
}

.form-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0,206,209,.12);
  outline: none;
}

.form-input::placeholder {
  color: var(--color-neutral-300);
}

.form-textarea {
  min-height: 120px;
  padding: var(--space-4) var(--space-5);
  resize: vertical;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235D6972' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  padding-right: var(--space-10);
}

.form-error { font-size: var(--text-xs); color: var(--color-error); }
.form-success { font-size: var(--text-xs); color: var(--color-success); }

/* ──────────────────────────────────────────────────────────
   TOAST NOTIFICATIONS
   ────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  min-width: 280px;
  max-width: 380px;
  animation: toastIn 350ms ease forwards;
  pointer-events: all;
  border-left: 4px solid var(--color-primary);
}

.toast.toast-success { border-left-color: var(--color-success); }
.toast.toast-error   { border-left-color: var(--color-error); }
.toast.toast-warning { border-left-color: var(--color-warning); }

.toast__icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}

.toast.toast-success .toast__icon { background: rgba(16,185,129,.1); }
.toast.toast-error   .toast__icon { background: rgba(239,68,68,.1); }
.toast.toast-warning .toast__icon { background: rgba(245,158,11,.1); }

.toast__text { flex: 1; }
.toast__title { font-weight: var(--weight-semibold); font-size: var(--text-sm); }
.toast__msg   { font-size: var(--text-xs); color: var(--color-neutral-500); margin-top: 2px; }

.toast.removing {
  animation: toastOut 300ms ease forwards;
}

/* ──────────────────────────────────────────────────────────
   BREADCRUMB
   ────────────────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-neutral-400);
  padding-block: var(--space-5);
}

.breadcrumb a {
  color: var(--color-neutral-400);
  transition: color var(--transition-fast);
}

.breadcrumb a:hover { color: var(--color-primary); }

.breadcrumb__sep {
  color: var(--color-neutral-300);
  font-size: 10px;
}

.breadcrumb__current {
  color: var(--color-secondary);
  font-weight: var(--weight-medium);
}

/* ──────────────────────────────────────────────────────────
   OVERLAY / BACKDROP
   ────────────────────────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 36, 34, 0.55);
  z-index: calc(var(--z-drawer) - 1);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* ──────────────────────────────────────────────────────────
   QUANTITY SELECTOR
   ────────────────────────────────────────────────────────── */
.qty-selector {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--color-neutral-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  height: 48px;
}

.qty-btn {
  width: 44px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-neutral-50);
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: var(--color-secondary);
  transition: background var(--transition-fast);
  flex-shrink: 0;
}

.qty-btn:hover { background: var(--color-neutral-100); }

.qty-input {
  width: 52px;
  text-align: center;
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  border: none;
  outline: none;
  background: #fff;
  color: var(--color-secondary);
  -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* ──────────────────────────────────────────────────────────
   SECTION DIVIDERS & DECORATIONS
   ────────────────────────────────────────────────────────── */
.divider {
  width: 60px;
  height: 2px;
  background: var(--color-primary);
  margin: var(--space-4) auto;
  border-radius: var(--radius-full);
}

.divider-left { margin-left: 0; }

/* ──────────────────────────────────────────────────────────
   CAROUSEL CONTROLS
   ────────────────────────────────────────────────────────── */
.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin-top: 14px;
}

.carousel-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: #fff;
  border: 1px solid var(--color-neutral-200);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-base);
  color: var(--color-secondary);
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  padding: 0;
  line-height: 1;
}

.carousel-btn:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.carousel-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
}

.carousel-dots {
  display: none !important; /* Removed wide dash pill between slider arrows as shown in Image 5 */
}

.carousel-dot {
  display: none !important;
}

/* ──────────────────────────────────────────────────────────
   RESPONSIVE ADJUSTMENTS
   ────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .section { padding-block: 36px; }
  .section-header { margin-bottom: 24px; }
}

@media (max-width: 768px) {
  .section { padding-block: 28px; }
  .section-header { margin-bottom: 20px; }
  #toast-container { left: var(--space-4); right: var(--space-4); bottom: var(--space-4); }
  .toast { min-width: auto; max-width: none; }
}

/* ── EQUAL HEIGHT PRODUCT CARD ALIGNMENT & QUICK VIEW ── */
.product-card {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  min-height: 100% !important;
  align-self: stretch !important;
  box-sizing: border-box !important;
}

.product-card__body {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
}

.product-card__price {
  min-height: 52px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  gap: 4px !important;
  margin-bottom: var(--space-4) !important;
}

.product-card__price .price-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.product-card__price .savings-line {
  min-height: 20px;
  display: flex;
  align-items: center;
}

.product-card__price .price-savings {
  display: inline-block;
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

.product-card__price .price-savings-spacer {
  display: inline-block;
  height: 20px;
  visibility: hidden;
}

.product-card__actions {
  margin-top: auto !important;
  padding-top: var(--space-2) !important;
}

/* Quick View - Always visible (not just on hover) */
.product-card__quick-view-btn {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  background: rgba(11, 36, 34, 0.92);
  color: #ffffff !important;
  border: 1px solid rgba(188, 155, 98, 0.5);
  backdrop-filter: blur(8px);
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
}

.product-card__quick-view-btn:hover {
  background: var(--color-primary, #143836);
  border-color: #B8955E;
  color: #B8955E !important;
  transform: translateX(-50%) scale(1.05);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.product-card__quick-view-btn svg {
  stroke: #B8955E;
}
