/* ============================================
   PIMBA AÍ — Components
   ============================================ */

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
  border: none;
  text-decoration: none;
}

.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.btn-primary {
  background: var(--gradient-brand);
  color: var(--text-inverse);
  box-shadow: var(--shadow-brand);
}
.btn-primary:hover {
  background: var(--gradient-brand-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 107, 43, 0.35);
}

.btn-secondary {
  background: var(--color-secondary);
  color: var(--text-inverse);
}
.btn-secondary:hover {
  background: var(--color-secondary-hover);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1.5px solid var(--gray-200);
}
.btn-outline:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-light);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: var(--space-2) var(--space-3);
}
.btn-ghost:hover {
  background: var(--gray-100);
  color: var(--text-primary);
}

.btn-lg {
  padding: var(--space-4) var(--space-6);
  font-size: var(--text-lg);
  border-radius: var(--radius-lg);
}

.btn-sm {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
}

.btn-block { width: 100%; }

.btn-cta {
  width: 100%;
  padding: 15px;
  background: var(--gradient-brand);
  color: var(--text-inverse);
  border-radius: var(--radius-md);
  font-size: var(--text-lg);
  font-weight: 700;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  box-shadow: var(--shadow-brand);
}
.btn-cta:hover {
  background: var(--gradient-brand-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 107, 43, 0.35);
}

.btn-cta-sticky {
  position: sticky;
  bottom: 0;
  z-index: var(--z-sticky);
  border-radius: 0;
  padding: var(--space-4);
}

/* ---- Product Card ---- */
.product-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--gray-100);
  transition: all var(--transition-base);
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  border-color: var(--gray-200);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-3px);
}
.product-card:active {
  transform: translateY(-1px);
}

.product-card__image-wrap {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--gray-50);
}
.product-card__image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.product-card:hover .product-card__image-wrap img {
  transform: scale(1.06);
}

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

.product-card__store {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: var(--space-1);
}

.product-card__name {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-snug);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.price-current {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-primary);
  white-space: nowrap;
}

.price-old {
  font-size: var(--text-sm);
  color: var(--gray-400);
  text-decoration: line-through;
  white-space: nowrap;
}

.price-economy {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-success);
  background: var(--color-success-light);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.product-card__action {
  width: 100%;
  padding: var(--space-3);
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  transition: all var(--transition-base);
  text-align: center;
}
.product-card__action:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--text-inverse);
}

/* ---- Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: var(--text-xs);
  font-weight: 700;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
}

.badge-discount {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--gradient-discount);
  color: var(--text-inverse);
  z-index: 2;
  font-size: 0.7rem;
  text-transform: uppercase;
}

.badge-store {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.65);
  color: var(--text-inverse);
  backdrop-filter: blur(4px);
  max-width: 46%;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.68rem;
  font-weight: 600;
}

.badge-tag {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 2;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-fire { background: #DC2626; color: var(--text-inverse); }
.badge-lightning { background: #EA580C; color: var(--text-inverse); }
.badge-price-drop { background: var(--color-success); color: var(--text-inverse); }
.badge-trending { background: var(--brand-purple); color: var(--text-inverse); }
.badge-coupon { background: #7C3AED; color: var(--text-inverse); }
.badge-new { background: #2563EB; color: var(--text-inverse); }
.badge-limited { background: #B45309; color: var(--text-inverse); }
.badge-free-shipping { background: #059669; color: var(--text-inverse); }
.badge-pick { background: var(--brand-coral); color: var(--text-inverse); }
.badge-best-value { background: #7C3AED; color: var(--text-inverse); }

.badge-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

/* ---- Coupon Box ---- */
.coupon-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  border: 2px dashed var(--color-primary);
  background: var(--color-primary-light);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
}

.coupon-box__label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--text-muted);
  margin-bottom: 2px;
}

.coupon-box__code {
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  color: var(--color-primary);
}

.coupon-box__copy {
  background: var(--color-primary);
  color: var(--text-inverse);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--transition-base);
  cursor: pointer;
  border: none;
}
.coupon-box__copy:hover {
  background: var(--color-primary-hover);
}
.coupon-box__copy.copied {
  background: var(--color-success);
}

.coupon-inline {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-primary-light);
  border: 1.5px dashed var(--color-primary);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.coupon-inline:hover { background: rgba(var(--brand-orange-rgb), 0.15); }
.coupon-inline svg { width: 12px; height: 12px; }

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  background: var(--bg-card);
  border: 1px solid var(--gray-200);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  font-weight: 500;
  z-index: var(--z-toast);
  box-shadow: var(--shadow-xl);
  transform: translateY(20px);
  opacity: 0;
  transition: all var(--transition-slow);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  max-width: 340px;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.toast-success { border-left: 3px solid var(--color-success); }
