/* Ruta: /public/assets/css/home-nav.css
   Barra lateral retráctil de categorías + carrusel principal + tarjetas de
   administración del slider. Usa los tokens de theme.css. (Iteración 9) */

/* =================== BARRA LATERAL =================== */
.cat-sidebar { position: fixed; top: 0; left: 0; height: 100%; z-index: 1040; pointer-events: none; }
.cat-sidebar > * { pointer-events: auto; }

/* Pestaña recogida */
.cat-tab {
    position: fixed; left: 0; top: 42%; transform: translateY(-50%);
    display: flex; flex-direction: column; align-items: center; gap: .5rem;
    background: linear-gradient(180deg, var(--navy), var(--navy-hover));
    color: #fff; border: none; border-radius: 0 16px 16px 0;
    padding: 1rem .55rem; cursor: pointer; box-shadow: var(--shadow-md);
    transition: padding .2s, background .2s; z-index: 1041;
}
.cat-tab:hover { padding-left: .8rem; }
.cat-tab-ico { font-size: 1.4rem; }
.cat-tab-label { writing-mode: vertical-rl; transform: rotate(180deg); font-weight: 800; letter-spacing: .05em; font-size: .95rem; }
.cat-tab-chev { font-size: 1.1rem; font-weight: 800; }

/* Panel */
.cat-panel {
    position: fixed; top: 0; left: 0; height: 100%; width: 340px; max-width: 86vw;
    background: var(--surface); border-right: 1px solid var(--line);
    box-shadow: var(--shadow-md); transform: translateX(-108%);
    transition: transform .28s cubic-bezier(.4,0,.2,1); display: flex; flex-direction: column;
    z-index: 1042; overflow: hidden;
}
.cat-sidebar.open .cat-panel { transform: translateX(0); }
.cat-sidebar.open .cat-tab { opacity: 0; pointer-events: none; }

.cat-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.2rem; border-bottom: 1px solid var(--line); }
.cat-panel-head strong { font-size: 1.2rem; color: var(--navy); }
.cat-close { background: var(--canvas); border: 1px solid var(--line); border-radius: 10px; width: 40px; height: 40px; font-size: 1rem; cursor: pointer; color: var(--ink); }

.cat-search { padding: 1rem 1.2rem .5rem; }
.cat-search-input { width: 100%; padding: .8rem 1rem; border-radius: 12px; border: 1px solid var(--line); font-size: 1rem; background: var(--canvas); color: var(--ink); }
.cat-search-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(24,120,230,.18); }

.cat-search-results { padding: .3rem .8rem; overflow-y: auto; }
.csr-group-title { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); margin: .6rem .4rem .2rem; font-weight: 700; }
.csr-item { display: flex; align-items: center; gap: .6rem; padding: .55rem .5rem; border-radius: 10px; color: var(--ink); }
.csr-item:hover { background: var(--canvas); color: var(--ink); }
.csr-item img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; }
.csr-emoji { width: 40px; text-align: center; font-size: 1.3rem; }
.csr-name { font-weight: 600; font-size: .95rem; line-height: 1.15; }
.csr-meta { color: var(--ink-soft); font-size: .82rem; }
.csr-empty { color: var(--ink-soft); padding: 1rem .5rem; text-align: center; }

/* Menú (nivel 1) y subpaneles (nivel 2) */
.cat-menu, .cat-sub { overflow-y: auto; flex: 1; padding: .5rem .8rem 1.2rem; }
.cat-item {
    display: flex; align-items: center; gap: .7rem; width: 100%; text-align: left;
    background: none; border: none; padding: .8rem .7rem; border-radius: 12px;
    color: var(--ink); font-weight: 600; font-size: 1.02rem; cursor: pointer;
}
.cat-item:hover { background: var(--canvas); color: var(--ink); }
.cat-ico { font-size: 1.3rem; width: 1.6rem; text-align: center; }
.cat-label { flex: 1; }
.cat-chev, .cat-chev-sm { color: var(--ink-soft); font-weight: 800; }
.cat-subs { display: contents; }
.cat-sub { position: absolute; inset: 0; top: 0; background: var(--surface); transform: translateX(100%); transition: transform .25s ease; display: flex; flex-direction: column; padding-top: 1rem; }
.cat-sub[hidden] { display: none; }
.cat-sub.show { transform: translateX(0); }
.cat-back { align-self: flex-start; background: none; border: none; color: var(--brand); font-weight: 700; cursor: pointer; padding: .3rem .7rem; font-size: 1rem; }
.cat-sub-title { display: block; font-family: 'Fraunces', serif; font-size: 1.3rem; color: var(--navy); padding: .2rem .7rem .6rem; }

.cat-backdrop { position: fixed; inset: 0; background: rgba(16,24,40,.45); z-index: 1041; border: none; }

@media (min-width: 992px) {
    .cat-backdrop { display: none !important; }
}

/* =================== LAYOUT DEL HOME =================== */
.home-container { width: 100%; max-width: 1480px; margin: 0 auto; padding-inline: clamp(16px, 3vw, 40px); }
.section-tight { padding: 20px 0; }

