/* ── RouteHop Styles ─────────────────────────────────────────────────────── */

:root {
  --rh-green:      #5A7A1E;
  --rh-green-btn:  #6B8E23;
  --rh-black:      #1A1A1A;
  --rh-cream:      #F0EEE6;
  --rh-cream-dark: #E8E7DD;
  --rh-text:       #282828;
  --rh-text-light: #888;
  --rh-white:      #ffffff;
  --rh-border:     #E0DED6;
  --rh-top-bg:     #EBFACD;
}

/* ── Hide main app sections when RouteHop is expanded ── */
.rh-hidden-by-routehop {
  display: none !important;
}

/* ── Wrapper — always fixed to bottom ── */
.rh-wrapper {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  z-index: 100;
}

.rh-clear-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  color: #A6A597;
  font-size: 18px;
  line-height: 1;
  padding: 4px;
  cursor: pointer;
}

.rh-input {
  padding-right: 30px;
}

.rh-clear-btn:hover { color: #666; }
/* ── Expanded panel sits inline in the page flow, not fixed ── */
.rh-wrapper--expanded {
  position: relative;
  bottom: auto;
  left: auto;
  transform: none;
  max-width: 100%;
}

/* ── Map background ── */
.rh-map-bg {
  position: relative;
  background-color: var(--rh-cream-dark);
  background-image: url('Generic_Map_2.svg');
  background-size: cover;
  background-position: center;
  border-radius: 20px;
  border: 4px solid var(--rh-green);
  padding: 12px 16px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── Drag handle ── */
.rh-drag-handle {
  width: 40px;
  height: 4px;
  background: rgba(0,0,0,0.2);
  border-radius: 2px;
  margin-bottom: 12px;
}

/* ── Close button ── */
.rh-close-btn {
  position: absolute;
  top: 12px;
  right: 16px;
  background: rgba(255,255,255,0.85);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--rh-text);
  z-index: 2;
}

/* ── Main RouteHop button ── */
.rh-main-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--rh-green);
  color: var(--rh-white);
  border: none;
  border-radius: 50px;
  padding: 12px 28px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: background 0.2s;
  position: relative;
  z-index: 1;
}

.rh-main-btn:hover { background: var(--rh-green-btn); }
.rh-btn-icon { width: 24px; height: 24px; }

/* ── Panel body ── */
.rh-body {
  background: var(--rh-cream);
  padding: 20px 16px 24px;
}

/* ── Intro text ── */
.rh-intro {
  font-size: 0.75rem;
  text-align: center;
  color: var(--rh-text-light);
  margin-bottom: 16px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Input fields ── */
.rh-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--rh-white);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  border: 1px solid var(--rh-border);
}

.rh-input-icon { width: 20px; height: 28px; flex-shrink: 0; }

.rh-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--rh-text);
  outline: none;
}

.rh-input::placeholder { color: var(--rh-text-light); }

/* ── Via row ── */
.rh-via-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 8px;
}

.rh-via-icon { width: 23px; height: 23px; flex-shrink: 0; }

.rh-via-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--rh-text-light);
  outline: none;
}

.rh-via-input::placeholder { color: var(--rh-text-light); }

/* ── Button row ── */
.rh-btn-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  margin-bottom: 12px;
}

.rh-saved-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--rh-black);
  color: var(--rh-white);
  border: none;
  border-radius: 50px;
  padding: 13px 16px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.rh-heart-icon { width: 20px; height: 18px; }

.rh-go-btn {
  flex: 1;
  background: var(--rh-green);
  color: var(--rh-white);
  border: none;
  border-radius: 50px;
  padding: 13px 16px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: background 0.2s;
}

.rh-go-btn:hover { background: var(--rh-green-btn); }

/* ── Saved routes list ── */
.rh-saved-list { margin-bottom: 8px; }

.rh-saved-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--rh-black);
  color: var(--rh-white);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 8px;
  cursor: pointer;
}

.rh-saved-icon { width: 24px; height: 24px; }
.rh-saved-name { flex: 1; font-size: 0.95rem; font-weight: 500; }

.rh-delete-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}

.rh-delete-btn img { width: 20px; height: 20px; }

