/*
  SimSim Trip — Hotel Selection Page (hotel-selection.css)
  ══════════════════════════════════════════════════════════
  Desktop : 3-column grid, fixed bottom bar
  Mobile  : single-column, fixed bottom bar
*/

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --purple: #6B48E8;
  --purple-dark: #5038C8;
  --main: #500EAF;
  --green: #22C55E;
  --orange: #F97316;
  --red: #EF4444;
  --text: #1a1a2e;
  --text-mid: #4b5563;
  --text-light: #9ca3af;
  --white: #ffffff;
  --bg: #f8f7fd;
  --bg-light: #f3f4f6;
  --border: #e5e7eb;
  --shadow: 0 2px 14px rgba(0, 0, 0, 0.07);
  --shadow-md: 0 6px 28px rgba(0, 0, 0, 0.11);
  --radius: 16px;
  --bottom-h: 64px;
  /* fixed bottom bar height */
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Satoshi', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  /* leave room for fixed bottom bar */
  padding-bottom: var(--bottom-h);
}

a {
  text-decoration: none;
}

/* ── Utility ── */
.desktop-only {
  display: flex;
}

.mobile-only {
  display: none;
}

/* ════════════════════════════════════
   DESKTOP SECONDARY NAV BAR
════════════════════════════════════ */
.secondary-bar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 10px 32px;
}

.secondary-bar-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 1400px;
  margin: 0 auto;
}

.sec-back-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-light);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-mid);
  flex-shrink: 0;
  transition: background 0.2s;
}

.sec-back-btn:hover {
  background: #ede9f8;
  color: var(--purple);
}

.sec-location {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}

.sec-count {
  color: var(--text-light);
  font-weight: 400;
}

.sec-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-light);
}

.sec-dot {
  margin: 0 2px;
}

/* ════════════════════════════════════
   MOBILE HEADER
════════════════════════════════════ */
.mob-header {
  display: none;
}

/* ════════════════════════════════════
   FILTER BAR
════════════════════════════════════ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 24px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-mid);
  transition: color 0.2s;
}

.filter-btn:hover {
  color: var(--purple);
}

.filter-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
}

/* ════════════════════════════════════
   SELECTION STATUS BAR
════════════════════════════════════ */
.selection-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 32px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.sel-count {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-mid);
}

.sel-max {
  display: none;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--green);
}

.sel-max::before {
  content: '✓';
}

.sel-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.sel-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(34, 197, 94, 0.1);
  border: 1.5px solid var(--green);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 14px;
}

/* ════════════════════════════════════
   HOTELS MAIN + GRID
════════════════════════════════════ */
.hotels-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 32px 20px;
}

.hotels-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* ════════════════════════════════════
   HOTEL CARD
════════════════════════════════════ */
.hotel-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow);
  transition: box-shadow 0.25s, border-color 0.25s, transform 0.2s;
  position: relative;
}

.hotel-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.hotel-card.selected {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25), var(--shadow-md);
}

/* Card image */
.card-img-wrap {
  position: relative;
  height: 200px;
  overflow: hidden;
  background: #e5e7eb;
}

.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s;
}

.hotel-card:hover .card-img-wrap img {
  transform: scale(1.04);
}

.discount-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  background: var(--green);
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 10px;
  letter-spacing: 0.03em;
}

.wishlist-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  cursor: pointer;
  color: var(--text-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
}

.wishlist-btn:hover {
  color: var(--red);
  background: var(--white);
}

/* Carousel nav */
.img-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  border: none;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  opacity: 0;
  transition: opacity 0.2s;
}

.card-img-wrap:hover .img-nav {
  opacity: 1;
}

.img-nav.prev {
  left: 8px;
}

.img-nav.next {
  right: 8px;
}

.img-dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  z-index: 3;
}

.img-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  transition: background 0.2s;
}

.img-dot.active {
  background: var(--white);
}

/* Card body */
.card-body {
  padding: 14px 16px 16px;
}

.card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.badge-green {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 8px;
}

.badge-orange {
  background: rgba(249, 115, 22, 0.12);
  color: #c2410c;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 8px;
}

.badge-blue {
  background: rgba(74, 144, 217, 0.12);
  color: #1d4ed8;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 8px;
}

.badge-teal {
  background: rgba(20, 184, 166, 0.12);
  color: #0f766e;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 8px;
}

.badge-purple {
  background: rgba(107, 72, 232, 0.12);
  color: var(--purple);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 8px;
}

.card-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.hotel-name {
  font-size: 0.97rem;
  font-weight: 800;
  color: var(--text);
}

.booked-tag {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--orange);
  white-space: nowrap;
  flex-shrink: 0;
}

.hotel-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-light);
  margin-bottom: 7px;
}

.meta-loc {
  display: flex;
  align-items: center;
  gap: 4px;
}

.meta-score strong {
  color: var(--text-mid);
}

.rating-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.stars {
  color: #F59E0B;
  font-size: 0.85rem;
  letter-spacing: 1px;
}

.rating-badge {
  background: var(--purple);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
}

.rating-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-mid);
}

.rating-reviews {
  font-size: 0.74rem;
  color: var(--text-light);
}

.amenities {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.amenities span {
  font-size: 0.72rem;
  color: var(--text-mid);
  background: var(--bg-light);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 8px;
}

.price-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 12px;
}

