:root {
  --hm-primary: #0f172a;
  --hm-primary-hover: #1e293b;
  --hm-accent: #b45309;
  --hm-accent-light: #f59e0b;
  --hm-accent-gradient: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  --hm-bg-glass: rgba(255, 255, 255, 0.88);
  --hm-bg-glass-dark: rgba(15, 23, 42, 0.75);
  --hm-text-dark: #0f172a;
  --hm-text-muted: #64748b;
  --hm-border: #e2e8f0;
  --hm-card-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
  --hm-card-shadow-hover: 0 20px 40px -10px rgba(0, 0, 0, 0.15);
  --hm-radius-sm: 8px;
  --hm-radius-md: 14px;
  --hm-radius-lg: 20px;
  --hm-font-heading: 'Playfair Display', Georgia, serif;
  --hm-font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* Reset & Scoped Styles */
.hm-booking-wrapper {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 20px;
  box-sizing: border-box;
}

.hm-booking-wrapper * {
  box-sizing: border-box;
  font-family: var(--hm-font-body);
  -webkit-tap-highlight-color: transparent;
}

/* Sticky / Floating Search Widget */
.hm-search-bar {
  background: var(--hm-bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
  border-radius: var(--hm-radius-lg);
  padding: 18px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin: 20px auto 40px auto;
  max-width: 1100px;
  position: relative;
  z-index: 20;
}

.hm-search-group {
  flex: 1 1 180px;
  display: flex;
  flex-direction: column;
}

.hm-search-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--hm-text-muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.hm-search-input,
.hm-search-select {
  width: 100%;
  border: 1px solid var(--hm-border);
  background: #ffffff;
  border-radius: var(--hm-radius-sm);
  padding: 10px 14px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--hm-text-dark);
  outline: none;
  transition: all 0.2s ease;
}

.hm-search-input:focus,
.hm-search-select:focus {
  border-color: var(--hm-accent);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.18);
}

.hm-btn-search {
  flex: 0 0 auto;
  background: var(--hm-accent-gradient);
  color: #ffffff;
  border: none;
  border-radius: var(--hm-radius-sm);
  padding: 13px 28px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(180, 83, 9, 0.3);
  transition: all 0.25s ease;
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hm-btn-search:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(180, 83, 9, 0.4);
}

/* Room Cards Grid */
.hm-rooms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 0;
}

.hm-room-card {
  background: #ffffff;
  border-radius: var(--hm-radius-md);
  box-shadow: var(--hm-card-shadow);
  border: 1px solid var(--hm-border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.hm-room-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--hm-card-shadow-hover);
}

.hm-room-image-wrap {
  position: relative;
  width: 100%;
  height: 240px;
  overflow: hidden;
  background: #e2e8f0;
}

.hm-room-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.hm-room-card:hover .hm-room-image {
  transform: scale(1.05);
}

.hm-room-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--hm-bg-glass-dark);
  backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 30px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hm-room-avail-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  background: #10b981;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 30px;
}

.hm-room-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.hm-room-title {
  font-family: var(--hm-font-heading);
  font-size: 1.45rem;
  color: var(--hm-text-dark);
  margin: 0 0 8px 0;
  line-height: 1.25;
}

.hm-room-specs {
  display: flex;
  gap: 14px;
  font-size: 0.85rem;
  color: var(--hm-text-muted);
  margin-bottom: 14px;
}

.hm-room-specs span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.hm-room-desc {
  font-size: 0.9rem;
  color: #475569;
  line-height: 1.5;
  margin-bottom: 16px;
  flex: 1;
}

.hm-amenities-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.hm-tag {
  background: #f1f5f9;
  color: #334155;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 500;
}

.hm-room-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #f1f5f9;
  padding-top: 18px;
  margin-top: auto;
}

.hm-price-box {
  display: flex;
  flex-direction: column;
}

.hm-price-amount {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--hm-text-dark);
}

.hm-price-period {
  font-size: 0.75rem;
  color: var(--hm-text-muted);
}

