/* ════════════════════════════════════════════════════════════
   NOVO SISTEMA DE AGENDAMENTO COM CALENDÁRIO
════════════════════════════════════════════════════════════ */

/* ── PASSOS DO AGENDAMENTO ── */
.booking-step {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-header {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    margin-bottom: var(--sp-6);
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--violet), var(--violet-bright));
    color: var(--white);
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.step-header h4 {
    font-size: 1.1rem;
    color: var(--white);
    margin: 0;
}

/* ── CALENDÁRIO WIDGET ── */
.calendar-widget {
    background: var(--coal);
    border: var(--line);
    border-radius: var(--r-lg);
    padding: var(--sp-5);
    margin-bottom: var(--sp-6);
}

.calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--sp-5);
}

.calendar-nav-btn {
    background: var(--white-06);
    border: var(--line);
    color: var(--white-50);
    width: 36px;
    height: 36px;
    border-radius: var(--r);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: var(--t-2);
}

.calendar-nav-btn:hover {
    background: var(--violet-ghost);
    color: var(--violet-pale);
    border-color: rgba(109, 40, 217, 0.4);
}

.calendar-month-label {
    font-size: 1rem;
    font-weight: 700;
    color: var(--white);
    text-transform: capitalize;
    letter-spacing: 0.03em;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.calendar-weekdays span {
    text-align: center;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--white-25);
    text-transform: uppercase;
    font-family: var(--font-mono);
    padding: 6px 0;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day {
    aspect-ratio: 1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: default;
    position: relative;
    transition: transform 0.12s ease, background 0.15s ease;
    border: 1px solid transparent;
    user-select: none;
}

.calendar-day.empty {
    background: transparent;
    pointer-events: none;
}

.calendar-day.free,
.calendar-day.busy {
    background: var(--white-06);
    color: var(--white-75);
    border-color: var(--white-10);
    cursor: pointer;
}

.calendar-day.free:hover,
.calendar-day.busy:hover {
    background: var(--white-10);
    border-color: var(--white-25);
    transform: scale(1.08);
}

.calendar-day.closed {
    background: transparent;
    color: rgba(255, 255, 255, 0.15);
    cursor: default;
    border-color: transparent;
}

.calendar-day.closed:hover {
    transform: none;
}

.calendar-day.today {
    border-color: var(--violet-pale) !important;
    box-shadow: 0 0 0 2px rgba(167, 139, 250, 0.2);
}

.calendar-day.selected {
    background: linear-gradient(135deg, var(--violet), var(--violet-bright));
    color: var(--white);
    border-color: var(--violet-pale);
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.2);
}

.calendar-day.past {
    background: transparent;
    color: rgba(255, 255, 255, 0.12);
    cursor: default;
    border-color: transparent;
}

.calendar-day.past:hover {
    transform: none;
}

.calendar-day .calendar-dot {
    position: absolute;
    bottom: 3px;
    right: 3px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.7;
    pointer-events: none;
}

/* ── LEGENDA DO CALENDÁRIO ── */
.calendar-legend {
    display: flex;
    gap: var(--sp-4);
    flex-wrap: wrap;
    padding: var(--sp-4);
    background: rgba(109, 40, 217, 0.05);
    border-radius: var(--r);
    border: var(--line);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: 0.85rem;
    color: var(--white-75);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid;
}

.legend-color.free {
    background: rgba(74, 222, 128, 0.18);
    border-color: rgba(74, 222, 128, 0.5);
}

.legend-color.busy {
    background: rgba(248, 113, 113, 0.18);
    border-color: rgba(248, 113, 113, 0.5);
}

.legend-color.closed {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

/* ── SELEÇÃO DE DATA ── */
.selected-date-display {
    background: linear-gradient(135deg, rgba(109, 40, 217, 0.15), rgba(109, 40, 217, 0.05));
    border: var(--line);
    border-radius: var(--r-lg);
    padding: var(--sp-5);
    margin-bottom: var(--sp-6);
    text-align: center;
}

.selected-date-display h5 {
    font-size: 0.85rem;
    color: var(--white-50);
    margin-bottom: var(--sp-2);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.selected-date-display .date-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--violet-pale);
    font-family: var(--font-display);
}

/* ── GRID DE HORÁRIOS ── */
.horarios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: var(--sp-3);
    margin-bottom: var(--sp-6);
}

.horario-btn {
    padding: var(--sp-3) var(--sp-2);
    border-radius: var(--r);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--t-2);
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 1.5px solid;
    line-height: 1;
}

/* ── INFORMAÇÕES SELECIONADAS ── */
.selected-info {
    background: linear-gradient(135deg, rgba(109, 40, 217, 0.15), rgba(109, 40, 217, 0.05));
    border: var(--line);
    border-radius: var(--r-lg);
    padding: var(--sp-5);
    margin-bottom: var(--sp-6);
}

.selected-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--sp-2) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.selected-info-row:last-child {
    border-bottom: none;
}

.selected-info-label {
    font-size: 0.85rem;
    color: var(--white-50);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.selected-info-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--violet-pale);
}

/* ── NAVEGAÇÃO DO AGENDAMENTO ── */
.booking-navigation {
    display: flex;
    gap: var(--sp-3);
    margin-top: var(--sp-8);
    flex-wrap: wrap;
}

