/* ==========================================================================
   GenZdukan — Reusable Components
   Product cards, buttons, badges, rating stars, brand cards, toast, quantity.
   Theme: Premium Modern Marketplace
   ========================================================================== */

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.75rem 1.75rem;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 1;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  text-transform: capitalize;
  letter-spacing: 0.02em;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.btn:active::before {
  width: 300px;
  height: 300px;
}

/* Primary Button: Deep Navy / Charcoal */
.btn--primary {
  background: var(--color-primary-dark);
  color: var(--color-white);
  border: 1px solid var(--color-primary-dark);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.2);
}

.btn--primary:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-white);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.3);
}

.btn--primary:active {
  transform: translateY(0);
}

/* Secondary Button: Light Gold / Accent */
.btn--secondary {
  background: var(--color-accent);
  color: var(--color-white);
  border: 1px solid var(--color-accent);
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.25);
}

.btn--secondary:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(217, 119, 6, 0.35);
}

/* Outline Button */
.btn--outline {
  background: transparent;
  color: var(--color-primary-dark);
  border: 1.5px solid var(--color-primary-dark);
}

.btn--outline:hover {
  background: var(--color-primary-dark);
  color: var(--color-white);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.2);
}

/* Ghost Button */
.btn--ghost {
  background: var(--color-secondary-light);
  color: var(--color-secondary);
  border: none;
}

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

/* Small Button */
.btn--sm {
  padding: 0.5rem 1.25rem;
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
}

/* Large Button */
.btn--lg {
  padding: 1rem 2.5rem;
  font-size: var(--text-base);
  border-radius: var(--radius-lg);
}

/* Icon Button */
.btn--icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-full);
}

/* Accent Button (Buy Now) */
.btn--accent,
.buy-now-btn {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 50%, #b45309 100%) !important;
  color: var(--color-white) !important;
  border: 1px solid #d97706 !important;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35);
  font-weight: 800;
  position: relative;
  overflow: hidden;
  animation: buyNowGlobalFloatPulse 2.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}

.btn--accent::after,
.buy-now-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transform: skewX(-25deg);
  animation: buyNowGlobalShimmer 3s ease-in-out infinite;
  pointer-events: none;
}

.btn--accent:hover,
.buy-now-btn:hover {
  animation-play-state: paused;
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 50%, #92400e 100%) !important;
  border-color: #b45309 !important;
  transform: translateY(-3px) scale(1.04) !important;
  box-shadow: 0 8px 22px rgba(217, 119, 6, 0.55), 0 0 14px rgba(245, 158, 11, 0.35) !important;
}

.btn--accent:active,
.buy-now-btn:active {
  transform: translateY(0) scale(0.98) !important;
}

@keyframes buyNowGlobalFloatPulse {
  0% {
    transform: translateY(0) scale(1);
    box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35);
  }
  50% {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 8px 20px rgba(217, 119, 6, 0.5), 0 0 14px rgba(245, 158, 11, 0.35);
  }
  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35);
  }
}

@keyframes buyNowGlobalShimmer {
  0% {
    left: -100%;
  }
  25%, 100% {
    left: 200%;
  }
}

/* Wishlist Active Button State */
.wishlist-btn--active,
.wishlist-btn.active,
.wishlist-btn--active:hover,
.wishlist-btn.active:hover {
  background: var(--color-accent-light) !important;
  color: var(--color-accent) !important;
  border-color: var(--color-accent) !important;
}

.wishlist-btn--active svg,
.wishlist-btn.active svg {
  fill: var(--color-accent) !important;
  stroke: var(--color-accent) !important;
}

/* ==========================================================================
   PRODUCT CARD (12–16px rounded, white bg, subtle shadow)
   ========================================================================== */

.product-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--color-border-light);
  transition: transform var(--transition-base),
              box-shadow var(--transition-base),
              border-color var(--transition-base);
  position: relative;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(217, 119, 6, 0.3);
}

/* Card Image Container */
.product-card__image {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--color-bg);
  cursor: pointer;
}

.product-card__image-link {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.product-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover .product-card__image img {
  transform: scale(1.06);
}

/* Quick Action Overlay */
.product-card__actions {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-md);
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  background: linear-gradient(transparent, rgba(15, 23, 42, 0.4));
  transform: translateY(100%);
  transition: transform var(--transition-base);
}

.product-card:hover .product-card__actions {
  transform: translateY(0);
}

.product-card__action-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--color-white);
  color: var(--color-primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  cursor: pointer;
  border: none;
}

.product-card__action-btn:hover {
  background: var(--color-accent);
  color: var(--color-white);
  transform: scale(1.1);
}

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

.product-card__category {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-xs);
}

.product-card__name {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--color-primary-dark);
  margin-bottom: var(--space-sm);
  line-height: var(--leading-tight);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card__name a {
  color: inherit;
  transition: color var(--transition-fast);
}

.product-card__name a:hover {
  color: var(--color-accent);
}

.product-card__description {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: var(--leading-normal);
}

/* Rating */
.product-card__rating {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}

.stars {
  display: flex;
  align-items: center;
  gap: 2px;
}

.star {
  color: var(--color-accent);
  font-size: var(--text-sm);
  line-height: 1;
}

.star--empty {
  color: var(--color-border);
}

.star--half {
  position: relative;
  color: var(--color-border);
}

.star--half::before {
  content: '★';
  position: absolute;
  left: 0;
  color: var(--color-accent);
  overflow: hidden;
  width: 50%;
}

.rating-count {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-left: var(--space-xs);
}

/* Price */
.product-card__price {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  margin-top: auto;
  margin-bottom: var(--space-md);
}

