/* ================================================================
   ⚡ PORTADA ÉLITE THUNDERSHOP (estilo marketplace) - [thundershop_home]
   Prefijo tsh- para no chocar con los estilos ts- existentes.
   ================================================================ */

/* Colores, tipografía, .tsh-wrap, .tsh-ico y la cabecera viven en thundershop-header.css (se carga en todo el sitio) */

.tsh-home {
    /* Rompe el contenedor de Elementor y ocupa todo el ancho.
       --tsh-sbw = ancho de la barra de scroll de PC (lo mide el JS), para no desbordar */
    width: calc(100vw - var(--tsh-sbw, 0px));
    margin-left: calc(50% - (100vw - var(--tsh-sbw, 0px)) / 2);
    background: var(--tsh-bg);
    color: var(--tsh-text);
    font-family: var(--tsh-font);
    font-size: 16px;
    line-height: 1.4;
}

.tsh-home *, .tsh-home *::before, .tsh-home *::after { box-sizing: border-box; }
.tsh-home a { color: inherit; text-decoration: none; }
.tsh-home h2, .tsh-home h3, .tsh-home p { margin: 0; }
.tsh-home img { max-width: 100%; }
.tsh-home button { font: inherit; cursor: pointer; }
.tsh-home :focus-visible { outline: 3px solid var(--tsh-gold); outline-offset: 2px; }

body.tsh-home-activa, body:has(.tsh-home) { overflow-x: clip; } /* clip (no hidden) para no romper la cabecera sticky */

/* ================================================================
   HERO / CARRUSEL PRINCIPAL
   ================================================================ */
.tsh-hero { position: relative; height: 340px; overflow: hidden; background: var(--tsh-navy); }
.tsh-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 110px; background: linear-gradient(transparent, var(--tsh-bg)); z-index: 3; pointer-events: none; }
.tsh-hero-track { position: absolute; inset: 0; }
.tsh-slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .7s ease, visibility .7s ease; }
.tsh-slide.is-active { opacity: 1; visibility: visible; z-index: 1; }
.tsh-slide-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; max-width: none !important; }
.tsh-slide::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(15, 23, 42, .92) 0%, rgba(15, 23, 42, .55) 45%, rgba(15, 23, 42, 0) 80%); }
.tsh-slide-inner { position: relative; z-index: 2; height: 100%; display: flex; align-items: center; justify-content: space-between; padding-bottom: 50px; }
.tsh-slide-text { max-width: 520px; color: #fff; }
.tsh-slide-text h2 { font-size: clamp(28px, 4vw, 46px); line-height: 1.1; font-weight: 800; margin: 10px 0 8px; color: #fff; }
.tsh-slide-text h2 span { color: var(--tsh-gold); }
.tsh-slide-text p { color: #CBD5E1; font-size: 16px; margin-bottom: 18px; }
.tsh-slide-subject { max-height: 250px; width: auto; max-width: 40% !important; object-fit: contain; filter: drop-shadow(0 18px 26px rgba(0, 0, 0, .55)); }

.tsh-badge { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--tsh-gold); color: var(--tsh-navy); font-size: 11px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; }
.tsh-btn { display: inline-block; padding: 12px 26px; border-radius: 8px; background: var(--tsh-gold); color: var(--tsh-navy) !important; font-weight: 800; font-size: 15px; transition: transform .2s, box-shadow .2s; }
.tsh-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(250, 204, 21, .35); }

.tsh-hero-arrow { position: absolute; top: 42%; transform: translateY(-50%); z-index: 4; width: 44px; height: 64px; border: 0; background: rgba(255, 255, 255, .9) !important; color: var(--tsh-navy) !important; font-size: 18px; box-shadow: var(--tsh-shadow); opacity: 0; transition: opacity .2s; padding: 0; }
.tsh-hero:hover .tsh-hero-arrow, .tsh-hero-arrow:focus-visible { opacity: 1; }
.tsh-prev { left: 0; border-radius: 0 64px 64px 0; }
.tsh-next { right: 0; border-radius: 64px 0 0 64px; }
.tsh-hero-dots { position: absolute; bottom: 74px; left: 50%; transform: translateX(-50%); z-index: 4; display: flex; gap: 8px; }
.tsh-hero-dots button { width: 9px; height: 9px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .5) !important; }
.tsh-hero-dots button.is-active { background: var(--tsh-gold) !important; width: 22px; border-radius: 5px; }

/* ================================================================
   ACCESOS RÁPIDOS (tarjetas flotando sobre el hero)
   ================================================================ */
