/* ============================================================
   WooCommerce Booking & Consultation – Front-End Styles
   ============================================================ */

:root {
    --wb-primary:     #2563eb;
    --wb-primary-dk:  #1d4ed8;
    --wb-primary-lt:  #eff6ff;
    --wb-accent:      #10b981;
    --wb-danger:      #ef4444;
    --wb-warn:        #f59e0b;
    --wb-text:        #1e293b;
    --wb-muted:       #64748b;
    --wb-border:      #e2e8f0;
    --wb-bg:          #f8fafc;
    --wb-white:       #ffffff;
    --wb-radius:      12px;
    --wb-radius-sm:   8px;
    --wb-shadow:      0 4px 24px rgba(37,99,235,.10);
    --wb-shadow-sm:   0 2px 8px rgba(0,0,0,.07);
    --wb-transition:  all .2s ease;
    --wb-font:        -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Wrap */
.woo-booking-wrap {
    font-family: var(--wb-font);
    background: var(--wb-white);
    border: 1.5px solid var(--wb-border);
    border-radius: var(--wb-radius);
    box-shadow: var(--wb-shadow);
    padding: 28px;
    margin: 28px 0 20px;
    max-width: 640px;
}

/* Header */
.wb-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1.5px solid var(--wb-border);
}
.wb-header-icon { font-size: 2.2rem; line-height: 1; }
.wb-header h3 { margin: 0 0 4px; font-size: 1.25rem; font-weight: 700; color: var(--wb-text); }
.wb-header p  { margin: 0; font-size: .875rem; color: var(--wb-muted); }

/* Steps */
.wb-step { margin-bottom: 24px; }
.wb-step-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--wb-muted);
    margin-bottom: 14px;
}
.wb-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--wb-primary);
    color: #fff;
    font-size: .75rem;
    font-weight: 800;
    flex-shrink: 0;
}

/* Consultation Type Cards */
.wb-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
}
.wb-type-card {
    position: relative;
    cursor: pointer;
}
.wb-type-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0; height: 0;
}
.wb-type-card span {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 10px;
    border: 2px solid var(--wb-border);
    border-radius: var(--wb-radius-sm);
    background: var(--wb-bg);
    transition: var(--wb-transition);
    text-align: center;
    font-size: .8rem;
    font-weight: 600;
    color: var(--wb-muted);
    user-select: none;
}
.wb-type-icon { font-size: 1.6rem; }
.wb-type-card input:checked + .wb-type-icon,
.wb-type-card:has(input:checked) span {
    border-color: var(--wb-primary);
    background: var(--wb-primary-lt);
    color: var(--wb-primary);
}
.wb-type-card:has(input:checked) span.wb-type-icon {
    border: none;
    background: none;
}
/* JS-driven selected class (works in all browsers, unlike :has() on older ones) */
.wb-type-card.wb-type-selected > span,
.wb-type-card:hover > span {
    border-color: var(--wb-primary);
    background: var(--wb-primary-lt);
    color: var(--wb-primary);
}
/* Trick: style the whole label-as-card */
.wb-type-card {
    display: block;
}
.wb-type-card > span {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 10px;
    border: 2px solid var(--wb-border);
    border-radius: var(--wb-radius-sm);
    background: var(--wb-bg);
    transition: var(--wb-transition);
    text-align: center;
    font-size: .8rem;
    font-weight: 600;
    color: var(--wb-muted);
    cursor: pointer;
}
.wb-type-card > span:first-of-type { font-size: 1.6rem; }

/* Calendar */
.wb-calendar-wrap {
    background: var(--wb-bg);
    border: 1.5px solid var(--wb-border);
    border-radius: var(--wb-radius-sm);
    overflow: hidden;
}
.wb-cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--wb-primary);
    color: #fff;
}
.wb-cal-title { font-weight: 700; font-size: 1rem; }
.wb-cal-prev, .wb-cal-next {
    background: rgba(255,255,255,.2);
    border: none;
    color: #fff;
    width: 32px; height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--wb-transition);
}
.wb-cal-prev:hover, .wb-cal-next:hover { background: rgba(255,255,255,.35); }

.wb-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--wb-primary-dk);
    color: rgba(255,255,255,.75);
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    text-align: center;
}
.wb-cal-weekdays > div { padding: 8px 4px; }

.wb-cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    padding: 8px;
    background: var(--wb-bg);
}

.wb-day {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    border-radius: 8px;
    font-size: .82rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--wb-transition);
    color: var(--wb-text);
    position: relative;
    min-width: 0;
}
.wb-day:hover:not(.wb-day-disabled):not(.wb-day-empty) {
    background: var(--wb-primary-lt);
    color: var(--wb-primary);
}
.wb-day-empty  { cursor: default; }
.wb-day-disabled {
    color: var(--wb-border);
    cursor: not-allowed;
}
.wb-day-today {
    background: var(--wb-primary-lt);
    color: var(--wb-primary);
    font-weight: 700;
}
.wb-day-selected {
    background: var(--wb-primary) !important;
    color: #fff !important;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(37,99,235,.4);
}
.wb-day-booked::after {
    content: '';
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px; height: 4px;
    border-radius: 50%;
    background: var(--wb-warn);
}
.wb-day-full::after { background: var(--wb-danger); }
.wb-day-closed { color: var(--wb-border) !important; cursor: not-allowed; }

