/* ============================================================
   Hotel Booking Plugin — Frontend Styles
   ============================================================ */

:root {
  --hb-primary:    #1a56db;
  --hb-primary-h:  #1e429f;
  --hb-accent:     #f59e0b;
  --hb-success:    #10b981;
  --hb-danger:     #ef4444;
  --hb-gray-50:    #f9fafb;
  --hb-gray-100:   #f3f4f6;
  --hb-gray-200:   #e5e7eb;
  --hb-gray-700:   #374151;
  --hb-gray-900:   #111827;
  --hb-radius:     12px;
  --hb-shadow:     0 4px 24px rgba(0,0,0,.10);
  --hb-shadow-lg:  0 12px 40px rgba(0,0,0,.18);
  --hb-font:       -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---- Grid ---- */
.hb-hotel-grid {
  display: grid;
  gap: 24px;
  margin: 32px 0;
}
.hb-cols-2 { grid-template-columns: repeat(2, 1fr); }
.hb-cols-3 { grid-template-columns: repeat(3, 1fr); }
.hb-cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .hb-cols-3, .hb-cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .hb-cols-2, .hb-cols-3, .hb-cols-4 { grid-template-columns: 1fr; }
}

/* ---- Card ---- */
.hb-hotel-card {
  background: #fff;
  border-radius: var(--hb-radius);
  overflow: hidden;
  box-shadow: var(--hb-shadow);
  transition: transform .2s, box-shadow .2s;
  cursor: pointer;
}
.hb-hotel-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--hb-shadow-lg);
}
.hb-card-image {
  height: 200px;
  background-size: cover;
  background-position: center;
  position: relative;
}
.hb-card-badge {
  position: absolute;
  top: 12px; left: 12px;
  background: var(--hb-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.hb-card-body {
  padding: 18px 20px;
}
.hb-card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--hb-gray-900);
  margin: 0 0 6px;
}
.hb-stars { color: var(--hb-accent); font-size: 14px; margin-bottom: 6px; }
.hb-stars-lg { font-size: 20px; }
.hb-card-address {
  font-size: 13px;
  color: #6b7280;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.hb-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--hb-gray-200);
}
.hb-price {
  font-size: 15px;
  font-weight: 600;
  color: var(--hb-primary);
}

