/* ==========================================================================
   Malgusto Barber · Sistema visual
   Oscuro, con ámbar como único color. Pensado primero para el móvil.
   Lo usan la web del cliente (index.html) y el panel (admin.html).
   ========================================================================== */

@font-face {
    font-family: "Bricolage Grotesque";
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url("/static/fonts/bricolage-grotesque-latin.woff2") format("woff2");
}

@font-face {
    font-family: "DM Sans";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("/static/fonts/dm-sans-latin.woff2") format("woff2");
}

:root {
    --bg: #0d0e10;
    --surface: #16181b;
    --surface-2: #121416;
    --surface-3: #1d2024;
    --ink: #f0eeea;
    --ink-2: #c9c6bf;
    --muted: #8b8e93;
    --line: #25282c;
    --line-strong: #3a3e44;
    --accent: #f0a53c;
    --accent-strong: #ffb85a;
    --accent-ink: #17110a;
    --accent-soft: rgba(240, 165, 60, 0.12);
    --accent-glow: rgba(240, 165, 60, 0.55);
    --ok: #62d3a2;
    --ok-soft: rgba(98, 211, 162, 0.13);
    --danger: #ff8070;
    --danger-soft: rgba(255, 128, 112, 0.12);
    --radius: 18px;
    --radius-sm: 14px;
    --font-display: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --max: 720px;
    color-scheme: dark;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    /* Arrastrar hacia abajo con la página arriba no recarga ni «rebota» toda la pantalla. */
    overscroll-behavior-y: none;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ol, ul, dl, dd, fieldset {
    margin: 0;
    padding: 0;
}

button,
input,
select {
    font: inherit;
    color: inherit;
}

a {
    color: inherit;
}

img, svg {
    display: block;
    max-width: 100%;
}

ol, ul {
    list-style: none;
}

[hidden] {
    display: none !important;
}

/* Sin el resaltado azul/gris que el navegador del móvil dibuja al tocar, ni la barra de
   selección (copiar / buscar) al mantener pulsado o hacer doble toque sobre cualquier texto.
   Es una web de uso, no de lectura: nada se selecciona, salvo lo que se escribe en los
   campos. El feedback del toque lo dan los propios elementos (ver :active más abajo). */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

input,
textarea {
    -webkit-user-select: text;
    user-select: text;
}

button,
a,
label,
summary,
[role="button"],
[role="tab"] {
    touch-action: manipulation; /* también quita la espera del doble toque */
}


/* --------------------------------------------------------------------------
   Utilidades
   -------------------------------------------------------------------------- */

.wrap {
    width: 100%;
    max-width: var(--max);
    margin: 0 auto;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -60px;
    left: 16px;
    z-index: 100;
    padding: 9px 14px;
    background: var(--accent);
    color: var(--accent-ink);
    border-radius: 0 0 10px 10px;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
}

.skip-link:focus {
    top: 0;
}

.muted {
    color: var(--muted);
    font-size: 0.85rem;
}

code {
    padding: 1px 6px;
    border-radius: 6px;
    background: var(--surface-3);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.85em;
}

/* Campo trampa anti-bots: fuera de pantalla, no display:none. */
.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Botones
   -------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 22px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease,
                box-shadow 0.15s ease, scale var(--press, var(--press-out));
}

.btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-primary {
    background: var(--accent);
    color: var(--accent-ink);
    box-shadow: 0 10px 24px -12px var(--accent-glow);
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-strong);
}

.btn-secondary {
    background: var(--surface-3);
    color: var(--ink);
}

.btn-secondary:hover:not(:disabled) {
    background: #262a30;
}

.btn-ghost {
    background: transparent;
    border-color: var(--line-strong);
    color: var(--ink-2);
}

.btn-ghost:hover:not(:disabled) {
    border-color: var(--muted);
    color: var(--ink);
}

.btn-danger {
    background: transparent;
    border-color: rgba(255, 128, 112, 0.35);
    color: var(--danger);
}

.btn-danger:hover:not(:disabled) {
    background: var(--danger-soft);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    height: 38px;
    padding: 0 14px;
    font-size: 0.82rem;
}

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    padding: 0;
    color: var(--muted);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 12px;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

.icon-btn:hover:not(:disabled) {
    color: var(--ink);
    border-color: var(--line-strong);
}

