/* ============================================================
   TICINO PLUS — HOJA DE ESTILOS
   ------------------------------------------------------------
   ÍNDICE
   1. Variables (colores, tipografía)  <- cambia colores aquí
   2. Base y utilidades
   3. Header + buscador + chips
   4. Hero
   5. Toolbar de filtros
   6. Tarjetas de video y grids
   7. Filas por categoría
   8. Sección para negocios (planes)
   9. Contacto y footer
   10. Modal del video
   11. Responsive
   ============================================================ */

/* ------------------------------------------------------------
   1. VARIABLES — cambia aquí los colores de toda la web
   ------------------------------------------------------------ */
:root {
  /* Colores de marca (tomados del logo Ticino Plus) */
  --rosso: #e2001a;        /* rojo suizo del logo */
  --rosso-scuro: #b50014;  /* rojo oscuro (hover) */
  --navy: #101b33;         /* azul oscuro del wordmark */
  --navy-profondo: #0a1226;/* azul casi negro (secciones oscuras) */

  /* Neutros */
  --bg: #f4f6fa;           /* fondo general */
  --surface: #ffffff;      /* tarjetas y header */
  --ink: #182238;          /* texto principal */
  --muted: #5c6678;        /* texto secundario */
  --line: #e3e7ee;         /* bordes finos */

  /* Tipografía */
  --font-display: "Outfit", sans-serif; /* títulos */
  --font-body: "Inter", sans-serif;     /* texto e interfaz */

  /* Otros */
  --radius: 16px;
  --shadow: 0 10px 30px rgba(16, 27, 51, 0.10);
  --shadow-soft: 0 2px 10px rgba(16, 27, 51, 0.07);
  --header-h: 68px;
}

/* ------------------------------------------------------------
   2. BASE
   ------------------------------------------------------------ */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; cursor: pointer; }

.container {
  width: min(1240px, 100% - 40px);
  margin-inline: auto;
}