.btn-nav-prev,
.btn-nav-next {
    flex: 1;
    min-width: 140px;
    padding: var(--sp-4);
    border-radius: var(--r);
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    transition: var(--t-2);
    border: var(--line);
}

.btn-nav-prev {
    background: var(--white-06);
    color: var(--white-50);
}

.btn-nav-prev:hover {
    background: var(--white-10);
    color: var(--white-75);
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-nav-next {
    background: linear-gradient(135deg, var(--violet), var(--violet-bright));
    color: var(--white);
    border-color: var(--violet-pale);
    box-shadow: var(--glow-v-sm);
}

.btn-nav-next:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow-v-md);
}

.btn-nav-next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ── RESPONSIVO ── */
@media (max-width: 768px) {
    .booking-step {
        padding: 0;
    }

    .calendar-widget {
        padding: var(--sp-4);
    }

    .horarios-grid {
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
        gap: var(--sp-2);
    }

    .booking-navigation {
        flex-direction: column;
    }

    .btn-nav-prev,
    .btn-nav-next {
        width: 100%;
        min-width: auto;
    }

    .calendar-legend {
        flex-direction: column;
        gap: var(--sp-2);
    }

    .legend-item {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .calendar-widget {
        padding: var(--sp-3);
    }

    .calendar-days {
        gap: 3px;
    }

    .calendar-day {
        font-size: 0.75rem;
    }

    .horarios-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .horario-btn {
        padding: var(--sp-2);
        font-size: 0.8rem;
    }

    .step-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .step-number {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    .step-header h4 {
        font-size: 1rem;
    }
}

/* ── HORÁRIOS: disponível (verde) ── */
.horario-btn {
    background: rgba(74, 222, 128, 0.08);
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.30);
}

.horario-btn .horario-status-icon {
    font-size: 0.7rem;
    opacity: 0.8;
}

.horario-btn .horario-label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.75;
}

.horario-btn:hover:not(:disabled) {
    background: rgba(74, 222, 128, 0.20);
    border-color: rgba(74, 222, 128, 0.60);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(74, 222, 128, 0.20);
}

.horario-btn.selected {
    background: linear-gradient(135deg, #22c55e, #4ade80);
    color: #052010;
    border-color: #4ade80;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.25), 0 8px 24px rgba(74, 222, 128, 0.35);
    transform: translateY(-2px);
}

.horario-btn.selected .horario-label {
    opacity: 0.7;
}

/* ── HORÁRIOS: ocupado (vermelho) ── */
.horario-btn:disabled,
.horario-btn.ocupado {
    background: rgba(248, 113, 113, 0.08);
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.28);
    cursor: not-allowed;
    opacity: 1;
}

.horario-btn:disabled:hover,
.horario-btn.ocupado:hover {
    background: rgba(248, 113, 113, 0.12);
    border-color: rgba(248, 113, 113, 0.38);
    transform: none;
    box-shadow: none;
}

/* ── Contador de disponíveis ── */
.horarios-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: var(--sp-4);
    padding: 10px 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 8px;
    font-size: 0.85rem;
    flex-wrap: wrap;
}

.horarios-summary-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.horarios-summary-item .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1.5px solid;
    flex-shrink: 0;
}

.horarios-summary-item.livre .dot {
    background: rgba(74, 222, 128, 0.3);
    border-color: #4ade80;
}

.horarios-summary-item.livre {
    color: #4ade80;
}

.horarios-summary-item.ocupado .dot {
    background: rgba(248, 113, 113, 0.3);
    border-color: #f87171;
}

.horarios-summary-item.ocupado {
    color: #f87171;
}

.horarios-summary-divider {
    width: 1px;
    height: 16px;
    background: rgba(255,255,255,0.12);
}

/* ── Legenda dos horários (inline no step) ── */
.horarios-legend {
    display: flex;
    gap: 20px;
    margin-top: 12px;
    margin-bottom: var(--sp-5);
    flex-wrap: wrap;
}

.horarios-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.6);
    font-weight: 500;
}

.horarios-legend-box {
    width: 28px;
    height: 22px;
    border-radius: 5px;
    border: 1.5px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
}

.horarios-legend-box.livre {
    background: rgba(74, 222, 128, 0.10);
    border-color: rgba(74, 222, 128, 0.35);
    color: #4ade80;
}

.horarios-legend-box.ocupado {
    background: rgba(248, 113, 113, 0.10);
    border-color: rgba(248, 113, 113, 0.32);
    color: #f87171;
}

.horarios-legend-box.selecionado {
    background: linear-gradient(135deg, #22c55e, #4ade80);
    border-color: #4ade80;
    color: #052010;
}


/* ── Texto de hora dentro do botão ── */
.horario-btn .horario-time {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
}

/* Responsive: mobile */
@media (max-width: 480px) {
    .horarios-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .horario-btn {
        padding: 10px 6px;
    }
    .horario-btn .horario-time {
        font-size: 0.88rem;
    }
    .horario-btn .horario-label {
        font-size: 0.58rem;
    }
    .horarios-summary {
        font-size: 0.78rem;
    }
}
