/* ---------------------------------------------------------------
   AOF Booking Widget
--------------------------------------------------------------- */
.aof-booking-widget {
  max-width: 860px;
  margin: 0 auto;
  font-family: inherit;
  color: #333;
  position: relative;
}

/* Loading overlay */
.aof-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: 10px;
}
.aof-loading-overlay--active {
  display: flex;
}
.aof-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid #eee;
  border-top-color: var(--primary-color, #1a1a1a);
  border-radius: 50%;
  animation: aofSpin 0.8s linear infinite;
}
@keyframes aofSpin {
  to {
    transform: rotate(360deg);
  }
}

/* Any-Available staff card */
.aof-staff-card--any {
  border-style: dashed;
  background: #fafafa;
}
.aof-staff-card__placeholder--any {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  color: #999;
  background: #f0f0f0;
}

/* Step indicator */
.aof-steps {
  display: flex;
  gap: 0;
  margin-bottom: 32px;
  border-bottom: 2px solid #eee;
  padding-bottom: 0;
}
.aof-step {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  color: #999;
  font-size: 14px;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition:
    color 0.2s,
    border-color 0.2s;
  flex-direction: column;
}
.aof-step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #eee;
  color: #999;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  transition:
    background 0.2s,
    color 0.2s;
  flex-direction: column;
}
.aof-step--active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}
.aof-step--active .aof-step__num {
  background: var(--primary-color);
  color: var(--primary-color-text);
}
.aof-step--completed {
  color: var(--primary-color);
}
.aof-step--completed .aof-step__num {
  background: var(--primary-color);
  color: var(--primary-color-text);
}

/* Panel */
.aof-panel {
  animation: aofFadeIn 0.25s ease;
}
.aof-panel--hidden {
  display: none !important;
}
@keyframes aofFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.aof-panel__title {
  font-size: 20px;
  margin: 0 0 8px;
}
.aof-panel__subtitle {
  color: #666;
  margin: 0 0 20px;
  font-size: 14px;
}

/* Staff grid */
.aof-staff-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}
.aof-staff-card {
  border: 2px solid #eee;
  border-radius: 10px;
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  background: #fff;
}
.aof-staff-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.aof-staff-card--selected {
  border-color: #1a1a1a;
}
.aof-staff-card img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 12px;
  display: block;
}
.aof-staff-card__placeholder {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #eee;
  margin: 0 auto 12px;
}
.aof-staff-card h3 {
  font-size: 15px;
  margin: 0 0 6px;
}
.aof-staff-card p {
  font-size: 13px;
  color: #666;
  margin: 0 0 12px;
  line-height: 1.4;
}

/* Services list */
.aof-services-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.aof-service-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 2px solid #eee;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s;
  background: #fff;
}
.aof-service-item:hover {
  border-color: #ccc;
}
.aof-service-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: #1a1a1a;
}
.aof-service-item img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
.aof-service-name {
  flex: 1;
  font-weight: 600;
  font-size: 15px;
}
.aof-service-meta {
  font-size: 13px;
  color: #666;
  white-space: nowrap;
}

.aof-total-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #f9f9f9;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 15px;
}
.aof-total-summary .aof-total-price {
  font-size: 18px;
}
.aof-total-summary .aof-total-duration {
  color: #888;
}

/* Date + Slots */
.aof-datetime-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}
@media (max-width: 600px) {
  .aof-datetime-wrap {
    grid-template-columns: 1fr;
  }
}

.aof-datepicker {
  width: 100%;
  visibility: hidden;
  height: 0;
  padding: 0;
  border: 0;
}

.aof-slots-prompt {
  color: #888;
  font-size: 14px;
}
.aof-slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
}
.aof-slot-btn {
  padding: 10px 6px;
  border: 2px solid #ddd;
  border-radius: 6px;
  background: #fff;
  font-size: 14px;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s,
    color 0.15s;
  font-weight: 500;
}
.aof-slot-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}
.aof-slot-btn--active,
.aof-slot-btn--active:hover {
  border-color: var(--primary-color);
  background: var(--primary-color);
  color: var(--primary-color-text);
}

/* Summary */
.aof-summary-box {
  background: #f9f9f9;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 24px;
}
.aof-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.aof-summary-table td {
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}
.aof-summary-table td:last-child {
  text-align: right;
}
.aof-summary-total td {
  border-bottom: none;
  padding-top: 12px;
  font-size: 16px;
}

/* Customer form */
.aof-form-row {
  margin-bottom: 16px;
}
.aof-form-row label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #444;
}
.aof-form-row input,
.aof-form-row textarea {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.aof-form-row input:focus,
.aof-form-row textarea:focus {
  outline: none;
  border-color: #1a1a1a;
}

.aof-payment-options {
  margin-bottom: 20px;
}
.aof-payment-options h3 {
  font-size: 16px;
  margin: 0 0 10px;
}
.aof-radio-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 15px;
  cursor: pointer;
  padding: 20px 5px;
  border: 1px solid #ebebeb;
  border-radius: 10px;
}
.aof-radio-label input[type="radio"] {
  accent-color: #1a1a1a;
  width: 18px;
  height: 18px;
}
.aof-radio-label input[type="radio"]:checked {
  accent-color: var(--primary-color);
}

