/* ============================================
   HOME — Hero, category grid, products grid, carrusel, CTA, brands+combos — Tu Rincón Ferretero
   Extraído de style.css en Fase 2 (Solución 2.0).
   No modificar selectores ni valores: paridad 1:1 con el original.
   ============================================ */

/* ============================================
   HERO BANNER
   ============================================ */
.hero-banner {
  background: linear-gradient(135deg, var(--accent-soft-purple), var(--accent-soft-cyan));
  border: 2.5px solid var(--line);
  border-radius: 4px;
  padding: 40px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 4px 4px 0 var(--line);
}
.hero-banner h2 { margin: 0 0 8px; font-size: 28px; }
.hero-banner p { margin: 0; color: var(--ink-2); font-size: 13px; }

/* ============================================
   CATEGORY GRID (HOME)
   ============================================ */
.quick-categories {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}
.category-card {
  border: 2px solid var(--line);
  border-radius: 2px;
  padding: 14px 8px;
  background: var(--accent-soft-purple);
  text-align: center;
  cursor: pointer;
  transition: all .1s;
  box-shadow: 2px 2px 0 var(--line);
  font-size: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  text-decoration: none;
}
.category-card:nth-child(2n) { background: var(--accent-soft-cyan); }
.category-card:nth-child(3n) { background: var(--accent-soft-pink); }
.category-card div {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 600;
}
.category-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--line);
  text-decoration: none;
}

/* ============================================
   PRODUCTS GRID
   ============================================ */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.products-grid--bestsellers {
  grid-template-columns: repeat(5, 1fr);
}

/* ============================================
   CARRUSEL HORIZONTAL 2.0 ("Nuevos productos")
   Flechas + scroll-snap + fade laterales.
   Selectores con .tr-carousel__track para máxima
   especificidad y evitar conflictos con caché.
   ============================================ */
.tr-carousel {
  position: relative;
  margin: 0 -4px;
}

.tr-carousel__track.products-grid--new {
  display: flex !important;
  grid-template-columns: none !important;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 12px;
  padding: 6px 4px 14px;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.tr-carousel__track.products-grid--new::-webkit-scrollbar {
  height: 8px;
}
.tr-carousel__track.products-grid--new::-webkit-scrollbar-track {
  background: transparent;
}
.tr-carousel__track.products-grid--new::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 4px;
}
.tr-carousel__track.products-grid--new > .product-card {
  flex: 0 0 220px;
  scroll-snap-align: start;
  min-width: 0;
}

/* Gradientes laterales que indican "hay más contenido" */
.tr-carousel::before,
.tr-carousel::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 14px;
  width: 28px;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity .25s ease;
}
.tr-carousel::before {
  left: 0;
  background: linear-gradient(to right, var(--paper, #fff), transparent);
}
.tr-carousel::after {
  right: 0;
  background: linear-gradient(to left, var(--paper, #fff), transparent);
}
.tr-carousel.is-overflow-start::before { opacity: 1; }
.tr-carousel.is-overflow-end::after { opacity: 1; }

/* Flechas de navegación (solo desktop) */
.tr-carousel__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: 2px solid var(--line);
  background: var(--paper, #fff);
  color: var(--ink, #111);
  font-size: 24px;
  line-height: 1;
  font-family: inherit;
  cursor: pointer;
  z-index: 3;
  border-radius: 50%;
  box-shadow: 2px 2px 0 var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s ease, box-shadow .15s ease, opacity .2s ease;
}
.tr-carousel__arrow:hover {
  transform: translateY(-50%) translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--line);
}
.tr-carousel__arrow:active {
  transform: translateY(-50%) translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--line);
}
.tr-carousel__arrow[hidden] {
  display: none;
}
.tr-carousel__arrow--prev { left: -8px; }
.tr-carousel__arrow--next { right: -8px; }

/* Móvil: ocultar flechas (swipe táctil es suficiente) */
@media (max-width: 768px) {
  .tr-carousel__arrow { display: none !important; }
  .tr-carousel__track.products-grid--new > .product-card {
    flex: 0 0 160px;
  }
}

.product-card {
  border: 2px solid var(--line);
  border-radius: 2px;
  padding: 10px;
  background: var(--paper);
  box-shadow: 2px 2px 0 var(--line);
  position: relative;
  transition: all .1s;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--line);
}

.product-card .product-link { color: inherit; text-decoration: none; display: block; }
.product-card .product-link:hover { text-decoration: none; }

.product-image {
  aspect-ratio: 1/1;
  background:
    repeating-linear-gradient(45deg, transparent 0 8px, rgba(0,0,0,0.05) 8px 9px);
  border: 1.5px dashed var(--muted);
  border-radius: 2px;
  margin-bottom: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
}
.product-image img { width: 100%; height: 100%; object-fit: contain; }

.product-brand-sku {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.product-name {
  font-size: 13px;
  line-height: 1.3;
  margin: 4px 0;
  color: var(--ink);
}

.product-price {
  color: var(--accent-pink);
  font-size: 16px;
  font-weight: 700;
  font-family: 'Oswald', sans-serif;
}
.product-price-old {
  color: var(--muted);
  font-size: 11px;
  margin-left: 4px;
  text-decoration: line-through;
}

.product-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 8px;
}

.product-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--accent-pink);
  color: #fff;
  border: 1.5px solid var(--line);
  border-radius: 2px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  z-index: 2;
}

