/* ============================================================
   LFIM — Actividades extraescolares · estilos
   Usa los tokens de styles.css (:root). Mobile-first.
   ============================================================ */
.lfim-act { display: block; }
.lfim-act__wrap { padding-top: 34px; padding-bottom: 40px; }

/* Deja sitio a la barra fija de totales: separa el footer y sube el
   lanzador del chatbot para que no se solapen en la esquina. */
body.has-act-bar { padding-bottom: 78px; }
body.has-act-bar .lfim-chat-launcher { bottom: 100px; }
@media (max-width: 760px) { body.has-act-bar .lfim-chat-launcher { bottom: 94px; } }

/* ---- cabecera de página (reusa .page-hero) ---- */
.lfim-act__hero .page-hero__lead { max-width: 760px; }

/* ---- plazos de inscripción del trimestre ---- */
.lfim-act__plazos {
  margin: 0 0 26px; padding: 20px 22px; background: var(--white); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 14px 34px rgba(22, 48, 74, .07);
}
.lfim-act__plazos h2 { font-family: 'Cormorant Garamond', serif; font-weight: 700; font-size: 24px; line-height: 1.2; margin: 0 0 14px; color: var(--ink); }
.plazos__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 760px) { .plazos__list { grid-template-columns: repeat(3, 1fr); } }
.plazo { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 13px 15px; border-radius: 12px; background: var(--cream); border-left: 3px solid var(--accent); }
.plazo--fecha { border-left-color: var(--ochre); }
.plazo__k { font-size: 12px; font-weight: 700; color: var(--accent-d); }
.plazo__big { font-size: 20px; font-weight: 800; line-height: 1.2; color: var(--ink); }
.plazo__t { font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.plazo__t a { color: var(--accent-d); font-weight: 700; overflow-wrap: anywhere; }
.plazos__foot { margin: 12px 0 0; font-size: 12.5px; color: var(--ink-2); }
@media (max-width: 599px) { .lfim-act__plazos { padding: 16px; } }

/* ---- grid de hijos ---- */
.lfim-act__grid {
  display: grid; grid-template-columns: 1fr; gap: 22px;
}
@media (min-width: 920px) { .lfim-act__grid { grid-template-columns: 1fr 1fr; } }

/* ---- tarjeta de un hijo ---- */
.actcard {
  background: var(--white); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 14px 34px rgba(22, 48, 74, .07); overflow: hidden; display: flex; flex-direction: column;
}
.actcard__head {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  background: linear-gradient(180deg, var(--accent-soft), #fff); border-bottom: 1px solid var(--line);
}
.actcard__dot { width: 13px; height: 13px; border-radius: 50%; background: var(--dot, var(--sea)); flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--dot, var(--sea)) 22%, transparent); }
.actcard__name {
  flex: 1; min-width: 0; font: inherit; font-weight: 600; font-size: 15px; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px;
}
.actcard__name::placeholder { color: var(--ink-2); font-weight: 500; opacity: .7; }
.actcard__level {
  font: inherit; font-weight: 700; font-size: 14px; color: var(--accent);
  background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; cursor: pointer; flex: none; max-width: 42%;
}
.actcard__remove {
  flex: none; width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); cursor: pointer; font-size: 15px; line-height: 1; transition: .15s;
}
.actcard__remove:hover { background: #fbeae2; color: var(--terr-d); border-color: var(--terr); }

.actcard__body { padding: 6px 14px 12px; }
.actcard__empty { padding: 26px 10px; text-align: center; color: var(--ink-2); font-size: 14px; font-style: italic; }
.actcard__ludo-note { font-size: 12px; color: var(--ink-2); margin: 4px 2px 10px; line-height: 1.5; }

/* ---- encabezados de franja ---- */
.franja-h {
  font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2);
  margin: 16px 2px 8px; padding-bottom: 5px; border-bottom: 1px dashed var(--line);
  display: flex; align-items: center; gap: 7px;
}
.franja-h::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--sea); flex: none; }
.franja-h--aft::before { background: var(--ochre); }
.franja-h--fri::before { background: var(--bougain); }
.franja-h--ludo::before { background: var(--terr); }

