/* BundleSell - Mobile-First CSS (FINAL) */

/* ===== CSS Variables ===== */
:root {
  --color-bg: #0a0a0b;
  --color-surface: #141416;
  --color-surface-hover: #1c1c1f;
  --color-border: #2a2a2e;
  --color-text: #ffffff;
  --color-text-muted: #888892;
  --color-primary: #6366f1;
  --color-primary-hover: #4f46e5;
  --color-success: #22c55e;
  --color-success-hover: #16a34a;
  --color-price: #fbbf24;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);

  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
}

/* ===== Reset ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ===== Layout ===== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-sm);
}

.page {
  min-height: 100vh;
  padding: var(--spacing-md) 0 var(--spacing-xl);
}

/* ===== Header ===== */
.header {
  padding: var(--spacing-md) 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--spacing-lg);
}

.header__logo {
  font-size: 1.25rem;
  font-weight: 700;
}

.header__logo span {
  color: var(--color-primary);
}

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: var(--spacing-lg) 0;
}

.hero__title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: var(--spacing-xs);
}

.hero__subtitle {
  color: var(--color-text-muted);
  font-size: 1rem;
}

/* ===== Product Grid ===== */
.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-md);
}

/* ===== Product Card ===== */
.product-card {
  position: relative;
  background: var(--color-surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-border);
  transition: transform 0.2s, border-color 0.2s;
}

.product-card:hover {
  transform: translateY(-2px);
  border-color: var(--color-primary);
}

.product-card--featured {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.3), var(--shadow);
}

.product-card__ribbon {
  position: absolute;
  top: 12px;
  left: 12px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  z-index: 2;
}

.product-card__image {
  aspect-ratio: 16 / 9;
  background: var(--color-surface-hover);
}

.product-card__image {
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-card__image img {
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
}

.product-card__image {
  padding: 0.5rem;
  background: linear-gradient(180deg, #0a0a0b, #141416);
}

.product-card__content {
  padding: var(--spacing-md);
}

.product-card__name {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
}

.product-card__desc {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-md);
}

.product-card__meta {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
}

.product-card__price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-price);
}

.product-card__badge {
  font-size: 0.75rem;
  color: var(--color-success);
  background: rgba(34, 197, 94, 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: background 0.2s, transform 0.1s;
  min-height: 52px;
  width: 100%;
}

.btn:active {
  transform: scale(0.98);
}

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

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

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

.btn--success:hover {
  background: var(--color-success-hover);
}

.btn--outline {
  background: transparent;
  border: 2px solid var(--color-border);
}

.btn--outline:hover {
  border-color: var(--color-primary);
  background: rgba(99, 102, 241, 0.1);
}

.btn--waiting {
  background: var(--color-surface);
  border: 2px dashed var(--color-border);
  color: var(--color-text);
  cursor: not-allowed;
  opacity: 0.9;
}

.btn--waiting .dots {
  display: inline-block;
  min-width: 1.5em;
  text-align: left;
  animation: blink 1.4s infinite both;
}

@keyframes blink {
  0% { opacity: 0.2; }
  20% { opacity: 1; }
  100% { opacity: 0.2; }
}

.btn--waiting {
  background: linear-gradient(
    110deg,
    var(--color-surface) 25%,
    var(--color-surface-hover) 37%,
    var(--color-surface) 63%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}



/* ===== Product Detail ===== */
.product-detail {
  max-width: 600px;
  margin: 0 auto;
}

.product-detail__image {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-border);
  margin-bottom: var(--spacing-lg);
}

.product-detail__image {
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-detail__image {
  padding: 0.75rem;
  border-radius: 14px;
}


.product-detail__image img {
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
}


.product-detail__tag {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
}

.product-detail__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
}

.product-detail__subtitle {
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-md);
}

.product-detail__price {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-price);
  margin-bottom: var(--spacing-sm);
}

.product-detail__strike {
  font-size: 1rem;
  color: var(--color-text-muted);
  text-decoration: line-through;
  margin-left: 0.5rem;
}

.product-detail__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: var(--spacing-lg);
}

.product-detail__badges span {
  font-size: 0.75rem;
  padding: 0.35rem 0.6rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-text-muted);
}

.product-detail__section {
  margin-bottom: var(--spacing-lg);
}

.product-detail__section h3 {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-sm);
  text-transform: uppercase;
}

.product-detail__list {
  list-style: none;
}

.product-detail__list li {
  padding: var(--spacing-sm) 0;
  border-bottom: 1px solid var(--color-border);
}

.product-detail__list li::before {
  content: "✓ ";
  color: var(--color-success);
  font-weight: bold;
}

/* ===== Payment Page ===== */
.payment-page {
  max-width: 400px;
  margin: 0 auto;
  text-align: center;
}

.payment-page__price {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-price);
  margin-bottom: var(--spacing-lg);
}

.payment-page__qr {
  background: #fff;
  padding: var(--spacing-md);
  border-radius: var(--radius);
  margin-bottom: var(--spacing-md);
  display: inline-block;
}