/* Buttons */
.aof-nav {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  align-items: center;
  justify-content: space-between;
}
.aof-nav button {
  width: 50%;
}
.aof-btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s;
  font-family: inherit;
  line-height: 1;
}
.aof-btn--submit {
  padding-left: 0px;
  padding-right: 0px;
}
.aof-btn--select,
.aof-btn--next,
.aof-btn--submit {
  background: var(--primary-color);
  color: var(--primary-color-text);
  border-color: var(--primary-color);
}
.aof-btn--select:hover,
.aof-btn--next:hover,
.aof-btn--submit:hover {
  background: var(--primary-color-hover);
  color: var(--primary-color-hover-text);
  border-color: var(--primary-color-hover-text);
}
.flatpickr-day:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background-color: #fff;
}
.flatpickr-day.selected,
.flatpickr-day.selected:hover {
  background-color: var(--primary-color);
  color: var(--primary-color-text);
  border-color: var(--primary-color);
}
.aof-btn--back {
  background: #fff;
  color: #1d1d1d;
  border-color: #1d1d1d;
}
.aof-btn--back:hover {
  color: #fff;
  background-color: #1d1d1d;
}
.aof-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.aof-btn--select {
  width: 100%;
  border-radius: 5px;
}

/* Success */
.aof-success-panel {
  text-align: center;
  padding: 40px 20px;
}
.aof-success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #4caf50;
  color: #fff;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.aof-success-panel h2 {
  font-size: 22px;
  margin: 0 0 12px;
}
.aof-success-msg {
  color: #555;
  font-size: 15px;
}

/* Error */
.aof-error-msg {
  padding: 10px 14px;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 6px;
}

/* ---------------------------------------------------------------
   My Bookings — WC My Account tab
--------------------------------------------------------------- */
.aof-myaccount-title {
  margin-bottom: 20px;
}

.aof-my-bookings {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}

.aof-booking-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.aof-booking-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

.aof-booking-ref {
  font-weight: 600;
  font-size: 15px;
  color: #111;
}

.aof-booking-status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.aof-booking-status--pending_payment {
  background: #fef3c7;
  color: #92400e;
}
.aof-booking-status--confirmed {
  background: #dcfce7;
  color: #166534;
}
.aof-booking-status--pay_later {
  background: #dbeafe;
  color: #1e40af;
}
.aof-booking-status--cancelled {
  background: #fee2e2;
  color: #991b1b;
}
.aof-booking-status--completed {
  background: #f3f4f6;
  color: #374151;
}

.aof-booking-card__body {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.aof-booking-detail {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 20px;
  border-bottom: 1px solid #f3f4f6;
  font-size: 14px;
  color: #111;
}
.aof-booking-detail:nth-child(odd) {
  border-right: 1px solid #f3f4f6;
}

.aof-booking-detail__label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #9ca3af;
}

.aof-booking-card__footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
}

.aof-cancel-form {
  display: inline;
}

.aof-btn--cancel {
  background: #fff;
  color: #dc2626;
  border: 2px solid #dc2626;
  padding: 8px 18px;
  font-size: 13px;
}
.aof-btn--cancel:hover {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}

.aof-btn--pay {
  background: #16a34a;
  color: #fff;
  border: 2px solid #16a34a;
  border-radius: 6px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.aof-btn--pay:hover {
  background: #15803d;
  border-color: #15803d;
  color: #fff;
}

/* Guest lookup form */
.aof-lookup-form {
  margin: 20px 0;
}
.aof-lookup-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  max-width: 480px;
}
.aof-lookup-row input[type="email"] {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 15px;
  font-family: inherit;
}
.aof-lookup-row input[type="email"]:focus {
  outline: none;
  border-color: #1a1a1a;
}
.aof-lookup-empty {
  color: #666;
  font-style: italic;
  margin-top: 16px;
}

@media (max-width: 600px) {
  .aof-booking-card__body {
    grid-template-columns: 1fr;
  }
  .aof-booking-detail:nth-child(odd) {
    border-right: none;
  }
  .aof-booking-card__footer {
    flex-direction: column;
    align-items: stretch;
  }
  .aof-booking-card__footer .aof-btn,
  .aof-booking-card__footer a.aof-btn {
    text-align: center;
  }
  .aof-lookup-row {
    flex-direction: column;
    max-width: 100%;
  }
}

/* Flatpickr overrides */
.flatpickr-calendar {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
  border-radius: 10px !important;
}
.aof-staff-card {
  display: flex;
  flex-direction: column;
}

.aof-staff-card-body {
  flex-grow: 1;
}
.aof-selected-staff-name {
  font-size: 16px;
  color: var(--primary-color);
  font-weight: bold;
}
@media (max-width: 500px) {
  .aof-step__label {
    display: none;
  }
}
@media (max-width: 749px) {
  .aof-staff-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