.toast-img {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  object-fit: cover;
  flex-shrink: 0;
}
.toast-content { flex: 1; min-width: 0; }
.toast-title {
  font-size: var(--text-sm);
  font-weight: 700;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast-subtitle {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ---- Share Panel ---- */
.share-panel {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: all var(--transition-base);
  border: 1px solid var(--gray-200);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  text-decoration: none;
}
.share-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.share-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }

.share-btn--whatsapp { border-color: #25D366; color: #25D366; }
.share-btn--whatsapp:hover { background: #25D366; color: var(--text-inverse); }

.share-btn--facebook { border-color: #1877F2; color: #1877F2; }
.share-btn--facebook:hover { background: #1877F2; color: var(--text-inverse); }

.share-btn--pinterest { border-color: #BD081C; color: #BD081C; }
.share-btn--pinterest:hover { background: #BD081C; color: var(--text-inverse); }

.share-btn--telegram { border-color: #229ED9; color: #229ED9; }
.share-btn--telegram:hover { background: #229ED9; color: var(--text-inverse); }

.share-btn--twitter { border-color: #1DA1F2; color: #1DA1F2; }
.share-btn--twitter:hover { background: #1DA1F2; color: var(--text-inverse); }

.share-btn--copy { border-color: var(--gray-300); color: var(--text-secondary); }
.share-btn--copy:hover { background: var(--gray-100); }
.share-btn--copy.copied { border-color: var(--color-success); color: var(--color-success); }

.share-btn--native {
  background: var(--gradient-brand);
  color: var(--text-inverse);
  border: none;
  font-weight: 600;
}
.share-btn--native:hover {
  background: var(--gradient-brand-hover);
  box-shadow: var(--shadow-brand);
}

/* ---- Loading Spinner ---- */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-page);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.4s ease;
}
.loading-screen.hidden {
  opacity: 0;
  pointer-events: none;
}
.loading-screen__text {
  margin-top: var(--space-4);
  font-size: var(--text-base);
  color: var(--text-muted);
}

/* ---- Error State ---- */
.error-screen {
  display: none;
  max-width: 500px;
  margin: var(--space-20) auto;
  padding: var(--space-10);
  text-align: center;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--gray-200);
}
.error-screen.show { display: block; }
.error-screen__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-4);
  background: var(--color-primary-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
}
.error-screen__icon svg { width: 28px; height: 28px; }
.error-screen h2 { font-size: var(--text-xl); margin-bottom: var(--space-2); }
.error-screen p { color: var(--text-muted); font-size: var(--text-base); }

/* ---- Empty State ---- */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--space-16) var(--space-5);
  color: var(--text-muted);
}
.empty-state svg {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-3);
  color: var(--gray-300);
}
.empty-state p { font-size: var(--text-base); }

/* ---- Back to Top ---- */
.back-to-top {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  width: 44px;
  height: 44px;
  background: var(--bg-card);
  border: 1px solid var(--gray-200);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-slow);
  opacity: 0;
  pointer-events: none;
  z-index: var(--z-sticky);
}
.back-to-top.show { opacity: 1; pointer-events: auto; }
.back-to-top:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--text-inverse);
  transform: translateY(-2px);
  box-shadow: var(--shadow-brand);
}
.back-to-top svg { width: 20px; height: 20px; }

/* ---- Cookie Banner ---- */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--gray-200);
  padding: var(--space-4) var(--space-5);
  z-index: var(--z-modal);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
  display: none;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.cookie-banner.show { display: flex; }
.cookie-banner__text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  max-width: 600px;
}
.cookie-banner__text a {
  color: var(--color-primary);
  text-decoration: underline;
}

/* ---- Image Placeholder ---- */
.img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--gray-100);
  color: var(--gray-400);
  gap: var(--space-2);
}
.img-placeholder svg { width: 40px; height: 40px; }
.img-placeholder span { font-size: var(--text-xs); font-weight: 500; }

/* ---- Gallery ---- */
.gallery {
  display: flex;
  flex-direction: column;
}
.gallery__main {
  aspect-ratio: 1;
  background: var(--gray-50);
  overflow: hidden;
  border-radius: var(--radius-lg);
}
.gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery__thumbs {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-3) 0;
  overflow-x: auto;
}
.gallery__thumb {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  opacity: 0.6;
  transition: all var(--transition-base);
  background: var(--bg-card);
  flex-shrink: 0;
}
.gallery__thumb:hover { opacity: 0.9; }
.gallery__thumb.active { border-color: var(--color-primary); opacity: 1; }
.gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Video Embed ---- */
.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---- Breadcrumbs ---- */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-muted);
  padding: var(--space-4) 0;
  overflow-x: auto;
  white-space: nowrap;
}
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--color-primary); }
.breadcrumbs__separator { color: var(--gray-300); }
.breadcrumbs__current { color: var(--text-primary); font-weight: 500; }

/* ---- Price History (placeholder) ---- */
.price-history {
  padding: var(--space-4);
  background: var(--gray-50);
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
}
.price-history__title {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.price-history__title svg { width: 16px; height: 16px; color: var(--color-primary); }
.price-history__note {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ---- Disclosure ---- */
.disclosure {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: var(--leading-relaxed);
  max-width: 640px;
  margin: 0 auto;
}