.icon-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   Cabecera y pie
   -------------------------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    padding-top: env(safe-area-inset-top, 0px);
    background: rgba(13, 14, 16, 0.97);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 60px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-display);
    font-size: 1.3rem;
    letter-spacing: -0.04em;
    text-decoration: none;
}

.brand-name {
    font-weight: 800;
}

.brand-dot {
    width: 7px;
    height: 7px;
    margin-top: 6px;
    border-radius: 50%;
    background: var(--accent);
}

.brand-sub {
    margin-left: -2px;
    font-weight: 500;
    color: var(--muted);
}

/* La cabecera del cliente lleva la palabra del logo oficial en lugar del texto. */
.brand-logo {
    display: block;
    width: auto;
    height: 38px;
}

.nav-link {
    padding: 9px 12px;
    color: var(--ink-2);
    background: transparent;
    border: 0;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.nav-link:hover {
    color: var(--ink);
    background: var(--surface);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-tag {
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.site-footer {
    padding: 8px 0 calc(32px + env(safe-area-inset-bottom, 0px));
    color: var(--muted);
    font-size: 0.82rem;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.footer-inner a {
    color: var(--muted);
}

.footer-inner a:hover {
    color: var(--ink);
}

/* --------------------------------------------------------------------------
   Web del cliente
   -------------------------------------------------------------------------- */

.app {
    padding-top: 22px;
    padding-bottom: 150px; /* deja sitio a la barra fija de abajo */
}

/* En la web del cliente el pie va justo encima de la barra fija (si no, la barra lo tapa). */
.page-client .app {
    padding-bottom: 40px;
}

.page-client.has-bar .site-footer {
    padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
}

.page-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 9vw, 2.6rem);
    font-weight: 800;
    line-height: 1.04;
    letter-spacing: -0.04em;
    text-wrap: balance;
}

.page-title:focus {
    outline: none;
}

.page-sub {
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.95rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin: 0 0 12px -6px;
    padding: 8px 10px 8px 4px;
    color: var(--ink-2);
    background: transparent;
    border: 0;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.back-link:hover {
    color: var(--ink);
}

.back-link svg {
    width: 18px;
    height: 18px;
}

.steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 20px;
}

.steps li {
    position: relative;
    padding-top: 13px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.steps li::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 999px;
    background: var(--line);
    transition: background-color 0.2s ease;
}

.steps li.on {
    color: var(--ink);
}

.steps li.on::before {
    background: var(--accent);
}

.step-panel {
    margin-top: 22px;
}

/* Servicios */

.services {
    min-width: 0;
    border: 0;
}

.service-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.service-card {
    position: relative;
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 15px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.2s ease;
}

.service-card:hover {
    border-color: var(--line-strong);
}

.service-card input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.service-radio {
    position: relative;
    width: 24px;
    height: 24px;
    border: 2px solid var(--line-strong);
    border-radius: 50%;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.service-radio::after {
    content: "";
    position: absolute;
    left: 7px;
    top: 3px;
    width: 6px;
    height: 11px;
    border: solid var(--accent-ink);
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
    opacity: 0;
}

.service-card input:checked + .service-radio {
    background: var(--accent);
    border-color: var(--accent);
}

.service-card input:checked + .service-radio::after {
    opacity: 1;
}

.service-card:has(input:checked) {
    background: var(--accent-soft);
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), 0 14px 34px -18px var(--accent-glow);
}

.service-card:has(input:focus-visible) {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.service-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.service-name {
    font-size: 1rem;
    font-weight: 650;
    line-height: 1.3;
}

.service-meta {
    color: var(--muted);
    font-size: 0.84rem;
}

.service-price {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
}

/* Días y horas */

.day-strip {
    display: flex;
    gap: 8px;
    padding-bottom: 8px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
}

.day-strip::-webkit-scrollbar {
    display: none;
}

.day-card {
    flex: 0 0 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 11px 0 10px;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    scroll-snap-align: start;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.2s ease;
}

.day-card:hover {
    border-color: var(--line-strong);
}

.day-tag {
    font-size: 0.76rem;
    font-weight: 650;
    white-space: nowrap;
}

.day-number {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--ink);
}

.day-month {
    font-size: 0.74rem;
}

.day-card.is-selected {
    color: var(--accent-ink);
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 10px 26px -10px var(--accent-glow);
}

.day-card.is-selected .day-number {
    color: var(--accent-ink);
}

.slot-hint {
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.slot-summary {
    margin: 18px 0 12px;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 600;
}

.slot-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.slot-chip {
    height: 46px;
    padding: 0 4px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.2s ease;
}

.slot-chip:hover:not(:disabled) {
    border-color: var(--line-strong);
}

.slot-chip:disabled {
    color: #4b4f55;
    background: #111315;
    border-color: transparent;
    text-decoration: line-through;
    text-decoration-thickness: 1px;
    cursor: not-allowed;
}

.slot-chip.is-selected {
    color: var(--accent-ink);
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 10px 26px -10px var(--accent-glow);
}

.slot-chip.is-current:not(.is-selected) {
    border-color: var(--accent);
    border-style: dashed;
}

.slot-break {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 6px 0;
    color: var(--muted);
    font-size: 0.76rem;
    white-space: nowrap;
}

.slot-break::before,
.slot-break::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}

/* Datos y resumen */

.recap {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.recap-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
}

.recap-row:last-child {
    border-bottom: 0;
}

.recap-row dt {
    color: var(--muted);
    font-size: 0.9rem;
}

.recap-row dd {
    font-weight: 600;
    text-align: right;
}

.recap-total dd {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.form-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 22px;
}

.pay-note {
    margin-top: 18px;
    color: var(--muted);
    font-size: 0.86rem;
}

/* Formularios (cliente y panel) */

.field > label,
.field-label {
    display: block;
    margin-bottom: 7px;
    padding: 0;
    color: var(--ink-2);
    font-size: 0.82rem;
    font-weight: 600;
}

.field input:not([type="checkbox"]):not([type="radio"]) {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input::placeholder {
    color: #5d6168;
}

.field input:hover {
    border-color: #4a4f56;
}

.field input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Avisos */

.toast {
    margin-top: 16px;
    padding: 12px 14px;
    color: var(--ok);
    background: var(--ok-soft);
    border: 1px solid rgba(98, 211, 162, 0.28);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.45;
    animation: toast-in 0.2s ease;
}

.toast.is-error {
    color: var(--danger);
    background: var(--danger-soft);
    border-color: rgba(255, 128, 112, 0.3);
}

.app #message {
    position: sticky;
    top: 72px;
    z-index: 15;
    box-shadow: 0 14px 30px -16px rgba(0, 0, 0, 0.9);
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: none; }
}

/* Barra fija de abajo */

.bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(14px + env(safe-area-inset-bottom, 0px))
             max(16px, env(safe-area-inset-left, 0px));
    background: rgba(18, 20, 22, 0.98);
    border-top: 1px solid var(--line);
}

.bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    max-width: calc(var(--max) - 32px); /* alineada con el contenido de .wrap */
    margin: 0 auto;
}

.bar-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.bar-text strong {
    overflow: hidden;
    font-size: 0.98rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bar-text span {
    overflow: hidden;
    color: var(--muted);
    font-size: 0.82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bar-text span:empty {
    display: none;
}

.bar .btn {
    height: 50px;
    padding: 0 24px;
    flex-shrink: 0;
}

/* Cita reservada */

.done-badge {
    display: grid;
    place-items: center;
    width: 68px;
    height: 68px;
    margin-bottom: 20px;
    color: var(--accent-ink);
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 16px 36px -12px var(--accent-glow);
}

.done-badge svg {
    width: 32px;
    height: 32px;
}

#viewDone .recap {
    margin-top: 24px;
}

.done-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 22px;
}

/* Mis citas */

.phone-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 22px;
}

.phone-known {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
    color: var(--muted);
    font-size: 0.9rem;
}

.phone-known strong {
    color: var(--ink);
    font-weight: 650;
}

.booking-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 22px;
}

.booking-item {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.booking-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0 7px;
    background: var(--surface-3);
    border-radius: var(--radius-sm);
    line-height: 1.15;
}

.booking-date strong {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
}

.booking-date span {
    color: var(--accent);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.booking-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.booking-info strong {
    font-size: 0.98rem;
    overflow-wrap: anywhere;
}

.booking-info span {
    color: var(--muted);
    font-size: 0.84rem;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 22px;
    padding: 40px 16px;
    color: var(--muted);
    border: 1.5px dashed var(--line-strong);
    border-radius: var(--radius);
    text-align: center;
}

.empty-state svg {
    width: 44px;
    height: 44px;
}

.mine-book {
    margin-top: 22px;
}

/* --------------------------------------------------------------------------
   Inicio (menú principal)
   Marca centrada y dos botones grandes al alcance del pulgar. Ocupa toda la pantalla:
   sin pie y con la marca de la cabecera oculta (ya está en grande).
   -------------------------------------------------------------------------- */

/* El inicio cabe exactamente en la pantalla: sin scroll en ningún sentido. El body deja de
   medir 100vh (en el móvil cuenta la barra del navegador y provocaba scroll vertical). */
.is-home {
    min-height: 0;
    overflow: hidden;
}

@media (max-height: 560px) {
    .is-home {
        overflow: visible; /* móvil en horizontal: ahí sí hace falta poder bajar */
    }
}

.is-home .brand {
    visibility: hidden;
}

.is-home .site-footer {
    display: none;
}

.home-view {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    /* pantalla menos cabecera y márgenes de .app: sin que aparezca scroll */
    min-height: calc(100svh - 61px - env(safe-area-inset-top, 0px) - 22px - 40px);
    min-height: calc(100dvh - 61px - env(safe-area-inset-top, 0px) - 22px - 40px);
    padding-top: 4vh;
    text-align: center;
}

.home-view::before {
    content: "";
    position: absolute;
    top: 2%;
    left: 50%;
    width: min(520px, 100vw); /* nunca más ancho que la pantalla: evita el scroll lateral */
    height: 420px;
    translate: -50% 0;
    background: radial-gradient(closest-side, rgba(240, 165, 60, 0.22), transparent);
    pointer-events: none;
}

.home-view > * {
    position: relative;
}

/* Logo oficial de la portada: sol en ámbar y MALGUSTO en crema (PNG transparente). */
.home-wordmark {
    margin: 0;
    line-height: 0;
}

.home-wordmark:focus {
    outline: none;
}

.home-wordmark img {
    width: min(320px, 84vw);
    height: auto;
    margin: 0 auto;
}

.home-tag {
    margin-top: 18px;
    color: var(--muted);
}

.home-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 420px;
    margin-top: 40px;
}

