/* ============================================
   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;
}


/* ============================================
   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;
  }
}


/* ============================================
   HOME CTA GRID
   ============================================ */
.home-cta-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
}
.cta-card {
  --cta-overlay: linear-gradient(90deg, rgba(20, 23, 26, .92), rgba(20, 23, 26, .68));
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  min-height: 178px;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 2px;
  padding: 22px;
  box-shadow: 3px 3px 0 var(--line);
  background-image: var(--cta-overlay), var(--cta-image);
  background-position: center;
  background-size: cover;
  color: #fff;
  transition: transform .16s ease, box-shadow .16s ease;
}
.cta-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: var(--accent-purple);
  z-index: -1;
}
.cta-card--support {
  --cta-overlay: linear-gradient(90deg, rgba(20, 23, 26, .94), rgba(20, 23, 26, .62));
}
.cta-card--support::before { background: var(--accent-pink); }
.cta-card:hover {
  transform: translateY(-2px);
  box-shadow: 5px 5px 0 var(--line);
}
.cta-card__content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 680px;
}
.cta-card__eyebrow {
  display: inline-block;
  margin-bottom: 7px;
  color: rgba(255, 255, 255, .78);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.cta-card h3 {
  max-width: calc(100% - 62px);
  margin: 0 0 8px;
  color: #fff;
  font-size: clamp(23px, 2.15vw, 31px);
  letter-spacing: .01em;
}
.cta-card p {
  max-width: 58ch;
  margin: 8px 0 16px;
  color: rgba(255, 255, 255, .88);
  font-size: 13px;
}
.cta-card__icon {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 1;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, .9);
  background: rgba(247, 244, 238, .92);
  box-shadow: 3px 3px 0 var(--line);
  color: var(--ink);
  font-size: 21px;
}
.cta-card__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.cta-card__button span {
  transition: transform .16s ease;
}
.cta-card__button:hover span {
  transform: translateX(3px);
}

@media (max-width: 640px) {
  .home-cta-grid { gap: 12px; }
  .cta-card {
    min-height: 210px;
    padding: 20px 16px;
  }
  .cta-card h3 {
    max-width: calc(100% - 52px);
    font-size: 23px;
  }
  .cta-card__icon {
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  .cta-card__button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cta-card,
  .cta-card__button span {
    transition: none;
  }
}

/* ============================================
   HOME SPLIT: BRANDS + COMBOS
   ============================================ */
.home-split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: stretch;
}
.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;
}

/* ============================================
   HOME: SOLUCIONES PARA TU TRABAJO
   Reemplaza visualmente Combos y kits sin alterar
   las dimensiones del bloque de marcas.
   ============================================ */
.home-col--solutions {
  display: flex;
  flex-direction: column;
}

.tr-home-solutions {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr)) auto;
  gap: 10px;
}

.tr-home-solution {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  overflow: hidden;
  padding: 10px;
  border: 2px solid var(--line);
  border-radius: 2px;
  background: var(--paper);
  box-shadow: 3px 3px 0 var(--line);
  color: var(--ink);
  text-decoration: none;
  transition: transform .16s cubic-bezier(.22, 1, .36, 1),
              box-shadow .16s cubic-bezier(.22, 1, .36, 1),
              background-color .16s ease;
}

.tr-home-solution:hover {
  background: #dfe5d8;
  box-shadow: 5px 5px 0 var(--line);
  color: var(--ink);
  text-decoration: none;
  transform: translate(-2px, -2px);
}

.tr-home-solution:focus-visible,
.tr-home-solutions__cta-button:focus-visible {
  outline: 3px solid var(--accent-pink);
  outline-offset: 3px;
}

.tr-home-solution__top {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.tr-home-solution__number {
  min-width: 36px;
  padding: 4px 6px;
  border: 2px solid var(--line);
  background: var(--accent-purple);
  box-shadow: 2px 2px 0 var(--line);
  color: #fff;
  font-family: 'Oswald', sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

.tr-home-solution__icon {
  font-size: 28px;
  line-height: 1;
  filter: grayscale(.15);
}

.tr-home-solution__name {
  max-width: calc(100% - 24px);
  margin-top: auto;
  font-family: 'Oswald', sans-serif;
  font-size: clamp(15px, 1.25vw, 18px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: .025em;
  text-transform: uppercase;
}

.tr-home-solution__description {
  margin-top: 4px;
  padding-right: 22px;
  color: var(--ink-2);
  font-size: 10px;
  line-height: 1.25;
}

.tr-home-solution__arrow {
  position: absolute;
  right: 10px;
  bottom: 8px;
  color: var(--accent-purple);
  font-size: 24px;
  line-height: 1;
  transition: transform .16s cubic-bezier(.22, 1, .36, 1);
}

.tr-home-solution:hover .tr-home-solution__arrow {
  transform: translateX(4px);
}

.tr-home-solutions__cta {
  grid-column: 1 / -1;
  min-height: 55px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border: 2px solid var(--line);
  border-radius: 2px;
  background: var(--accent-purple);
  box-shadow: 3px 3px 0 var(--line);
  color: #fff;
}

.tr-home-solutions__cta-copy {
  min-width: 0;
}

.tr-home-solutions__cta-copy strong {
  display: block;
  font-family: 'Oswald', sans-serif;
  font-size: 15px;
  line-height: 1.1;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.tr-home-solutions__cta-copy > span {
  display: block;
  margin-top: 2px;
  color: rgba(255,255,255,.75);
  font-size: 9px;
  line-height: 1.2;
}

.tr-home-solutions__cta-button {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 2px solid #fff;
  background: transparent;
  box-shadow: 2px 2px 0 var(--line);
  color: #fff;
  font-family: 'Oswald', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .035em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.tr-home-solutions__cta-button:hover {
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
}

@media (max-width: 900px) {
  .home-split-grid { grid-template-columns: 1fr; }
  .tr-home-solution { min-height: 125px; }
}
@media (max-width: 520px) {
  .brands-grid { grid-template-columns: repeat(3, 1fr); }
  .tr-home-solutions {
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }
  .tr-home-solution { min-height: 138px; }
  .tr-home-solutions__cta {
    align-items: flex-start;
    flex-direction: column;
  }
  .tr-home-solutions__cta-button {
    width: 100%;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tr-home-solution,
  .tr-home-solution__arrow {
    transition: none;
  }
}