/* ---- Buttons ---- */
.hb-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .1s;
  text-decoration: none;
  font-family: var(--hb-font);
}
.hb-btn:active { transform: scale(.97); }
.hb-btn-view  { background: var(--hb-gray-100); color: var(--hb-gray-700); }
.hb-btn-view:hover { background: var(--hb-gray-200); }
.hb-btn-book  { background: var(--hb-primary); color: #fff; width: 100%; justify-content: center; padding: 14px; font-size: 16px; }
.hb-btn-book:hover { background: var(--hb-primary-h); }
.hb-btn-book:disabled { opacity: .6; cursor: not-allowed; }

/* ---- Modal ---- */
.hb-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  backdrop-filter: blur(2px);
}
.hb-modal {
  background: #fff;
  border-radius: 10px;
  width: 100%;
  max-width: 860px;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  animation: hbSlideUp .25s ease;
}
@keyframes hbSlideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hb-modal-close {
  padding: 13px;
  position: sticky;
  top: 0;
  float: right;
  margin: 12px 12px 0 0;
  background: #7d2d22;
  border: none;
  width: 40px; height: 40px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  z-index: 10;
  transition: background .15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hb-modal-close:hover { background: var(--hb-gray-200); }
.hb-modal-loading {
  text-align: center;
  padding: 60px 40px;
  color: #7d2d22;
}

/* Spinner */
.hb-spinner {
  display: inline-block;
  width: 40px; height: 40px;
  border: 3px solid var(--hb-gray-200);
  border-top-color: var(--hb-primary);
  border-radius: 50%;
  animation: hbSpin .7s linear infinite;
  margin-bottom: 12px;
}
@keyframes hbSpin { to { transform: rotate(360deg); } }

/* ---- Hotel Detail (inside modal) ---- */
.hb-detail { font-family: var(--hb-font); }
.hb-detail-gallery { position: relative; }
.hb-gallery-main {
  height: 320px;
  background-size: cover;
  background-position: center;
  border-radius: 16px 16px 0 0;
  transition: background-image .3s;
}
.hb-gallery-thumbs {
  display: flex;
  gap: 8px;
  padding: 10px 20px;
  overflow-x: auto;
}
.hb-thumb {
  width: 70px; height: 50px;
  border-radius: 6px;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  flex-shrink: 0;
  border: 2px solid transparent;
  transition: border-color .15s;
}
.hb-thumb.active { border-color: var(--hb-primary); }
.hb-detail-info { padding: 20px 28px 0; }
.hb-detail-info h2 {
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 8px;
  color: var(--hb-gray-900);
}
.hb-address { color: #6b7280; font-size: 14px; margin: 6px 0; }
.hb-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.hb-tag {
  background: var(--hb-gray-100);
  color: var(--hb-gray-700);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.hb-desc { font-size: 14px; line-height: 1.6; color: #4b5563; margin: 14px 0; }
.hb-amenities h4 { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.hb-amenities ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  list-style: none;
  margin: 0 0 16px;
}
.hb-amenities li {
  background: #ecfdf5;
  color: #065f46;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.hb-amenities li::before { content: '✓  '; }

/* ---- Booking Form ---- */
.hb-booking-form-wrap {
  padding: 20px 28px 28px;
  border-top: 1px solid var(--hb-gray-200);
  margin-top: 16px;
}
.hb-booking-form-wrap h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 18px;
}
.hb-form-row { display: flex; gap: 16px; }
.hb-two-col .hb-form-group { flex: 1; }
.hb-form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
}
.hb-form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--hb-gray-700);
  margin-bottom: 6px;
}
.hb-form-group label .required { color: var(--hb-danger); }
.hb-form-group input[type="date"],
.hb-form-group select {
  padding: 10px 12px;
  border: 1.5px solid var(--hb-gray-200);
  border-radius: 8px;
  font-size: 14px;
  transition: border-color .15s;
  background: #fff;
}
.hb-form-group input:focus,
.hb-form-group select:focus {
  outline: none;
  border-color: var(--hb-primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}

/* ---- Room Type Cards ---- */
.hb-room-types { display: flex; flex-direction: column; gap: 10px; }
.hb-room-option { cursor: pointer; display: block; }
.hb-room-option input[type="radio"] { display: none; }
.hb-room-card {
  border: 2px solid var(--hb-gray-200);
  border-radius: 10px;
  padding: 14px 16px;
  transition: border-color .15s, background .15s;
}
.hb-room-option input:checked + .hb-room-card {
  border-color: var(--hb-primary);
  background: #eff6ff;
}
.hb-room-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.hb-room-name { font-weight: 700; font-size: 15px; }
.hb-ac-badge {
  background: #dbeafe;
  color: var(--hb-primary);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}
.hb-room-desc { font-size: 13px; color: #6b7280; margin: 0 0 8px; }
.hb-room-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #6b7280;
}
.hb-room-price { font-weight: 700; color: var(--hb-primary); font-size: 15px; }

/* ---- Price Summary ---- */
.hb-price-summary {
  background: var(--hb-gray-50);
  border-radius: 10px;
  padding: 14px 18px;
  margin: 16px 0;
}
.hb-price-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 4px 0;
  color: var(--hb-gray-700);
}
.hb-price-total {
  border-top: 1px solid var(--hb-gray-200);
  margin-top: 8px;
  padding-top: 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--hb-gray-900);
}

/* ---- Form Messages ---- */
.hb-form-messages {
  margin: 12px 0;
  font-size: 14px;
  min-height: 20px;
}
.hb-msg-error   { color: var(--hb-danger);  background: #fef2f2; padding: 10px 14px; border-radius: 8px; }
.hb-msg-success { color: #065f46; background: #ecfdf5; padding: 10px 14px; border-radius: 8px; }
.hb-msg-loading { color: var(--hb-primary); }

/* ---- Checkout Summary ---- */
.hb-checkout-summary {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 24px;
}
.hb-checkout-summary h3 { font-size: 16px; font-weight: 700; margin: 0 0 12px; }
.hb-summary-table { width: 100%; border-collapse: collapse; }
.hb-summary-table th,
.hb-summary-table td { padding: 6px 8px; text-align: left; font-size: 14px; }
.hb-summary-table th { font-weight: 600; color: var(--hb-gray-700); width: 130px; }
.hb-traveler-fields { margin-top: 8px; }
.hb-traveler-fields h3 { font-size: 16px; font-weight: 700; margin-bottom: 12px; }

@media (max-width: 600px) {
  .hb-modal { border-radius: 12px; }
  .hb-detail-info { padding: 16px 16px 0; }
  .hb-booking-form-wrap { padding: 16px; }
  .hb-form-row.hb-two-col { flex-direction: column; }
}
