/* ==========================================================================
   ORDER MODAL STYLES - BỘ SÁCH LONGEVITY 2026 (LIVING HERITAGE)
   ========================================================================== */

/* Modal Backdrop */
.lh-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 12, 10, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.lh-modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

/* Modal Container */
.lh-modal-container {
  background: #0f1c17;
  background-image: radial-gradient(circle at top right, rgba(212, 175, 55, 0.12), transparent 45%),
                    linear-gradient(180deg, #12221c 0%, #0c1613 100%);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 18px;
  width: 100%;
  max-width: 680px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65), 0 0 35px rgba(212, 175, 55, 0.2);
  position: relative;
  transform: scale(0.94) translateY(12px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  color: #f0f4f2;
  font-family: 'Alumni Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  box-sizing: border-box;
}

.lh-modal-backdrop.is-open .lh-modal-container {
  transform: scale(1) translateY(0);
}

/* Custom scrollbar for modal */
.lh-modal-container::-webkit-scrollbar {
  width: 6px;
}
.lh-modal-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
.lh-modal-container::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.4);
  border-radius: 3px;
}
.lh-modal-container::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 175, 55, 0.7);
}

/* Close Button */
.lh-modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(212, 175, 55, 0.25);
  color: #d4af37;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
}
.lh-modal-close:hover {
  background: rgba(212, 175, 55, 0.2);
  color: #fff;
  transform: rotate(90deg);
}

/* Modal Header */
.lh-modal-header {
  padding: 24px 28px 18px 28px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  text-align: left;
}
.lh-modal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: #f3e2a9;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 10px;
}
.lh-modal-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #f5e4b3;
  margin: 0 0 6px 0;
  line-height: 1.25;
}
.lh-modal-subtitle {
  font-size: 0.95rem;
  color: #a6b8b0;
  margin: 0;
  line-height: 1.4;
}

/* Modal Body */
.lh-modal-body {
  padding: 22px 28px 28px 28px;
}

/* Section Titles inside form */
.lh-form-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.15rem;
  font-weight: 700;
  color: #d4af37;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 14px 0;
  padding-bottom: 6px;
  border-bottom: 1px dashed rgba(212, 175, 55, 0.25);
}

/* Book Choice Item Cards */
.lh-book-items-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 22px;
}

.lh-book-item {
  background: rgba(14, 28, 23, 0.65);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 12px;
  padding: 14px 16px;
  transition: all 0.25s ease;
}
.lh-book-item:hover, .lh-book-item.has-selected {
  border-color: rgba(212, 175, 55, 0.5);
  background: rgba(18, 36, 29, 0.85);
}

.lh-book-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.lh-book-info {
  flex: 1;
  min-width: 220px;
}
.lh-book-tag {
  font-size: 0.78rem;
  font-weight: 700;
  color: #d4af37;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 2px;
}
.lh-book-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  line-height: 1.3;
}
.lh-book-meta {
  font-size: 0.85rem;
  color: #a6b8b0;
  margin-top: 3px;
}
.lh-book-price {
  color: #f3e2a9;
  font-weight: 700;
  font-size: 0.95rem;
}

/* Quantity Counter Widget */
.lh-qty-selector {
  display: inline-flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 8px;
  overflow: hidden;
}
.lh-qty-btn {
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  color: #f3e2a9;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.lh-qty-btn:hover {
  background: rgba(212, 175, 55, 0.25);
}
.lh-qty-input {
  width: 36px;
  height: 32px;
  background: transparent;
  border: none;
  text-align: center;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  -moz-appearance: textfield;
}
.lh-qty-input::-webkit-outer-spin-button,
.lh-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Ebook Checklist */
.lh-ebook-options {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.lh-ebook-options-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #ca9f80;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.lh-ebook-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.lh-ebook-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  color: #d1ded8;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s;
}
.lh-ebook-chip input[type="checkbox"] {
  accent-color: #d4af37;
  cursor: pointer;
}
.lh-ebook-chip:hover, .lh-ebook-chip.is-checked {
  background: rgba(212, 175, 55, 0.15);
  border-color: rgba(212, 175, 55, 0.45);
  color: #f3e2a9;
}