.btn-xl {
    justify-content: space-between;
    height: 68px;
    padding: 0 12px 0 28px;
    font-size: 1.08rem;
}

.btn-ic {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
}

.btn-ic svg {
    width: 22px;
    height: 22px;
}

.btn-primary .btn-ic {
    color: var(--accent);
    background: var(--accent-ink);
}

.btn-outline {
    color: var(--ink);
    background: var(--surface);
    border-color: var(--line-strong);
}

.btn-outline:hover:not(:disabled) {
    border-color: var(--muted);
}

.btn-outline .btn-ic {
    color: var(--ink-2);
    background: var(--surface-3);
}

/* Pantallas bajas (iPhone pequeños): logo y huecos más compactos para que todo quepa. */
@media (max-height: 680px) {
    .home-view {
        padding-top: 0;
    }

    .home-wordmark img {
        width: min(250px, 70vw);
    }

    .home-actions {
        margin-top: 24px;
    }
}

@media (min-width: 760px) {
    .home-view {
        min-height: calc(100svh - 61px - env(safe-area-inset-top, 0px) - 40px - 40px);
        min-height: calc(100dvh - 61px - env(safe-area-inset-top, 0px) - 40px - 40px);
    }
}

/* --------------------------------------------------------------------------
   Catálogo de productos
   -------------------------------------------------------------------------- */

.product-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 22px;
}

