/* ─── Book Order Form v2 ───────────────────────────────────────────────────── */

/* ── Custom picker wrapper ───────────────────────────────────────────────── */

.bof-picker {
  position: relative;
  font-family: inherit;
}

/* ── Search row ──────────────────────────────────────────────────────────── */

.bof-picker__row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  cursor: text;
}

.bof-picker--open .bof-picker__row,
.bof-picker__row:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  border-radius: 8px 8px 0 0;
}

.bof-picker__search-icon {
  color: #94a3b8;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.bof-picker__input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  color: #0f172a;
  background: transparent;
  min-width: 0;
}

.bof-picker__input::placeholder { color: #94a3b8; }

/* Subtle pulse on the border when search is running */
.bof-picker__input--searching {
  caret-color: #3b82f6;
}

/* ── Spinner ─────────────────────────────────────────────────────────────── */

.bof-picker__spinner {
  display: flex;
  align-items: center;
  color: #3b82f6;
  animation: bof-spin 0.8s linear infinite;
}

@keyframes bof-spin {
  to { transform: rotate(360deg); }
}

/* ── Result count badge ──────────────────────────────────────────────────── */

.bof-picker__count {
  font-size: 11px;
  color: #64748b;
  white-space: nowrap;
  flex-shrink: 0;
  background: #f1f5f9;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 0;
  transition: opacity 0.2s;
}
.bof-picker__count:empty { display: none; }

/* ── Dropdown panel ──────────────────────────────────────────────────────── */

.bof-picker__dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #fff;
  border: 1.5px solid #3b82f6;
  border-top: none;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  max-height: 460px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Subtle entrance animation */
.bof-picker__dropdown:not([hidden]) {
  animation: bof-slide-in 0.12s ease-out;
}
@keyframes bof-slide-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.bof-picker__list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
}

/* ── Empty state ─────────────────────────────────────────────────────────── */

.bof-picker__empty {
  padding: 20px 16px;
  text-align: center;
  color: #64748b;
  font-size: 13px;
}

/* ── Book row ────────────────────────────────────────────────────────────── */

.bof-picker__book {
  border-bottom: 1px solid #eef2f6;
  padding: 12px 14px;
  transition: background-color 0.12s;
}
.bof-picker__book:last-child { border-bottom: none; }
.bof-picker__book:hover { background-color: #fafbfc; }

.bof-picker__book-head { margin-bottom: 9px; }

.bof-picker__book-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.bof-picker__book-name {
  font-size: 14.5px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.bof-picker__book-author {
  font-size: 12.5px;
  font-weight: 500;
  color: #475569;
}

.bof-picker__book-by {
  font-weight: 400;
  color: #94a3b8;
  margin-right: 1px;
}

/* ── Highlight match ─────────────────────────────────────────────────────── */

.bof-hl {
  background: #fef08a;
  color: #713f12;
  border-radius: 2px;
  font-style: normal;
  padding: 0 1px;
}

/* ── Format buttons ──────────────────────────────────────────────────────── */

.bof-picker__formats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bof-picker__fmt-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 20px;
  background: #fff;
  font-size: 12px;
  color: #334155;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: background 0.12s, border-color 0.12s, color 0.12s, box-shadow 0.12s, transform 0.12s;
  white-space: nowrap;
}

.bof-picker__fmt-btn:hover,
.bof-picker__fmt-btn:focus-visible {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1e40af;
  outline: none;
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.18);
  transform: translateY(-1px);
}

.bof-picker__fmt-btn--digital {
  border-style: dashed;
}

.bof-picker__fmt-icon {
  display: flex;
  align-items: center;
  color: #64748b;
  flex-shrink: 0;
}

.bof-picker__fmt-btn:hover .bof-picker__fmt-icon,
.bof-picker__fmt-btn:focus .bof-picker__fmt-icon {
  color: #1e40af;
}

.bof-picker__fmt-name { font-weight: 600; }

.bof-picker__fmt-isbn {
  color: #94a3b8;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  padding-left: 6px;
  border-left: 1px solid #e2e8f0;
}

.bof-picker__fmt-price {
  font-weight: 700;
  color: #16a34a;
  font-size: 12px;
  padding-left: 6px;
  border-left: 1px solid #e2e8f0;
}

/* ── Preview card ─────────────────────────────────────────────────────────── */

.bof-picker__preview { margin-top: 12px; }

.bof-preview {
  display: flex;
  gap: 18px;
  padding: 18px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  animation: bof-fade-in 0.2s ease;
}

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

/* Cover column */
.bof-preview__cover-col {
  flex-shrink: 0;
  width: 90px;
}

.bof-preview__cover-placeholder {
  width: 90px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  border-radius: 6px;
}

