/**
 * PrimalBooking Frontend Styles
 */

/* Services Grid */
.pb-services-grid {
    display: grid;
    gap: 24px;
    margin: 20px 0;
}

.pb-columns-2 { grid-template-columns: repeat(2, 1fr); }
.pb-columns-3 { grid-template-columns: repeat(3, 1fr); }
.pb-columns-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
    .pb-services-grid { grid-template-columns: 1fr; }
}

/* Service Card */
.pb-service-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.pb-service-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.pb-service-content { padding: 20px; }
.pb-service-title { margin: 0 0 10px 0; font-size: 1.25em; }
.pb-service-excerpt { color: #555; margin-bottom: 15px; font-size: 0.9em; line-height: 1.5; }

.pb-service-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.pb-service-price { font-weight: 700; color: #2c3e50; font-size: 1.1em; }
.pb-service-duration { color: #666; font-size: 0.9em; }
.pb-service-duration::before { content: "\23F1\FE0F "; }

/* Buttons */
.pb-btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

.pb-btn-primary { background-color: #3498db; color: #fff; }
.pb-btn-primary:hover { background-color: #2980b9; color: #fff; }
.pb-btn-secondary { background-color: #ecf0f1; color: #2c3e50; border: 1px solid #bdc3c7; }
.pb-btn-secondary:hover { background-color: #dfe6e9; }
.pb-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* =========================================================================
   BOOKING WIZARD
   ========================================================================= */

.pb-wizard {
    max-width: 600px;
    margin: 30px auto;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Progress Bar */
.pb-wizard-progress {
    position: relative;
    margin-bottom: 30px;
}

.pb-wizard-progress-bar {
    position: absolute;
    top: 14px;
    left: 0;
    height: 3px;
    background: #3498db;
    transition: width 0.3s ease;
    border-radius: 2px;
    z-index: 0;
}

.pb-wizard-steps-indicator {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.pb-wizard-steps-indicator::before {
    content: '';
    position: absolute;
    top: 14px;
    left: 0;
    right: 0;
    height: 3px;
    background: #ecf0f1;
    z-index: -1;
}

.pb-step-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #ecf0f1;
    color: #95a5a6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.3s ease;
}

.pb-step-dot.active {
    background: #3498db;
    color: #fff;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.4);
}

.pb-step-dot.completed {
    background: #27ae60;
    color: #fff;
}

/* Wizard Steps */
.pb-wizard-step {
    display: none;
    animation: pbFadeIn 0.3s ease;
}

.pb-wizard-step.active {
    display: block;
}

@keyframes pbFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.pb-wizard-step h3 {
    margin: 0 0 20px 0;
    font-size: 1.3em;
    color: #2c3e50;
}

/* Service Selection (Step 1) */
.pb-service-select-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pb-service-option {
    display: block;
    cursor: pointer;
}

.pb-service-option input[type="radio"],
.pb-service-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.pb-service-option-content {
    display: block;
    padding: 15px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.pb-service-option-content strong {
    display: block;
    font-size: 1.05em;
    margin-bottom: 4px;
}

.pb-service-option-content .pb-service-option-meta {
    font-size: 0.85em;
    color: #666;
}

.pb-service-option-content small {
    display: block;
    margin-top: 6px;
    color: #888;
    font-size: 0.8em;
}

.pb-service-option input[type="radio"]:checked + .pb-service-option-content {
    border-color: #3498db;
    background: #ebf5fb;
}

.pb-service-option-content:hover {
    border-color: #3498db;
}

.pb-selected-service-card {
    padding: 15px 18px;
    background: #ebf5fb;
    border: 2px solid #3498db;
    border-radius: 8px;
}

.pb-selected-service-card strong { display: block; margin-bottom: 4px; }
.pb-selected-service-card span { color: #666; font-size: 0.9em; }

/* Time Slots (Step 3) */
.pb-slots-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pb-slots-placeholder {
    color: #888;
    font-style: italic;
}

.pb-no-slots {
    color: #e74c3c;
    font-weight: 500;
}

.pb-slot-option { position: relative; }

.pb-slot-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.pb-slot-option label {
    display: inline-block;
    padding: 10px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95em;
    transition: all 0.2s ease;
}

.pb-slot-option input[type="radio"]:checked + label {
    border-color: #3498db;
    background: #ebf5fb;
    color: #2980b9;
    font-weight: 700;
}

.pb-slot-option label:hover { border-color: #3498db; }

/* Contact Details (Step 4) */
.pb-payment-note {
    background: #f8f9fa;
    border-left: 4px solid #27ae60;
    padding: 10px 15px;
    margin-bottom: 20px;
    font-size: 0.9em;
    color: #555;
}

.pb-phone-verify-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.pb-phone-verify-row input {
    flex: 1;
}

.pb-phone-verify-row .pb-btn {
    white-space: nowrap;
    padding: 10px 16px;
    font-size: 13px;
}

.pb-field-note {
    margin-top: 5px;
    font-size: 0.8em;
    color: #888;
}

.pb-verify-status {
    font-size: 0.85em;
    margin-top: 5px;
    font-weight: 600;
}

.pb-success-text { color: #27ae60; }
.pb-verify-status.pb-error { color: #e74c3c; }

/* Wizard Navigation */
.pb-wizard-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* Forms General */
.pb-form { max-width: 600px; }

.pb-form-group { margin-bottom: 18px; }

.pb-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.pb-form-group input[type="text"],
.pb-form-group input[type="email"],
.pb-form-group input[type="tel"],
.pb-form-group input[type="date"],
.pb-form-group input[type="time"],
.pb-form-group select,
.pb-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.pb-form-group input:focus,
.pb-form-group select:focus,
.pb-form-group textarea:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.pb-form-row { display: flex; gap: 15px; }
.pb-form-half { flex: 1; }

@media (max-width: 480px) {
    .pb-form-row { flex-direction: column; gap: 0; }
    .pb-phone-verify-row { flex-direction: column; }
}

/* Messages */
.pb-form-message {
    margin-top: 15px;
    padding: 12px 16px;
    border-radius: 5px;
    display: none;
}

.pb-form-message.pb-success {
    display: block;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.pb-form-message.pb-error {
    display: block;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Loading */
.pb-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.pb-loading::after {
    content: "";
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-top-color: #3498db;
    border-radius: 50%;
    animation: pb-spin 0.8s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

@keyframes pb-spin {
    to { transform: rotate(360deg); }
}

/* Request Form */
.pb-request-form-wrapper {
    max-width: 600px;
    margin: 30px 0;
}


/* Request fallback (no slots available) */
.pb-no-slots-request {
    color: #856404;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 0.9em;
    margin-bottom: 15px;
}

.pb-request-fallback {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

/* ========================================================================= *
 * Multi-service selection summary (step 1)
 * ========================================================================= */
.pb-step-hint {
    color: #6b706a;
    margin-top: -0.4em;
    margin-bottom: 1rem;
}

.pb-service-summary {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    background: #eef2e9;
    border: 1px solid #d6e0cf;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.pb-summary-count {
    font-weight: 600;
    color: #46633f;
}

.pb-summary-totals {
    display: flex;
    gap: 1.25rem;
    font-weight: 600;
}

.pb-summary-totals #pb-summary-price {
    color: #46633f;
}

/* Selected service option highlight (checkbox mode) — mirror the radio style
   so the whole card reads as selected, with a leading check mark to make the
   multi-select state obvious. */
.pb-service-option input[type="checkbox"]:checked + .pb-service-option-content {
    border-color: #5a7d5a;
    background: #eef2e9;
}
.pb-service-option input[type="checkbox"]:checked + .pb-service-option-content strong::before {
    content: "\2713\00a0"; /* check mark + non-breaking space */
    color: #46633f;
    font-weight: 700;
}

/* ========================================================================= *
 * Date chip grid (step 2)
 * ========================================================================= */
.pb-date-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.pb-date-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 0.6rem 0.4rem;
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    font: inherit;
    line-height: 1.1;
    color: #2f342f;
    transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.pb-date-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(47, 52, 47, 0.12);
}

/* Available = green, Unavailable = red. Both remain clickable. */
.pb-date-available {
    background: #e3f0e0;
    color: #2f5d2a;
}
.pb-date-available:hover {
    border-color: #5a7d5a;
}

.pb-date-unavailable {
    background: #f6e0dd;
    color: #8a3b2f;
}
.pb-date-unavailable:hover {
    border-color: #c0533f;
}

.pb-date-chip.selected {
    border-color: #46633f;
    box-shadow: 0 0 0 2px rgba(70, 99, 63, 0.25);
}

.pb-chip-day {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.85;
}
.pb-chip-num {
    font-size: 1.25rem;
    font-weight: 700;
}
.pb-chip-month {
    font-size: 0.7rem;
    opacity: 0.85;
}

.pb-date-calendar {
    margin-top: 0.5rem;
}
.pb-date-calendar-label {
    display: block;
    font-size: 0.9rem;
    color: #6b706a;
    margin-bottom: 0.35rem;
}

.pb-no-dates {
    color: #6b706a;
    font-style: italic;
}

/* ========================================================================= *
 * Service list pager (step 1, 6 per page)
 * ========================================================================= */
.pb-service-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.pb-pager-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #d6e0cf;
    background: #fff;
    border-radius: 50%;
    font-size: 1.3rem;
    line-height: 1;
    color: #46633f;
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease, opacity 120ms ease;
}

.pb-pager-btn:hover:not(:disabled) {
    background: #eef2e9;
    border-color: #5a7d5a;
}

.pb-pager-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.pb-pager-status {
    font-size: 0.9rem;
    color: #6b706a;
    min-width: 90px;
    text-align: center;
}


/* =========================================================================
   SERVICE CATEGORIES (booking wizard step 1)
   ========================================================================= */

.pb-service-category {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-top: 10px;
    overflow: hidden;
}

.pb-service-category.has-selection {
    border-color: #3498db;
}

.pb-category-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 14px 16px;
    background: #f8f9fa;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
    text-align: left;
    transition: background 0.15s ease;
}

.pb-category-toggle:hover {
    background: #eef1f4;
}

.pb-category-name {
    flex: 1;
}

.pb-category-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    background: #e0e0e0;
    color: #555;
    font-size: 12px;
    font-weight: 600;
}

.pb-category-selected {
    color: #3498db;
    font-size: 13px;
    font-weight: 600;
}

.pb-category-chevron {
    color: #999;
    transition: transform 0.15s ease;
}

.pb-service-category.open .pb-category-chevron {
    transform: rotate(90deg);
}

.pb-category-services {
    padding: 10px 14px 14px;
    border-top: 1px solid #eee;
}

/* Admin: category separator rows in the services list table */
.pb-cat-row td {
    background: #f1f1f1;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #555;
}
