/* =========================================================
   Home
   ========================================================= */

.home {
  width: min(100% - 32px, var(--container));
  margin-inline: auto;
  padding-block: var(--space-8);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  padding: clamp(28px, 5vw, 56px);
  color: #fff;
  background:
    radial-gradient(800px 400px at 80% 20%, rgba(255,255,255,0.18), transparent 60%),
    linear-gradient(135deg, #1a0c0d 0%, #4a0d0d 40%, #b91c1c 100%);
  box-shadow: var(--shadow-lg);
  isolation: isolate;
}
.hero::before, .hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  z-index: -1;
}
.hero::before {
  width: 380px; height: 380px;
  background: radial-gradient(circle, #ef4444, transparent 70%);
  top: -120px; right: -80px;
  animation: hero-float 14s ease-in-out infinite;
}
.hero::after {
  width: 300px; height: 300px;
  background: radial-gradient(circle, #fbbf24, transparent 70%);
  bottom: -120px; left: -60px;
  animation: hero-float 18s ease-in-out -4s infinite;
}
@keyframes hero-float {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(20px, -16px); }
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: var(--space-8);
  position: relative;
  z-index: 1;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hero-eyebrow .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.25);
  animation: rgt-pop 1.6s var(--ease-spring) infinite;
}
.hero h1 {
  color: #fff;
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: var(--space-4) 0 var(--space-3);
}
.hero h1 .accent {
  background: linear-gradient(180deg, #fde68a, #f59e0b);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}
.hero p.lede {
  max-width: 56ch;
  color: rgba(255,255,255,0.82);
  font-size: 1.05rem;
  line-height: 1.6;
}

.hero-actions {
  margin-top: var(--space-6);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.hero .btn--primary {
  --btn-bg: #fff;
  --btn-fg: var(--ink-900);
}
.hero .btn--primary:hover { --btn-bg: #f5f5f5; box-shadow: 0 12px 30px -10px rgba(255,255,255,0.4); }
.hero .btn--ghost {
  --btn-bg: transparent;
  --btn-fg: #fff;
  --btn-bd: rgba(255,255,255,0.35);
}
.hero .btn--ghost:hover { --btn-bg: rgba(255,255,255,0.08); }

.hero-stats {
  margin-top: var(--space-8);
  display: flex;
  gap: var(--space-6);
  flex-wrap: wrap;
}
.hero-stat .num {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1;
}
.hero-stat .lbl {
  margin-top: 4px;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.65);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-card {
  position: relative;
  perspective: 1000px;
}
.hero-card-inner {
  position: relative;
  padding: var(--space-5);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-lg);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  transform: rotateY(-6deg) rotateX(4deg);
  transition: transform var(--t-slow) var(--ease-out);
  box-shadow: 0 20px 60px -20px rgba(0,0,0,0.35);
}
.hero-card:hover .hero-card-inner { transform: rotateY(0) rotateX(0); }
.hero-card-inner h3 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: var(--space-2);
}
.hero-card-list { list-style: none; padding: 0; margin: var(--space-3) 0 0; display: grid; gap: var(--space-2); }
.hero-card-list li {
  display: flex; align-items: center; gap: var(--space-2);
  color: rgba(255,255,255,0.85); font-size: 0.9rem;
}
.hero-card-list li::before {
  content: '';
  width: 18px; height: 18px;
  border-radius: 50%;
  background: rgba(74, 222, 128, 0.2);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234ade80' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px;
  flex-shrink: 0;
}

/* ---------- Toolbar ---------- */
.products-toolbar {
  margin-top: var(--space-10);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.products-toolbar h2 {
  font-size: clamp(1.4rem, 2.4vw, 1.8rem);
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}
.products-toolbar h2 .count {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0;
}

.search-box {
  position: relative;
  width: min(360px, 100%);
}
.search-box .input { padding-left: 42px; height: 44px; border-radius: var(--radius-pill); }
.search-box svg {
  position: absolute;
  top: 50%; left: 14px;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--text-subtle);
  pointer-events: none;
}

/* ---------- Product grid ---------- */
.product-container {
  margin-top: var(--space-6);
  position: relative;
  min-height: 320px;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-5);
}

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition:
    transform var(--t-base) var(--ease-out),
    box-shadow var(--t-base) var(--ease-out),
    border-color var(--t-base) var(--ease-out);
  animation: rgt-fade-up 480ms var(--ease-out) both;
}
.product-card::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px transparent;
  transition: box-shadow var(--t-base) var(--ease-out);
}
.product-card:hover {
  transform: translateY(-4px);
  border-color: transparent;
  box-shadow: var(--shadow-lg);
}
.product-card:hover::after { box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.18); }

.product-image-container {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: linear-gradient(180deg, var(--ink-50), var(--surface-2));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.product-image {
  width: 80%;
  height: 80%;
  object-fit: contain;
  transition: transform var(--t-slow) var(--ease-out);
}
.product-card:hover .product-image { transform: scale(1.06); }

.product-info {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1;
}
.product-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}
.product-price {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}
.product-price::before { content: 'R '; color: var(--text-muted); font-weight: 500; font-size: 0.85rem; }

.product-whatsapp {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 42px;
  border: 0;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #128c7e, #075e54);
  color: #fff;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background var(--t-base) var(--ease-out), transform var(--t-fast) var(--ease-out), box-shadow var(--t-base);
}
.product-whatsapp::before {
  content: '';
  width: 18px; height: 18px;
  flex-shrink: 0;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'><path d='M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.435 9.884-9.881 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z'/></svg>") center/contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'><path d='M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.435 9.884-9.881 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z'/></svg>") center/contain no-repeat;
}
.product-whatsapp:hover {
  background: linear-gradient(180deg, #25d366, #128c7e);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px -8px rgba(37, 211, 102, 0.55);
}

/* ---------- Loader / states ---------- */
.product-grid--loading {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-5);
}
.product-skel {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
}
.product-skel .img { aspect-ratio: 4/3; }
.product-skel .body { padding: var(--space-4); display: grid; gap: 10px; }
.product-skel .line { height: 12px; border-radius: 6px; }
.product-skel .line.lg { width: 80%; height: 14px; }
.product-skel .line.md { width: 50%; }

.empty-state {
  text-align: center;
  padding: var(--space-12);
  color: var(--text-muted);
}
.empty-state h3 { color: var(--text); margin-bottom: var(--space-2); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-card { display: none; }
}
@media (max-width: 480px) {
  .product-grid, .product-grid--loading { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
  .product-info { padding: var(--space-3); }
  .product-name { font-size: 0.9rem; min-height: 2.4em; }
  .product-price { font-size: 1rem; }
  .product-whatsapp { height: 38px; font-size: 0.78rem; }
  .hero { padding: 24px; }
  .hero-stats { gap: var(--space-4); }
}