.tsh-accesos { position: relative; z-index: 5; margin-top: -60px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.tsh-acceso { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 18px 10px; background: var(--tsh-card); border-radius: var(--tsh-radius); box-shadow: var(--tsh-shadow); transition: transform .2s, box-shadow .2s; }
.tsh-acceso:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(15, 23, 42, .14); }
.tsh-acceso-ico { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--tsh-navy); color: var(--tsh-gold); }
.tsh-acceso-ico .tsh-ico { width: 26px; height: 26px; }
.tsh-acceso-txt strong { display: block; font-size: 14px; }
.tsh-acceso-txt small { display: block; font-size: 12px; color: var(--tsh-muted); margin-top: 2px; }

/* ================================================================
   SECCIONES Y CARRUSELES DE PRODUCTOS
   ================================================================ */
.tsh-section { margin-top: 32px; }
.tsh-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.tsh-section-head h2 { font-size: 24px; font-weight: 700; color: var(--tsh-text); }
.tsh-section-head p { font-size: 14px; color: var(--tsh-muted); margin-top: 2px; }
.tsh-more { display: flex; align-items: center; color: var(--tsh-blue) !important; font-size: 14px; font-weight: 600; white-space: nowrap; }
.tsh-more .tsh-ico { width: 18px; height: 18px; }