.product-row {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 10px 16px 10px 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.product-thumb {
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    overflow: hidden;
    color: #4a4f56;
    background: var(--surface-2);
    border: 1px dashed var(--line-strong);
    border-radius: 12px;
}

.product-thumb svg {
    width: 28px;
    height: 28px;
}

.product-thumb.has-photo {
    border-style: solid;
    border-color: var(--line);
}

.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-name,
.product-meta {
    display: block;
}

.product-name {
    font-size: 1rem;
    font-weight: 650;
    line-height: 1.3;
}

.product-meta {
    color: var(--muted);
    font-size: 0.84rem;
}

.product-price {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
}

.product-price.is-unset {
    color: var(--muted);
}

.coming {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 10px;
    padding: 18px 16px;
    color: var(--muted);
    border: 1.5px dashed var(--line-strong);
    border-radius: var(--radius);
    font-size: 0.9rem;
}

.coming svg {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    color: var(--accent);
}

/* --------------------------------------------------------------------------
   Panel · acceso
   -------------------------------------------------------------------------- */

.admin-main {
    padding-top: 20px;
    padding-bottom: 24px;
}

.login-shell {
    display: grid;
    place-items: center;
    padding: 28px 0 48px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

/* .panel (más abajo) fija un relleno de 18px; con esta especificidad manda el del login. */
.panel.login-card {
    padding: 34px 24px 34px;
}

.login-icon {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    margin: 0 auto 18px;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 50%;
}

.login-icon svg {
    width: 24px;
    height: 24px;
}

.login-card h1 {
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.login-lead {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.92rem;
}

.login-form {
    margin-top: 22px;
    text-align: left;
}

.login-form .btn-block {
    margin-top: 14px;
}

/* Tarjetas del panel */

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 18px;
}

.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.panel-head h2 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.panel-note {
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.86rem;
}

/* Pestañas */

.tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-bottom: 14px;
    padding: 4px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.tab {
    height: 42px;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 11px;
    font-size: 0.92rem;
    font-weight: 650;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.tab:hover {
    color: var(--ink);
}

.tab.is-active {
    color: var(--ink);
    background: #23262b;
}

/* Avisos fijos del panel: se quedan arriba aunque estés más abajo en la lista */

.admin-main #message,
.admin-main .notice {
    position: sticky;
    top: calc(70px + env(safe-area-inset-top, 0px));
    z-index: 15;
    margin: 0 0 12px;
    box-shadow: 0 14px 30px -16px rgba(0, 0, 0, 0.9);
}

.notice {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
}

.notice #noticeText {
    flex: 1 1 180px;
}

.notice .icon-btn {
    margin-left: auto;
    color: inherit;
    border-color: rgba(98, 211, 162, 0.3);
}

/* --------------------------------------------------------------------------
   Panel · agenda del día
   -------------------------------------------------------------------------- */

.day-nav {
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 10px;
}

.day-nav-btn {
    flex: 0 0 48px;
    min-height: 48px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}

.day-nav-btn:hover {
    border-color: var(--line-strong);
}

.day-label {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 48px;
    padding: 4px 8px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    text-align: center;
    cursor: pointer;
}

.day-label:hover {
    border-color: var(--line-strong);
}

.day-label strong {
    display: block;
    font-size: 1.05rem;
    line-height: 1.2;
}

.day-label span {
    display: block;
    color: var(--muted);
    font-size: 0.74rem;
}

.day-today {
    flex: 0 0 auto;
    height: auto;
    min-height: 48px;
    padding: 0 16px;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
}

.week-strip {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
    margin-bottom: 12px;
}

.wk-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    min-height: 62px;
    padding: 7px 0 5px;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
}

.wk-day strong {
    color: var(--ink);
    font-size: 1.05rem;
    line-height: 1.25;
}

.week-count {
    min-height: 1em;
    color: var(--accent);
    font-size: 0.68rem;
    font-weight: 700;
}

.wk-day.is-today:not(.is-selected) {
    border-color: var(--accent);
}

.wk-day.is-selected {
    color: var(--accent-ink);
    background: var(--accent);
    border-color: var(--accent);
}

.wk-day.is-selected strong,
.wk-day.is-selected .week-count {
    color: var(--accent-ink);
}

.wk-day.is-closed:not(.is-selected) {
    opacity: 0.5;
}

.day-summary {
    margin-bottom: 14px;
    color: var(--ink-2);
    font-size: 0.92rem;
    font-weight: 650;
}

.day-summary:empty {
    display: none;
}

.day-closed {
    margin-bottom: 14px;
    padding: 13px 14px;
    color: var(--ink-2);
    background: var(--surface-2);
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-weight: 650;
}

.timeline {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); /* sitio para el botón flotante */
}

.tl {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
}