/* Order Summary Bar */
.lh-order-summary-box {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.1) 0%, rgba(20, 36, 29, 0.7) 100%);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 10px;
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}
.lh-summary-label {
  font-size: 0.95rem;
  color: #d1ded8;
  font-weight: 600;
}
.lh-summary-label small {
  display: block;
  font-size: 0.8rem;
  color: #8c9e96;
}
.lh-summary-total {
  font-size: 1.45rem;
  font-weight: 800;
  color: #f3e2a9;
  letter-spacing: 0.5px;
}

/* Customer Inputs Form Grid */
.lh-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
@media (max-width: 600px) {
  .lh-form-grid {
    grid-template-columns: 1fr;
  }
}
.lh-form-full {
  grid-column: 1 / -1;
}

.lh-form-group {
  margin-bottom: 12px;
}
.lh-form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #d1ded8;
  margin-bottom: 5px;
}
.lh-form-group label span.req {
  color: #e57373;
}

.lh-form-control {
  width: 100%;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 8px;
  color: #fff;
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.2s;
  box-sizing: border-box;
}
.lh-form-control:focus {
  outline: none;
  border-color: #d4af37;
  background: rgba(0, 0, 0, 0.55);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.25);
}
.lh-form-control::placeholder {
  color: #5c6e66;
}

textarea.lh-form-control {
  resize: vertical;
  min-height: 60px;
}

/* Checkbox Terms */
.lh-terms-group {
  margin: 16px 0 20px 0;
}
.lh-terms-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.83rem;
  color: #a6b8b0;
  cursor: pointer;
  line-height: 1.4;
}
.lh-terms-label input[type="checkbox"] {
  accent-color: #d4af37;
  margin-top: 2px;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Submit Button */
.lh-submit-btn {
  width: 100%;
  padding: 15px 24px;
  background: linear-gradient(135deg, #f5e4b3 0%, #d4af37 50%, #9e7514 100%);
  color: #0b1411;
  border: none;
  border-radius: 10px;
  font-size: 1.15rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.3);
}
.lh-submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(212, 175, 55, 0.45);
  background: linear-gradient(135deg, #ffffff 0%, #d4af37 60%, #b8860b 100%);
}
.lh-submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* Error message banner */
.lh-form-error {
  background: rgba(229, 115, 115, 0.15);
  border: 1px solid #e57373;
  color: #ffcdd2;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.88rem;
  margin-bottom: 16px;
  display: none;
  align-items: center;
  gap: 8px;
}
.lh-form-error.is-visible {
  display: flex;
}

/* Spinner */
.lh-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(11, 20, 17, 0.3);
  border-top-color: #0b1411;
  border-radius: 50%;
  animation: lh-spin 0.8s linear infinite;
}
@keyframes lh-spin {
  to { transform: rotate(360deg); }
}

/* Success View State */
.lh-success-view {
  text-align: center;
  padding: 30px 10px;
  display: none;
}
.lh-success-view.is-visible {
  display: block;
}
.lh-success-icon {
  width: 70px;
  height: 70px;
  background: rgba(212, 175, 55, 0.18);
  border: 2px solid #d4af37;
  color: #f3e2a9;
  font-size: 2rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  box-shadow: 0 0 25px rgba(212, 175, 55, 0.3);
}
.lh-success-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #f5e4b3;
  margin: 0 0 10px 0;
}
.lh-success-desc {
  font-size: 0.95rem;
  color: #d1ded8;
  max-width: 480px;
  margin: 0 auto 20px auto;
  line-height: 1.5;
}
.lh-success-order-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px dashed rgba(212, 175, 55, 0.4);
  border-radius: 10px;
  padding: 14px 18px;
  max-width: 420px;
  margin: 0 auto 24px auto;
  font-size: 0.9rem;
  color: #a6b8b0;
  text-align: left;
}
.lh-success-order-box strong {
  color: #f3e2a9;
}
.lh-success-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.lh-btn-secondary {
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: #f3e2a9;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.lh-btn-secondary:hover {
  background: rgba(212, 175, 55, 0.2);
  color: #fff;
}