.tsh-section--oferta { background: var(--tsh-navy); border-radius: var(--tsh-radius); padding: 20px 16px 22px; max-width: 1168px; }
.tsh-section--oferta .tsh-section-head h2 { color: #fff; }
.tsh-section--oferta .tsh-section-head h2::before { content: "⚡ "; }
.tsh-section--oferta .tsh-section-head p { color: #94A3B8; }
.tsh-section--oferta .tsh-more { color: var(--tsh-gold) !important; }

.tsh-carousel { position: relative; }
.tsh-car-track { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 4 * 12px) / 5); gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; padding: 2px 2px 8px; scrollbar-width: none; }
.tsh-car-track::-webkit-scrollbar { display: none; }
.tsh-car-track > * { scroll-snap-align: start; }
/* Carruseles aleatorios: antes de que el JS los revuelva solo se ven 12 (y quedan 12 si no hay JS) */
.tsh-car-track[data-tsh-aleatorio]:not(.is-listo) > :nth-child(n+13) { display: none; }
.tsh-car-btn { position: absolute; top: 38%; z-index: 2; width: 42px; height: 42px; border-radius: 50%; border: 0; background: #fff !important; color: var(--tsh-navy) !important; font-size: 15px; box-shadow: 0 4px 14px rgba(15, 23, 42, .25); padding: 0; }
.tsh-car-prev { left: -14px; }
.tsh-car-next { right: -14px; }
.tsh-car-btn[disabled] { opacity: 0; pointer-events: none; }

/* Tarjeta de producto */
.tsh-card { display: flex; flex-direction: column; background: var(--tsh-card); border-radius: var(--tsh-radius); overflow: hidden; box-shadow: var(--tsh-shadow); transition: box-shadow .2s, transform .2s; }
.tsh-card:hover { box-shadow: 0 10px 26px rgba(15, 23, 42, .16); transform: translateY(-2px); }
.tsh-card-img { display: flex; align-items: center; justify-content: center; aspect-ratio: 1 / 1; background: #fff; border-bottom: 1px solid var(--tsh-line); padding: 10px; }
.tsh-card-img img { width: 100%; height: 100%; object-fit: contain; margin: 0 !important; }
.tsh-card-body { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px 14px; }
.tsh-card-old { font-size: 12px; color: var(--tsh-muted); text-decoration: line-through; }
.tsh-card-old .amount { color: inherit; }
.tsh-card-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; font-size: 22px; font-weight: 500; color: var(--tsh-text); }
.tsh-card-price small { font-size: 12px; color: var(--tsh-muted); }
.tsh-card-price em { font-style: normal; font-size: 13px; font-weight: 600; color: var(--tsh-green); }
.tsh-card-ship { display: flex; align-items: center; gap: 3px; font-size: 13px; font-weight: 600; color: var(--tsh-green); }
.tsh-card-ship .tsh-ico { width: 14px; height: 14px; color: var(--tsh-gold); }
.tsh-card-title { font-size: 14px; color: #334155; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 4px; }
.tsh-card-store { font-size: 12px; color: var(--tsh-muted); }

/* ================================================================
   CATEGORÍAS
   ================================================================ */
.tsh-cats-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.tsh-cat { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px 8px; background: var(--tsh-card); border-radius: var(--tsh-radius); box-shadow: var(--tsh-shadow); text-align: center; transition: transform .2s; }
.tsh-cat:hover { transform: translateY(-3px); }
.tsh-cat-img { width: 84px; height: 84px; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #F1F5F9; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--tsh-gold); color: var(--tsh-navy); }
.tsh-cat-img img { width: 100%; height: 100%; object-fit: cover; }
.tsh-cat-name { font-size: 13px; font-weight: 600; line-height: 1.25; }

/* ================================================================
   BANNER VENDE
   ================================================================ */
.tsh-promo { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 28px 32px; border-radius: var(--tsh-radius); color: #fff; background: radial-gradient(circle at 90% 20%, rgba(250, 204, 21, .25), transparent 45%), linear-gradient(120deg, var(--tsh-navy) 0%, #1E3A5F 100%); box-shadow: var(--tsh-shadow); }
.tsh-promo h2 { font-size: clamp(22px, 3vw, 30px); font-weight: 800; margin: 10px 0 6px; color: #fff; }
.tsh-promo h2 span { color: var(--tsh-gold); }
.tsh-promo p { color: #CBD5E1; max-width: 620px; }
.tsh-promo .tsh-btn { flex: none; }

/* ================================================================
   TIENDAS THUNDERS
   ================================================================ */
.tsh-store { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0 14px 16px; background: var(--tsh-card); border-radius: var(--tsh-radius); overflow: hidden; box-shadow: var(--tsh-shadow); }
.tsh-store-cover { align-self: stretch; height: 64px; margin: 0 -14px; background: linear-gradient(120deg, var(--tsh-navy), #1E3A5F); }
.tsh-store-logo { width: 72px; height: 72px; margin-top: -36px; border-radius: 50%; object-fit: cover; background: #fff; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--tsh-gold); }
.tsh-store strong { margin-top: 10px; font-size: 15px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.tsh-store small { font-size: 12px; color: var(--tsh-muted); }
.tsh-store-btn { margin-top: 12px; padding: 7px 18px; border-radius: 6px; background: #E0F2FE; color: var(--tsh-blue); font-size: 13px; font-weight: 700; }
.tsh-store:hover .tsh-store-btn { background: var(--tsh-navy); color: var(--tsh-gold); }

/* ================================================================
   BENEFICIOS
   ================================================================ */
.tsh-beneficios { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: 40px; margin-bottom: 40px; background: var(--tsh-card); border-radius: var(--tsh-radius); box-shadow: var(--tsh-shadow); padding: 28px 16px; max-width: 1168px; }
.tsh-beneficio { text-align: center; padding: 0 22px; }
.tsh-beneficio + .tsh-beneficio { border-left: 1px solid var(--tsh-line); }
.tsh-beneficio-ico { display: inline-flex; width: 60px; height: 60px; border-radius: 50%; align-items: center; justify-content: center; background: var(--tsh-navy); color: var(--tsh-gold); margin-bottom: 10px; }
.tsh-beneficio-ico .tsh-ico { width: 30px; height: 30px; }
.tsh-beneficio h3 { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.tsh-beneficio p { font-size: 14px; color: var(--tsh-muted); }


/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1024px) {
    .tsh-car-track { grid-auto-columns: calc((100% - 3 * 12px) / 4); }
    .tsh-accesos { grid-template-columns: repeat(3, 1fr); }
    .tsh-cats-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 767px) {
    .tsh-hero { height: 300px; }
    .tsh-slide::before { background: linear-gradient(180deg, rgba(15, 23, 42, .2) 0%, rgba(15, 23, 42, .85) 55%, var(--tsh-navy) 100%); }
    .tsh-slide-inner { flex-direction: column; justify-content: flex-end; align-items: flex-start; padding-bottom: 70px; }
    .tsh-slide-subject { position: absolute; top: 10px; right: 10px; max-height: 120px; max-width: 45% !important; }
    .tsh-slide-text p { font-size: 13px; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .tsh-hero-arrow { display: none; }
    .tsh-hero-dots { bottom: 48px; }

    .tsh-accesos { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 42%; overflow-x: auto; scrollbar-width: none; margin-top: -40px; padding-bottom: 6px; }
    .tsh-accesos::-webkit-scrollbar { display: none; }

    .tsh-section { margin-top: 24px; }
    .tsh-section-head h2 { font-size: 20px; }
    .tsh-car-track { grid-auto-columns: 46%; }
    .tsh-car-btn { display: none; }
    .tsh-card-price { font-size: 18px; }

    .tsh-cats-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .tsh-cat { padding: 12px 4px; }
    .tsh-cat-img { width: 64px; height: 64px; }
    .tsh-cat-name { font-size: 12px; }

    .tsh-promo { flex-direction: column; align-items: flex-start; padding: 22px 20px; }

    .tsh-beneficios { grid-template-columns: 1fr; gap: 18px; }
    .tsh-beneficio + .tsh-beneficio { border-left: 0; border-top: 1px solid var(--tsh-line); padding-top: 18px; }
}

@media (prefers-reduced-motion: reduce) {
    .tsh-home *, .tsh-home *::before, .tsh-home *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