.tl-time {
    padding-top: 13px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.tl-time strong {
    display: block;
    font-size: 0.95rem;
}

.tl-time span {
    color: var(--muted);
    font-size: 0.72rem;
}

.tl-card {
    padding: 13px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.tl.is-past .tl-card {
    opacity: 0.62;
}

/* En las citas la opacidad va en el contenedor, para que al deslizar no se transparente el fondo. */
.tl.is-past .tl-swipe {
    opacity: 0.62;
}

.tl.is-past .tl-swipe .tl-card {
    opacity: 1;
}

.tl.is-next .tl-card {
    border-color: rgba(240, 165, 60, 0.55);
}

.tl.is-now .tl-card {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.tl.is-done .tl-card {
    border-left: 4px solid var(--ok);
}

.tl.is-noshow .tl-card {
    border-left: 4px solid var(--danger);
}

/* Tarjeta de cita deslizable: a la derecha «Vino», a la izquierda «No vino» */

.tl-swipe {
    position: relative;
    /* Al deslizar, la tarjeta no invade la columna de la hora (el margen deja ver el resplandor). */
    clip-path: inset(-6px);
}

.tl-swipe-bg {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    padding: 0 22px;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 700;
    opacity: 0;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.tl-swipe-bg--done {
    justify-content: flex-start;
    color: var(--ok);
    background: var(--ok-soft);
}

.tl-swipe-bg--noshow {
    justify-content: flex-end;
    color: var(--danger);
    background: var(--danger-soft);
}

.tl-swipe[data-dir="right"] .tl-swipe-bg--done,
.tl-swipe[data-dir="left"] .tl-swipe-bg--noshow {
    opacity: 1;
}

.tl-swipe.is-armed .tl-swipe-bg--done {
    color: #08281b;
    background: var(--ok);
}

.tl-swipe.is-armed .tl-swipe-bg--noshow {
    color: #2e0c07;
    background: var(--danger);
}

.tl-card--tap {
    position: relative;
    cursor: pointer;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.18s ease;
}

.tl-swipe.is-dragging .tl-card--tap {
    transition: none;
}

.tl-card--tap:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.timeline-hint {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.5;
    text-align: center;
}

.tl-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.tl-name {
    font-size: 1.05rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.tl-head .badge {
    flex-shrink: 0;
    margin-top: 3px;
}

.tl-service {
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.86rem;
}

.btn-toggle[aria-pressed="true"].btn-toggle--ok {
    color: #08281b;
    background: var(--ok);
    border-color: var(--ok);
}

.btn-toggle[aria-pressed="true"].btn-toggle--bad {
    color: #2e0c07;
    background: var(--danger);
    border-color: var(--danger);
}

.tl-free-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 50px;
    padding: 0 14px;
    color: var(--accent);
    background: transparent;
    border: 1.5px dashed #343840;
    border-radius: var(--radius);
    font-size: 0.9rem;
    cursor: pointer;
}

.tl-free-btn span {
    color: var(--muted);
}

.tl-free-btn:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
}

.tl-blocked .tl-card {
    color: var(--muted);
    background: var(--surface-2);
    border-style: dashed;
    font-size: 0.88rem;
}

.fab {
    position: fixed;
    right: max(16px, env(safe-area-inset-right, 0px));
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    z-index: 30;
    min-height: 54px;
    padding: 0 24px;
    color: var(--accent-ink);
    background: var(--accent);
    border: 0;
    border-radius: 999px;
    box-shadow: 0 14px 32px -10px var(--accent-glow);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
}

.fab:hover {
    background: var(--accent-strong);
}

/* Etiquetas de estado */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}

.badge--today {
    color: var(--accent);
    background: var(--accent-soft);
}

.badge--next {
    color: var(--ok);
    background: var(--ok-soft);
}

.badge--noshow {
    color: var(--danger);
    background: var(--danger-soft);
}

/* --------------------------------------------------------------------------
   Panel · horario
   -------------------------------------------------------------------------- */

.schedule-grid,
.schedule-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.skeleton-note {
    color: var(--muted);
    font-size: 0.9rem;
}

.week-editor {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.week-row {
    padding: 14px 12px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.week-row.is-closed {
    opacity: 0.75;
}

.week-day {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.week-day strong {
    font-size: 1rem;
}

.day-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.day-status {
    color: var(--ok);
    font-size: 0.85rem;
    font-weight: 650;
}

.week-row.is-closed .day-status {
    color: var(--muted);
}

.day-toggle input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    width: 44px;
    height: 26px;
    margin: 0;
    background: var(--surface-3);
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.day-toggle input[type="checkbox"]::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: var(--muted);
    border-radius: 50%;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.day-toggle input[type="checkbox"]:checked {
    background: var(--accent-soft);
    border-color: var(--accent);
}

.day-toggle input[type="checkbox"]:checked::after {
    background: var(--accent);
    transform: translateX(18px);
}

.week-ranges {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.range-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.range-row input[type="time"] {
    flex: 1 1 0;
    min-width: 0;
    height: 48px;
    padding: 0 6px 0 10px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
}

.range-row .icon-btn {
    width: 36px;
    height: 36px;
}

.range-row input:disabled {
    opacity: 0.5;
}

.range-sep {
    color: var(--muted);
}

.add-range {
    align-self: flex-start;
}

.schedule-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.inline-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
}

.inline-form .field {
    flex: 1 1 140px;
    min-width: 0;
}

.inline-form .field--grow {
    flex: 2 1 200px;
}

/* Ocupa toda la fila (por ejemplo, la rejilla de horas de «Horas bloqueadas»). */
.inline-form .field--full {
    flex: 1 1 100%;
}

.inline-form .field--full .slot-hint {
    margin: 0 0 10px;
}

.inline-form .btn {
    flex: 1 1 100%;
}

.field input[type="date"],
.field input[type="time"] {
    color-scheme: dark;
}

.tag-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.tag-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px 10px 14px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.tag-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.tag-text strong {
    font-size: 0.95rem;
}

.tag-note {
    color: var(--muted);
    font-size: 0.82rem;
}

.tag-empty {
    color: var(--muted);
    font-size: 0.88rem;
}

/* --------------------------------------------------------------------------
   Diálogos (nueva cita y reprogramar)
   -------------------------------------------------------------------------- */

.modal {
    overscroll-behavior: contain; /* el scroll del diálogo no arrastra la página de detrás */
    width: min(520px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    margin: auto;
    padding: 0;
    overflow: auto;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 24px;
    box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.9);
    color-scheme: dark;
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
}

.modal::backdrop {
    background: rgba(5, 6, 7, 0.78);
}

.modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 20px 20px 0;
}

.modal-head h2 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.modal-sub {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.86rem;
}

.modal-body {
    padding: 16px 20px;
}

.modal-body .field,
.modal-body .services {
    margin-bottom: 16px;
}

.modal-body .slot-hint {
    margin: 4px 0 0;
}

.modal-body .slot-grid {
    margin: 12px 0 16px;
}

.modal-actions {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 20px calc(16px + env(safe-area-inset-bottom, 0px));
    background: var(--surface);
    border-top: 1px solid var(--line);
}

/* Hoja de opciones de una cita (sube desde abajo en el móvil) */

.sheet {
    overscroll-behavior: contain;
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    margin: auto auto 0;
    padding: 0;
    overflow: auto;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-bottom: 0;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -30px 80px -30px rgba(0, 0, 0, 0.9);
    color-scheme: dark;
}

.sheet::backdrop {
    background: rgba(5, 6, 7, 0.78);
}

.sheet[open] {
    animation: sheet-up 0.22s ease-out;
}

@keyframes sheet-up {
    from {
        transform: translateY(32px);
        opacity: 0;
    }
    to {
        transform: none;
        opacity: 1;
    }
}

.sheet-grip {
    width: 40px;
    height: 4px;
    margin: 10px auto 0;
    background: var(--line-strong);
    border-radius: 999px;
}

.sheet-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 20px 0;
}

.sheet-head h2,
.sheet-confirm h2 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    overflow-wrap: anywhere;
}

.sheet-actions {
    display: grid;
    gap: 10px;
    padding: 18px 20px calc(22px + env(safe-area-inset-bottom, 0px));
}

.sheet-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 10px;
}

.sheet-note {
    color: var(--muted);
    font-size: 0.86rem;
}

.sheet .btn {
    padding: 0 12px;
}

.sheet-confirm {
    padding: 22px 20px calc(22px + env(safe-area-inset-bottom, 0px));
}

.sheet-confirm .modal-sub {
    margin-top: 8px;
    font-size: 0.92rem;
    line-height: 1.5;
}

.sheet-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 20px;
}

