/* ==========================================================================
   Home v2 — refresh visual del index (T-019).
   Todo scoped a .home-v2 para no afectar otras páginas que comparten main.css.
   Paleta: azul de marca (#3483fa) + neutros fríos + acentos verde/teal/ámbar.
   ========================================================================== */
:root {
  --hv-primary: #3483fa;
  --hv-primary-600: #1f6fe5;
  --hv-primary-700: #1a56b8;
  --hv-primary-50: #eef4ff;
  --hv-primary-100: #dce8ff;
  --hv-ink: #0f172a;
  --hv-text: #334155;
  --hv-muted: #64748b;
  --hv-line: #e6ebf2;
  --hv-bg: #f5f7fb;
  --hv-surface: #ffffff;
  --hv-green: #00a74e;
  --hv-green-50: #e7f7ee;
  --hv-teal: #2cccd3;
  --hv-amber: #ffbc53;
  --hv-red: #dc2626;
  --hv-radius: 16px;
  --hv-radius-sm: 12px;
  --hv-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .05);
  --hv-shadow-hover: 0 10px 30px rgba(15, 23, 42, .10);
}
.home-v2 {
  background: var(--hv-bg);
  color: var(--hv-text);
}
.home-v2 .cont-body { padding-bottom: 32px; }

/* ----- layout ----- */
.home-v2 .hv-wrap {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
}
.home-v2 .hv-section { margin-top: 40px; }

.home-v2 .hv-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.home-v2 .hv-head h2 {
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -.02em;
  color: var(--hv-ink);
  margin: 0;
}
.home-v2 .hv-head a {
  font-family: "Poppins", sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--hv-primary);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.home-v2 .hv-head a i { transition: transform .2s; }
.home-v2 .hv-head a:hover i { transform: translateX(3px); }

/* ----- hero ----- */
.home-v2 .hv-hero { margin-top: 20px; }
.home-v2 .banner-ppal {
  width: 100%;
  margin: 0;
  border-radius: var(--hv-radius);
  overflow: hidden;
  box-shadow: var(--hv-shadow);
  background: var(--hv-surface);
}
.home-v2 .banner-ppal img { display: block; }
.home-v2 .banner-ppal .swiper-button-next,
.home-v2 .banner-ppal .swiper-button-prev {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  box-shadow: var(--hv-shadow);
  color: var(--hv-ink);
  transition: background .2s, transform .2s;
}
.home-v2 .banner-ppal .swiper-button-next::after,
.home-v2 .banner-ppal .swiper-button-prev::after { font-size: 16px; font-weight: 700; }
.home-v2 .banner-ppal .swiper-button-next:hover,
.home-v2 .banner-ppal .swiper-button-prev:hover { background: #fff; transform: scale(1.06); }

.home-v2 .hv-perks {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 16px 0 0;
  padding: 0;
}
.home-v2 .hv-perks li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--hv-surface);
  border: 1px solid var(--hv-line);
  border-radius: var(--hv-radius-sm);
}
.home-v2 .hv-perks i {
  flex: 0 0 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 18px;
  color: var(--hv-primary);
  background: var(--hv-primary-50);
}
.home-v2 .hv-perks li:nth-child(2) i { color: var(--hv-green); background: var(--hv-green-50); }
.home-v2 .hv-perks div { display: flex; flex-direction: column; line-height: 1.3; }
.home-v2 .hv-perks b { font-family: "Poppins", sans-serif; font-size: 14px; color: var(--hv-ink); }
.home-v2 .hv-perks span { font-size: 12px; color: var(--hv-muted); }