/* Time slots */
.wb-slots-wrap {
    min-height: 60px;
}
.wb-slots-placeholder {
    color: var(--wb-muted);
    font-size: .875rem;
    font-style: italic;
    padding: 8px 0;
    margin: 0;
}
.wb-slots-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--wb-muted);
    font-size: .875rem;
}
.wb-spinner {
    width: 18px; height: 18px;
    border: 2px solid var(--wb-border);
    border-top-color: var(--wb-primary);
    border-radius: 50%;
    animation: wb-spin .7s linear infinite;
}
@keyframes wb-spin { to { transform: rotate(360deg); } }

.wb-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
    margin-top: 4px;
}
.wb-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 8px;
    border: 2px solid var(--wb-border);
    border-radius: var(--wb-radius-sm);
    cursor: pointer;
    transition: var(--wb-transition);
    background: var(--wb-white);
    text-align: center;
    user-select: none;
}
.wb-slot:hover:not(.wb-slot-full):not(.wb-slot-past):not(.wb-slot-booked) {
    border-color: var(--wb-primary);
    background: var(--wb-primary-lt);
}
.wb-slot.wb-slot-selected {
    border-color: var(--wb-accent);
    background: #ecfdf5;
    box-shadow: 0 0 0 3px rgba(16,185,129,.15);
}
/* Legacy alias – keep for safety */
.wb-slot.selected {
    border-color: var(--wb-accent);
    background: #ecfdf5;
    box-shadow: 0 0 0 3px rgba(16,185,129,.15);
}
.wb-slot-time {
    font-weight: 700;
    font-size: .9rem;
    color: var(--wb-text);
}
.wb-slot-end {
    font-size: .72rem;
    color: var(--wb-muted);
    margin-top: 2px;
}
.wb-slot-avail {
    font-size: .7rem;
    font-weight: 600;
    margin-top: 5px;
    padding: 2px 8px;
    border-radius: 20px;
    background: #d1fae5;
    color: #065f46;
}
.wb-slot-full .wb-slot-avail,
.wb-slot-booked .wb-slot-avail {
    background: var(--wb-bg);
    color: var(--wb-muted);
}
.wb-slot-past .wb-slot-avail {
    background: var(--wb-bg);
    color: var(--wb-muted);
}
.wb-slot-full, .wb-slot-past, .wb-slot-booked {
    opacity: .5;
    cursor: not-allowed;
    /* No pointer-events:none — that would let clicks fall through to
       underlying elements in some themes and cause confusion. Instead
       the JS click handler guards against these classes explicitly. */
}
/* Ensure full/past slots can never appear selected */
.wb-slot-full.wb-slot-selected,
.wb-slot-past.wb-slot-selected {
    border-color: var(--wb-border);
    background: var(--wb-white);
    box-shadow: none;
}
.wb-no-slots {
    color: var(--wb-muted);
    font-size: .875rem;
    text-align: center;
    padding: 20px;
    background: var(--wb-bg);
    border-radius: var(--wb-radius-sm);
    border: 1.5px dashed var(--wb-border);
}

/* Notes textarea */
.woo-booking-wrap textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1.5px solid var(--wb-border);
    border-radius: var(--wb-radius-sm);
    padding: 12px 14px;
    font-family: var(--wb-font);
    font-size: .875rem;
    color: var(--wb-text);
    resize: vertical;
    transition: var(--wb-transition);
    background: var(--wb-bg);
    line-height: 1.6;
}
.woo-booking-wrap textarea:focus {
    outline: none;
    border-color: var(--wb-primary);
    background: var(--wb-white);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

/* Summary */
.wb-summary {
    background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
    border: 1.5px solid var(--wb-accent);
    border-radius: var(--wb-radius-sm);
    padding: 16px 20px;
    margin-top: 8px;
    animation: wb-fade-in .3s ease;
}
.wb-summary h4 { margin: 0 0 12px; font-size: .95rem; color: var(--wb-text); }
.wb-summary-grid { display: flex; flex-direction: column; gap: 8px; }
.wb-summary-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: .875rem;
}
.wb-summary-label { font-weight: 700; color: var(--wb-muted); min-width: 80px; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.wb-summary-val   { color: var(--wb-text); font-weight: 600; }

@keyframes wb-fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Mobile */
@media (max-width: 480px) {
    .woo-booking-wrap { padding: 18px; }
    .wb-type-grid { grid-template-columns: repeat(2, 1fr); }
    .wb-slots-grid { grid-template-columns: repeat(3, 1fr); }
}