/* ---- fila de actividad / bono ---- */
.actrow {
  display: flex; align-items: flex-start; gap: 11px; padding: 9px 10px; border-radius: 11px;
  border: 1px solid transparent; cursor: pointer; transition: background .14s, border-color .14s;
}
.actrow:hover { background: var(--accent-soft); }
.actrow.is-sel { background: var(--accent-soft); border-color: var(--accent); }
.actrow.is-locked { opacity: .5; cursor: not-allowed; }
.actrow.is-locked:hover { background: transparent; }
.actrow__cb { margin-top: 2px; width: 18px; height: 18px; flex: none; accent-color: var(--accent); cursor: pointer; }
.actrow.is-locked .actrow__cb { cursor: not-allowed; }
.actrow__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.actrow__name { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.3; display: inline; }
.actrow__meta { font-size: 11.5px; color: var(--ink-2); line-height: 1.35; }
.actrow__nota { font-size: 11px; color: var(--terr-d); font-style: italic; line-height: 1.35; margin-top: 1px; }
.actrow__price { flex: none; text-align: right; font-size: 13.5px; font-weight: 800; color: var(--ink); white-space: nowrap; }
.actrow__price small { display: block; font-weight: 600; font-size: 10.5px; color: var(--ink-2); }
.actrow__lockico { display: none; margin-left: 4px; }
.actrow.is-locked .actrow__lockico { display: inline; }

