/* ============================================
   NUTRESSE - Catálogo de Productos Premium
   Dark Mode Premium Design
   ============================================ */

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #111827;
  --bg-card: #1a2535;
  --bg-card-hover: #1f2d42;
  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --accent: #10b981;
  --accent-hover: #059669;
  --accent-light: #d1fae5;
  --accent-dim: rgba(16, 185, 129, 0.1);
  --accent-glow: rgba(16, 185, 129, 0.3);
  --border: #2d3748;
  --border-accent: rgba(16, 185, 129, 0.3);
  --shadow-card: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-hover: 0 8px 40px rgba(16,185,129,0.15);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-badge: 20px;
  --transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition);
}

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

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

/* ============================================
   HEADER
   ============================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  gap: 1.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--accent), #047857);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 0 20px var(--accent-glow);
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  display: block;
  margin-top: -4px;
}

/* Search bar */
.search-wrapper {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.search-input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 1rem 0.6rem 2.8rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: var(--transition);
  outline: none;
}

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

.search-input:focus {
  border-color: var(--accent);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.search-icon {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
}

.search-count {
  position: absolute;
  right: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  color: var(--text-muted);
  pointer-events: none;
}

/* Header CTA */
.header-cta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.header-contact {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: none;
}

@media (min-width: 1024px) {
  .header-contact { display: block; }
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #047857);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.55rem 1.2rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--accent-glow);
}

/* ============================================
   HERO
   ============================================ */
.hero {
  padding: 120px 1.5rem 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(16, 185, 129, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent-dim);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-badge);
  padding: 0.35rem 1rem;
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 0.5px;
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 1.2rem;
}

.hero h1 .highlight {
  background: linear-gradient(135deg, var(--accent) 0%, #34d399 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.hero-stat {
  text-align: center;
}

.hero-stat .number {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.hero-stat .label {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.hero-cta {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-large {
  padding: 0.85rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.btn-large.primary {
  background: linear-gradient(135deg, var(--accent), #047857);
  color: #fff;
}

.btn-large.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px var(--accent-glow);
}

.btn-large.outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-large.outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

/* ============================================
   CATALOG SECTION
   ============================================ */
.catalog {
  padding: 0 1.5rem 80px;
}

.catalog-inner {
  max-width: 1400px;
  margin: 0 auto;
}

/* Category filters */
.filters-wrapper {
  position: sticky;
  top: 70px;
  z-index: 100;
  background: var(--bg-primary);
  padding: 1.2rem 0;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.filters-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.8rem;
  font-weight: 600;
}

.filters-scroll {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}

.filters-scroll::-webkit-scrollbar {
  height: 3px;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-badge);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.filter-btn .count {
  background: rgba(255,255,255,0.2);
  border-radius: 10px;
  padding: 0.05rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 700;
}

.filter-btn.active .count {
  background: rgba(255,255,255,0.25);
}

/* Results info */
.results-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.results-count {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.results-count span {
  color: var(--accent);
  font-weight: 700;
}

/* No results */
.no-results {
  display: none;
  text-align: center;
  padding: 5rem 1rem;
  color: var(--text-muted);
}

.no-results.show { display: block; }

.no-results .emoji {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

/* ============================================
   CATEGORY SECTION
   ============================================ */
.category-section {
  margin-bottom: 3.5rem;
  transition: var(--transition);
}

.category-section.hidden { display: none; }

.category-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.category-emoji {
  font-size: 1.8rem;
  line-height: 1;
}

.category-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.category-pill {
  margin-left: auto;
  background: var(--accent-dim);
  border: 1px solid var(--border-accent);
  color: var(--accent);
  border-radius: var(--radius-badge);
  padding: 0.2rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ============================================
   PRODUCT CARDS GRID
   ============================================ */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

@media (min-width: 1200px) {
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  }
}

/* Product Card */
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  cursor: default;
}

.product-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0;
  transition: var(--transition);
}

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

.product-card:hover::before {
  opacity: 1;
}

.product-card.hidden { display: none; }

/* Card Header */
.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.card-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  letter-spacing: -0.2px;
  flex: 1;
}

.card-number {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.15rem 0.5rem;
  flex-shrink: 0;
  font-family: monospace;
}

/* Category Badge */
.card-category-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--accent-dim);
  border: 1px solid var(--border-accent);
  color: var(--accent);
  border-radius: var(--radius-badge);
  padding: 0.2rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  width: fit-content;
}

/* Card description */
.card-description {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-description.expanded {
  -webkit-line-clamp: unset;
  overflow: visible;
}

/* Card sections */
.card-section {
  background: rgba(0,0,0,0.2);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
  border: 1px solid rgba(255,255,255,0.04);
}

.card-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.card-section-content {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.card-benefits {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.card-benefits li {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.card-benefits li::before {
  content: '✓';
  color: var(--accent);
  font-weight: 700;
  font-size: 0.75rem;
  margin-top: 0.1rem;
  flex-shrink: 0;
}

/* Card footer */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  gap: 0.6rem;
  flex-wrap: wrap;
}

.card-presentation {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-badge);
  padding: 0.2rem 0.65rem;
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.card-dosis {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Expand button */
.expand-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0;
  font-weight: 600;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.expand-btn:hover { color: var(--accent-hover); }

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 3rem 1.5rem 2rem;
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .footer-inner {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

.footer-brand .logo {
  margin-bottom: 1rem;
}

.footer-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 320px;
}

.footer-heading {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  margin-bottom: 1rem;
}

.footer-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-list li {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-list a {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.footer-list a:hover { color: var(--accent); }

.footer-bottom {
  max-width: 1400px;
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-copy .brand {
  color: var(--accent);
  font-weight: 600;
}

/* ============================================
   BACK TO TOP
   ============================================ */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  background: var(--accent);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px var(--accent-glow);
  transition: var(--transition);
  z-index: 999;
}

.back-to-top.show {
  display: flex;
}

.back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px var(--accent-glow);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 640px) {
  .hero {
    padding: 100px 1rem 60px;
  }

  .hero-stats {
    gap: 1.5rem;
  }

  .header-cta .btn-primary {
    display: none;
  }

  .products-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 641px) and (max-width: 1023px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 20px var(--accent-glow); }
  50% { box-shadow: 0 0 40px rgba(16, 185, 129, 0.5); }
}

.hero-inner {
  animation: fadeInUp 0.7s ease forwards;
}

.product-card {
  animation: fadeInUp 0.5s ease forwards;
}

/* ============================================
   LOADING STATE
   ============================================ */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
  height: 14px;
}

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

/* ============================================
   UTILITY CLASSES
   ============================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.font-bold { font-weight: 700; }
