/* ═══════════════════════════════════════════════════════════
   My Trip Drawer v1 — right-side slide-out trip hub
   Mirrors the full /my-trip workbench (tabs, trip overview,
   saved itineraries, map views, quizzes) inside a drawer so
   readers can review and act on their saved items without
   navigating away. Scoped to .hg-td-*.
   ═══════════════════════════════════════════════════════════ */

.hg-td-root {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  /* Above Raptive / AdThrive sticky footer ads (which use 2147483645-ish)
     so the drawer overlays the ad instead of sitting alongside it. */
  z-index: 2147483647;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0s linear 0.3s;
}
.hg-td-root.is-open {
  pointer-events: auto;
  visibility: visible;
  transition: visibility 0s linear 0s;
}
.hg-td-root,
.hg-td-root * { box-sizing: border-box; }

.hg-td-backdrop {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.25s ease;
  cursor: pointer;
}
.hg-td-root.is-open .hg-td-backdrop { opacity: 1; }

/* ── Panel ────────────────────────────────────────────────── */
.hg-td-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 440px;
  max-width: calc(100vw - 40px);
  background: linear-gradient(135deg, #f0f7f4 0%, #e3f0e8 50%, #dceee4 100%);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow: hidden;
}
.hg-td-root.is-open .hg-td-panel { transform: translateX(0); }

/* Decorative circles — same vibe as features-cta banner */
.hg-td-panel::before,
.hg-td-panel::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
.hg-td-panel::before {
  top: 120px;
  right: -80px;
  width: 220px;
  height: 220px;
  background: rgba(26, 107, 74, 0.06);
}
.hg-td-panel::after {
  bottom: 70px;
  left: -70px;
  width: 180px;
  height: 180px;
  background: rgba(26, 107, 74, 0.04);
}
/* Everything inside the panel sits above the circles. */
.hg-td-head,
.hg-td-ov,
.hg-td-tabs,
.hg-td-body,
.hg-td-foot { position: relative; z-index: 1; }

