/* ═══════════════════════════════════════════════════════════
   traevel.com — Deal Tools Styles
   Watchlist · Price Alerts · Share · Compare
   ═══════════════════════════════════════════════════════════ */

/* ─── Shared overlay ─── */
.deal-tools-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 20, .55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s, visibility .3s;
}
.deal-tools-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

/* ═══ DEAL CARD TOOLBAR ═══ */
.deal-tools-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-top: 1px solid var(--border, #e5e7eb);
  background: var(--bg, #faf8f5);
}
.deal-tools-bar__btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 11px;
  border: 1.5px solid var(--border, #e5e7eb);
  border-radius: 10px;
  background: #fff;
  color: var(--text, #1a1f2e);
  font-family: 'DM Sans', sans-serif;
  font-size: .8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
  white-space: nowrap;
}
.deal-tools-bar__btn:hover {
  border-color: var(--accent, var(--accent, #e85d3a));
  color: var(--accent, var(--accent, #e85d3a));
  transform: translateY(-1px);
}
.deal-tools-bar__btn.is-active {
  background: var(--primary, #0d5c63);
  border-color: var(--primary, #0d5c63);
  color: #fff;
}
.deal-tools-bar__btn .icon {
  font-size: .9375rem;
  line-height: 1;
}
.deal-tools-bar__spacer {
  flex: 1;
}
.deal-tools-bar__compare-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border: 1.5px solid var(--border, #e5e7eb);
  border-radius: 10px;
  background: #fff;
  color: var(--text-muted, #6b7280);
  font-family: 'DM Sans', sans-serif;
  font-size: .8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
}
.deal-tools-bar__compare-check.is-active {
  background: #0d5c63;
  border-color: #0d5c63;
  color: #fff;
}
.deal-tools-bar__compare-check .checkbox {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  line-height: 1;
}
.deal-tools-bar__compare-check.is-active .checkbox::after {
  content: '✓';
}

/* ═══ HEADER BADGE (Watchlist counter in site header) ═══ */
.header-watchlist-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background .2s;
}
.header-watchlist-btn:hover {
  background: rgba(255, 255, 255, .2);
}
.header-watchlist-btn[data-watchlist-badge] {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--accent, #e85d3a);
  color: #fff;
  font-size: .6875rem;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg-elevated, #1a1f2e);
}
.header-watchlist-btn > [data-watchlist-badge] {
  position: absolute;
  top: -2px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--accent, #e85d3a);
  color: #fff;
  font-size: .6875rem;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ═══ WATCHLIST DRAWER ═══ */
.watchlist-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 420px;
  height: 100vh;
  height: 100dvh;
  background: var(--bg-elevated, #faf8f5);
  z-index: 9999;
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.4, 0, .2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 40px rgba(0, 0, 0, .15);
}
.watchlist-drawer.is-open {
  transform: translateX(0);
}
.watchlist-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  background: #fff;
}
.watchlist-drawer__head h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  color: var(--text, #1a1f2e);
}
.watchlist-drawer__close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--bg, #f3f4f6);
  color: var(--text, #1a1f2e);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}
.watchlist-drawer__close:hover {
  background: var(--border, #e5e7eb);
}
.watchlist-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}
.watchlist-drawer__empty {
  text-align: center;
  padding: 60px 24px;
  color: var(--text, #1a1f2e);
}
.watchlist-drawer__empty p {
  margin: 8px 0;
  font-family: 'DM Sans', sans-serif;
}
.watchlist-item {
  display: flex;
  align-items: stretch;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
  transition: box-shadow .2s, transform .2s;
}
.watchlist-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, .1);
  transform: translateY(-1px);
}
.watchlist-item__link {
  display: flex;
  flex: 1;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.watchlist-item__img {
  width: 72px;
  min-height: 72px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #e0f2f1, #b2dfdb);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  overflow: hidden;
}
.watchlist-item__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.watchlist-item__info {
  flex: 1;
  padding: 10px 12px;
  min-width: 0;
}
.watchlist-item__dest {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--primary, #0d5c63);
}
.watchlist-item__title {
  font-size: .875rem;
  font-weight: 600;
  color: var(--text, #1a1f2e);
  margin: 2px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.watchlist-item__price {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent, var(--accent, #e85d3a));
}
.watchlist-item__saved {
  font-size: .6875rem;
  color: var(--text-muted, #6b7280);
  margin-top: 2px;
}
.watchlist-item__remove {
  width: 36px;
  border: none;
  background: transparent;
  color: var(--text-muted, #6b7280);
  cursor: pointer;
  font-size: .875rem;
  transition: color .2s, background .2s;
}
.watchlist-item__remove:hover {
  color: var(--accent, #e85d3a);
  background: rgba(200, 78, 47, .05);
}
.watchlist-drawer__foot {
  padding: 16px 24px;
  border-top: 1px solid var(--border, #e5e7eb);
  background: #fff;
}
.watchlist-drawer__foot .btn {
  width: 100%;
  text-align: center;
}

/* ═══ MODALS (shared) ═══ */
.deal-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.deal-modal.is-open {
  display: flex;
}
.deal-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 12, 20, .6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.deal-modal__panel {
  position: relative;
  background: var(--bg-elevated, #faf8f5);
  border-radius: 20px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px 24px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .25);
  animation: modalIn .3s cubic-bezier(.4, 0, .2, 1);
}
.deal-modal__panel--sm {
  max-width: 380px;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.deal-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--bg, #f3f4f6);
  color: var(--text, #1a1f2e);
  font-size: .9375rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.deal-modal__close:hover {
  background: var(--border, #e5e7eb);
}
.deal-modal__title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text, #1a1f2e);
  margin: 0 0 4px;
  padding-right: 36px;
}
.deal-modal__sub {
  font-size: .9375rem;
  color: var(--text-muted, #6b7280);
  margin: 0;
  font-family: 'DM Sans', sans-serif;
}

/* ─── Form fields ─── */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.form-field__label {
  font-size: .875rem;
  font-weight: 600;
  color: var(--text, #1a1f2e);
  font-family: 'DM Sans', sans-serif;
}
.form-field__input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border, #e5e7eb);
  border-radius: 12px;
  font-size: 1rem;
  font-family: 'DM Sans', sans-serif;
  color: var(--text, #1a1f2e);
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
  box-sizing: border-box;
}
.form-field__input:focus {
  outline: none;
  border-color: var(--primary, #0d5c63);
  box-shadow: 0 0 0 3px rgba(13, 92, 99, .12);
}
.form-field__hint {
  font-size: .75rem;
  color: var(--text-muted, #6b7280);
}

/* ═══ SHARE MODAL ═══ */
.share-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 20px;
}
.share-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 12px;
  border-radius: 14px;
  text-decoration: none;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: .875rem;
  color: #fff;
  transition: transform .2s, box-shadow .2s;
}
.share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .15);
  color: #fff;
}
.share-btn__icon {
  font-size: 1.75rem;
}
.share-btn--wa { background: #25d366; }
.share-btn--tg { background: #0088cc; }
.share-btn--fb { background: #1877f2; }
.share-btn--mail { background: #6b7280; }

.share-copy {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding: 4px;
  background: #fff;
  border: 1.5px solid var(--border, #e5e7eb);
  border-radius: 12px;
}
.share-copy__input {
  flex: 1;
  border: none;
  padding: 10px 12px;
  font-size: .8125rem;
  font-family: 'DM Sans', sans-serif;
  color: var(--text, #1a1f2e);
  background: transparent;
  outline: none;
  min-width: 0;
}
.share-copy__btn {
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  background: var(--primary, #0d5c63);
  color: #fff;
  font-weight: 700;
  font-size: .8125rem;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: background .2s;
  white-space: nowrap;
}
.share-copy__btn:hover {
  background: #0a494e;
}

/* ═══ COMPARE BAR (fixed bottom) ═══ */
.compare-bar {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9997;
  width: calc(100% - 32px);
  max-width: 520px;
  background: var(--text, #1a1f2e);
  color: #fff;
  border-radius: 16px;
  padding: 12px 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
  animation: compareBarIn .3s cubic-bezier(.4, 0, .2, 1);
}
@keyframes compareBarIn {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.compare-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.compare-bar__text {
  font-family: 'DM Sans', sans-serif;
  font-size: .9375rem;
  font-weight: 600;
}
.compare-bar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.compare-bar__clear {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, .7);
  font-family: 'DM Sans', sans-serif;
  font-size: .8125rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: color .2s, background .2s;
}
.compare-bar__clear:hover {
  color: #fff;
  background: rgba(255, 255, 255, .1);
}
.compare-bar .btn {
  padding: 10px 20px;
  font-size: .875rem;
}

/* ═══ COMPARE MODAL ═══ */
.compare-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.compare-modal.is-open {
  display: flex;
}
.compare-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 12, 20, .6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.compare-modal__panel {
  position: relative;
  background: var(--bg-elevated, #faf8f5);
  border-radius: 20px;
  max-width: 900px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  padding: 28px 24px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .25);
  animation: modalIn .3s cubic-bezier(.4, 0, .2, 1);
}
.compare-modal__scroll {
  overflow-x: auto;
  margin-top: 16px;
}

/* ─── Compare Table ─── */
.compare-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 500px;
}
.compare-table td,
.compare-table th {
  padding: 12px 10px;
  text-align: center;
  border-bottom: 1px solid var(--border, #e5e7eb);
  font-family: 'DM Sans', sans-serif;
  font-size: .875rem;
  color: var(--text, #1a1f2e);
  vertical-align: middle;
}
.compare-table__head th {
  border-bottom: 2px solid var(--border, #e5e7eb);
  padding: 16px 10px;
}
.compare-table__deal-head {
  position: relative;
  width: 33%;
  min-width: 160px;
}
.compare-table__deal-img {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  overflow: hidden;
  margin: 0 auto 8px;
  background: linear-gradient(135deg, #e0f2f1, #b2dfdb);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}
.compare-table__deal-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.compare-table__deal-title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text, #1a1f2e);
}
.compare-table__remove {
  position: absolute;
  top: 8px;
  right: 4px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: var(--bg, #f3f4f6);
  color: var(--text-muted, #6b7280);
  font-size: .75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.compare-table__remove:hover {
  background: var(--accent, #e85d3a);
  color: #fff;
}
.compare-table__row--highlight td {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text, #1a1f2e);
}
.compare-table__cell--best {
  background: linear-gradient(135deg, rgba(16, 185, 129, .08), rgba(16, 185, 129, .02));
  color: #059669 !important;
  font-weight: 700;
}
.compare-table__cta-row td {
  border-bottom: none;
  padding-top: 20px;
}

/* ═══ PRICE HISTORY UPGRADE (SVG sparkline) ═══ */
.price-history-chart {
  background: var(--bg, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 14px;
  padding: 20px;
}
.price-history-chart__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.price-history-chart__stats {
  display: flex;
  gap: 16px;
  font-family: 'DM Sans', sans-serif;
  font-size: .8125rem;
}
.price-history-chart__stat {
  display: flex;
  flex-direction: column;
}
.price-history-chart__stat-label {
  color: var(--text-muted, #6b7280);
  font-size: .6875rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.price-history-chart__stat-value {
  font-weight: 700;
  color: var(--text, #1a1f2e);
}
.price-history-chart__stat-value--down { color: #059669; }
.price-history-chart__stat-value--up { color: var(--accent, #e85d3a); }
.price-history-svg {
  width: 100%;
  height: auto;
  display: block;
}

/* ═══ MOBILE ═══ */
@media (max-width: 640px) {
  .deal-tools-bar {
    padding: 6px 8px;
    flex-wrap: wrap;
  }
  .deal-tools-bar__btn {
    padding: 6px 9px;
    font-size: .75rem;
  }
  .deal-tools-bar__btn .label {
    display: none; /* icon-only on mobile */
  }
  .deal-tools-bar__compare-check .label {
    display: none;
  }
  .share-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .compare-modal__panel,
  .deal-modal__panel {
    margin: 0;
    padding: 20px 16px;
    border-radius: 16px;
    max-height: 100vh;
    max-height: 100dvh;
  }
  .watchlist-drawer {
    max-width: 100%;
  }
  .compare-bar {
    bottom: 8px;
    width: calc(100% - 16px);
  }
}

/* ═══ REDUCED MOTION ═══ */
@media (prefers-reduced-motion: reduce) {
  .deal-tools-overlay,
  .watchlist-drawer,
  .deal-modal__panel,
  .compare-modal__panel,
  .compare-bar {
    transition: none !important;
    animation: none !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   PRICE HISTORY CHART (SVG Sparkline)
   ═══════════════════════════════════════════════════════════ */
.header-watchlist-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 1rem;
  font-family: inherit;
  position: relative;
  transition: background 0.2s, border-color 0.2s;
}
.header-watchlist-btn:hover {
  background: rgba(255,255,255,0.16);
  border-color: #fff;
}
.header-watchlist-btn [data-watchlist-badge]:empty { display: none; }
.header-watchlist-btn .watchlist-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent, var(--accent, #e85d3a));
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.price-history-chart {
  background: var(--bg, #faf8f5);
  border-radius: 12px;
  padding: 16px;
}
.price-history-chart__header {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.price-history-chart__stats {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  width: 100%;
}
.price-history-chart__stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.price-history-chart__stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted, #6b7280);
  font-weight: 600;
}
.price-history-chart__stat-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text, #1a1f2e);
  font-family: 'DM Sans', sans-serif;
}
.price-history-chart__stat-value--down { color: #059669; }
.price-history-chart__stat-value--up { color: var(--accent, #e85d3a); }
.price-history-svg {
  width: 100%;
  height: auto;
  display: block;
}
@media (max-width: 600px) {
  .price-history-chart__stats { gap: 12px; }
  .price-history-chart__stat-value { font-size: 0.95rem; }
}