.rh-no-saved {
  font-size: 0.85rem;
  color: var(--rh-text-light);
  text-align: center;
  padding: 8px 0;
}

/* ── Paywall ── */
.rh-paywall {
  background: var(--rh-white);
  border-radius: 16px;
  padding: 20px 16px;
  margin-top: 12px;
  text-align: center;
  border: 1px solid var(--rh-border);
}

.rh-paywall-title {
  font-size: 0.95rem;
  color: var(--rh-text);
  margin-bottom: 10px;
  line-height: 1.5;
}

.rh-paywall-sub {
  font-size: 0.85rem;
  color: var(--rh-text-light);
  margin-bottom: 20px;
}

.rh-paywall-btns { display: flex; gap: 10px; }

.rh-cancel-btn {
  flex: 1;
  background: #C8C8C8;
  color: var(--rh-white);
  border: none;
  border-radius: 50px;
  padding: 13px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.rh-unlock-btn {
  flex: 1;
  background: var(--rh-green);
  color: var(--rh-white);
  border: none;
  border-radius: 50px;
  padding: 13px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.rh-unlock-btn:hover { background: var(--rh-green-btn); }
.rh-unlock-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── Results ── */
.rh-results { margin-top: 8px; border-radius: 12px; overflow: hidden; }

.rh-loading {
  text-align: center;
  color: var(--rh-text-light);
  font-size: 0.9rem;
  padding: 16px 0;
}

.rh-error {
  text-align: center;
  color: #c0392b;
  font-size: 0.9rem;
  padding: 16px 0;
}

.rh-station {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--rh-border);
  cursor: pointer;
  background: var(--rh-white);
}

.rh-station:last-child { border-bottom: none; }
.rh-station--top { background: var(--rh-top-bg); }

.rh-station-left { display: flex; align-items: flex-start; gap: 10px; }

.rh-station-num {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--rh-text-light);
  min-width: 16px;
  padding-top: 2px;
}

.rh-station-name { font-size: 0.95rem; font-weight: 700; color: var(--rh-text); margin-bottom: 2px; }
.rh-station-addr { font-size: 0.78rem; color: var(--rh-text-light); margin-bottom: 2px; }
.rh-station-dist { font-size: 0.78rem; color: var(--rh-green); font-weight: 500; }
.rh-station-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.rh-heart {
  background: transparent;
  border: none;
  font-size: 1rem;
  color: var(--rh-text-light);
  cursor: pointer;
  padding: 4px;
}

.rh-price { text-align: right; line-height: 1.4; }
.rh-price--petrol { font-size: 1rem; font-weight: 700; color: var(--rh-green); }
.rh-price--diesel { font-size: 0.9rem; font-weight: 700; color: var(--rh-text); }
.rh-fuel-label { font-size: 0.65rem; font-weight: 400; color: var(--rh-text-light); }

/* ── Save row ── */
.rh-save-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--rh-white);
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 8px;
  border: 1px solid var(--rh-border);
}

.rh-route-name-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--rh-text);
  outline: none;
}

.rh-route-name-input::placeholder { color: var(--rh-text-light); }

.rh-save-btn {
  background: var(--rh-black);
  color: var(--rh-white);
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.05em;
}

.rh-fallback-msg {
  font-size: 13px;
  color: #888;
  text-align: center;
  margin: 10px 0 6px;
}

.rh-save-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ── Start over ── */
.rh-start-over {
  display: block;
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: none;
  box-shadow: none;
  color: var(--rh-green);
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  padding: 0 0 6px 4px;
  margin: 0;
  cursor: pointer;
  text-align: left;
}
.rh-start-over:hover { color: var(--rh-green-btn); }

/* ── Selected saved route ── */
.rh-saved-item--active {
  border: none;
  padding: 14px 16px; /* back to the default — box-shadow doesn't eat into the box like border did */
  box-shadow:
    0 0 0 2px #fff,
    0 0 0 5px var(--rh-green);
}

/* ── Save row at max capacity ── */
.rh-save-max-msg {
  flex: 1;
  font-size: 0.72rem;
  color: #848484;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rh-heart-grey { filter: grayscale(1); opacity: 0.45; }

/* ── Utility ── */
.hidden { display: none !important; }
