/* ════════════════════════════════════════════════════════════════════
 *  EP Citas — Frontend Booking v2
 *  Diseño: Strip horizontal de fechas + slots agrupados Mañana/Tarde/Noche
 * ════════════════════════════════════════════════════════════════════ */

:root {
    --epf-primary: #2196F3;
    --epf-accent: #7f525f;
    --epf-primary-light: #f5edf0;
    --epf-text: #37474f;
    --epf-text-light: #90a4ae;
    --epf-border: #e0e0e0;
    --epf-bg: #ffffff;
    --epf-bg-page: #fafafa;
    --epf-danger: #ef5350;
    --epf-sans: "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
    --epf-radius: 8px;
    --epf-transition: 0.2s ease;
}

/* ── Container ───────────────────────────────────────────────────── */

.ep-citas-booking {
    width: 100%; /* Toma el ancho total del Div padre que le pongas en Bricks */
    max-width: 100%; /* Evita que crezca más allá de la pantalla */
    box-sizing: border-box; /* Asegura que los márgenes no rompan el ancho */
    margin: 0 auto;
    font-family: var(--epf-sans);
    color: var(--epf-text);
}

.ep-citas-booking__error {
    padding: 16px;
    background: #fbe9e7;
    color: var(--epf-danger);
    border-radius: var(--epf-radius);
    font-size: 14px;
}

/* ── Header ──────────────────────────────────────────────────────── */

.ep-citas-booking__header {
    margin-bottom: 20px;
}

.ep-citas-booking__title {
    font-size: 22px;
    font-weight: 400;
    color: var(--epf-text);
    margin: 0;
}

.ep-citas-booking__title span {
    color: var(--epf-danger);
}

/* ── Month Navigation ────────────────────────────────────────────── */

.ep-citas-booking__month-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.ep-citas-booking__month-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--epf-primary);
}

.ep-citas-booking__month-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--epf-text-light);
}

.ep-citas-booking__month-nav-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--epf-primary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background var(--epf-transition);
}

.ep-citas-booking__month-nav-btn:hover {
    background: var(--epf-primary-light);
}

/* ── Date Strip ──────────────────────────────────────────────────── */

.ep-citas-booking__strip-wrap {
    position: relative;
    margin-bottom: 24px;
}

.ep-citas-booking__strip-scroll {
    display: flex;
    align-items: stretch;
    gap: 0;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 4px 0;
}

.ep-citas-booking__strip-scroll::-webkit-scrollbar {
    display: none;
}

.ep-citas-booking__strip-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    background: var(--epf-bg);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    border-radius: 50%;
    font-size: 18px;
    color: var(--epf-text);
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow var(--epf-transition);
}

.ep-citas-booking__strip-arrow:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.20);
}

.ep-citas-booking__strip-arrow--left { left: -8px; }
.ep-citas-booking__strip-arrow--right { right: -8px; }

/* ── Date Cell ───────────────────────────────────────────────────── */

.ep-citas-booking__date-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    padding: 10px 8px 14px;
    cursor: default;
    user-select: none;
    position: relative;
    transition: all var(--epf-transition);
    flex-shrink: 0;
}

.ep-citas-booking__date-weekday {
    font-size: 12px;
    font-weight: 600;
    color: var(--epf-text-light);
    margin-bottom: 6px;
    text-transform: capitalize;
}

.ep-citas-booking__date-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    border-radius: 50%;
    color: var(--epf-text);
    transition: all var(--epf-transition);
}

/* States */
.ep-citas-booking__date-cell--available {
    cursor: pointer;
}

.ep-citas-booking__date-cell--available .ep-citas-booking__date-number {
    color: var(--epf-accent);
}

.ep-citas-booking__date-cell--available:hover .ep-citas-booking__date-number {
    background: var(--epf-primary-light);
}

.ep-citas-booking__date-cell--selected .ep-citas-booking__date-number {
    background: var(--epf-primary);
    color: var(--epf-bg);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.35);
}

.ep-citas-booking__date-cell--selected .ep-citas-booking__date-weekday {
    color: var(--epf-text-light);
}