.section { padding: 56px 0; }

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title--light { color: #fff; }
.section-sub { color: var(--muted); margin-top: 4px; }
.section-head { margin-bottom: 24px; }

/* Indicador de la conexión con el canal de YouTube */
.yt-status {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
}
.yt-status--ok   { background: #e6f6ec; color: #146c3c; border: 1px solid #bce5cc; }
.yt-status--warn { background: #fff6e5; color: #8a5a00; border: 1px solid #f3ddae; }

/* El "+" rojo del logo, usado como marca de sección */
.plus-mark {
  display: inline-grid;
  place-items: center;
  width: 30px; height: 30px;
  background: var(--rosso);
  color: #fff;
  border-radius: 9px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1;
  flex: none;
}

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}
.btn:active { transform: scale(0.97); }

.btn--primary { background: var(--rosso); color: #fff; }
.btn--primary:hover { background: var(--rosso-scuro); }

.btn--ghost { background: rgba(255,255,255,0.12); color: #fff; border-color: rgba(255,255,255,0.55); backdrop-filter: blur(4px); }
.btn--ghost:hover { background: rgba(255,255,255,0.22); }

.btn--outline { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn--outline:hover { background: var(--navy); color: #fff; }

.btn--reset { background: transparent; color: var(--muted); border: none; padding: 12px 10px; font-weight: 500; }
.btn--reset:hover { color: var(--rosso); }

:focus-visible { outline: 3px solid var(--rosso); outline-offset: 2px; border-radius: 6px; }

/* ------------------------------------------------------------
   3. HEADER
   ------------------------------------------------------------ */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  width: min(1400px, 100% - 32px);
  margin-inline: auto;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand-logo { width: 42px; height: 42px; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--navy);
  letter-spacing: -0.02em;
  line-height: 1.1;
  display: block;
}
.brand-name em { font-style: normal; color: var(--rosso); }
.brand-tagline {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* Buscador */
.search {
  flex: 1;
  max-width: 560px;
  display: flex;
  margin-inline: auto;
}
.search-input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 18px;
  border: 1.5px solid var(--line);
  border-right: none;
  border-radius: 999px 0 0 999px;
  font: inherit;
  font-size: 0.95rem;
  background: var(--bg);
  color: var(--ink);
}
.search-input:focus { outline: none; border-color: var(--navy); background: #fff; }
.search-btn {
  width: 58px;
  border: 1.5px solid var(--line);
  border-left: none;
  border-radius: 0 999px 999px 0;
  background: var(--navy);
  color: #fff;
  display: grid;
  place-items: center;
  transition: background 0.2s;
}
.search-btn:hover { background: var(--rosso); }

/* Nav */
.nav { display: flex; align-items: center; gap: 4px; flex: none; }
.nav-link {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
  transition: background 0.2s, color 0.2s;
}
.nav-link:hover { background: var(--bg); color: var(--rosso); }
.nav-link--cta { background: var(--rosso); color: #fff; }
.nav-link--cta:hover { background: var(--rosso-scuro); color: #fff; }

/* Chips de categorías (scroll horizontal) */
.chips-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px max(calc((100% - 1400px) / 2 + 16px), 16px);
  border-top: 1px solid var(--line);
  scrollbar-width: none;
  background: var(--surface);
}
.chips-bar::-webkit-scrollbar { display: none; }

.chip {
  flex: none;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.chip:hover { border-color: var(--navy); }
.chip.is-active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* Chips con icono redondo de la categoría */
.chip--icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 16px 5px 6px;
}
.chip-ico {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  line-height: 1;
  flex: none;
  box-shadow: 0 0 0 1px var(--line);
}
.chip.is-active .chip-ico { box-shadow: 0 0 0 1px rgba(255,255,255,0.35); }

/* ------------------------------------------------------------
   4. HERO
   ------------------------------------------------------------ */
.hero {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero-media {
  position: absolute; inset: 0;
  background: url("../assets/hero-bg.jpg") center 65% / cover no-repeat;
  transform: scale(1.02);
}
.hero-overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 18, 38, 0.88) 0%, rgba(10, 18, 38, 0.62) 45%, rgba(10, 18, 38, 0.18) 100%),
    linear-gradient(0deg, rgba(10, 18, 38, 0.55) 0%, transparent 40%);
}
.hero-content {
  position: relative;
  width: min(1240px, 100% - 40px);
  margin-inline: auto;
  padding: 72px 0;
  color: #fff;
  max-width: 1240px;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  margin-bottom: 18px;
}
.hero-eyebrow .plus-mark { width: 24px; height: 24px; border-radius: 7px; font-size: 1rem; }
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
  max-width: 14ch;
}
.hero-sub {
  margin-top: 16px;
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  color: rgba(255,255,255,0.88);
  max-width: 52ch;
}
.hero-actions { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 14px; }

/* ------------------------------------------------------------
   5. TOOLBAR DE FILTROS
   ------------------------------------------------------------ */
.toolbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}
.toolbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.toolbar-filters { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.select-wrap { display: flex; flex-direction: column; gap: 2px; }
.select-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.select {
  min-width: 200px;
  height: 42px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  font: inherit;
  font-size: 0.92rem;
  color: var(--ink);
  cursor: pointer;
}
.select:focus { outline: none; border-color: var(--navy); }

.toolbar-count { font-size: 0.9rem; color: var(--muted); font-weight: 500; }

/* ------------------------------------------------------------
   6. TARJETAS DE VIDEO
   ------------------------------------------------------------ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: 22px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

/* Miniatura 16:9 */
.card-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--navy);
  cursor: pointer;
  border: none;
  padding: 0;
  display: block;
  width: 100%;
  overflow: hidden;
}
.card-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.35s;
}
.card:hover .card-thumb img { transform: scale(1.05); }

/* Placeholder fotográfico si la miniatura de YouTube no carga */
.card-thumb .thumb-fallback {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: url("../assets/categorie/fallback.jpg") center / cover no-repeat;
}
.card-thumb .thumb-fallback::after {
  content: "";
  position: absolute; inset: 0;
  background: rgba(16, 27, 51, 0.35);
}
.thumb-fallback-logo {
  width: 54px; height: 54px;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
}

/* Botón de play superpuesto */
.card-thumb .play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.2s;
  background: rgba(10, 18, 38, 0.35);
}
.card:hover .play, .card-thumb:focus-visible .play { opacity: 1; }
.play-circle {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--rosso);
  display: grid; place-items: center;
  color: #fff;
  box-shadow: 0 8px 20px rgba(226, 0, 26, 0.45);
}

/* Badge "In evidenza" */
.badge-featured {
  position: absolute;
  top: 10px; left: 10px;
  background: var(--rosso);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

/* Etiqueta de zona sobre la miniatura */
.badge-zone {
  position: absolute;
  bottom: 10px; right: 10px;
  background: rgba(10, 18, 38, 0.82);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-category {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--rosso);
}
.card-title {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}
.card-business { font-size: 0.86rem; color: var(--muted); font-weight: 500; }
.card-actions { margin-top: auto; padding-top: 12px; display: flex; gap: 8px; }
.card-actions .btn { padding: 9px 16px; font-size: 0.85rem; flex: 1; }
.card-actions .btn--outline { border-width: 1.5px; }

.empty {
  padding: 40px 0;
  text-align: center;
  color: var(--muted);
  font-size: 1rem;
}

/* ------------------------------------------------------------
   7. FILAS POR CATEGORÍA (scroll horizontal tipo YouTube)
   ------------------------------------------------------------ */
.cat-row { padding: 34px 0 8px; }
.cat-row:nth-of-type(even) { background: #eef1f7; }

.cat-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.cat-row-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: -0.01em;
}
.cat-ico {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: #fde8ea;               /* rojo muy suave de la marca */
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  line-height: 1;
  flex: none;
  box-shadow: inset 0 0 0 1.5px #f6c2c9;
}

.link-all {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--rosso);
  white-space: nowrap;
  background: none;
  border: none;
  padding: 6px 0;
}
.link-all:hover { text-decoration: underline; }

