/* Cusco Creativos · Disponibilidad de Tours — calendario y panel de venta presencial */

.tocc {
    --tocc-navy: #001e4e;
    --tocc-red: #a4270b;
    --tocc-red-dark: #86200a;
    --tocc-text: #1f2937;
    --tocc-muted: #64748b;
    --tocc-border: rgba(0, 30, 78, 0.08);
    width: 100%;
    min-width: 0; /* dentro de un flex (portada en móvil) no debe ensanchar la página */
    max-width: 800px;
    margin: 0 auto;
    box-sizing: border-box;
    font-family: 'Archivo', system-ui, -apple-system, sans-serif;
    color: var(--tocc-text);
    text-align: left;
}
.tocc *, .tocc *::before, .tocc *::after { box-sizing: border-box; }
.tocc--wide { max-width: 1100px; }

/* ---------- Pestañas principales (una sola fila) ---------- */
.tocc-nav {
    display: grid;
    grid-template-columns: repeat(var(--tocc-tabs, 4), minmax(0, 1fr));
    gap: 8px;
    margin: 0 auto 22px;
    padding: 6px;
    border-radius: 16px;
    background: #f1f5f9;
}
.tocc-nav__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 8px 10px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #475569;
    font: 700 14px/1.2 'Archivo', system-ui, sans-serif;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.25s, color 0.25s, box-shadow 0.25s;
}
.tocc-nav__btn:hover { background: #e2e8f0; color: var(--tocc-navy); }
.tocc-nav__btn.is-active { background: var(--tocc-navy); color: #fff; box-shadow: 0 6px 16px rgba(0, 30, 78, 0.2); }
.tocc-nav__btn:focus-visible, .tocc-sub__btn:focus-visible, .tocc-alert:focus-visible, .tocc-month-select:focus-visible {
    outline: 3px solid rgba(164, 39, 11, 0.35);
    outline-offset: 2px;
}
.tocc-dot {
    width: 8px;
    height: 8px;
    flex: none;
    border-radius: 50%;
    background: #ef4444;
    animation: toccPulseRing 1.6s infinite;
}
@keyframes toccPulseRing {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55); }
    70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
@media (max-width: 640px) {
    .tocc-nav { display: flex; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    .tocc-nav::-webkit-scrollbar { display: none; }
    .tocc-nav__btn { flex: 0 0 auto; padding: 8px 14px; font-size: 13px; }
}

/* ---------- Sub-pestañas (circuitos de Machu Picchu) ---------- */
.tocc-sub { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 16px; }
.tocc-sub__btn {
    padding: 8px 18px;
    border: 1px solid rgba(0, 30, 78, 0.1);
    border-radius: 999px;
    background: #fff;
    color: var(--tocc-navy);
    font: 600 13px/1.3 'Archivo', system-ui, sans-serif;
    cursor: pointer;
    transition: all 0.2s;
}
.tocc-sub__btn:hover { border-color: rgba(0, 30, 78, 0.3); background: #f8fafc; }
.tocc-sub__btn.is-active { background: rgba(164, 39, 11, 0.08); border-color: var(--tocc-red); color: var(--tocc-red); }

.tocc-panel, .tocc-pane { display: none; }
.tocc-panel.is-active, .tocc-pane.is-active { display: block; animation: toccFade 0.3s ease; }
@keyframes toccFade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

/* ---------- Barra: leyenda + aviso de venta presencial ---------- */
.tocc-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.tocc-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--tocc-muted); }
.tocc-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tocc-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.tocc-alert {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border: 1px solid #fecaca;
    border-radius: 999px;
    background: #fef2f2;
    color: #b91c1c;
    font: 700 13px/1.3 'Archivo', system-ui, sans-serif;
    cursor: pointer;
    transition: all 0.2s;
}
.tocc-alert:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.tocc-alert .tocc-dot { background: currentColor; }
@media (max-width: 640px) {
    .tocc-toolbar { flex-direction: column-reverse; align-items: stretch; }
    .tocc-alert { justify-content: center; }
    .tocc-legend { justify-content: center; }
}

.tocc-updated { margin: 10px 0 0; font-size: 12px; color: var(--tocc-muted); text-align: center; }
.tocc-updated.is-stale { color: #92400e; }
.tocc-empty {
    padding: 28px 20px;
    border: 1px dashed rgba(0, 30, 78, 0.15);
    border-radius: 20px;
    background: #f8fafc;
    color: #475569;
    text-align: center;
}
.tocc-empty strong { display: block; margin-bottom: 6px; font-size: 16px; color: var(--tocc-navy); }

/* ---------- Calendario (flatpickr) ---------- */
.tocc .flatpickr-calendar.inline {
    width: 100% !important;
    max-width: 100% !important;
    padding: 16px;
    border: 1px solid var(--tocc-border);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0, 30, 78, 0.06) !important;
}
.tocc .flatpickr-innerContainer, .tocc .flatpickr-rContainer, .tocc .flatpickr-days, .tocc .dayContainer {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
}
.tocc .flatpickr-months { align-items: center; margin-bottom: 10px; }
.tocc .flatpickr-months .flatpickr-month { height: 48px; overflow: visible; }
.tocc .flatpickr-current-month { display: none !important; } /* se usa el selector propio de mes y año */
.tocc-month-picker { position: absolute; top: 4px; left: 64px; right: 64px; display: flex; justify-content: center; }
.tocc-month-select {
    width: 100%;
    max-width: 340px;
    height: 44px;
    margin: 0;
    padding: 0 44px 0 18px;
    border: 1.5px solid rgba(0, 30, 78, 0.14);
    border-radius: 999px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' fill='%23a4270b'%3E%3Cpath d='M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z'/%3E%3C/svg%3E") no-repeat right 16px center / 14px;
    box-shadow: 0 2px 8px rgba(0, 30, 78, 0.06);
    color: var(--tocc-navy);
    font: 700 15px/1 'Archivo', system-ui, sans-serif;
    text-overflow: ellipsis;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.tocc-month-select:hover { border-color: var(--tocc-navy); box-shadow: 0 0 0 3px rgba(0, 30, 78, 0.1); }
.tocc-month-select optgroup { font-weight: 800; color: var(--tocc-red); }
.tocc-month-select option { font-weight: 600; color: #111827; }
.tocc-month-select option:disabled { color: #9ca3af; }
@media (max-width: 640px) {
    .tocc-month-picker { left: 52px; right: 52px; }
    .tocc-month-select { height: 40px; padding: 0 36px 0 12px; background-position: right 12px center; font-size: 13px; }
}
.tocc .flatpickr-prev-month, .tocc .flatpickr-next-month {
    top: 20px !important;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0 !important;
    border: 1px solid rgba(0, 30, 78, 0.12);
    border-radius: 50%;
    background: #fff;
    transition: all 0.2s;
}
.tocc .flatpickr-prev-month { left: 16px !important; }
.tocc .flatpickr-next-month { right: 16px !important; }
.tocc .flatpickr-prev-month svg, .tocc .flatpickr-next-month svg { width: 12px; height: 12px; fill: var(--tocc-navy); }
.tocc .flatpickr-prev-month:hover, .tocc .flatpickr-next-month:hover { background: var(--tocc-navy); border-color: var(--tocc-navy); }
.tocc .flatpickr-prev-month:hover svg, .tocc .flatpickr-next-month:hover svg { fill: #fff; }
.tocc .flatpickr-prev-month.flatpickr-disabled, .tocc .flatpickr-next-month.flatpickr-disabled { display: none; }
.tocc span.flatpickr-weekday { color: #94a3b8; font: 700 12px 'Archivo', system-ui, sans-serif; text-transform: uppercase; letter-spacing: 0.04em; }
.tocc .flatpickr-day {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-basis: auto !important;
    width: calc(100% / 7 - 4px) !important;
    max-width: calc(100% / 7 - 4px) !important;
    height: auto !important;
    min-height: 70px;
    margin: 2px !important;
    padding: 6px;
    border: 1px solid transparent;
    border-radius: 10px !important;
    color: #374151;
    font: 700 14px/1.1 'Archivo', system-ui, sans-serif;
    line-height: unset !important;
    transition: all 0.2s;
}
@media (max-width: 768px) {
    .tocc .flatpickr-day { min-height: 55px; }
    .tocc .flatpickr-calendar.inline { padding: 10px; }
}
.tocc-badge { margin-top: 4px; font-size: 11px; font-weight: 700; line-height: 1; white-space: nowrap; }
.tocc .flatpickr-day.tocc-high:not(.flatpickr-disabled) { background: #f0fdf4 !important; border-color: #bbf7d0 !important; color: #16a34a !important; }
.tocc .flatpickr-day.tocc-med:not(.flatpickr-disabled) { background: #fefce8 !important; border-color: #fef08a !important; color: #ca8a04 !important; }
.tocc .flatpickr-day.tocc-low:not(.flatpickr-disabled) { background: #fef2f2 !important; border-color: #fecaca !important; color: #ef4444 !important; }
.tocc-high .tocc-badge { color: #16a34a; }
.tocc-med .tocc-badge { color: #ca8a04; }
.tocc-low .tocc-badge { color: #ef4444; animation: toccBlink 1.5s ease-in-out infinite; }
.tocc-out .tocc-badge { color: #94a3b8; }
.tocc-unknown .tocc-badge { color: #94a3b8; font-weight: 600; }
@keyframes toccBlink { 50% { opacity: 0.55; } }
.tocc .flatpickr-day.flatpickr-disabled { background: #f9fafb !important; border-color: transparent !important; color: #cbd5e1 !important; }
.tocc .flatpickr-day:not(.flatpickr-disabled):hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06); filter: brightness(0.96); }

/* ---------- Panel en vivo de venta presencial ---------- */
.tocc-live__head { max-width: 640px; margin: 0 auto 22px; text-align: center; }
.tocc-live__badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    border-radius: 999px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.tocc-live__badge .tocc-dot { background: #dc2626; }
.tocc-live__title { margin: 12px 0 8px; color: var(--tocc-navy); font-size: clamp(20px, 3vw, 26px); font-weight: 800; line-height: 1.2; }
.tocc-live__intro { margin: 0; color: #4b5563; font-size: 14px; line-height: 1.6; }
.tocc-live__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.tocc-live__day { padding: 18px; border: 1px solid var(--tocc-border); border-radius: 18px; background: #fff; box-shadow: 0 10px 30px rgba(0, 30, 78, 0.06); }
.tocc-live__date { display: flex; flex-direction: column; gap: 2px; margin: 0 0 6px; }
.tocc-live__date span { color: var(--tocc-red); font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.tocc-live__date time { color: var(--tocc-navy); font-size: 18px; font-weight: 800; text-transform: capitalize; }
.tocc-live__total { margin: 0 0 14px; padding-bottom: 12px; border-bottom: 1px solid #f1f5f9; color: #6b7280; font-size: 13px; }
.tocc-live__total strong { color: var(--tocc-navy); font-size: 16px; }
.tocc-live__seen { display: block; margin-top: 3px; color: #16a34a; font-size: 11px; }
.tocc-live__seen.is-presale { color: #1d4ed8; }
.tocc-live__seen.is-out { color: #b91c1c; }
.tocc-live__seen.is-old { color: #b45309; }
.tocc-live__routes { display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 0; list-style: none; }
.tocc-live__route-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.tocc-live__route-name { color: #111827; font-size: 14px; font-weight: 700; }
.tocc-live__route-name small { display: block; color: #9ca3af; font-size: 11px; font-weight: 600; }
.tocc-live__count { color: #6b7280; font-size: 12px; white-space: nowrap; }
.tocc-live__count strong { font-size: 20px; font-weight: 800; }
.tocc-live__bar { height: 7px; margin: 7px 0 8px; overflow: hidden; border-radius: 999px; background: #eef2f7; }
.tocc-live__bar span { display: block; height: 100%; border-radius: 999px; }
.tocc-live__route-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tocc-live__level { font-size: 12px; font-weight: 700; }
.tocc-live__cta {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: var(--tocc-red);
    color: #fff !important;
    font: 700 13px/1 'Archivo', system-ui, sans-serif;
    text-decoration: none !important;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}
.tocc-live__cta:hover { background: var(--tocc-red-dark); transform: translateY(-1px); }
.tocc-live .is-high .tocc-live__count strong, .tocc-live .is-high .tocc-live__level { color: #15803d; }
.tocc-live .is-high .tocc-live__bar span { background: #22c55e; }
.tocc-live .is-med .tocc-live__count strong, .tocc-live .is-med .tocc-live__level { color: #b45309; }
.tocc-live .is-med .tocc-live__bar span { background: #f59e0b; }
.tocc-live .is-low .tocc-live__count strong, .tocc-live .is-low .tocc-live__level { color: #dc2626; }
.tocc-live .is-low .tocc-live__bar span { background: #ef4444; }
.tocc-live .is-low .tocc-live__level { animation: toccBlink 1.4s ease-in-out infinite; }
.tocc-live .is-out .tocc-live__count strong, .tocc-live .is-out .tocc-live__level,
.tocc-live .is-unknown .tocc-live__count strong, .tocc-live .is-unknown .tocc-live__level { color: #9ca3af; }
.tocc-live .is-out .tocc-live__bar span { background: #cbd5e1; }
.tocc-live .is-out .tocc-live__cta, .tocc-live .is-unknown .tocc-live__cta { border: 1px solid rgba(0, 30, 78, 0.2); background: #fff; color: var(--tocc-navy) !important; }
.tocc-live__help { margin: 18px 0 0; color: #4b5563; font-size: 14px; text-align: center; }
.tocc-live__help a { color: #15803d; font-weight: 700; }
@media (max-width: 860px) {
    .tocc-live__grid { grid-template-columns: 1fr; }
    .tocc-live__day { padding: 16px; }
}

/* ---------- Modal de reserva (sitios sin formulario propio) ---------- */
.tocc-booking[hidden] { display: none !important; }
.tocc-booking { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(0, 20, 45, 0.6); }
.tocc-booking__card { position: relative; width: min(100%, 420px); padding: 28px; border-radius: 18px; background: #fff; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25); color: var(--tocc-text); font-family: 'Archivo', system-ui, sans-serif; }
.tocc-booking__card h3 { margin: 0 36px 8px 0; color: var(--tocc-navy); font-size: 21px; }
.tocc-booking__card p { margin: 0 0 16px; line-height: 1.5; }
.tocc-booking__close { position: absolute; top: 12px; right: 14px; border: 0; background: transparent; color: #334155; font-size: 28px; line-height: 1; cursor: pointer; }
.tocc-booking__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.tocc-booking__actions a { display: inline-flex; align-items: center; justify-content: center; padding: 11px 16px; border-radius: 10px; background: #15803d; color: #fff; font-weight: 700; text-decoration: none; }
.tocc-booking__actions a:hover { background: #166534; color: #fff; }
.tocc-booking__actions a.is-email { background: var(--tocc-navy); }
.tocc-booking__actions a[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
    .tocc-dot, .tocc-low .tocc-badge, .tocc-live .is-low .tocc-live__level { animation: none; }
    .tocc-panel.is-active, .tocc-pane.is-active { animation: none; }
}