/* El drawer de categorías es OVERLAY (se superpone): el slider NO se reduce y
   no hay layout shift. Recogido = ancho completo. */

/* Franja de promoción — carrusel/ticker continuo (recorre SIEMPRE, pausa al hover).
   El !important es intencional: gana a la regla global de reduce-motion
   (* { animation: none !important }). El dueño pidió que este ticker corra
   siempre para llamar la atención, aun con "reducir movimiento" activado. */
.promo-bar { background: var(--navy); color: #fff; border-radius: 16px; margin-top: 14px; overflow: hidden; }
.promo-bar .promo-track { display: flex; align-items: center; width: max-content; gap: 1.2rem; padding: .7rem 1.2rem; animation: promo-marquee 26s linear infinite !important; }
.promo-bar:hover .promo-track { animation-play-state: paused; }
.promo-bar .promo-item { white-space: nowrap; }
.promo-bar .promo-sep { color: var(--gold); font-size: .85rem; }
@keyframes promo-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Beneficios rápidos */
.benefits-bar { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
.benefit { display: flex; align-items: center; gap: .5rem; font-weight: 600; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .75rem 1rem; justify-content: center; }
.benefit span { font-size: 1.2rem; }
@media (min-width: 768px) { .benefits-bar { grid-template-columns: repeat(4, 1fr); } }

/* =================== CARRUSEL PRINCIPAL (HERO) — SLIDES APILADOS =================== */
/* Stage de proporción fija: cada imagen se ve COMPLETA (contain) sobre un fondo
   desenfocado de sí misma (relleno sin barras). Efecto distinto por transición. */
.hero-slider { position: relative; width: 100%; overflow: hidden; background: var(--navy); }
.hs-stage { position: relative; width: 100%; aspect-ratio: 1717 / 916; background: var(--cream); overflow: hidden; }

.hs-slide { position: absolute; inset: 0; z-index: 0; }
.hs-slide.is-leaving { z-index: 1; }
.hs-slide.is-active  { z-index: 2; }

/* Relleno: fondo desenfocado tomado de la propia imagen (sin barras vacías) */
.hs-slide::before {
    content: ''; position: absolute; inset: 0; z-index: 0;
    background: var(--hs-bg) center / cover no-repeat;
    filter: blur(24px) brightness(1.04); transform: scale(1.18);
}
.hs-bg-img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; display: block; }

/* OVERLAY = foto recortada + textos encima (slide por defecto sin imagen) */
.hs-slide.is-overlay { display: flex; align-items: center; background: linear-gradient(135deg, var(--navy), var(--navy-hover)); }
.hs-slide.is-overlay::before { display: none; }
.hs-slide.is-overlay .hs-bg-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }

.hs-overlay { position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(13,43,94,.82) 0%, rgba(13,43,94,.55) 42%, rgba(13,43,94,.15) 100%); }
.hs-artlink { position: absolute; inset: 0; z-index: 3; }
.hs-inner { position: relative; z-index: 2; width: 100%; max-width: 1480px; margin: 0 auto; padding-inline: clamp(24px, 4vw, 56px); }
.hs-text { max-width: 620px; color: #fff; padding: 2rem 0; }
.hs-eyebrow { display: inline-block; background: rgba(255,255,255,.18); color: #fff; font-weight: 800; letter-spacing: .08em; font-size: .8rem; padding: .35rem .9rem; border-radius: 999px; margin-bottom: 1rem; }
.hs-title { font-family: 'Fraunces', serif; font-size: clamp(1.9rem, 4vw, 3.2rem); line-height: 1.08; margin: 0 0 .8rem; color: #fff; }
.hs-sub { font-size: clamp(1rem, 2vw, 1.25rem); opacity: .95; margin: 0 0 1.5rem; }
.hs-cta { display: flex; flex-wrap: wrap; gap: .8rem; }
.hs-ghost { border-color: rgba(255,255,255,.6); color: #fff; }
.hs-ghost:hover { border-color: #fff; color: #fff; background: rgba(255,255,255,.12); }

/* ---- EFECTOS DE TRANSICIÓN (uno distinto por avance). Solo se anima el slide
   activo. !important: corren aun con "reducir movimiento" (a pedido del dueño). ---- */
.hs-slide.is-active.hsfx-fade  { animation: hsfx-fade  .9s ease both !important; }
.hs-slide.is-active.hsfx-zoom  { animation: hsfx-zoom  .9s cubic-bezier(.22,.61,.36,1) both !important; }
.hs-slide.is-active.hsfx-right { animation: hsfx-right .8s cubic-bezier(.22,.61,.36,1) both !important; }
.hs-slide.is-active.hsfx-left  { animation: hsfx-left  .8s cubic-bezier(.22,.61,.36,1) both !important; }
.hs-slide.is-active.hsfx-up    { animation: hsfx-up    .8s cubic-bezier(.22,.61,.36,1) both !important; }
@keyframes hsfx-fade  { from { opacity: 0; } to { opacity: 1; } }
@keyframes hsfx-zoom  { from { opacity: 0; transform: scale(1.08); } to { opacity: 1; transform: scale(1); } }
@keyframes hsfx-right { from { opacity: .2; transform: translateX(6%); }  to { opacity: 1; transform: translateX(0); } }
@keyframes hsfx-left  { from { opacity: .2; transform: translateX(-6%); } to { opacity: 1; transform: translateX(0); } }
@keyframes hsfx-up    { from { opacity: .2; transform: translateY(6%) scale(1.02); } to { opacity: 1; transform: translateY(0) scale(1); } }

.hs-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 4; width: 60px; height: 60px; border-radius: 50%; border: 2px solid rgba(255,255,255,.9); background: #fff; color: var(--navy); font-size: 2.3rem; font-weight: 700; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 22px rgba(13,43,94,.28); transition: background .18s, color .18s, transform .18s, box-shadow .18s; }
.hs-arrow:hover { background: var(--navy); color: #fff; transform: translateY(-50%) scale(1.09); box-shadow: 0 10px 28px rgba(13,43,94,.36); }
.hs-arrow:active { transform: translateY(-50%) scale(1.02); }
.hs-prev { left: 64px; } .hs-next { right: 24px; }
.hs-dots { position: absolute; bottom: 16px; left: 0; right: 0; display: flex; gap: .5rem; justify-content: center; z-index: 4; }
.hs-dot { width: 11px; height: 11px; border-radius: 50%; border: none; background: rgba(255,255,255,.6); cursor: pointer; padding: 0; transition: background .15s, width .15s; }
.hs-dot.is-active { background: #fff; width: 26px; border-radius: 999px; }

@media (max-width: 1100px) {
    .hs-inner { padding-left: 62px; }
}
@media (max-width: 767px) {
    .hs-arrow { display: none; }
    .hs-stage { aspect-ratio: 3 / 2; }
}

@media (prefers-reduced-motion: reduce) {
    .cat-panel, .cat-sub { transition: none; }
}

/* =================== BARRA INFORMATIVA INFINITA =================== */
.info-bar { overflow: hidden; border-bottom: 1px solid var(--line); background: var(--surface); }
.info-track { display: flex; width: max-content; animation: info-marquee 28s linear infinite !important; }
.info-bar:hover .info-track, .info-bar.is-paused .info-track { animation-play-state: paused; }
@keyframes info-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.info-block { flex: 0 0 auto; width: 360px; height: 88px; display: flex; align-items: center; gap: .9rem; padding: 0 1.5rem; text-decoration: none; }
.info-block:hover .info-title { text-decoration: underline; }
.info-ico { font-size: 1.9rem; line-height: 1; flex-shrink: 0; }
.info-text { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.info-title { font-weight: 800; font-size: .95rem; letter-spacing: .02em; }
.info-desc { font-size: .84rem; opacity: .82; line-height: 1.2; }

@media (max-width: 900px) { .info-block { width: 320px; height: 82px; } }
@media (max-width: 640px) { .info-block { width: 300px; height: 72px; } .info-ico { font-size: 1.6rem; } .info-title { font-size: .88rem; } .info-desc { font-size: .78rem; } }
/* La barra de info corre siempre (excepción reduce-motion, ver nota en .promo-bar). */

/* =================== CARRUSEL INFINITO DE CATEGORÍAS =================== */
.catcar-section { padding-top: 20px; padding-bottom: 8px; }
.catcar {
    overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -ms-overflow-style: none;
    cursor: grab; padding: 6px clamp(16px, 3vw, 40px) 18px; -webkit-overflow-scrolling: touch;
}
.catcar::-webkit-scrollbar { display: none; }
.catcar.dragging { cursor: grabbing; }
.catcar.dragging a { pointer-events: none; }
.catcar-track { display: flex; gap: 18px; width: max-content; }

.catcar-card {
    flex: 0 0 230px; width: 230px; background: var(--surface); border: 1px solid var(--line);
    border-radius: 22px; overflow: hidden; box-shadow: var(--shadow-sm); color: var(--ink);
    text-decoration: none; transition: transform .2s ease, box-shadow .2s ease;
}
.catcar-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.catcar-img { height: 200px; overflow: hidden; background: var(--canvas); display: flex; align-items: center; justify-content: center; }
.catcar-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.catcar-card:hover .catcar-img img { transform: scale(1.06); }
.catcar-img-fallback { font-size: 3.4rem; }
.catcar-body { padding: .9rem 1.1rem 1.1rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.catcar-name { font-weight: 800; font-size: 1.05rem; color: var(--navy); line-height: 1.15; }
.catcar-sub { color: var(--ink-soft); font-size: .88rem; margin-top: .15rem; }
.catcar-arrow { color: var(--gold); font-weight: 800; font-size: 1.25rem; flex-shrink: 0; }

@media (max-width: 1100px) { .catcar-card { flex-basis: 205px; width: 205px; } .catcar-img { height: 185px; } }
@media (max-width: 640px)  { .catcar-card { flex-basis: 165px; width: 165px; } .catcar-img { height: 150px; } }

/* (Las tarjetas de administración del slider se estilizan en app.css, porque el
    panel usa el layout admin que carga app.css, no home-nav.css.) */