.btn-danger-solid {
    color: #2e0c07;
    background: var(--danger);
    border-color: var(--danger);
}

.btn-danger-solid:hover:not(:disabled) {
    background: #ff9486;
}

@media (min-width: 760px) {
    .sheet {
        margin: auto;
        border-bottom: 1px solid var(--line-strong);
        border-radius: 24px;
    }
}

#createServices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

#createServices .service-card {
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: flex-start;
    gap: 10px;
    padding: 11px;
}

#createServices .service-radio {
    width: 22px;
    height: 22px;
    margin-top: 1px;
}

#createServices .service-radio::after {
    left: 6px;
    top: 2px;
}

#createServices .service-name {
    font-size: 0.9rem;
    line-height: 1.25;
}

#createMessage {
    scroll-margin-bottom: 96px; /* que no lo tape la barra de botones fija */
}

/* --------------------------------------------------------------------------
   Pantallas grandes y ajustes
   -------------------------------------------------------------------------- */

@media (min-width: 760px) {
    .app {
        padding-top: 40px;
    }

    .slot-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .inline-form .btn {
        flex: 0 0 auto;
    }
}

@media (max-width: 520px) {
    .admin-tag {
        display: none; /* en el móvil no cabe junto a los dos botones */
    }
}

@media (max-width: 380px) {
    .page-title {
        font-size: 1.9rem;
    }

    .slot-grid {
        gap: 6px;
    }

    .bar .btn {
        padding: 0 18px;
    }

    .day-today {
        padding: 0 10px;
    }
}