.ep-citas-booking__date-cell--no-slots .ep-citas-booking__date-number {
    color: #c6ced3;
}

.ep-citas-booking__date-cell--no-slots .ep-citas-booking__date-weekday {
    color: #d5dde1;
}

.ep-citas-booking__date-cell--past {
    opacity: 0.35;
}

/* Today dot */
.ep-citas-booking__date-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--epf-primary);
    margin-top: 4px;
}

/* ── Time Slots Grouped ──────────────────────────────────────────── */

.ep-citas-booking__slots {
    border-top: 1px solid var(--epf-border);
    padding-top: 20px;
}

.ep-citas-booking__group {
    margin-bottom: 20px;
}

.ep-citas-booking__group-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--epf-text);
    margin-bottom: 10px;
    padding-left: 2px;
    position: relative;
}

.ep-citas-booking__group-label::after {
    content: '';
    display: inline-block;
    width: calc(100% - 80px);
    height: 1px;
    background: var(--epf-border);
    vertical-align: middle;
    margin-left: 12px;
}

.ep-citas-booking__slot-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ep-citas-booking__slot {
    padding: 10px 18px;
    border: 1px solid var(--epf-border);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--epf-text);
    background: var(--epf-bg);
    cursor: pointer;
    transition: all var(--epf-transition);
    white-space: nowrap;
}

.ep-citas-booking__slot:hover {
    border-color: var(--epf-primary);
    background: var(--epf-primary-light);
}

.ep-citas-booking__slot--booked {
    opacity: 0.35;
    cursor: not-allowed;
    text-decoration: line-through;
}

.ep-citas-booking__slot--booked:hover {
    border-color: var(--epf-border);
    background: var(--epf-bg);
}

/* ── Loading / Empty ─────────────────────────────────────────────── */

.ep-citas-booking__loading {
    text-align: center;
    padding: 30px;
    color: var(--epf-text-light);
    font-size: 14px;
}

.ep-citas-booking__spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--epf-border);
    border-top-color: var(--epf-primary);
    border-radius: 50%;
    animation: epf-spin 0.6s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
}

@keyframes epf-spin { to { transform: rotate(360deg); } }

.ep-citas-booking__empty {
    text-align: center;
    padding: 24px;
    color: var(--epf-text-light);
    font-size: 14px;
    border-top: 1px solid var(--epf-border);
    margin-top: 10px;
}

/* Scheduler embebido en tarjetas de sesiones/créditos. */
.db-em-scheduler {
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
}

.db-em-scheduler .ep-citas-booking {
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
}

