:root {
  --bg-main: #0B0E14;
  --bg-card: #121620;
  --bg-card-hover: #181E2C;
  --border: #1E2330;
  --border-focus: #38BDF8;
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --accent-gold: #F59E0B;
  --accent-blue: #0088CC;
  --accent-green: #10B981;
  --accent-red: #E50914;
  --radius: 14px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
header {
  background: rgba(14, 18, 26, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.8rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-top-row, .header-brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-nav-row {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.brand {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-badge {
  background: var(--accent-red);
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.rate-ticker {
  background: #181E2C;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.rate-value {
  color: var(--accent-gold);
  font-weight: 700;
}

.nav-links {
  display: flex;
  gap: 1.2rem;
  align-items: center;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--text-main);
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 2.2rem 1rem 1.2rem;
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 1.9rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #FFF 0%, #94A3B8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Filters & Search */
.controls-bar {
  max-width: 1100px;
  margin: 0 auto 1.5rem;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.search-input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: 8px;
  outline: none;
  font-size: 0.85rem;
  width: 240px;
}

.search-input:focus {
  border-color: var(--border-focus);
}

.category-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pill {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.pill:hover, .pill.active {
  background: var(--accent-red);
  color: #fff;
  border-color: var(--accent-red);
}

/* 🎯 PRODUCTS GRID: TARJETAS COMPACTAS (Nunca se estiran verticalmente) */
.products-grid {
  max-width: 1100px;
  margin: 0 auto 3rem;
  padding: 0 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 1.1rem;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  width: 235px;
  max-width: 235px;
  height: auto;
  min-height: auto;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: #38BDF8;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

.product-banner {
  height: 115px;
  width: 100%;
  background-size: cover;
  background-position: center;
  position: relative;
}

.product-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 14, 20, 0) 25%, rgba(18, 22, 32, 1) 100%);
}

.product-type-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.62rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 800;
  letter-spacing: 0.4px;
  z-index: 1;
}

.product-content {
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.product-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  line-height: 1.25;
}

.product-desc {
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.3;
  margin: 0 0 0.3rem 0;
  flex: 1;
}

.price-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 0.55rem;
  margin-top: auto;
}

.price-usd {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--accent-gold);
}

.price-bs {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.btn-buy {
  background: var(--accent-red);
  color: #fff;
  border: none;
  padding: 7px 10px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 100%;
}

.btn-buy:hover {
  background: #B90710;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.modal-overlay.open {
  display: flex !important;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.8rem;
  width: 90%;
  max-width: 440px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
}

.btn-channel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  border: none;
  margin-bottom: 0.8rem;
}

.btn-whatsapp { background: #25D366; color: #fff; }
.btn-telegram { background: #0088CC; color: #fff; }

/* Footer */
footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* 📱 Responsive Mobile (Pantallas < 640px) */
@media (max-width: 640px) {
  .products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
    padding: 0 0.65rem;
    margin-bottom: 2rem;
  }
  .product-card {
    width: 100%;
    max-width: 100%;
    border-radius: 10px;
  }
  .product-banner {
    height: 85px;
  }
  .product-content {
    padding: 0.65rem 0.55rem;
    gap: 0.35rem;
  }
  .product-title {
    font-size: 0.8rem;
    line-height: 1.2;
  }
  .product-desc {
    font-size: 0.65rem;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .price-usd {
    font-size: 0.95rem;
  }
  .price-bs {
    font-size: 0.7rem;
  }
  .btn-buy {
    padding: 6px 4px;
    font-size: 0.72rem;
    border-radius: 5px;
  }
  .stock-badge {
    font-size: 0.65rem;
    padding: 2px 4px;
  }
}