.row-scroll {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 4px 4px 26px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.row-scroll .card {
  flex: 0 0 272px;
  scroll-snap-align: start;
}

/* ------------------------------------------------------------
   8. SECCIÓN PARA NEGOCIOS
   ------------------------------------------------------------ */
.section--business {
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.business-head { max-width: 720px; margin-bottom: 40px; }
.business-eyebrow {
  color: var(--rosso);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  margin-bottom: 10px;
}
.business-title {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.business-title span { color: var(--rosso); }
.business-text { margin-top: 14px; color: var(--muted); font-size: 1.02rem; }

.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.plan {
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--surface);
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}
.plan:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.plan-name { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; }
.plan-price {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--rosso);
  letter-spacing: -0.02em;
}
.plan-list { display: grid; gap: 8px; font-size: 0.92rem; color: var(--muted); flex: 1; }
.plan-list li { padding-left: 22px; position: relative; }
.plan-list li::before {
  content: "+";
  position: absolute; left: 0; top: -1px;
  color: var(--rosso);
  font-weight: 800;
  font-family: var(--font-display);
}

/* Plan destacado (fondo navy) */
.plan--featured {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.plan--featured .plan-name { color: #fff; }
.plan--featured .plan-list { color: rgba(255,255,255,0.8); }
.plan--featured .plan-price { color: #ff5b6e; }
.plan-badge {
  position: absolute;
  top: -12px; left: 24px;
  background: var(--rosso);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 5px 12px;
  border-radius: 999px;
}

/* ------------------------------------------------------------
   9. CONTACTO + FOOTER
   ------------------------------------------------------------ */
.section--contact {
  background: var(--navy-profondo);
  color: #fff;
}
.contact-sub { color: rgba(255,255,255,0.7); margin: 8px 0 30px; }

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.contact-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius);
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: background 0.2s, transform 0.2s, border-color 0.2s;
}
.contact-card:hover {
  background: rgba(255,255,255,0.12);
  border-color: var(--rosso);
  transform: translateY(-3px);
}
.contact-card svg { color: #ff5b6e; }
.contact-name { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.contact-detail { font-size: 0.86rem; color: rgba(255,255,255,0.65); }

.footer {
  background: var(--navy-profondo);
  border-top: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  padding: 30px 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-logo { width: 40px; height: 40px; }
.footer-name { font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; }
.footer-name em { font-style: normal; color: #ff5b6e; }
.footer-tag { font-size: 0.78rem; color: rgba(255,255,255,0.6); }
.footer-note, .footer-copy { font-size: 0.82rem; color: rgba(255,255,255,0.6); }

/* ------------------------------------------------------------
   10. MODAL DEL VIDEO
   ------------------------------------------------------------ */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(6, 10, 22, 0.82);
  backdrop-filter: blur(3px);
}
.modal-dialog {
  position: relative;
  width: min(880px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--surface);
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  animation: modal-in 0.25s ease;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
.modal-close {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 2;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(10, 18, 38, 0.7);
  color: #fff;
  font-size: 1rem;
  transition: background 0.2s;
}
.modal-close:hover { background: var(--rosso); }

.modal-player { aspect-ratio: 16 / 9; background: #000; }
.modal-player iframe { width: 100%; height: 100%; border: 0; display: block; }

.modal-info { padding: 22px 26px 28px; }
.modal-meta {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--rosso);
  margin-bottom: 6px;
}
.modal-title { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; line-height: 1.25; }
.modal-business { color: var(--muted); font-weight: 600; margin-top: 4px; }
.modal-desc { color: var(--muted); margin-top: 12px; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.modal-actions .btn { padding: 10px 18px; font-size: 0.88rem; }

body.modal-open { overflow: hidden; }

/* ------------------------------------------------------------
   11. RESPONSIVE
   ------------------------------------------------------------ */
@media (max-width: 1080px) {
  .brand-tagline { display: none; }
  .nav-link:not(.nav-link--cta) { display: none; } /* menú compacto: queda el CTA */
  .search { max-width: none; }
}

@media (max-width: 720px) {
  :root { --header-h: 60px; }

  .header-inner { gap: 10px; }
  .brand-name { font-size: 1.15rem; }
  .brand-logo { width: 36px; height: 36px; }

  .hero { min-height: 440px; }
  .hero-content { padding: 56px 0; }
  .hero-actions .btn { width: 100%; }

  .toolbar-inner { flex-direction: column; align-items: stretch; }
  .select { min-width: 0; width: 100%; }
  .select-wrap { flex: 1; }
  .toolbar-filters { width: 100%; }
  .toolbar-filters .select-wrap { flex: 1 1 40%; }

  .grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
  .row-scroll .card { flex-basis: 240px; }

  .section { padding: 42px 0; }
  .modal-info { padding: 18px 18px 24px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 420px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .card-actions { flex-direction: column; }
  .card-title { font-size: 0.92rem; }
  .card-body { padding: 12px; }
}

/* Accesibilidad: respeta la preferencia de menos animaciones */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