.orig-price {
  font-size: 0.75rem;
  color: var(--text-light);
  text-decoration: line-through;
}

.final-price {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--purple);
  line-height: 1.1;
}

.price-note {
  font-size: 0.68rem;
  color: var(--text-light);
}

.saved-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--green);
  white-space: nowrap;
}

/* Card action buttons */
.card-actions {
  display: flex;
  gap: 8px;
}

.btn-explore {
  flex: 1;
  padding: 9px 12px;
  border-radius: 20px;
  background: var(--white);
  border: 1.5px solid var(--border);
  color: var(--text-mid);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.2s, color 0.2s;
}

.btn-explore:hover {
  border-color: var(--purple);
  color: var(--purple);
}

.btn-select {
  flex: 1;
  padding: 9px 12px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--main), #8B3DD8);
  color: var(--white);
  font-size: 0.82rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 3px 12px rgba(107, 72, 232, 0.28);
  transition: opacity 0.2s, transform 0.15s;
}

.btn-select:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-select.selected-state {
  background: linear-gradient(135deg, #22C55E, #16A34A);
  box-shadow: 0 3px 12px rgba(34, 197, 94, 0.28);
}

/* Mobile extra actions (Map + Saved per card) */
.mob-extra-actions {
  display: none;
}

/* ════════════════════════════════════
   FIXED BOTTOM BAR
════════════════════════════════════ */
.fixed-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-h);
  background: var(--white);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.09);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 0 32px;
  z-index: 300;
}

/* Proceed btn — hidden by default, shown when 3 selected */
.proceed-btn {
  display: none;
  /* hidden until .visible is added by JS */
  align-items: center;
  gap: 8px;
  padding: 12px 32px;
  border-radius: 26px;
  background: linear-gradient(135deg, var(--main), #9810FA);
  color: var(--white);
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 5px 20px rgba(107, 72, 232, 0.38);
  transition: transform 0.2s, opacity 0.2s;
  animation: proceedPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.proceed-btn.visible {
  display: flex;
}

.proceed-btn:hover {
  transform: translateY(-1px);
  opacity: 0.92;
}

@keyframes proceedPop {
  from {
    transform: scale(0.88);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.bottom-bar-right {
  display: flex;
  gap: 8px;
}

.bottom-bar-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: 22px;
  background: var(--white);
  border: 1.5px solid var(--border);
  color: var(--text-mid);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.2s, color 0.2s;
}

.bottom-bar-btn:hover {
  border-color: var(--purple);
  color: var(--purple);
}

/* ════════════════════════════════════
   MOBILE  (≤768px)
════════════════════════════════════ */
@media (max-width: 768px) {

  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: flex;
  }

  .secondary-bar {
    display: none;
  }

  /* Mobile header */
  .mob-header {
    display: block;
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, #ede8fb 0%, #ddd4f7 100%);
    border-bottom: 1px solid rgba(107, 72, 232, 0.1);
    box-shadow: 0 2px 10px rgba(107, 72, 232, 0.08);
  }

  .mob-header-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
  }

  .mob-back {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(107, 72, 232, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text);
    flex-shrink: 0;
  }

  .mob-loc {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text);
    flex: 1;
  }

  .mob-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    color: var(--text-light);
  }

  .mob-wishlist {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.7);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-mid);
    flex-shrink: 0;
  }

  /* Filter bar */
  .filter-bar {
    padding: 0 16px;
    gap: 4px;
    justify-content: space-between;
  }

  .filter-btn {
    padding: 12px 10px;
    font-size: 0.82rem;
  }

  /* Selection bar */
  .selection-bar {
    padding: 8px 16px;
  }

  /* Hotels grid → single column */
  .hotels-main {
    padding: 14px 14px 16px;
  }

  .hotels-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* Card image */
  .card-img-wrap {
    height: 200px;
  }

  .img-nav {
    opacity: 1;
  }

  /* always visible on mobile */

  /* Card body */
  .card-body {
    padding: 12px 14px 14px;
  }

  .hotel-name {
    font-size: 0.92rem;
  }

  .booked-tag {
    font-size: 0.65rem;
  }

  .final-price {
    font-size: 1.1rem;
  }

  /* Mobile extra actions (Map + Saved per card) */
  .mob-extra-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
  }

  .mob-map-btn,
  .mob-saved-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 12px;
    border-radius: 18px;
    background: var(--white);
    border: 1.5px solid var(--border);
    color: var(--text-mid);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.2s, color 0.2s;
  }

  .mob-map-btn:hover,
  .mob-saved-btn:hover {
    border-color: var(--purple);
    color: var(--purple);
  }

  /* Fixed bottom bar */
  .fixed-bottom-bar {
    padding: 0 16px;
    gap: 8px;
    height: 68px;
    border-radius: 18px 18px 0 0;
    justify-content: center;
  }

  .proceed-btn {
    flex: 1;
    justify-content: center;
    padding: 12px 16px;
    font-size: 0.9rem;
    border-radius: 20px;
  }

  .bottom-bar-right {
    gap: 6px;
  }

  .bottom-bar-btn {
    padding: 10px 14px;
    font-size: 0.78rem;
  }

  body {
    padding-bottom: 80px;
  }
}

/* Extra small */
@media (max-width: 380px) {
  .card-img-wrap {
    height: 175px;
  }

  .bottom-bar-btn {
    padding: 9px 10px;
    font-size: 0.74rem;
  }
}