/* ServicePress — Frontend Styles */

/* ── Flatpickr ───────────────────────────────────────────────── */
.flatpickr-calendar { font-family:inherit; box-shadow:0 4px 12px rgba(0,0,0,.15); border-radius:8px; }
.flatpickr-day.sp-date-available { background:#e7f7e7 !important; border-color:#4CAF50 !important; }
.flatpickr-day.sp-date-available:hover { background:#4CAF50 !important; color:#fff !important; border-color:#4CAF50 !important; }
.flatpickr-day.sp-date-unavailable { background:#ffe7e7 !important; color:#999 !important; border-color:#ffcccc !important; cursor:not-allowed !important; }
.flatpickr-day.sp-date-unavailable:hover { background:#ffe7e7 !important; color:#999 !important; }

/* ── Contenedor ──────────────────────────────────────────────── */
.rb-booking-form-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 40px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,.1);
    font-family: inherit;
}
.rb-booking-form-container h2 {
    text-align: center;
    margin-bottom: 35px;
    color: #333;
    font-size: 28px;
    font-weight: 500;
}

/* ── Steps ───────────────────────────────────────────────────── */
.rb-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    position: relative;
}
.rb-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 60px;
    right: 60px;
    height: 2px;
    background: #e0e0e0;
    z-index: 0;
}
.rb-step { display:flex; flex-direction:column; align-items:center; flex:1; position:relative; z-index:1; }
.rb-step-number {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 8px;
    transition: all .3s;
}
.rb-step-active .rb-step-number,
.rb-step-completed .rb-step-number { background: var(--rb-primary, #4F46E5); color: #fff; }
.rb-step-label { font-size:13px; color:#666; text-align:center; }
.rb-step-active .rb-step-label { color: var(--rb-primary, #4F46E5); font-weight:600; }

/* ── Form steps ──────────────────────────────────────────────── */
.rb-form-step { display:none; }
.rb-form-step.rb-active { display:block; }

.rb-form-group { margin-bottom:24px; }
.rb-form-group label { display:block; margin-bottom:8px; font-weight:600; color:#333; font-size:15px; }

.rb-form-group input[type="text"],
.rb-form-group input[type="email"],
.rb-form-group input[type="tel"],
.rb-form-group textarea,
#rb-booking-date {
    width: 100%;
    padding: 13px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color .3s;
    font-family: inherit;
    box-sizing: border-box;
    resize: vertical;
}
.rb-form-group input:focus,
.rb-form-group textarea:focus,
#rb-booking-date:focus { outline:none; border-color: var(--rb-primary, #4F46E5); }

.rb-form-row { display:grid; grid-template-columns:1fr 1fr; gap:18px; }
@media (max-width:520px) { .rb-form-row { grid-template-columns:1fr; } }

/* ── Slots de tiempo ─────────────────────────────────────────── */
.rb-time-slot-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(130px,1fr)); gap:12px; }

.rb-time-slot {
    padding: 16px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: all .25s;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 72px;
    justify-content: center;
}
.rb-time-slot:hover { border-color: var(--rb-primary, #4F46E5); background: rgba(79,70,229,.06); transform:translateY(-2px); }
.rb-time-slot.rb-selected {
    background: var(--rb-primary, #4F46E5);
    color: #fff;
    border-color: var(--rb-primary, #4F46E5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79,70,229,.3);
}
.rb-time-display { font-size:17px; display:block; }
.rb-availability { font-size:11px; margin-top:5px; opacity:.75; font-weight:normal; }
.rb-time-slot.rb-selected .rb-availability { opacity:.9; }

/* ── Selector de servicio ────────────────────────────────────── */
.sp-services-list { display:flex; flex-direction:column; gap:10px; }
.sp-service-opt {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all .2s;
}
.sp-service-opt:hover, .sp-service-opt.sp-selected {
    border-color: var(--rb-primary, #4F46E5);
    background: rgba(79,70,229,.05);
}
.sp-svc-img {
    width: 54px; height: 54px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}
.sp-svc-img--color { opacity: .85; }
.sp-svc-info { flex:1; }
.sp-svc-info strong { display:block; font-size:15px; margin-bottom:3px; }
.sp-svc-info span { font-size:13px; color:#888; display:block; }
.sp-svc-info small { font-size:12px; color:#aaa; }
.sp-svc-check {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--rb-primary, #4F46E5);
    color: #fff;
    display: flex; align-items:center; justify-content:center;
    font-size:12px;
    opacity: 0;
    transition: opacity .2s;
    flex-shrink: 0;
}
.sp-service-opt.sp-selected .sp-svc-check { opacity:1; }

/* ── Botones ─────────────────────────────────────────────────── */
.rb-form-actions { display:flex; gap:12px; margin-top:30px; }
.rb-btn {
    flex:1;
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all .25s;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.rb-btn-primary { background: var(--rb-primary, #4F46E5); color:#fff; }
.rb-btn-primary:hover { filter:brightness(1.1); transform:translateY(-2px); box-shadow:0 4px 12px rgba(79,70,229,.3); }
.rb-btn-primary:disabled { background:#ccc; cursor:not-allowed; transform:none; box-shadow:none; }
.rb-btn-secondary { background:#f5f5f5; color:#333; }
.rb-btn-secondary:hover { background:#e0e0e0; }

/* ── Mensajes ────────────────────────────────────────────────── */
.rb-messages { margin-bottom:16px; }
.rb-error { padding:13px 16px; background:#ffebee; color:#c62828; border-radius:8px; border-left:4px solid #c62828; margin-bottom:12px; font-size:14px; }
.rb-info { padding:13px 16px; background:#f5f5f5; color:#666; border-radius:8px; text-align:center; font-size:14px; }
.rb-info-message { padding:16px 18px; background:#e3f2fd; color:#1565c0; border-radius:8px; border-left:4px solid #1976d2; text-align:center; font-size:14px; }
.rb-loading { text-align:center; color:#888; padding:20px; font-size:14px; }

/* ── Éxito ───────────────────────────────────────────────────── */
.rb-booking-success { padding:0; }
.rb-success-header { text-align:center; padding:30px 20px 24px; border-bottom:1px solid #f0f0f0; margin-bottom:24px; }
.rb-success-check {
    width: 60px; height: 60px;
    border-radius: 50%;
    background: var(--rb-primary, #4F46E5);
    color: #fff;
    font-size: 30px;
    font-weight: 700;
    line-height: 60px;
    text-align: center;
    display: block;
    margin: 0 auto 16px;
    box-shadow: 0 4px 14px rgba(79,70,229,.3);
}
.rb-success-check.rb-check-pending { background:#f59e0b; box-shadow:0 4px 14px rgba(245,158,11,.3); }
.rb-booking-success h3 { color:#1a1a1a; margin:0 0 8px; font-size:20px; font-weight:700; }
.rb-success-message { color:#555; font-size:15px; margin:0; }

/* ── Tarjeta de pago ─────────────────────────────────────────── */
.rb-payment-card { background:#fffbeb; border:1.5px solid #fcd34d; border-radius:10px; padding:20px; }
.rb-payment-card__header { display:flex; align-items:flex-start; gap:12px; margin-bottom:14px; padding-bottom:12px; border-bottom:1px solid #fde68a; }
.rb-payment-card__icon { font-size:22px; flex-shrink:0; margin-top:2px; }
.rb-payment-card__header strong { display:block; font-size:14px; color:#92400e; margin-bottom:3px; }
.rb-payment-card__header p { margin:0; font-size:13px; color:#78350f; }
.rb-payment-card__amount { display:flex; align-items:center; justify-content:space-between; background:#fff; border:1px solid #fde68a; border-radius:7px; padding:10px 14px; margin-bottom:14px; }
.rb-payment-amount-label { font-size:13px; color:#555; }
.rb-payment-amount-value { font-size:20px; font-weight:800; color:#1a1a1a; }
.rb-payment-cta {
    display:flex; align-items:center; justify-content:center; gap:8px;
    width:100%; padding:13px 20px; font-size:15px; font-weight:700;
    border-radius:8px; text-decoration:none; margin-bottom:12px;
    box-sizing:border-box; background:#f59e0b !important;
    border:none; color:#fff !important; cursor:pointer;
    letter-spacing:.5px; text-transform:uppercase;
}
.rb-payment-cta:hover { background:#d97706 !important; transform:translateY(-1px); }
.rb-payment-card__note { margin:0; font-size:12px; color:#92400e; text-align:center; }

/* ── Info boxes (cancel/review) ──────────────────────────────── */
.sp-info-box, .sp-success-box {
    padding: 28px 24px;
    border-radius: 10px;
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}
.sp-info-box { background:#e3f2fd; border:1px solid #90caf9; }
.sp-success-box { background:#e8f5e9; border:1px solid #a5d6a7; }
.sp-success-icon { font-size:48px; display:block; margin-bottom:12px; }
.sp-info-box h3, .sp-success-box h3 { margin:0 0 8px; font-size:18px; }
.sp-info-box p, .sp-success-box p { margin:4px 0; font-size:14px; color:#555; }

/* ── Página cancelación ──────────────────────────────────────── */
.sp-cancel-page { max-width:560px; margin:0 auto; }
.sp-cancel-page h2 { font-size:22px; margin-bottom:20px; }
.sp-info-table-pub { width:100%; border-collapse:collapse; font-size:14px; margin-bottom:20px; }
.sp-info-table-pub td { padding:8px 12px; border-bottom:1px solid #eee; }
.sp-info-table-pub td:first-child { color:#888; width:40%; }
.sp-btn { display:inline-block; padding:13px 28px; border-radius:8px; font-weight:700; text-decoration:none; font-size:15px; cursor:pointer; border:none; }
.sp-btn-primary { background: var(--rb-primary, #4F46E5); color:#fff; }
.sp-btn-primary:hover { filter:brightness(1.1); }

/* ── Formulario reseña ───────────────────────────────────────── */
.sp-review-wrap { max-width:500px; margin:0 auto; }
.sp-review-wrap h2 { font-size:22px; margin-bottom:10px; }
.sp-star-rating { display:flex; flex-direction:row-reverse; justify-content:center; gap:6px; margin:20px 0; }
.sp-star-rating input { display:none; }
.sp-star-rating label { font-size:40px; color:#ddd; cursor:pointer; transition:color .15s; }
.sp-star-rating input:checked ~ label,
.sp-star-rating label:hover,
.sp-star-rating label:hover ~ label { color:#f59e0b; }
.sp-review-form button { background: var(--rb-primary, #4F46E5); color:#fff; padding:12px 28px; border:none; border-radius:8px; font-size:15px; font-weight:700; cursor:pointer; }

/* ── Modal ───────────────────────────────────────────────────── */
.rb-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    inset: 0;
    background: rgba(0,0,0,.6);
    backdrop-filter: blur(3px);
    overflow: auto;
}
.rb-modal-content {
    background: #fefefe;
    margin: 3% auto;
    width: 90%;
    max-width: 750px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,.3);
    max-height: 95vh;
    overflow-y: auto;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width:600px) {
    .rb-booking-form-container { padding:24px 16px; }
    .rb-time-slot-grid { grid-template-columns:repeat(3,1fr); gap:8px; }
    .rb-time-slot { padding:12px 6px; min-height:60px; font-size:14px; }
    .rb-time-display { font-size:15px; }
    .rb-steps::before { left:30px; right:30px; }
}

/* ── Detección de cliente ─────────────────────────────────────── */
.sp-detect-client-wrap {
    background: #f0f4ff;
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 20px;
}
.sp-detect-client-wrap > label { font-weight:600; font-size:14px; color:#3730A3; display:block; margin-bottom:8px; }
.sp-detect-row { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.sp-detect-row input { flex:1; min-width:200px; padding:10px 14px; border:2px solid #c7d2fe; border-radius:8px; font-size:14px; }
.sp-detect-spinner { font-size:16px; }
.sp-client-found { color:#065f46; font-size:13px; background:#d1fae5; border-radius:6px; padding:6px 12px; margin-top:8px; }

/* ── Banner de beneficios ────────────────────────────────────── */
.sp-benefit {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
    line-height: 1.5;
}
.sp-benefit--bono       { background:#fef3c7; border:1px solid #fcd34d; color:#92400e; }
.sp-benefit--membership { background:#ede9fe; border:1px solid #c4b5fd; color:#5b21b6; }

.sp-benefit--client-type { background:#fdf4ff; border:1px solid #e9d5ff; color:#7e22ce; }
