/* Liftit Home - Gett-style Map-First Layout */

/* Reset for map-first page */
.home-page {
  margin: 0;
  padding: 0;
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
  position: relative;
}

/* ── Floating Header ── */
.home-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.08);
}

.home-logo {
  display: flex;
  align-items: center;
}

.home-logo .brand-logo,
.brand-logo--header {
  height: 28px;
  width: auto;
  display: block;
}

@media (min-width: 768px) {
  .home-logo .brand-logo,
  .brand-logo--header {
    height: 32px;
  }
}

.brand-logo--modal {
  height: 36px;
  width: auto;
  display: inline-block;
}

.brand-logo--footer {
  height: 24px;
  width: auto;
  display: inline-block;
  margin-bottom: 8px;
}

.home-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.home-user-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.home-header-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--bg-light);
  color: var(--text-primary);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.home-header-btn:hover {
  background: #edf2f7;
}

.home-header-btn[hidden],
.home-user-name[hidden] {
  display: none !important;
}

.address-suggestions {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  background: #fff;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  max-height: 220px;
  overflow-y: auto;
  box-shadow: var(--shadow-card, 0 8px 24px rgba(0,0,0,.08));
}
.address-suggestions li {
  padding: 10px 12px;
  cursor: pointer;
  font-size: 0.9rem;
}
.address-suggestions li:hover {
  background: var(--bg-light, #f7fafc);
}

/* Leaflet panes must sit under the bottom sheet */
.home-map.leaflet-container {
  height: 100%;
  width: 100%;
  z-index: 1;
}
.home-map .leaflet-pane {
  z-index: 2 !important;
}
.home-map .leaflet-control-container {
  z-index: 3;
}

/* ── Full-Screen Map ── */
.home-map {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background: #e5e3df;
}

/* ── Bottom Sheet ── */
.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: #fff;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.12);
  max-height: 70vh;
  max-height: 70dvh;
  overflow-y: auto;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overscroll-behavior: contain;
}

.sheet-handle {
  display: flex;
  justify-content: center;
  padding: 12px 0 4px;
  cursor: grab;
}

.sheet-handle span {
  width: 40px;
  height: 4px;
  background: #d0d5dd;
  border-radius: 4px;
}

.sheet-content {
  padding: 4px 20px 24px;
}

/* ── Address Input ── */
.address-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.address-input-wrap {
  flex: 1;
  position: relative;
}

.address-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--brand-primary);
  font-size: 1rem;
  pointer-events: none;
}

.address-input {
  width: 100%;
  padding: 14px 40px 14px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 1rem;
  font-family: var(--font-family);
  color: var(--text-primary);
  background: var(--bg-light);
  /* Maps auth failure tiles icon_error.png as the input background */
  background-image: none !important;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.address-input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.1);
  background: #fff;
}

.location-btn {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  background: #fff;
  color: var(--brand-primary);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.location-btn:hover {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
}

.location-btn.loading {
  pointer-events: none;
  opacity: 0.6;
}

.selected-address {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #f0fdf4;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  color: #166534;
}

.selected-address i {
  color: var(--liftit-success);
}

/* ── Section Label ── */
.section-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
  margin-top: 4px;
}

/* ── Crane Type Selector ── */
.crane-selector {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.crane-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-family);
}

.crane-option:hover {
  border-color: #cbd5e0;
  background: #fafafa;
}

.crane-option.selected {
  border-color: var(--brand-primary);
  background: #fff8f3;
  box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.12);
}

.crane-option-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
}

.crane-option-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.crane-option-detail {
  font-size: 0.7rem;
  color: var(--text-light);
}

.crane-option-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.crane-option-price {
  font-size: 0.75rem;
  color: var(--text-secondary);
  min-height: 18px;
}

/* ── Billing Toggle ── */
.billing-toggle {
  display: flex;
  gap: 0;
  background: var(--bg-light);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 16px;
}