/* badges */
.badge { display: inline-block; font-size: 9.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 1px 6px; border-radius: 999px; vertical-align: middle; margin-left: 4px; }
.badge--en { background: var(--sea); color: #fff; }
.badge--warn { background: #f8ebdf; color: var(--terr-d); border: 1px solid var(--ochre); text-transform: none; letter-spacing: .02em; }

/* ---- ofertas combo ---- */
.combo-box { margin: 14px 0 4px; background: #fbf6ea; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; }
.combo-box__title { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; }
.combo { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; padding: 6px 0; }
.combo + .combo { border-top: 1px dashed var(--line); }
.combo__name { flex: 1; min-width: 130px; font-size: 13px; font-weight: 600; color: var(--ink); }
.combo__price { font-size: 13px; font-weight: 800; color: var(--terr-d); }
.combo__price small { font-weight: 600; color: var(--ink-2); text-decoration: line-through; }
.combo__btn { font: inherit; font-weight: 700; font-size: 12px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--accent); background: #fff; color: var(--accent); cursor: pointer; transition: .15s; }
.combo__btn:hover { background: var(--accent); color: #fff; }
.combo.is-applied .combo__btn { background: var(--accent); color: #fff; }

/* ---- coste compacto (pie de tarjeta) ---- */
.actcard__cost { margin-top: auto; padding: 12px 16px; background: var(--cream); border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; }
.actcard__cost-empty { font-size: 12.5px; color: var(--ink-2); font-style: italic; }
.cost-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); }
.cost-row--disc { color: var(--terr-d); font-weight: 600; }
.cost-row--total { font-weight: 800; color: var(--ink); font-size: 14.5px; padding-top: 4px; margin-top: 2px; border-top: 1px solid var(--line); }
.cost-row--mat { font-size: 12px; font-style: italic; }

/* ---- añadir hijo ---- */
.lfim-act__add-wrap { margin: 22px 0 8px; }
.lfim-act__add {
  width: 100%; padding: 15px; border-radius: 13px; border: 2px dashed var(--accent);
  background: var(--accent-soft); color: var(--accent-d); font: inherit; font-weight: 800; font-size: 15px; cursor: pointer; transition: .15s;
}
.lfim-act__add:hover { background: #dbe8f6; }

/* ---- aviso de salida coordinada ---- */
.lfim-act__exit-wrap:empty { display: none; }
.lfim-act__exit { display: flex; gap: 13px; align-items: flex-start; margin: 22px 0; padding: 15px 17px; border-radius: 14px; border: 1px solid; }
.lfim-act__exit .exit__ico { font-size: 18px; flex: none; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.lfim-act__exit strong { display: block; font-size: 15px; margin-bottom: 2px; }
.lfim-act__exit p { margin: 0; font-size: 13px; line-height: 1.5; }
.lfim-act__exit.is-ok { background: #ecf6ee; border-color: #b6dcbf; color: #235c33; }
.lfim-act__exit.is-ok .exit__ico { background: #cbe9d2; color: #235c33; }
.lfim-act__exit.is-warn { background: #fdf4e6; border-color: var(--ochre); color: #7a4d16; }
.lfim-act__exit.is-warn .exit__ico { background: #f6e2bf; color: #7a4d16; }
.exit__days { margin: 8px 0 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.exit__days li { font-size: 13px; }
.exit__days li::first-letter { text-transform: uppercase; }
.exit__days li span { color: var(--ink); font-weight: 700; margin-left: 4px; }

/* ---- semana de un vistazo (horario visual) ---- */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.lfim-act__week {
  --hour-h: 84px;
  margin: 22px 0; padding: 20px 22px; background: var(--white); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 14px 34px rgba(22, 48, 74, .07);
}
.lfim-act__week:empty { display: none; }
.week__head { margin-bottom: 14px; }
.week__head h2 { font-family: 'Cormorant Garamond', serif; font-weight: 700; font-size: 28px; margin: 0; color: var(--ink); }
.week__lead { margin: 4px 0 0; font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.week__empty { margin: 0; font-size: 14px; color: var(--ink-2); font-style: italic; }

/* contenedor con scroll horizontal en móvil: la rejilla nunca fuerza el ancho de la página */
.week__scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -6px; padding: 0 6px; }
/* ancho mínimo: crece con el nº máximo de carriles (hijos) que coinciden un mismo día,
   para que la línea de hora ("13h10–13h55", ~63px) nunca se trunque en móvil */
.week__grid { display: grid; grid-template-columns: 42px repeat(5, minmax(0, 1fr)); min-width: max(640px, calc(42px + 5 * var(--lanes, 1) * 86px)); padding-bottom: 10px; }
.week__dayh {
  font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2);
  text-align: center; padding: 0 4px 7px; border-bottom: 1px dashed var(--line);
}
.week__dayh-short { display: none; }
.week__hours { position: relative; height: calc(var(--hours, 6) * var(--hour-h)); }
.week__hour { position: absolute; right: 8px; transform: translateY(-50%); font-size: 10.5px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.week__day {
  position: relative; height: calc(var(--hours, 6) * var(--hour-h));
  display: flex; gap: 3px; padding: 0 3px; border-left: 1px solid var(--line);
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--hour-h) - 1px), var(--line) calc(var(--hour-h) - 1px), var(--line) var(--hour-h));
}
.week__day:last-child { border-right: 1px solid var(--line); }
.week__lane { flex: 1 1 0; min-width: 0; position: relative; }
.week__blk {
  position: absolute; left: 0; right: 0; overflow: hidden;
  display: flex; flex-direction: column; gap: 1px; padding: 4px 6px 4px 7px; border-radius: 7px;
  border-left: 3px solid var(--dot, var(--sea));
  background: color-mix(in srgb, var(--dot, var(--sea)) 14%, white);
  color: var(--ink); font-size: 11.5px; line-height: 1.2;
}
/* nombre del hijo en su color, oscurecido hacia --ink para garantizar ≥4.5:1 (peor caso: ocre) */
.week__blk-who { font-size: 11px; font-weight: 800; color: color-mix(in srgb, var(--dot, var(--sea)) 55%, var(--ink)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.week__blk-what { font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.week__blk-when { font-size: 10.5px; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }

.week__foot { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 7px; }
.week__line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.week__lbl { font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.week__legend ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.week__legend li { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink); }
.week__legend small { font-size: 11px; font-weight: 800; color: var(--accent); background: var(--accent-soft); padding: 0 7px; border-radius: 999px; }
.week__dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.week__item b { color: var(--ink); font-weight: 800; }
.week__item small { font-size: 11.5px; }
.week__sep { margin: 0 7px; opacity: .55; }
@media (max-width: 599px) {
  .lfim-act__week { padding: 16px 14px; }
  .week__dayh-long { display: none; }
  .week__dayh-short { display: inline; }
}

/* ---- resumen ---- */
.lfim-act__summary { margin: 22px 0; background: var(--white); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 14px 34px rgba(22, 48, 74, .07); padding: 20px 22px; }
.sum__head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.sum__head h2 { font-family: 'Cormorant Garamond', serif; font-weight: 700; font-size: 28px; margin: 0; color: var(--ink); }
.sum__actions { display: flex; gap: 9px; }
.sum__btn { font: inherit; font-weight: 700; font-size: 13.5px; padding: 9px 15px; border-radius: 10px; border: none; background: var(--accent); color: #fff; cursor: pointer; transition: .15s; }
.sum__btn:hover { background: var(--accent-d); }
.sum__btn--ghost { background: #fff; color: var(--accent); border: 1px solid var(--accent); }
.sum__btn--ghost:hover { background: var(--accent-soft); }
.sum__empty { color: var(--ink-2); font-style: italic; }

.sum__children { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 720px) { .sum__children { grid-template-columns: 1fr 1fr; } }
.sum__child { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; break-inside: avoid; }
.sum__child-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.sum__dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.sum__child-head strong { font-size: 15px; color: var(--ink); }
.sum__lvl { font-size: 11px; font-weight: 800; color: var(--accent); background: var(--accent-soft); padding: 1px 8px; border-radius: 999px; }
.sum__child-total { margin-left: auto; font-weight: 800; color: var(--ink); font-size: 14px; }
.sum__items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.sum__item { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--ink); }
.sum__item small { color: var(--ink-2); font-size: 11px; }
.sum__item em { color: var(--terr-d); font-style: normal; font-weight: 700; font-size: 11px; }
.sum__item--bono { color: var(--ink-2); }
.sum__item--empty { color: var(--ink-2); font-style: italic; }
.sum__matline { margin-top: 8px; font-size: 11.5px; font-style: italic; color: var(--ink-2); }

.sum__foot { margin-top: 18px; padding-top: 14px; border-top: 2px solid var(--ink); display: flex; flex-direction: column; gap: 6px; max-width: 420px; margin-left: auto; }
.sum__foot-row { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-2); }
.sum__foot-row--disc { color: var(--terr-d); font-weight: 600; }
.sum__foot-row--grand { font-weight: 800; font-size: 18px; color: var(--ink); padding-top: 6px; border-top: 1px solid var(--line); }
.sum__foot-row--mat { font-size: 12.5px; font-style: italic; }

/* ---- notas ---- */
.lfim-act__notes { margin: 22px 0; padding: 16px 18px; background: var(--accent-soft); border: 1px solid var(--line); border-radius: 14px; }
.lfim-act__notes-title { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-d); margin-bottom: 8px; }
.lfim-act__notes ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.lfim-act__notes li { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }

/* ---- barra de totales fija ---- */
.lfim-act-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 200; background: var(--ink); color: #fff; box-shadow: 0 -10px 30px rgba(22, 48, 74, .28); padding: 11px 0 calc(11px + env(safe-area-inset-bottom, 0px)); }
.lfim-act-bar__inner { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.lfim-act-bar__total { display: flex; flex-direction: column; line-height: 1.15; }
.lfim-act-bar__lbl { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #b9cbe0; }
.lfim-act-bar__val { font-size: 22px; font-weight: 800; }
.lfim-act-bar__mat { font-size: 11px; color: #cbd9ea; }
.lfim-act-bar__mat:empty { display: none; }
.lfim-act-bar__btns { display: flex; gap: 9px; }
.lfim-act-bar__btn { font: inherit; font-weight: 800; font-size: 14px; padding: 11px 18px; border-radius: 10px; border: none; background: var(--ochre); color: var(--ink); cursor: pointer; transition: .15s; }
.lfim-act-bar__btn:hover { background: var(--gold); }
.lfim-act-bar__btn--ghost { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .4); }
.lfim-act-bar__btn--ghost:hover { background: rgba(255, 255, 255, .12); }
@media (max-width: 560px) { .lfim-act-bar__val { font-size: 19px; } .lfim-act-bar__btn { padding: 10px 13px; font-size: 13px; } }

/* ---- impresión / PDF ---- */
@media print {
  .util, .header, .footer, .azulejo, .lfim-act__hero, .lfim-act__plazos, .lfim-act__grid,
  .lfim-act__add-wrap, .lfim-act-bar, .sum__actions, .lfim-book-overlay, #lfim-chatbot { display: none !important; }
  body { background: #fff !important; }
  .lfim-act__wrap { padding: 0 !important; }
  .lfim-act__summary { box-shadow: none; border: 1px solid #ccc; margin: 0 0 14px; }
  .lfim-act__exit { box-shadow: none; }
  .sum__children { grid-template-columns: 1fr 1fr; }
  .sum__child { break-inside: avoid; }
  /* horario semanal: una sola página, sin sombras, colores de bloque preservados */
  .lfim-act__week { --hour-h: 60px; box-shadow: none; border: 1px solid #ccc; margin: 0 0 14px; padding: 14px 16px; break-inside: avoid; page-break-inside: avoid; }
  .week__scroll { overflow: visible; margin: 0; padding: 0; }
  .week__grid { min-width: 0; }
  .week__dayh-long { display: inline !important; }
  .week__dayh-short { display: none !important; }
  .week__blk { -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 10px; padding: 2px 5px; gap: 0; }
  .week__blk-what { -webkit-line-clamp: 1; }
  .week__blk-when { font-size: 9.5px; }
}