.bof-preview__cover-img {
  width: 90px;
  height: auto;
  max-height: 130px;
  border-radius: 6px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  display: block;
}

/* Body */
.bof-preview__body {
  flex: 1;
  min-width: 0;
}

.bof-preview__title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.bof-preview__title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  line-height: 1.3;
}

.bof-preview__author {
  font-size: 13px;
  color: #64748b;
  margin: 0 0 6px;
}

.bof-preview__subtitle {
  font-size: 12px;
  color: #475569;
  font-style: italic;
  margin: 0 0 8px;
  line-height: 1.4;
}

/* Format badge */
.bof-preview__format-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  background: #dbeafe;
  color: #1e40af;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
}
.bof-preview__format-badge--digital {
  background: #f0fdf4;
  color: #166534;
}

.bof-preview__format-badge svg {
  vertical-align: -2px;
  margin-right: 3px;
}

/* Meta key/value grid */
.bof-preview__meta {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.bof-preview__meta-row {
  display: flex;
  gap: 8px;
  padding: 3px 0;
  border-bottom: 1px solid #f1f5f9;
}
.bof-preview__meta-row:last-child { border-bottom: none; }

.bof-preview__meta dt {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  min-width: 70px;
  flex-shrink: 0;
  padding-top: 1px;
}

.bof-preview__meta dd {
  font-size: 13px;
  color: #334155;
  margin: 0;
  word-break: break-word;
}

/* Skeleton loading placeholder */
.bof-skeleton {
  display: inline-block;
  min-width: 80px;
  height: 14px;
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: bof-shimmer 1.2s infinite;
  border-radius: 4px;
  vertical-align: middle;
}

@keyframes bof-shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* Change button */
.bof-preview__change {
  flex-shrink: 0;
  padding: 4px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  color: #64748b;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.bof-preview__change:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}

/* GF success message */
.bof-success-msg,
.gform_confirmation_message .bof-success-msg {
  padding: 16px 20px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  color: #166534;
  font-size: 14px;
}

/* ── Fallback HTML form styles ───────────────────────────────────────────── */

.bof-wrapper { max-width: 768px; margin: 0 auto; font-family: inherit; }

.bof-alert {
  padding: 14px 18px; border-radius: 8px; margin-bottom: 24px; font-size: 14px;
}
.bof-alert--success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }

.bof-form {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 16px;
  padding: 32px; box-shadow: 0 1px 3px rgba(0,0,0,0.07);
}

.bof-section { margin-bottom: 32px; padding-bottom: 32px; border-bottom: 1px solid #f1f5f9; }
.bof-section:last-of-type { border-bottom: none; margin-bottom: 0; }
.bof-section__title { margin: 0 0 20px; font-size: 16px; font-weight: 600; color: #1e293b; }

.bof-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }

.bof-field label { font-size: 13px; font-weight: 600; color: #374151; }

.bof-req { color: #ef4444; margin-left: 2px; }

.bof-field input[type="text"],
.bof-field input[type="email"],
.bof-field input[type="tel"],
.bof-field input[type="date"],
.bof-field input[type="number"],
.bof-field textarea {
  padding: 10px 14px; border: 1px solid #cbd5e1; border-radius: 8px;
  font-size: 14px; color: #0f172a; background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s; width: 100%; box-sizing: border-box;
}

.bof-field input:focus, .bof-field textarea:focus {
  outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.bof-field input::placeholder, .bof-field textarea::placeholder { color: #94a3b8; }
.bof-field textarea { resize: vertical; min-height: 90px; }
.bof-field small { font-size: 12px; color: #64748b; }

.bof-grid { display: grid; gap: 16px; }
.bof-grid--2 { grid-template-columns: 1fr 1fr; }
.bof-grid--3 { grid-template-columns: 2fr 1fr 1fr; }
.bof-field--full { grid-column: 1 / -1; }

.bof-submit { margin-top: 24px; }

.bof-btn {
  display: flex; align-items: center; justify-content: center; width: 100%;
  padding: 14px 24px; background: #0f172a; color: #fff; border: none;
  border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}
.bof-btn:hover { background: #1e293b; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
  .bof-form { padding: 20px; }
  .bof-grid--2, .bof-grid--3 { grid-template-columns: 1fr; }
  .bof-field--full { grid-column: 1; }

  .bof-preview { flex-direction: column; gap: 12px; }
  .bof-preview__cover-col { width: 100%; display: flex; justify-content: center; }
  .bof-preview__cover-placeholder { width: 80px; height: 110px; }
  .bof-preview__cover-img { width: 80px; }

  .bof-picker__formats { gap: 4px; }
  .bof-picker__fmt-btn { font-size: 11px; padding: 4px 8px; }
}