.billing-btn {
  flex: 1;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: var(--font-family);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.billing-btn.active {
  background: #fff;
  color: var(--brand-primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  font-weight: 600;
}

/* ── Order Button ── */
.btn-order {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 14px;
  background: var(--brand-primary);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  font-family: var(--font-family);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, opacity 0.2s;
}

.btn-order:hover:not(:disabled) {
  background: var(--brand-primary-dark);
  transform: translateY(-1px);
}

.btn-order:active:not(:disabled) {
  transform: translateY(0);
}

.btn-order:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ── Login Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  background: #fff;
  border-radius: 20px;
  padding: 32px 28px;
  width: 100%;
  max-width: 400px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-close {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 36px;
  height: 36px;
  border: none;
  background: var(--bg-light);
  border-radius: 50%;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.modal-close:hover {
  background: #edf2f7;
}

.modal-title {
  text-align: center;
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--text-primary);
}

.modal-subtitle {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0 0 24px;
}

.modal-form-group {
  margin-bottom: 16px;
}

.modal-form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.phone-input-row {
  display: flex;
  align-items: center;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.phone-input-row:focus-within {
  border-color: var(--brand-primary);
}

.phone-prefix {
  padding: 12px;
  background: var(--bg-light);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-left: 1px solid #e2e8f0;
  white-space: nowrap;
}

.phone-input-row input {
  flex: 1;
  padding: 12px;
  border: none;
  font-size: 1rem;
  font-family: var(--font-family);
  outline: none;
}

.otp-input {
  width: 100%;
  padding: 14px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 1.2rem;
  font-family: var(--font-family);
  text-align: center;
  letter-spacing: 8px;
  transition: border-color 0.2s;
}

.otp-input:focus {
  outline: none;
  border-color: var(--brand-primary);
}

.login-error {
  background: #fef2f2;
  color: var(--liftit-danger);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 16px;
  display: none;
  text-align: center;
}

.login-error.visible {
  display: block;
}

.modal-resend {
  text-align: center;
  margin-top: 12px;
  font-size: 0.85rem;
}

.modal-resend a {
  color: var(--brand-primary);
}

/* Modal Divider */
.modal-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-light);
  font-size: 0.85rem;
}

.modal-divider::before,
.modal-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

/* Google Sign-In Button */
.btn-google {
  width: 100%;
  padding: 12px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: var(--font-family);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-primary);
  transition: all 0.2s;
}

.btn-google:hover {
  background: #fafafa;
  border-color: #cbd5e0;
}

/* ── Toast ── */
.toast-container {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
}

/* ── Desktop Layout ── */
@media (min-width: 768px) {
  .bottom-sheet {
    left: auto;
    right: 20px;
    bottom: 20px;
    top: 80px;
    width: 380px;
    border-radius: 20px;
    max-height: none;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.12);
  }

  .sheet-handle {
    display: none;
  }

  .sheet-content {
    padding: 20px;
  }
}

/* ── Mobile Tweaks ── */
@media (max-width: 767px) {
  .home-header {
    padding: 10px 16px;
  }

  .sheet-content {
    padding: 4px 16px 20px;
  }

  .crane-option {
    padding: 10px 6px;
  }

  .crane-option-icon {
    width: 34px;
    height: 34px;
  }

  .crane-option-icon svg {
    width: 34px;
    height: 34px;
  }

  .crane-option-name {
    font-size: 0.8rem;
  }

  .btn-order {
    font-size: 1.05rem;
    padding: 14px;
  }
}

/* ── Small phones ── */
@media (max-width: 380px) {
  .crane-selector {
    gap: 6px;
  }

  .crane-option {
    padding: 8px 4px;
  }
}

/* ── Google Autocomplete dropdown fix ── */
.pac-container {
  z-index: 600 !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12) !important;
  border: none !important;
  font-family: var(--font-family) !important;
  margin-top: 4px !important;
}

.pac-item {
  padding: 10px 14px !important;
  font-size: 0.9rem !important;
  cursor: pointer !important;
}

.pac-item:hover {
  background: #f7fafc !important;
}