.price-current {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: var(--weight-extrabold);
  color: var(--color-primary-dark);
}

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

.price-discount {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-secondary);
  background: var(--color-secondary-light);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

/* Card Footer Buttons */
.product-card__footer {
  display: flex;
  gap: var(--space-sm);
  padding: 0 var(--space-lg) var(--space-lg);
}

.product-card__footer .btn {
  flex: 1;
  padding: 0.6rem 1rem;
  font-size: var(--text-sm);
}

/* Wishlist Card Footer — 3 buttons layout */
.product-card__footer--wishlist {
  flex-wrap: wrap;
}

.product-card__footer--wishlist .btn {
  flex: 1 1 auto;
  min-width: 0;
  font-size: var(--text-xs);
  padding: 0.5rem 0.75rem;
}

.product-card__footer--wishlist .wishlist-remove-btn {
  flex-basis: 100%;
  color: var(--color-danger);
  border-color: var(--color-danger);
}

.product-card__footer--wishlist .wishlist-remove-btn:hover {
  background: var(--color-danger);
  color: var(--color-white);
}

/* ==========================================================================
   BADGES
   ========================================================================== */

.badge {
  position: absolute;
  top: var(--space-md);
  left: var(--space-md);
  padding: 4px 12px;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: var(--radius-pill);
  z-index: var(--z-base);
}

.badge--hot {
  background: var(--gradient-primary);
  color: var(--color-white);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.badge--new {
  background: var(--color-secondary-light);
  color: var(--color-secondary);
  border: 1px solid rgba(2, 132, 199, 0.2);
}

.badge--sale {
  background: var(--color-accent-light);
  color: var(--color-accent);
  border: 1px solid rgba(217, 119, 6, 0.2);
}

.product-card__video-badge {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  z-index: var(--z-base);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}


/* ==========================================================================
   BRAND CARD
   ========================================================================== */

.brand-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-base);
  cursor: pointer;
  border: 1px solid var(--color-border-light);
  aspect-ratio: 16/9;
}

.brand-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-accent);
}

.brand-card__logo {
  max-width: 110px;
  max-height: 45px;
  object-fit: contain;
  filter: grayscale(100%) opacity(0.5);
  transition: filter var(--transition-base);
}

.brand-card:hover .brand-card__logo {
  filter: grayscale(0%) opacity(1);
}

.brand-card__text {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-primary-dark);
  letter-spacing: -0.02em;
  opacity: 0.6;
  transition: opacity 0.3s ease, color 0.3s ease;
}

.brand-card:hover .brand-card__text {
  opacity: 1;
  color: var(--color-primary-dark);
}

/* ==========================================================================
   TOAST NOTIFICATION
   ========================================================================== */

.toast-container {
  position: fixed;
  top: calc(var(--header-height) + var(--space-md));
  right: var(--space-lg);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
}

.toast {
  background: var(--color-primary-dark);
  color: var(--color-white);
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  pointer-events: auto;
  animation: toastIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 350px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast--success {
  border-left: 4px solid var(--color-accent);
}

.toast--error {
  border-left: 4px solid var(--color-danger);
}

.toast.removing {
  animation: toastOut 0.3s ease forwards;
}

.toast__icon {
  font-size: var(--text-lg);
  flex-shrink: 0;
  color: var(--color-accent);
}

/* ==========================================================================
   QUANTITY SELECTOR
   ========================================================================== */

.qty-selector {
  display: flex;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  width: fit-content;
  background: var(--color-white);
}

.qty-selector__btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  color: var(--color-primary-dark);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
}

.qty-selector__btn:hover {
  background: var(--color-primary-dark);
  color: var(--color-white);
}

.qty-selector__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.qty-selector__btn:disabled:hover {
  background: var(--color-bg);
  color: var(--color-primary-dark);
}

.qty-selector__value {
  width: 55px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  background: var(--color-white);
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  color: var(--color-primary-dark);
}

/* ==========================================================================
   PRODUCT GRID
   ========================================================================== */

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-xl);
}

/* ==========================================================================
   BRAND GRID
   ========================================================================== */

.brand-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
}

/* ==========================================================================
   RECENT SALES SOCIAL PROOF TOAST
   ========================================================================== */

.sales-proof-toast {
  position: fixed !important;
  bottom: 24px !important;
  left: 24px !important;
  z-index: 999999999 !important;
  display: flex !important;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #ffffff !important;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 14px;
  box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.22), 0 4px 12px rgba(15, 23, 42, 0.08);
  max-width: 320px;
  width: calc(100% - 48px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(25px) scale(0.94);
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s ease;
  font-family: inherit;
}

.sales-proof-toast--visible {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) scale(1) !important;
  pointer-events: auto !important;
}

.sales-proof-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.35);
}

.sales-proof-content {
  flex: 1;
  min-width: 0;
}

.sales-proof-header {
  display: flex;
  align-items: baseline;
  gap: 4px;
  line-height: 1.25;
}

.sales-proof-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f172a;
}

.sales-proof-location {
  font-size: 0.74rem;
  color: #64748b;
}

.sales-proof-text {
  font-size: 0.78rem;
  color: #334155;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sales-proof-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-size: 0.68rem;
  color: #64748b;
}

.sales-proof-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.sales-proof-verified {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: #10b981;
  font-weight: 700;
  font-size: 0.68rem;
  margin-left: 2px;
}

.sales-proof-close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  border-radius: 4px;
  transition: color 0.15s ease;
}

.sales-proof-close:hover {
  color: #0f172a;
}

@media (max-width: 640px) {
  .sales-proof-toast {
    bottom: 16px !important;
    left: 16px !important;
    max-width: 290px;
    width: calc(100% - 32px);
  }
}