.hm-btn-book {
  background: var(--hm-primary);
  color: #ffffff;
  padding: 10px 22px;
  border-radius: var(--hm-radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hm-btn-book:hover {
  background: var(--hm-primary-hover);
  transform: translateY(-2px);
}

/* Stepped Booking Modal / Checkout Drawer */
.hm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.hm-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.hm-modal-container {
  background: #ffffff;
  border-radius: var(--hm-radius-lg);
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  position: relative;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.hm-modal-overlay.active .hm-modal-container {
  transform: scale(1);
}

.hm-modal-drag-pill {
  display: none;
}

.hm-modal-header {
  background: #f8fafc;
  border-bottom: 1px solid var(--hm-border);
  padding: 20px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.hm-modal-title {
  margin: 0;
  font-family: var(--hm-font-heading);
  font-size: 1.35rem;
  color: var(--hm-text-dark);
}

.hm-modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--hm-text-muted);
  cursor: pointer;
}

.hm-modal-body {
  padding: 28px;
}

/* Hold TTL Banner */
.hm-hold-timer-banner {
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #92400e;
  padding: 12px 18px;
  border-radius: var(--hm-radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  font-size: 0.9rem;
  font-weight: 500;
}

.hm-hold-countdown {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
}

/* Form Styles */
.hm-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.hm-form-col {
  display: flex;
  flex-direction: column;
}

.hm-form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--hm-text-dark);
  margin-bottom: 6px;
}

.hm-form-input {
  border: 1px solid var(--hm-border);
  border-radius: var(--hm-radius-sm);
  padding: 10px 14px;
  font-size: 0.95rem;
}

/* Pricing Breakdown Box */
.hm-quote-summary {
  background: #f8fafc;
  border: 1px solid var(--hm-border);
  border-radius: var(--hm-radius-sm);
  padding: 18px;
  margin: 20px 0;
}

.hm-quote-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: #475569;
  margin-bottom: 8px;
}

.hm-quote-row.total {
  border-top: 1px dashed var(--hm-border);
  padding-top: 12px;
  margin-top: 12px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--hm-text-dark);
}

/* Confirmation Pass (Digital Voucher) */
.hm-voucher-pass {
  background: #ffffff;
  border: 2px solid var(--hm-accent);
  border-radius: var(--hm-radius-md);
  padding: 28px;
  box-shadow: var(--hm-card-shadow);
  position: relative;
  overflow: hidden;
}

.hm-voucher-pass::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--hm-accent-gradient);
}

.hm-voucher-header {
  text-align: center;
  margin-bottom: 24px;
}

.hm-voucher-badge {
  background: #dcfce7;
  color: #15803d;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 30px;
  font-size: 0.85rem;
  display: inline-block;
  margin-bottom: 12px;
}

.hm-voucher-code {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--hm-text-dark);
}

/* AI Concierge Widget */
.hm-ai-widget {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
}