/* ----- categorías ----- */
.home-v2 .hv-cats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 14px;
}
.home-v2 .hv-cat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 140px;
  padding: 18px 10px;
  background: var(--hv-surface);
  border: 1px solid var(--hv-line);
  border-radius: var(--hv-radius-sm);
  text-align: center;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.home-v2 .hv-cat:hover {
  transform: translateY(-3px);
  box-shadow: var(--hv-shadow-hover);
  border-color: var(--hv-primary-100);
}
.home-v2 .hv-cat__icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 28px;
  color: var(--hv-primary);
  background: var(--hv-primary-50);
  transition: background .2s, color .2s;
}
.home-v2 .hv-cat:hover .hv-cat__icon { background: var(--hv-primary); color: #fff; }
.home-v2 .hv-cat__name {
  font-family: "Poppins", sans-serif;
  font-size: 13px;
  color: var(--hv-ink);
  line-height: 1.3;
}
.home-v2 .hv-cat--promo {
  grid-column: span 2;
  padding: 0;
  overflow: hidden;
}
.home-v2 .hv-cat--promo picture,
.home-v2 .hv-cat--promo img { width: 100%; height: 100%; display: block; }
.home-v2 .hv-cat--promo img { object-fit: contain; }

/* ----- promos ----- */
.home-v2 .hv-promos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}
.home-v2 .hv-promo,
.home-v2 .hv-link {
  display: block;
  border-radius: var(--hv-radius);
  overflow: hidden;
  background: var(--hv-surface);
  box-shadow: var(--hv-shadow);
  transition: transform .25s, box-shadow .25s;
}
.home-v2 .hv-promo:hover,
.home-v2 .hv-link:hover { transform: translateY(-3px); box-shadow: var(--hv-shadow-hover); }
.home-v2 .hv-promo img,
.home-v2 .hv-link img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ----- productos ----- */
.home-v2 .hv-products {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.hv-cards .product {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 16px;
  background: var(--hv-surface);
  border: 1px solid var(--hv-line);
  border-radius: var(--hv-radius);
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.hv-cards .product:hover {
  transform: translateY(-4px);
  box-shadow: var(--hv-shadow-hover);
  border-color: transparent;
}
/* orden visual: imagen → marca → nombre → precio → acciones → stock */
.hv-cards .product__img { order: 1; margin: 8px 0 0; }
.hv-cards .product__brand { order: 2; }
.hv-cards .product__description { order: 3; }
.hv-cards h2.product__price:first-of-type { order: 4; }
.hv-cards .product > .row { order: 5; }
.hv-cards h2.product__price:last-of-type { order: 6; }

.hv-cards .product__img > figure {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  max-width: 220px;
  border-radius: var(--hv-radius-sm);
  display: grid;
  place-items: center;
}
.hv-cards .product__img img { object-fit: contain; transition: transform .35s; }
.hv-cards .product:hover .product__img img { transform: scale(1.04); }

.hv-cards .product__brand {
  height: auto;
  margin: 8px 0 0;
  justify-content: flex-start;
}
.hv-cards .product__brand > picture > img {
  height: 24px;
  margin: 0;
  opacity: .85;
}
.hv-cards .product__description {
  width: 100%;
  padding: 0;
  margin-top: 8px;
  text-align: left;
  font-family: "Poppins", sans-serif;
  font-size: 13px;
  line-height: 1.45;
  color: var(--hv-ink);
  min-height: 38px;
  max-height: 38px;
  overflow: hidden;
}
.hv-cards .product__price {
  width: 100%;
  padding: 0;
  margin-top: 8px;
  align-items: flex-start;
  text-align: left;
  font-family: "Poppins", sans-serif !important;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -.01em;
  color: var(--hv-ink);
}
.hv-cards .product__price > small { font-weight: 400; color: var(--hv-muted); }
.hv-cards h2.product__price:last-of-type { margin-top: 6px; font-size: 12px; }
.hv-cards h2.product__price:last-of-type > small { font-size: 12px; color: var(--hv-green); }

.hv-cards .product > .row {
  justify-content: space-between;
  flex-direction: row-reverse;
  align-items: center;
  margin-top: 12px;
}
.hv-cards .product__add-cart {
  width: 42px;
  height: 42px;
  border-radius: 12px !important;
  font-size: 16px;
  background: var(--hv-primary);
}
.hv-cards .product__add-cart:hover { background: var(--hv-primary-600); box-shadow: 0 6px 16px rgba(52, 131, 250, .35); }
.hv-cards .product__add-cart:disabled { opacity: .7; cursor: wait; }
.hv-cards .product__free-shipping {
  margin: 0;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: var(--hv-green);
  background: var(--hv-green-50);
}

.hv-cards .product__labels { top: 12px; left: 12px; }
.hv-cards .product__labels > div { border-radius: 6px; padding: 3px 8px; margin: 0 0 4px; font-size: 11px; }
.hv-cards .product__actions { top: 12px; right: 12px; }
.hv-cards .product__actions > button {
  width: 34px;
  height: 34px;
  background: #fff;
  color: var(--hv-ink);
  border: 1px solid var(--hv-line);
  box-shadow: var(--hv-shadow);
}
.hv-cards .product__actions > button:hover { color: var(--hv-primary); }
.hv-cards .product__like .fas { color: var(--hv-red); }
.hv-cards .product__24hours { width: auto; left: 12px; right: 12px; top: 12px; border-radius: 10px; box-sizing: border-box; }

/* skeleton */
.home-v2 .hv-skel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: var(--hv-surface);
  border: 1px solid var(--hv-line);
  border-radius: var(--hv-radius);
}
.home-v2 .hv-skel .skeleton-loading { display: block; min-width: auto; border: none; border-radius: 8px; }
.home-v2 .hv-skel__img { width: 100%; aspect-ratio: 1 / 1; }
.home-v2 .hv-skel__line { width: 85%; height: 14px; }
.home-v2 .hv-skel__line--short { width: 45%; height: 20px; }

/* ----- marcas ----- */
.home-v2 .hv-brands {
  padding: 24px;
  border-radius: var(--hv-radius);
  background: linear-gradient(135deg, var(--hv-primary-50) 0%, #f7faff 100%);
  border: 1px solid var(--hv-primary-100);
}
.home-v2 .hv-brands .banner-brand { background: transparent; margin: 0; padding: 0; width: 100%; overflow: hidden; }
.home-v2 .hv-brands .banner-brand__container { margin: 0; padding: 4px 0 8px; }
.home-v2 .hv-brands .banner-brand__slide {
  background: #fff;
  border-radius: var(--hv-radius-sm);
  box-shadow: var(--hv-shadow);
  filter: grayscale(1);
  opacity: .8;
  transition: filter .25s, opacity .25s, transform .25s;
}
.home-v2 .hv-brands .banner-brand__slide:hover { filter: none; opacity: 1; transform: translateY(-2px); }
.home-v2 .hv-brands__skel { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.home-v2 .hv-brands__skel .skeleton-loading { display: block; height: 110px; min-width: auto; border: none; border-radius: var(--hv-radius-sm); }

/* ----- accesos ----- */
.home-v2 .hv-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

/* ----- responsive ----- */
@media (max-width: 1100px) {
  .home-v2 .hv-products { grid-template-columns: repeat(3, 1fr); }
  .home-v2 .hv-perks { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .home-v2 .hv-wrap { padding: 0 16px; }
  .home-v2 .hv-section { margin-top: 28px; }
  .home-v2 .hv-head h2 { font-size: 20px; }
  .home-v2 .hv-products { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .hv-cards .product { padding: 12px; }
  .hv-cards .product__price { font-size: 17px; }
  .home-v2 .hv-cats { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .home-v2 .hv-cat { min-height: 116px; }
  .home-v2 .hv-cat__icon { width: 52px; height: 52px; font-size: 22px; }
  .home-v2 .hv-cat--promo { grid-column: 1 / -1; }
  .home-v2 .hv-brands { padding: 16px; }
  .home-v2 .hv-brands__skel { grid-template-columns: repeat(3, 1fr); }
  .home-v2 .banner-ppal .swiper-button-next,
  .home-v2 .banner-ppal .swiper-button-prev { display: none; }
}
@media (max-width: 500px) {
  /* main.css le pone min-height:300px al banner en móvil: dejaba un hueco blanco bajo la imagen */
  .home-v2 .banner-ppal { min-height: 0; }
}
@media (max-width: 480px) {
  /* 2x2 compacto: en una columna los 4 beneficios empujaban el contenido muy abajo */
  .home-v2 .hv-perks { grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
  .home-v2 .hv-perks li { padding: 10px; gap: 8px; }
  .home-v2 .hv-perks i { flex-basis: 32px; height: 32px; font-size: 15px; border-radius: 8px; }
  .home-v2 .hv-perks b { font-size: 12px; }
  .home-v2 .hv-perks span { font-size: 10px; }
  .home-v2 .hv-hero { margin-top: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .home-v2 * { transition: none !important; }
}