/* --------------------------------------------------------------------------
   Feedback al pulsar
   Se encoge rápido al apretar y recupera su tamaño con una curva suave al soltar. Usa la
   propiedad `scale` (no `transform`) para no pisar otras animaciones, y repite las
   transiciones de cada elemento porque esta regla sustituye a las anteriores.
   -------------------------------------------------------------------------- */

:root {
    --press-in: 0.09s ease-out;
    --press-out: 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.service-card,
.day-card,
.slot-chip {
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.2s ease,
                scale var(--press, var(--press-out));
}

.tab {
    transition: background-color 0.15s ease, color 0.15s ease, scale var(--press, var(--press-out));
}

.tl-free-btn,
.nav-link,
.back-link,
.icon-btn {
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease,
                scale var(--press, var(--press-out));
}

/* Tarjetas anchas: un encogimiento leve; piezas pequeñas: algo más marcado. */
.service-card:active,
.tl-free-btn:active {
    --press: var(--press-in);
    scale: 0.985;
}

.btn:active:not(:disabled),
.fab:active {
    --press: var(--press-in);
    scale: 0.97;
}

.fab {
    transition: background-color 0.15s ease, scale var(--press, var(--press-out));
}

.day-card:active,
.slot-chip:not(:disabled):active,
.tab:active,
.nav-link:active,
.back-link:active,
.icon-btn:active:not(:disabled) {
    --press: var(--press-in);
    scale: 0.95;
}

/* --------------------------------------------------------------------------
   Cargas sin saltos
   Al cambiar de servicio o de día se conserva lo anterior (atenuado) hasta que llega lo
   nuevo, y se sustituye de una vez: así la pantalla no se encoge ni se estira entre medias.
   -------------------------------------------------------------------------- */

.day-strip,
.slot-panel,
.slot-grid {
    transition: opacity 0.18s ease;
}

.is-loading {
    opacity: 0.45;
    pointer-events: none;
}

/* Huecos de carga cuando todavía no hay horas que conservar. */
.slot-chip.is-skeleton {
    color: transparent;
    pointer-events: none;
    animation: skeleton-pulse 1.1s ease-in-out infinite;
}

@keyframes skeleton-pulse {
    50% {
        opacity: 0.45;
    }
}

/* Panel · navegación de días con la misma pulsación suave que el resto */

.wk-day {
    transition: background-color 0.22s ease, border-color 0.22s ease, color 0.22s ease,
                opacity 0.22s ease, scale var(--press, var(--press-out));
}

.wk-day strong,
.week-count {
    transition: color 0.22s ease;
}

.day-nav-btn,
.day-label {
    transition: background-color 0.15s ease, border-color 0.15s ease,
                scale var(--press, var(--press-out));
}

.wk-day:active {
    --press: var(--press-in);
    scale: 0.92;
}

.day-nav-btn:active,
.day-label:active {
    --press: var(--press-in);
    scale: 0.96;
}

/* Al cambiar de día, la lista entra con un deslizamiento corto. Nunca baja de 0,6 de opacidad:
   si desapareciera del todo se vería como un parpadeo. */
.timeline.is-entering {
    animation: tl-in 0.2s ease-out;
}

@keyframes tl-in {
    from {
        opacity: 0.6;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