.db-em-scheduler .ep-citas-booking__strip-wrap {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.db-em-scheduler .ep-citas-booking__strip-scroll {
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── Tarjetas renovadas de citas/sesiones ───────────────────────── */
.dosbit-shortcode h1,
.dosbit-shortcode h2,
.dosbit-shortcode h3,
.dosbit-shortcode h4,
.dosbit-shortcode h5,
.dosbit-shortcode h6 {
    font-family: "Barlow", sans-serif;
}

.dosbit-shortcode,
.dosbit-shortcode p,
.dosbit-shortcode li,
.dosbit-shortcode span,
.dosbit-shortcode a,
.dosbit-shortcode button,
.dosbit-shortcode input,
.dosbit-shortcode textarea {
    font-family: "Averia", serif;
}

.em-card-list {
    display: grid;
    gap: 18px;
}

.em-card-filters {
    display: flex;
    gap: 8px;
    margin: 0 0 18px;
    padding: 2px 0 8px;
    overflow-x: auto;
}

.em-card-filter {
    flex: 0 0 auto;
    padding: 9px 14px;
    border: 1px solid #ded7da;
    border-radius: 999px;
    background: #fff;
    color: #65757e;
    font-size: 13px;
    font-weight: 750;
    cursor: pointer;
}

.em-card-filter.is-active {
    border-color: #23313a;
    background: #23313a;
    color: #fff;
}

.em-cita-card {
    --cat-accent: #7f525f;
    --cat-bg: #f7edf1;
    position: relative;
    display: grid;
    grid-template-columns: minmax(170px, 0.78fr) minmax(0, 1.45fr) minmax(220px, 0.9fr);
    overflow: hidden;
    border: 1px solid rgba(127, 82, 95, 0.22);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 18px 40px rgba(54, 41, 47, 0.08);
}

.em-cita-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 8px;
    background: var(--cat-accent);
}

.em-cita-card__when {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px 22px 24px 30px;
    background: var(--cat-bg);
    border-right: 1px solid rgba(127, 82, 95, 0.14);
}

.em-cita-card__eyebrow {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    margin-bottom: 16px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #ffffff;
    color: var(--cat-accent);
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}

.em-cita-card__day {
    display: block;
    color: #23313a;
    font-size: 42px;
    font-weight: 800;
    line-height: 0.95;
}

.em-cita-card__month {
    display: block;
    margin-top: 5px;
    color: #23313a;
    font-size: 17px;
    font-weight: 700;
    text-transform: capitalize;
}

.em-cita-card__time {
    display: block;
    margin-top: 18px;
    color: var(--cat-accent);
    font-size: 20px;
    font-weight: 800;
}

.em-cita-card__duration {
    display: block;
    margin-top: 4px;
    color: #7a8992;
    font-size: 13px;
    font-weight: 700;
}

.em-cita-card__order {
    display: block;
    margin-top: 7px;
    color: #8a969d;
    font-size: 11px;
    font-weight: 650;
}

.em-cita-card__main {
    min-width: 0;
    padding: 24px 24px 22px;
}

.em-cita-card__category {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.em-cita-card__type {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--cat-bg);
    color: var(--cat-accent);
    font-size: 12px;
    font-weight: 800;
}

.em-cita-card__meaning {
    color: #7a8992;
    font-size: 13px;
    font-weight: 650;
}

.em-cita-card__title {
    margin: 0;
    color: #23313a;
    font-size: clamp(22px, 3vw, 31px);
    line-height: 1.12;
}

.em-cita-card__note {
    max-width: 680px;
    margin: 10px 0 18px;
    color: #596a73;
    font-size: 14px;
    line-height: 1.55;
}

.em-session-tabs {
    display: flex;
    gap: 8px;
    margin: 0 0 16px;
    padding: 2px 0 8px;
    overflow-x: auto;
}

.em-session-tab {
    min-width: 108px;
    flex: 0 0 auto;
    display: grid;
    gap: 2px;
    padding: 9px 11px;
    border: 1px solid #e2d9dd;
    border-radius: 12px;
    background: #fff;
    color: #687982;
    text-align: left;
    cursor: pointer;
}

.em-session-tab strong {
    color: inherit;
    font-size: 12px;
    line-height: 1.1;
}

.em-session-tab span {
    color: inherit;
    font-size: 11px;
    line-height: 1.2;
}

.em-session-tab.is-active {
    border-color: var(--cat-accent);
    background: var(--cat-bg);
    color: var(--cat-accent);
}

.em-cita-card__people {
    display: grid;
    gap: 12px;
}

.em-person {
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-width: 0;
    padding: 12px;
    border: 1px solid #eadde2;
    border-radius: 14px;
    background: #fffdfd;
}

.em-person__photo,
.em-person__initials {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 14px;
    background: var(--cat-bg);
    color: var(--cat-accent);
    font-size: 15px;
    font-weight: 850;
}

.em-person__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.em-person__label {
    display: block;
    margin-bottom: 3px;
    color: #7a8992;
    font-size: 12px;
    font-weight: 750;
}

.em-person__name {
    display: block;
    overflow: hidden;
    color: #23313a;
    font-size: 15px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.em-person__meta {
    display: block;
    margin-top: 2px;
    overflow: hidden;
    color: #7a8992;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.em-cita-card__side {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
    padding: 24px;
    border-left: 1px solid #eadde2;
    background: #fffdfd;
}

.em-session-pane {
    display: flex;
    min-height: 100%;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
}

.em-session-pane[hidden] {
    display: none;
}

.em-cita-card__status {
    display: grid;
    gap: 10px;
}

.em-status {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border-radius: 14px;
    background: #eef6f3;
    color: #4f746a;
}

.em-status--waiting {
    background: #f5f2ef;
    color: #876e62;
}

.em-status__dot {
    width: 9px;
    height: 9px;
    flex: 0 0 auto;
    margin-top: 5px;
    border-radius: 50%;
    background: currentColor;
}

.em-status strong {
    display: block;
    margin-bottom: 2px;
    font-size: 13px;
}

.em-status span {
    display: block;
    font-size: 12px;
    line-height: 1.35;
}

.em-cita-card__actions {
    display: grid;
    gap: 9px;
}

.em-action,
.em-cita-card__actions .ep-citas-btn {
    --em-action-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m22 8-6 4 6 4V8Z'/%3E%3Crect x='2' y='6' width='14' height='12' rx='2'/%3E%3C/svg%3E");
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: var(--cat-accent);
    color: #ffffff;
    font-size: 13px;
    font-weight: 850;
    line-height: 1.1;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.em-action::before,
.em-cita-card__actions .ep-citas-btn::before {
    content: "";
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    background: currentColor;
    -webkit-mask: var(--em-action-icon) center / contain no-repeat;
    mask: var(--em-action-icon) center / contain no-repeat;
}

.em-action--schedule,
.db-em-schedule-btn {
    --em-action-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2v4'/%3E%3Cpath d='M16 2v4'/%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M3 10h18'/%3E%3Cpath d='M8 14h.01'/%3E%3Cpath d='M12 14h.01'/%3E%3Cpath d='M16 14h.01'/%3E%3C/svg%3E");
}

.em-action--orders {
    --em-action-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z'/%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M16 10a4 4 0 0 1-8 0'/%3E%3C/svg%3E");
}

.em-action--danger,
.db-em-cancel-btn {
    --em-action-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m15 9-6 6'/%3E%3Cpath d='m9 9 6 6'/%3E%3C/svg%3E");
}

.em-action--end,
.db-em-complete-btn {
    --em-action-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 11.08V12a10 10 0 1 1-5.93-9.14'/%3E%3Cpath d='m9 11 3 3L22 4'/%3E%3C/svg%3E");
}

.em-action--video-pending {
    --em-action-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m2 2 20 20'/%3E%3Cpath d='M16 16V8a2 2 0 0 0-2-2H7.5'/%3E%3Cpath d='M2 8v8a2 2 0 0 0 2 2h10'/%3E%3Cpath d='m22 8-6 4 6 4V8Z'/%3E%3C/svg%3E");
}

.em-action--secondary {
    background: var(--cat-bg);
    color: var(--cat-accent);
}

.em-action--danger {
    border-color: rgba(199, 75, 66, 0.45);
    background: #fff2f1;
    color: #c74b42;
}

.em-action--end {
    background: #23313a;
    color: #ffffff;
}

.em-action--disabled,
.em-action:disabled,
.em-cita-card__actions .ep-citas-btn:disabled {
    background: #f2f2f2;
    color: #b9b9b9;
    cursor: not-allowed;
}

.em-cita-card__scheduler {
    grid-column: 1 / -1;
    padding: 22px 24px 24px;
    border-top: 1px solid #eadde2;
    background: #ffffff;
}

.em-cita-card__scheduler .ep-citas-booking {
    max-width: 100%;
}

@media (max-width: 880px) {
    .em-cita-card {
        grid-template-columns: 1fr;
    }

    .em-cita-card__when,
    .em-cita-card__side {
        border: 0;
    }

    .em-cita-card__when {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        column-gap: 18px;
    }

    .em-cita-card__eyebrow,
    .em-cita-card__time,
    .em-cita-card__duration {
        grid-column: 2;
    }

    .em-cita-card__day,
    .em-cita-card__month {
        grid-column: 1;
    }

    .em-cita-card__day {
        grid-row: 1 / 4;
    }

    .em-cita-card__time {
        margin-top: 6px;
    }

    .em-cita-card__side {
        border-top: 1px solid #eadde2;
    }
}

@media (max-width: 620px) {
    .em-cita-card__when,
    .em-cita-card__main,
    .em-cita-card__side,
    .em-cita-card__scheduler {
        padding: 20px;
    }
}
