/* Thanh điều hướng dưới cùng + bảng Tour nổi bật (chỉ mobile/tablet nhỏ) */
:root {
  --qn-nav-h: 64px;
  --qn-nav-safe: env(safe-area-inset-bottom, 0px);
  --qn-brand: #9a0f11;
  --qn-brand-soft: #fbeaea;
  --qn-ink: #1f2937;
  --qn-muted: #6b7280;
  --qn-line: rgba(15, 23, 42, .08);
}

.qn-bottom-nav,
.qn-sheet {
  display: none;
}

@media (max-width: 849px) {
  body.has-mobile-bottom-nav {
    padding-bottom: calc(var(--qn-nav-h) + var(--qn-nav-safe));
  }

  /* Nhấc các nút nổi (gọi, Zalo, chat) lên trên thanh nav */
  body.has-mobile-bottom-nav .floating-actions {
    bottom: calc(var(--qn-nav-h) + var(--qn-nav-safe) + 12px) !important;
  }

  .qn-bottom-nav {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    padding-bottom: var(--qn-nav-safe);
    background: rgba(255, 255, 255, .96);
    border-top: 1px solid var(--qn-line);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, .08);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
  }

  .qn-bottom-nav__list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    height: var(--qn-nav-h);
    margin: 0;
    padding: 0 4px;
    list-style: none;
  }

  .qn-bottom-nav__item {
    margin: 0;
    list-style: none;
  }

  .qn-bottom-nav__link {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 100%;
    min-height: 44px;
    padding: 6px 2px;
    color: var(--qn-muted);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: color .2s ease;
  }

  .qn-bottom-nav__link:hover,
  .qn-bottom-nav__link:focus-visible {
    color: var(--qn-brand);
  }

  .qn-bottom-nav__link:focus-visible {
    outline: 2px solid var(--qn-brand);
    outline-offset: -4px;
    border-radius: 12px;
  }

  .qn-bottom-nav__icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 28px;
    border-radius: 14px;
    font-size: 18px;
    transition: background-color .2s ease, transform .2s ease;
  }

  .qn-bottom-nav__label {
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .qn-bottom-nav__link.is-active {
    color: var(--qn-brand);
    font-weight: 600;
  }

  .qn-bottom-nav__link.is-active .qn-bottom-nav__icon {
    background: var(--qn-brand-soft);
  }

  /* Nút Tour nổi bật ở giữa */
  .qn-bottom-nav__link--tour .qn-bottom-nav__icon {
    width: 48px;
    height: 48px;
    margin-top: -22px;
    border-radius: 50%;
    background: linear-gradient(145deg, #c0191c, var(--qn-brand));
    color: #fff;
    box-shadow: 0 8px 18px rgba(154, 15, 17, .35), 0 0 0 4px #fff;
    font-size: 19px;
  }

  .qn-bottom-nav__link--tour,
  .qn-bottom-nav__link--tour.is-active {
    color: var(--qn-brand);
    font-weight: 600;
  }

  .qn-bottom-nav__link--tour.is-active .qn-bottom-nav__icon {
    background: linear-gradient(145deg, #c0191c, var(--qn-brand));
  }

  .qn-bottom-nav__link--tour[aria-expanded="true"] .qn-bottom-nav__icon {
    transform: scale(.94);
  }

  /* ---------- Bottom sheet ---------- */
  .qn-sheet {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 10001;
  }

  .qn-sheet[hidden] {
    display: none;
  }

  .qn-sheet__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    opacity: 0;
    transition: opacity .25s ease;
  }

  .qn-sheet__panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    max-height: min(82vh, 640px);
    padding: 8px 16px calc(16px + var(--qn-nav-safe));
    border-radius: 20px 20px 0 0;
    background: #fff;
    box-shadow: 0 -12px 40px rgba(15, 23, 42, .18);
    transform: translateY(100%);
    transition: transform .3s cubic-bezier(.2, .8, .2, 1);
    outline: none;
    touch-action: pan-y;
  }

  .qn-sheet.is-open .qn-sheet__backdrop {
    opacity: 1;
  }

  .qn-sheet.is-open .qn-sheet__panel {
    transform: translateY(0);
  }

  .qn-sheet__handle {
    width: 40px;
    height: 4px;
    margin: 4px auto 12px;
    border-radius: 2px;
    background: #d1d5db;
  }

  .qn-sheet__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
  }

  .qn-sheet__eyebrow {
    margin: 0 0 2px;
    color: var(--qn-brand);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
  }

  .qn-sheet__title {
    margin: 0;
    color: var(--qn-ink);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
  }

  .qn-sheet__close {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f3f4f6;
    color: var(--qn-ink);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
  }

  .qn-sheet__close:focus-visible {
    outline: 2px solid var(--qn-brand);
    outline-offset: 2px;
  }

  .qn-sheet__list {
    flex: 1 1 auto;
    margin: 0 -16px;
    padding: 0 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    list-style: none;
  }

  .qn-sheet__list li {
    margin: 0;
    list-style: none;
  }

  .qn-sheet__list li + li {
    border-top: 1px solid var(--qn-line);
  }

  .qn-tour-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    color: inherit;
    text-decoration: none;
  }

  .qn-tour-row:focus-visible {
    outline: 2px solid var(--qn-brand);
    outline-offset: 2px;
    border-radius: 12px;
  }

  .qn-tour-row__media {
    display: grid;
    place-items: center;
    flex: 0 0 96px;
    width: 96px;
    height: 72px;
    overflow: hidden;
    border-radius: 12px;
    background: var(--qn-brand-soft);
    color: var(--qn-brand);
    font-size: 22px;
  }

  .qn-tour-row__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .qn-tour-row__body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1 1 auto;
  }

  .qn-tour-row__title {
    display: -webkit-box;
    overflow: hidden;
    color: var(--qn-ink);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .qn-tour-row__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 10px;
    color: var(--qn-muted);
    font-size: 12px;
  }

  .qn-tour-row__meta i {
    margin-right: 4px;
  }

  .qn-tour-row__price {
    color: var(--qn-brand);
    font-size: 15px;
    font-weight: 700;
  }

  .qn-tour-row__price small {
    color: var(--qn-muted);
    font-size: 12px;
    font-weight: 500;
  }

  .qn-tour-row__arrow {
    flex: 0 0 auto;
    color: #cbd5e1;
    font-size: 13px;
  }

  .qn-sheet__all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    margin-top: 12px;
    border-radius: 999px;
    background: var(--qn-brand);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
  }

  .qn-sheet__all:hover,
  .qn-sheet__all:focus-visible {
    background: #7d0b0d;
    color: #fff;
  }

  body.qn-sheet-locked {
    overflow: hidden;
  }
}

@media (max-width: 849px) and (prefers-reduced-motion: reduce) {
  .qn-sheet__panel,
  .qn-sheet__backdrop,
  .qn-bottom-nav__icon {
    transition: none;
  }
}