.hm-ai-toggle-btn {
  background: var(--hm-accent-gradient);
  color: #ffffff;
  border: none;
  border-radius: 50px;
  padding: 14px 22px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(180, 83, 9, 0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hm-ai-toggle-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(180, 83, 9, 0.45);
}

.hm-ai-box {
  position: absolute;
  bottom: 65px;
  right: 0;
  width: 360px;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
  border: 1px solid var(--hm-border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 10000;
}

.hm-ai-header {
  background: var(--hm-primary);
  color: #ffffff;
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hm-ai-close-btn {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1.35rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.hm-ai-messages {
  padding: 16px;
  height: 280px;
  overflow-y: auto;
  font-size: 0.88rem;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8fafc;
}

.hm-ai-msg-bot {
  background: #ffffff;
  color: var(--hm-text-dark);
  padding: 11px 14px;
  border-radius: 12px 12px 12px 2px;
  border: 1px solid var(--hm-border);
  max-width: 85%;
  line-height: 1.45;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.hm-ai-msg-user {
  background: var(--hm-primary);
  color: #ffffff;
  padding: 11px 14px;
  border-radius: 12px 12px 2px 12px;
  align-self: flex-end;
  max-width: 85%;
  line-height: 1.45;
}

.hm-ai-form {
  display: flex;
  border-top: 1px solid var(--hm-border);
  background: #ffffff;
}

.hm-ai-input {
  flex: 1;
  border: none;
  padding: 14px 16px;
  font-size: 0.9rem;
  outline: none;
  font-family: inherit;
}

.hm-ai-send-btn {
  background: var(--hm-accent);
  color: #ffffff;
  border: none;
  padding: 0 20px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.hm-ai-send-btn:hover {
  background: #92400e;
}

/* ==========================================================================
   Responsive Design & Mobile Viewport Enhancements
   ========================================================================== */

/* Tablet & Intermediate Screens */
@media (max-width: 991px) {
  .hm-search-bar {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
    padding: 20px;
  }
  .hm-search-group:nth-child(1) { grid-column: span 3; }
  .hm-search-group:nth-child(2) { grid-column: span 3; }
  .hm-search-group:nth-child(3) { grid-column: span 2; }
  .hm-search-group:nth-child(4) { grid-column: span 2; }
  .hm-search-group:nth-child(5) { grid-column: span 2; }
  .hm-btn-search {
    grid-column: span 6;
    width: 100%;
    justify-content: center;
    margin-top: 4px;
    padding: 14px;
  }
}

/* Mobile Devices (Smartphones & Phablets) */
@media (max-width: 768px) {
  /* Prevent iOS automatic zoom on touch inputs */
  .hm-search-input,
  .hm-search-select,
  .hm-form-input,
  .hm-ai-input {
    font-size: 16px !important;
  }

  .hm-booking-wrapper {
    padding: 0 14px;
  }

  /* Compact 2-column mobile search widget */
  .hm-search-bar {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 16px 14px;
    border-radius: var(--hm-radius-md);
    margin: 12px auto 28px auto;
  }
  .hm-search-group:nth-child(1) { grid-column: 1 / 2; }
  .hm-search-group:nth-child(2) { grid-column: 2 / 3; }
  .hm-search-group:nth-child(3) { grid-column: 1 / 2; }
  .hm-search-group:nth-child(4) { grid-column: 2 / 3; }
  .hm-search-group:nth-child(5) { grid-column: 1 / -1; }
  .hm-btn-search {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: center;
    padding: 14px;
    font-size: 1rem;
    min-height: 48px;
  }

  .hm-search-input,
  .hm-search-select {
    min-height: 46px;
    padding: 8px 12px;
    border-radius: var(--hm-radius-sm);
  }

  .hm-search-label {
    font-size: 0.72rem;
    margin-bottom: 4px;
  }

  /* Room Cards Grid: Single column without overflow */
  .hm-rooms-grid {
    grid-template-columns: 1fr !important;
    gap: 22px;
    padding: 8px 0 32px 0;
  }

  .hm-room-card {
    border-radius: var(--hm-radius-md);
  }

  .hm-room-image-wrap {
    height: 200px;
  }

  .hm-room-body {
    padding: 16px 18px 20px 18px;
  }

  .hm-room-title {
    font-size: 1.25rem;
    margin-bottom: 6px;
  }

  .hm-room-specs {
    gap: 12px;
    font-size: 0.8rem;
    margin-bottom: 10px;
  }

  .hm-room-desc {
    font-size: 0.86rem;
    line-height: 1.45;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .hm-amenities-tags {
    gap: 6px;
    margin-bottom: 14px;
  }

  .hm-tag {
    font-size: 0.72rem;
    padding: 3px 8px;
  }

  /* Stepped Booking Modal converted to App-Style Bottom Sheet */
  .hm-modal-overlay {
    align-items: flex-end;
    padding: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .hm-modal-container {
    max-width: 100%;
    width: 100%;
    max-height: 88dvh;
    max-height: 88vh; /* fallback */
    border-radius: 24px 24px 0 0;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
  }

  .hm-modal-overlay.active .hm-modal-container {
    transform: translateY(0);
  }

  .hm-modal-drag-pill {
    display: block;
    width: 44px;
    height: 5px;
    background: #cbd5e1;
    border-radius: 999px;
    margin: 12px auto 2px auto;
  }

  .hm-modal-header {
    padding: 14px 20px;
  }

  .hm-modal-title {
    font-size: 1.15rem;
  }

  .hm-modal-close {
    font-size: 1.6rem;
    padding: 4px 8px;
  }

  .hm-modal-body {
    padding: 16px 20px calc(24px + env(safe-area-inset-bottom, 12px)) 20px;
    -webkit-overflow-scrolling: touch;
  }

  .hm-form-row {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 12px;
  }

  .hm-form-input {
    padding: 12px 14px;
    min-height: 48px;
    border-radius: var(--hm-radius-sm);
  }

  .hm-hold-timer-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 10px 14px;
    font-size: 0.85rem;
  }

  .hm-quote-summary {
    padding: 14px;
    margin: 16px 0;
  }

  .hm-quote-row {
    font-size: 0.85rem;
  }

  .hm-quote-row.total {
    font-size: 1.05rem;
  }

  .hm-voucher-pass {
    padding: 20px 16px;
  }

  .hm-voucher-code {
    font-size: 1.45rem;
  }
}

/* Small Smartphone Optimization (Screens <= 540px) */
@media (max-width: 540px) {
  .hm-room-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .hm-price-box {
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
  }

  .hm-price-amount {
    font-size: 1.35rem;
  }

  .hm-btn-book {
    width: 100%;
    text-align: center;
    justify-content: center;
    padding: 12px;
    font-size: 0.95rem;
    min-height: 46px;
  }
}

/* Mobile AI Concierge Drawer (Screens <= 640px) */
@media (max-width: 640px) {
  .hm-ai-widget {
    bottom: 16px;
    right: 16px;
  }

  .hm-ai-toggle-btn {
    padding: 11px 18px;
    font-size: 0.88rem;
    box-shadow: 0 6px 18px rgba(180, 83, 9, 0.35);
  }

  .hm-ai-box {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 72dvh;
    height: 72vh;
    max-height: 520px;
    border-radius: 22px 22px 0 0;
    border: none;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.28);
  }

  .hm-ai-messages {
    height: calc(100% - 110px);
  }

  .hm-ai-input {
    padding: 12px 14px;
    font-size: 16px !important;
  }
}