.payment-page__upi-id {
  background: var(--color-surface);
  padding: var(--spacing-sm);
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-size: 0.875rem;
  margin-bottom: var(--spacing-lg);
  border: 1px solid var(--color-border);
}

/* ===== Download Page ===== */
.download-page {
  max-width: 400px;
  margin: 0 auto;
  text-align: center;
  padding-top: var(--spacing-xl);
}

.download-page__icon {
  font-size: 4rem;
  margin-bottom: var(--spacing-lg);
}

.download-page__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--spacing-xs);
}

.download-page__subtitle {
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-lg);
}

.download-page__box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.download-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.download-page__note {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-lg);
}

/* ===== Utilities ===== */
.text-center { text-align: center; }

/* ===== Media Queries ===== */
@media (min-width: 480px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .hero__title {
    font-size: 2.25rem;
  }

  .product-grid {
    gap: var(--spacing-lg);
  }

  .btn {
    width: auto;
    min-width: 200px;
  }
}

@media (min-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ===== Product Detail Mobile Image Fix ===== */
@media (max-width: 768px) {
  .product-detail__image {
    aspect-ratio: unset;
    max-height: 280px;
    padding: 1rem;
    background: linear-gradient(180deg, #0d0d0f 0%, #141416 100%);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .product-detail__image img {
    width: auto;
    max-width: 100%;
    max-height: 248px;
    object-fit: contain;
    border-radius: var(--radius-sm);
  }

  /* Add bottom padding to prevent content being hidden by floating button */
  .product-detail {
    padding-bottom: 100px;
  }
}

/* ===== Floating Buy Button (Mobile Only) ===== */
.floating-buy-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  background: rgba(10, 10, 11, 0.98);
  border-top: 1px solid var(--color-border);
  z-index: 9999;
}

.floating-buy-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--color-primary) 0%, #8b5cf6 100%);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
  min-height: 56px;
  text-decoration: none;
}

.floating-buy-btn:active {
  transform: scale(0.98);
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.3);
}

/* Desktop: Always show inline button, hide floating bar */
@media (min-width: 769px) {
  .floating-buy-bar {
    display: none !important;
  }

  .product-detail .btn--primary.btn--large {
    display: inline-flex !important;
  }
}

/* Mobile: Hide inline button, show floating bar */
@media (max-width: 768px) {
  .floating-buy-bar {
    display: block !important;
  }

  .product-detail .btn--primary.btn--large {
    display: none !important;
  }
}

/* ===== Creator Results Section ===== */
.creator-results {
  margin-bottom: var(--spacing-lg);
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--color-border);
}

.creator-results__title {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-md);
  text-transform: uppercase;
}

.creator-results__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-sm);
}

.creator-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s;
  display: flex;
  flex-direction: column;
}

.creator-card:hover {
  border-color: var(--color-primary);
}

.creator-card__image {
  aspect-ratio: 1 / 1;
  background: #0d0d0f;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
}

.creator-card__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.creator-card__content {
  padding: var(--spacing-sm);
  flex-shrink: 0;
}

.creator-card__story {
  font-size: 0.8rem;
  color: var(--color-text);
  line-height: 1.4;
}

.creator-card__story strong {
  color: var(--color-success);
}

.creator-results__disclaimer {
  margin-top: var(--spacing-md);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-style: italic;
}

/* Creator Results - Mobile adjustments */
@media (max-width: 480px) {
  .creator-results__grid {
    gap: 0.5rem;
  }

  .creator-card__image {
    aspect-ratio: 4 / 5;
    padding: 0.25rem;
  }

  .creator-card__content {
    padding: 0.5rem;
  }

  .creator-card__story {
    font-size: 0.7rem;
    line-height: 1.3;
  }
}

/* Creator Results - Desktop adjustments */
@media (min-width: 769px) {
  .creator-results__grid {
    gap: var(--spacing-md);
  }

  .creator-card__image {
    aspect-ratio: 4 / 3;
    padding: 0.75rem;
  }

  .creator-card__story {
    font-size: 0.875rem;
  }
}

/* Creator Card - Clickable */
.creator-card {
  cursor: pointer;
}

/* ===== Creator Lightbox ===== */
.creator-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.creator-lightbox.active {
  opacity: 1;
  visibility: visible;
}

.creator-lightbox__content {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  background: var(--color-surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-border);
  transform: scale(0.9);
  transition: transform 0.25s ease;
}

.creator-lightbox.active .creator-lightbox__content {
  transform: scale(1);
}

.creator-lightbox__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 36px;
  height: 36px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  color: #fff;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s, transform 0.2s;
}

.creator-lightbox__close:hover {
  background: rgba(99, 102, 241, 0.8);
  transform: scale(1.1);
}

.creator-lightbox__image {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
}

.creator-lightbox__caption {
  padding: 1rem 1.25rem;
  font-size: 1rem;
  color: var(--color-text);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

.creator-lightbox__caption strong {
  color: var(--color-success);
}

/* Lightbox Desktop */
@media (min-width: 769px) {
  .creator-lightbox__content {
    max-width: 600px;
  }

  .creator-lightbox__close {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }

  .creator-lightbox__image {
    max-height: 75vh;
  }
}