/* ── Header ───────────────────────────────────────────────── */
.hg-td-head {
  background: linear-gradient(135deg, #1e2e22 0%, #2a3e2e 100%);
  color: #fff;
  padding: 18px 20px 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-shrink: 0;
}
.hg-td-head-main { flex: 1; min-width: 0; }
.hg-td-title {
  margin: 0 0 4px;
  font-size: 19px;
  font-weight: 700;
  color: #fff;
  line-height: 1.15;
}
.hg-td-title i {
  color: #f5c842;
  margin-right: 8px;
  font-size: 17px;
}
.hg-td-count {
  margin: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 500;
}
.hg-td-close {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.15s ease;
}
.hg-td-close:hover { background: rgba(255, 255, 255, 0.22); }

/* ── Trip Overview (collapsible) ──────────────────────────── */
.hg-td-ov {
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid #d1ddd5;
  flex-shrink: 0;
}
.hg-td-ov-toggle {
  width: 100%;
  background: transparent;
  border: none;
  padding: 11px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: #1e2e22;
  text-align: left;
}
.hg-td-ov-toggle-icon { color: #1a6b4a; margin-right: 2px; font-size: 13px; }
.hg-td-ov-toggle-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hg-td-ov-toggle-arrow { color: #5a6b60; font-size: 11px; }
.hg-td-ov-inner {
  padding: 2px 18px 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.hg-td-ov-inner.is-collapsed { display: none; }
.hg-td-ov-field { display: flex; flex-direction: column; gap: 4px; }
.hg-td-ov-field.full { grid-column: 1 / -1; }
.hg-td-ov-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #5a6b60;
}
.hg-td-ov-input,
.hg-td-ov-select {
  font-family: inherit;
  font-size: 14px;
  padding: 9px 10px;
  border: 1px solid #c8d6cc;
  border-radius: 8px;
  background: #fff;
  color: #1e2e22;
  width: 100%;
  min-width: 0;
  line-height: 1.4;
  min-height: 40px;
}
.hg-td-ov-select {
  /* Reserve space on the right for the native dropdown arrow so the
     selected option text never gets clipped by it. */
  padding-right: 28px;
  cursor: pointer;
}
.hg-td-ov-input:focus,
.hg-td-ov-select:focus {
  outline: none;
  border-color: #1a6b4a;
  box-shadow: 0 0 0 2px rgba(26, 107, 74, 0.18);
}
.hg-td-ov-daterow {
  display: flex;
  align-items: center;
  gap: 6px;
  grid-column: 1 / -1;
}
.hg-td-ov-daterow .hg-td-ov-input { flex: 1; }
.hg-td-ov-dash {
  color: #8a9690;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* ── Tabs (2×4 grid) ──────────────────────────────────────── */
.hg-td-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  padding: 10px 10px 6px;
  background: rgba(255, 255, 255, 0.45);
  border-bottom: 1px solid #d1ddd5;
  flex-shrink: 0;
}
.hg-td-tab {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 4px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  color: #3a4f42;
  line-height: 1.1;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
  position: relative;
}
.hg-td-tab:hover { background: rgba(255, 255, 255, 0.9); }
.hg-td-tab i {
  font-size: 16px;
  color: #1a6b4a;
  margin-bottom: 2px;
  transition: color 0.12s ease;
}
.hg-td-tab.is-active {
  background: #fff;
  border-color: #2e86de;
  color: #2e86de;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.hg-td-tab.is-active i { color: #2e86de; }
.hg-td-tab-badge {
  position: absolute;
  top: 4px;
  right: 6px;
  background: #1a6b4a;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 999px;
  min-width: 16px;
  line-height: 1.3;
  text-align: center;
}
.hg-td-tab-badge:empty { display: none; }

/* ── Scrollable body ──────────────────────────────────────── */
.hg-td-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 16px 18px;
}
.hg-td-pane-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
}
.hg-td-pane-title {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #3a4f42;
}
.hg-td-pane-link {
  font-size: 12px;
  font-weight: 700;
  color: #2e86de;
  text-decoration: none;
}
.hg-td-pane-link:hover { text-decoration: underline; }

.hg-td-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.hg-td-item {
  display: flex;
  align-items: stretch;
  background: #fff;
  border: 1px solid #d9e3dc;
  border-radius: 10px;
  margin-bottom: 6px;
  overflow: hidden;
  transition: border-color 0.12s ease;
}
.hg-td-item:hover { border-color: #b3c5b8; }
.hg-td-item-link {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: #1e2e22 !important;
  text-decoration: none !important;
  font-size: 14px;
  line-height: 1.3;
}
.hg-td-item-link:hover { color: #1e2e22 !important; }
.hg-td-item-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hg-td-item-meta {
  font-size: 11.5px;
  color: #6b7b72;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hg-td-item-island {
  font-size: 10.5px;
  color: #889;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.hg-td-item-remove {
  background: transparent;
  border: none;
  color: #8a9690;
  cursor: pointer;
  padding: 0 14px;
  font-size: 14px;
  border-left: 1px solid #e4ebe5;
  transition: color 0.15s ease, background 0.15s ease;
  flex-shrink: 0;
}
.hg-td-item-remove:hover {
  color: #c3232f;
  background: rgba(195, 35, 47, 0.08);
}

/* ── Itinerary cards ──────────────────────────────────────── */
.hg-td-itin {
  background: #fff;
  border: 1px solid #d9e3dc;
  border-left: 4px solid #2e86de;
  border-radius: 10px;
  padding: 12px 14px 10px;
  margin-bottom: 8px;
}
.hg-td-itin-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  color: #1e2e22;
  line-height: 1.25;
}
.hg-td-itin-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}
.hg-td-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 2px 8px;
  background: #eef3ef;
  color: #3a4f42;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}
.hg-td-chip i { font-size: 10px; opacity: 0.7; }
.hg-td-chip.is-island {
  background: transparent;
  border: 1px solid currentColor;
}
.hg-td-itin-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.hg-td-itin-btn {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 7px;
  text-decoration: none !important;
  background: #f4f7f5;
  color: #1e2e22 !important;
  border: 1px solid #d9e3dc;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.hg-td-itin-btn:hover {
  background: #eaf0ec;
  border-color: #b3c5b8;
}
.hg-td-itin-btn.is-primary {
  background: #2e86de;
  color: #fff !important;
  border-color: #2e86de;
}
.hg-td-itin-btn.is-primary:hover {
  background: #1f6dc2;
  color: #fff !important;
  border-color: #1f6dc2;
}
.hg-td-itin-btn.is-danger {
  color: #c3232f !important;
  margin-left: auto;
}
.hg-td-itin-btn.is-danger:hover {
  background: rgba(195, 35, 47, 0.08);
  border-color: rgba(195, 35, 47, 0.3);
}
.hg-td-new-itin {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 11px 14px;
  background: #2e86de;
  color: #fff !important;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none !important;
  cursor: pointer;
  margin-bottom: 10px;
  transition: background 0.15s ease;
}
.hg-td-new-itin:hover { background: #1f6dc2; color: #fff !important; }

/* ── Quiz cards ───────────────────────────────────────────── */
.hg-td-quiz {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid #d9e3dc;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 6px;
  text-decoration: none !important;
  color: #1e2e22 !important;
}
.hg-td-quiz:hover { border-color: #b3c5b8; color: #1e2e22 !important; }
.hg-td-quiz-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #eef3ef;
  color: #1a6b4a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.hg-td-quiz-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hg-td-quiz-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  margin: 0;
}
.hg-td-quiz-status {
  display: block;
  font-size: 11.5px;
  color: #6b7b72;
  margin: 0;
  line-height: 1.3;
}
.hg-td-quiz-status.is-done { color: #1a6b4a; font-weight: 600; }
.hg-td-quiz-chev {
  color: #8a9690;
  font-size: 12px;
  flex-shrink: 0;
}

/* ── Empty state ──────────────────────────────────────────── */
.hg-td-empty {
  text-align: center;
  padding: 22px 12px 18px;
  background: #fff;
  border: 1px dashed #c8d6cc;
  border-radius: 14px;
}
.hg-td-empty-icon {
  font-size: 44px;
  line-height: 1;
  margin-bottom: 10px;
}
.hg-td-empty h3 {
  margin: 0 0 8px;
  font-size: 16px;
  color: #1e2e22;
  line-height: 1.3;
}
.hg-td-empty p {
  font-size: 13.5px;
  color: #5a6b60;
  line-height: 1.5;
  margin: 0 0 14px;
}
.hg-td-empty p a {
  color: #2e86de;
  font-weight: 600;
  text-decoration: underline;
}
.hg-td-empty-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.hg-td-empty-link {
  padding: 9px 10px;
  background: #f4f7f5;
  border: 1px solid #dde4df;
  border-radius: 9px;
  color: #1e2e22 !important;
  text-decoration: none !important;
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  line-height: 1.2;
}
.hg-td-empty-link:hover {
  background: #eaf0ec;
  border-color: #c7d1c9;
  color: #1e2e22 !important;
}
.hg-td-empty-link i { color: #1a6b4a; font-size: 12px; }
.hg-td-empty-cta {
  display: inline-block;
  padding: 9px 18px;
  background: #2e86de;
  color: #fff !important;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none !important;
  font-size: 13.5px;
}
.hg-td-empty-cta:hover { background: #1f6dc2; color: #fff !important; }

/* ── Footer CTAs ──────────────────────────────────────────── */
.hg-td-foot {
  flex-shrink: 0;
  padding: 12px 16px 14px;
  border-top: 1px solid #c8d6cc;
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hg-td-cta-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: #1a6b4a;
  color: #fff !important;
  text-decoration: none !important;
  font-size: 15px;
  font-weight: 700;
  border-radius: 10px;
  transition: background 0.15s ease;
}
.hg-td-cta-primary:hover { background: #145838; color: #fff !important; }
.hg-td-cta-arrow { font-size: 11px; }
.hg-td-foot-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.hg-td-foot-btn {
  background: #fff;
  border: 1px solid #d9e3dc;
  color: #3a4f42;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 6px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none !important;
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.hg-td-foot-btn:hover {
  border-color: #b3c5b8;
  background: #eaf0ec;
  color: #1e2e22;
}
.hg-td-foot-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  background: #f4f7f5;
}
.hg-td-foot-btn i { font-size: 12px; }

/* Subdued, deliberately small destructive action — keeps accidental
   taps unlikely. Confirmation dialog still fires on click. */
.hg-td-foot-clear {
  background: transparent;
  border: none;
  color: #8a9690;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 6px 2px;
  cursor: pointer;
  align-self: center;
  text-decoration: underline;
  text-decoration-color: rgba(138, 150, 144, 0.35);
  text-underline-offset: 2px;
  letter-spacing: 0.2px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
.hg-td-foot-clear:hover {
  color: #c3232f;
  text-decoration-color: rgba(195, 35, 47, 0.5);
}

/* Scroll lock when drawer is open */
body.hg-td-scroll-lock { overflow: hidden; }

/* ── Mobile ───────────────────────────────────────────────── */
@media (max-width: 540px) {
  .hg-td-panel {
    width: 100vw;
    max-width: 100vw;
  }
  .hg-td-head { padding: 14px 16px 12px; }
  .hg-td-body { padding: 12px 14px 16px; }
  .hg-td-foot { padding: 10px 14px 12px; }
  .hg-td-tabs { padding: 8px 8px 4px; }
  .hg-td-tab { font-size: 10.5px; padding: 8px 2px 7px; }
  .hg-td-tab i { font-size: 15px; }
  .hg-td-ov-inner { padding: 2px 14px 12px; }
  .hg-td-empty-links { grid-template-columns: 1fr; }
}

/* ── Print ────────────────────────────────────────────────── */
@media print {
  .hg-td-root { display: none !important; }
}