.favorite-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px; height: 28px;
  border: 1.5px solid var(--line);
  border-radius: 2px;
  background: var(--paper);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

/* ============================================
   HOME CTA GRID
   ============================================ */
.home-cta-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
}
.cta-card {
  border: 2px solid var(--line);
  border-radius: 2px;
  padding: 18px;
  box-shadow: 3px 3px 0 var(--line);
}
.cta-card.b2b { background: var(--accent-soft-cyan); }
.cta-card.support { background: var(--accent-soft-pink); }
.cta-card h3 { margin: 0 0 8px; }
.cta-card p { font-size: 13px; margin: 8px 0 12px; }

/* ============================================
   HOME SPLIT: BRANDS + COMBOS
   ============================================ */
.home-split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.home-col { min-width: 0; }

.brands-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.brand-tile {
  position: relative;
  display: grid;
  grid-template-rows: 1fr 52px;
  align-items: center;
  justify-items: stretch;
  aspect-ratio: 1 / 1;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 2px;
  box-shadow: 3px 3px 0 var(--line);
  color: var(--ink);
  text-decoration: none;
  transition: transform .1s, box-shadow .1s, background .1s;
  text-align: center;
  padding: 16px 8px 12px;
  overflow: hidden;
}
.brand-tile::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: var(--accent-purple);
  z-index: 1;
}
.brand-tile[data-tone="cyan"]::before  { background: var(--accent-cyan); }
.brand-tile[data-tone="pink"]::before  { background: var(--accent-pink); }

.brand-logo-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  overflow: hidden;
}
.brand-logo {
  max-width: 80%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: 0.9;
  transition: opacity .2s;
}
.brand-tile:hover .brand-logo {
  opacity: 1;
}

.brand-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  gap: 6px;
}
.brand-meta .brand-name,
.brand-meta .brand-tag {
  display: block;
  width: 100%;
  text-align: center;
}
.brand-name {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 15px;
  line-height: 1;
}
.brand-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
}

.brand-tile:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--line);
  background: var(--accent-soft-purple);
  text-decoration: none;
}
.brand-tile[data-tone="cyan"]:hover { background: var(--accent-soft-cyan); }
.brand-tile[data-tone="pink"]:hover { background: var(--accent-soft-pink); }

.combos-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.combo-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 2px;
  box-shadow: 2px 2px 0 var(--line);
  text-decoration: none;
  color: var(--ink);
  transition: transform .1s, box-shadow .1s;
}
.combo-card:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--line);
  background: var(--accent-soft-cyan);
  text-decoration: none;
}
.combo-icon {
  font-size: 26px;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft-pink);
  border: 2px solid var(--line);
  border-radius: 2px;
  flex-shrink: 0;
}
.combo-info { flex: 1; min-width: 0; }
.combo-name {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 2px;
}
.combo-desc {
  font-size: 12px;
  color: var(--muted);
}
.combo-price {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 15px;
  color: var(--accent-pink);
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .home-split-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .brands-grid { grid-template-columns: repeat(3, 1fr); }
}

