/* ============================================
   REUSABLE COMPONENTS — Buttons, Cards, Badges
   ============================================ */

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 12px 28px;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--fw-semibold);
  line-height: 1;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.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;
}

.btn-primary {
  background: var(--gradient-accent);
  color: var(--color-white);
  box-shadow: var(--shadow-accent);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(255, 77, 0, 0.4);
}

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

.btn-secondary:hover {
  background: #1a2035;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-outline {
  background: transparent;
  border-color: var(--color-accent);
  color: var(--color-accent);
}

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

.btn-white {
  background: var(--color-white);
  color: var(--color-primary);
}

.btn-white:hover {
  background: var(--color-surface);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-ghost {
  background: rgba(255,255,255,0.1);
  color: var(--color-white);
  border-color: rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
}

.btn-ghost:hover {
  background: rgba(255,255,255,0.2);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 8px 18px;
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 16px 36px;
  font-size: var(--text-lg);
  border-radius: var(--radius-lg);
}

.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon svg {
  width: 20px;
  height: 20px;
}

/* ── Product Card ── */
.product-card {
  position: relative;
  background: var(--color-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  overflow: hidden;
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
  border-color: var(--color-accent);
}

.product-card__image {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--color-surface);
}

.product-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

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

.product-card__actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  opacity: 0;
  transform: translateX(10px);
  transition: all var(--transition-base);
}

.product-card:hover .product-card__actions {
  opacity: 1;
  transform: translateX(0);
}

.product-card__action-btn {
  width: 38px;
  height: 38px;
  background: var(--color-white);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  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);
}

.product-card__action-btn svg {
  width: 18px;
  height: 18px;
}

.product-card__body {
  padding: var(--space-4) var(--space-5) var(--space-5);
  flex: 1;
  display: flex;
  flex-direction: column;
}

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

.product-card__title {
  font-family: var(--font-body);
  font-size: var(--text-md);
  font-weight: var(--fw-semibold);
  color: var(--color-primary);
  line-height: var(--lh-snug);
  margin-bottom: var(--space-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card__title a {
  color: inherit;
}

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

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

.product-card__stars {
  display: flex;
  gap: 2px;
  color: var(--color-warning);
}

.product-card__stars svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.product-card__review-count {
  font-size: var(--text-xs);
  color: var(--color-muted);
}

.product-card__price {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  margin-top: auto;
}

.product-card__sale-price {
  font-size: var(--text-xl);
  font-weight: var(--fw-bold);
  color: var(--color-accent);
}

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

.product-card__btn {
  width: 100%;
  padding: 10px;
  background: var(--color-primary);
  color: var(--color-white);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.product-card__btn:hover {
  background: var(--color-accent);
  box-shadow: var(--shadow-accent);
}

.product-card__btn svg {
  width: 16px;
  height: 16px;
}

/* ── Dark Product Card (for flash deals) ── */
.product-card--dark {
  background: var(--color-dark-card);
  border-color: rgba(255,255,255,0.08);
}

.product-card--dark:hover {
  border-color: var(--color-accent);
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.product-card--dark .product-card__title {
  color: var(--color-white);
}

.product-card--dark .product-card__category {
  color: var(--color-accent);
}

.product-card--dark .product-card__review-count {
  color: var(--color-dark-muted);
}

.product-card--dark .product-card__btn {
  background: var(--gradient-accent);
}

/* ── Badge ── */
.badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--color-accent);
  color: var(--color-white);
  font-size: 11px;
  font-weight: var(--fw-bold);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  z-index: 2;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.badge--hot {
  background: linear-gradient(135deg, #FF4D00, #FF6B35);
}

.badge--sale {
  background: linear-gradient(135deg, #EF4444, #F97316);
}

.badge--new {
  background: linear-gradient(135deg, #10B981, #34D399);
}

.badge--mega {
  background: linear-gradient(135deg, #8B5CF6, #A78BFA);
}

.badge--discount {
  background: linear-gradient(135deg, #1A73E8, #60A5FA);
}

/* ── Star Rating ── */
.star-rating {
  display: inline-flex;
  gap: 2px;
}

.star-rating .star {
  width: 16px;
  height: 16px;
  fill: var(--color-warning);
}

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

/* ── Tags / Pills ── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 4px 12px;
  font-size: var(--text-xs);
  font-weight: var(--fw-medium);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-text-light);
  transition: all var(--transition-fast);
}

.tag--accent {
  background: rgba(255, 77, 0, 0.1);
  color: var(--color-accent);
}

.tag--blue {
  background: rgba(26, 115, 232, 0.1);
  color: var(--color-secondary);
}

/* ── Input fields ── */
.input-field {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  transition: all var(--transition-fast);
  background: var(--color-white);
}

.input-field:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(255, 77, 0, 0.1);
}

.input-field::placeholder {
  color: var(--color-muted);
}

/* ── Countdown Timer ── */
.countdown {
  display: flex;
  gap: var(--space-3);
}

.countdown__item {
  text-align: center;
}

.countdown__value {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: rgba(255, 77, 0, 0.15);
  border: 2px solid var(--color-accent);
  border-radius: var(--radius-lg);
  font-size: var(--text-2xl);
  font-weight: var(--fw-bold);
  color: var(--color-accent);
  font-family: var(--font-heading);
}

.countdown__label {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--text-xs);
  color: var(--color-dark-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ── Trust Badge ── */
.trust-badge {
  text-align: center;
  padding: var(--space-8) var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  transition: all var(--transition-base);
}

.trust-badge:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-accent);
}

.trust-badge__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-4);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 77, 0, 0.08);
  border-radius: var(--radius-full);
  font-size: 28px;
  color: var(--color-accent);
}

.trust-badge__title {
  font-size: var(--text-md);
  font-weight: var(--fw-bold);
  color: var(--color-primary);
  margin-bottom: var(--space-2);
}

.trust-badge__text {
  font-size: var(--text-sm);
  color: var(--color-muted);
  line-height: var(--lh-normal);
  margin-bottom: 0;
}

/* ── Testimonial Card ── */
.testimonial-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  border: 1px solid var(--color-border);
  transition: all var(--transition-base);
  position: relative;
}

.testimonial-card::before {
  content: '"';
  position: absolute;
  top: 16px;
  right: 24px;
  font-size: 80px;
  font-family: Georgia, serif;
  color: rgba(255, 77, 0, 0.08);
  line-height: 1;
}

.testimonial-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.testimonial-card__stars {
  display: flex;
  gap: 2px;
  margin-bottom: var(--space-4);
  color: var(--color-warning);
}

.testimonial-card__stars svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.testimonial-card__text {
  font-size: var(--text-base);
  line-height: var(--lh-relaxed);
  color: var(--color-text-light);
  margin-bottom: var(--space-6);
  font-style: italic;
}

.testimonial-card__author {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.testimonial-card__avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--color-accent);
}

.testimonial-card__name {
  font-size: var(--text-base);
  font-weight: var(--fw-semibold);
  color: var(--color-primary);
}

.testimonial-card__location {
  font-size: var(--text-sm);
  color: var(--color-muted);
}

/* ── Filter Tabs ── */
.filter-tabs {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-8);
}

.filter-tab {
  padding: 10px 24px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--color-text-light);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--color-white);
}

.filter-tab:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.filter-tab.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-white);
}

/* ── Product Grid ── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
}

/* ── Tooltip ── */
.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 12px;
  background: var(--color-primary);
  color: var(--color-white);
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
  pointer-events: none;
}

.tooltip:hover::after {
  opacity: 1;
  visibility: visible;
}
