/* =========================================================================
   ATKV global chrome - mobile appbar + tabbar matching docs/ui-redesign.
   Applies to every page via MainLayout. Mobile is the primary target; on
   desktop the bottom tabbar is hidden and the existing horizontal top nav
   menu takes over (rules in navigation.css remain authoritative there).
   ========================================================================= */

/* ----------------------------------------------- HELP DROPDOWN (APPBAR) */

.nav-help-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.nav-help-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border: 1px solid var(--atkv-line, #e5e7eb);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    padding: 6px;
    display: flex;
    flex-direction: column;
    min-width: 200px;
    z-index: 60;
}

.nav-help-menu__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--atkv-ink, #0f172a);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.12s ease;
}

.nav-help-menu__item i {
    color: var(--atkv-blue, #2a63af);
    font-size: 16px;
    width: 18px;
    text-align: center;
}

.nav-help-menu__item:hover {
    background: var(--atkv-bg-alt, #f3f4f6);
    color: var(--atkv-blue, #2a63af);
    text-decoration: none;
}

/* -------------------------------------------- INLINE CHANGELOG (PROFILE) */

.changelog-inline-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--atkv-bg-alt, #f3f4f6);
    color: var(--atkv-blue, #2a63af);
    border: 1px solid var(--atkv-line, #e5e7eb);
    border-radius: 999px;
    padding: 6px 12px;
    margin: 8px auto 0;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.12s ease, border-color 0.12s ease;
}

.changelog-inline-btn:hover {
    background: #fff;
    border-color: var(--atkv-blue, #2a63af);
}

.changelog-inline-btn i {
    font-size: 13px;
}

/* ---------------------------------------------------------------- TABBAR */

.atkv-tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    padding-bottom: env(safe-area-inset-bottom, 0);
    background: #fff;
    border-top: 1px solid var(--atkv-line, #e5e7eb);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: stretch;
    z-index: 50;
}

.atkv-tabbar__item {
    border: 0;
    background: transparent;
    color: var(--atkv-muted, #6b7280);
    display: grid;
    place-items: center;
    gap: 2px;
    padding: 6px 4px 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.15s ease;
}

.atkv-tabbar__item:hover {
    color: var(--atkv-blue, #2a63af);
}

.atkv-tabbar__icon {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    font-size: 20px;
    line-height: 1;
}

.atkv-tabbar__label {
    font-size: 10.5px;
    letter-spacing: 0.02em;
    line-height: 1;
}

.atkv-tabbar__item--active {
    color: var(--atkv-blue, #2a63af);
}

.atkv-tabbar__item--active .atkv-tabbar__icon i {
    transform: scale(1.05);
}

/* Hide the bottom tabbar on desktop - the top horizontal menu replaces it. */
@media (min-width: 1025px) {
    .atkv-tabbar {
        display: none;
    }
}

/* ------------------------------------------- MAIN CONTENT TABBAR SPACING */

/* When the bottom tabbar is present we need to give the main scroll area
   bottom padding so content isn't obscured. Applied via a body class set
   in MainLayout. */
@media (max-width: 1024px) {
    body.has-tabbar {
        padding-bottom: 64px;
    }
}

/* =========================================================================
   Layout tightening overrides - higher specificity than component-scoped
   CSS so we can shrink cards / spacing without rewriting each component.
   Keeps every CTA + every data binding; just compresses the visual.
   ========================================================================= */

@media (max-width: 1024px) {
    /* Main content tighter horizontal padding on mobile. */
    .main-content {
        padding: 12px 14px !important;
    }

    /* FeaturedExperiences carousel on the home page must match the mock-up:
       240px-wide cards with a 120px image banner, the resort title BELOW
       the image (not overlaid), and a single 'From R{X} / night' muted
       caption underneath. The whole card is clickable - card click routes
       to the booking page where the real Book CTA lives. */
    .home-v2 .accommodation-card,
    .main-content .accommodation-card {
        width: 240px !important;
        max-width: 240px !important;
        min-width: 240px !important;
        height: auto !important;
        min-height: 0 !important;
        flex-shrink: 0 !important;
        border-radius: 18px !important;
        overflow: hidden !important;
        padding: 0 !important;
        margin: 0 !important;
        background: #fff !important;
        border: 1px solid var(--atkv-line, #e5e7eb) !important;
    }
    .home-v2 .accommodation-image-wrap,
    .main-content .accommodation-image-wrap {
        height: 120px !important;
    }
    .home-v2 .accommodation-image,
    .home-v2 .accommodation-image-placeholder,
    .main-content .accommodation-image,
    .main-content .accommodation-image-placeholder {
        height: 120px !important;
        width: 100% !important;
        object-fit: cover;
    }
    /* Mock-up has NO title overlay on the photo. Hide it; show the
       below-image .accommodation-title--below instead. */
    .home-v2 .accommodation-overlay,
    .main-content .accommodation-overlay {
        display: none !important;
    }
    .home-v2 .accommodation-title,
    .main-content .accommodation-title {
        font-size: 14px !important;
        line-height: 1.2 !important;
    }
    .home-v2 .accommodation-title--below,
    .main-content .accommodation-title--below {
        display: block !important;
        margin: 0 !important;
        color: var(--atkv-ink, #0f172a) !important;
        font-weight: 700 !important;
    }
    .home-v2 .accommodation-details,
    .main-content .accommodation-details {
        padding: 12px 14px !important;
        flex: 0 0 auto !important;
        gap: 2px !important;
        background: #fff !important;
    }
    /* Carousel must NOT stretch cards to a common height (default flex
       align-items: stretch is what was making short cards grow to match
       the tallest sibling, leaving an empty band). */
    .home-v2 .carousel,
    .main-content .carousel {
        align-items: flex-start !important;
    }
    /* Mock-up has no amenity chips on the home cards. */
    .home-v2 .accommodation-amenities,
    .main-content .accommodation-amenities {
        display: none !important;
    }
    /* Book Now button on home cards: full-width gradient CTA below the
       price, matching docs/ui-redesign/featured-carousel-mobile.html .book
       (display:block; width:100%; min-height:42px; radius:10px; per-resort
       gradient). The card stays clickable; the button stops propagation and
       opens the resort's own booking page. */
    .home-v2 .accommodation-footer,
    .main-content .accommodation-footer {
        padding: 0 !important;
        margin: 0 !important;
        display: block !important;
    }
    .home-v2 .accommodation-footer .button--booking,
    .main-content .accommodation-footer .button--booking {
        display: block !important;
        width: 100% !important;
        min-height: 42px !important;
        margin-top: 10px !important;
        padding: 0 16px !important;
        border-radius: 10px !important;
        font-size: 14px !important;
        font-weight: 700 !important;
    }
    /* Price label - render as 'From R{price} / night' all muted, matches
       mock-up where the entire price line is .text-xs.text-muted styled. */
    .home-v2 .price,
    .main-content .price {
        color: var(--atkv-muted, #6b7280) !important;
        font-weight: 400 !important;
        font-size: 12px !important;
        margin-top: 2px !important;
    }
    .home-v2 .price-from,
    .main-content .price-from,
    .home-v2 .price-large,
    .main-content .price-large,
    .home-v2 .price-small,
    .main-content .price-small {
        font-size: 12px !important;
        font-weight: 400 !important;
        color: var(--atkv-muted, #6b7280) !important;
    }

    /* Section titles on home are left-aligned per mock-up. */
    .home-v2 .section-title,
    .main-content .section-title {
        text-align: left !important;
        margin: 0 0 12px !important;
    }

    /* NewsEventsSection on the home page: full-width cards stacked
       vertically. The page scrolls vertically; news never scrolls
       horizontally (see feedback_no_horizontal_scroll). */
    .home-v2 .news-section .card-grid,
    .home-v2 .news-section .card-grid--4-col,
    .main-content .news-section .card-grid,
    .main-content .news-section .card-grid--4-col {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: none !important;
        gap: 12px !important;
        overflow-x: visible !important;
        overflow-y: visible !important;
        scroll-snap-type: none !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
    }
    .home-v2 .news-card,
    .main-content .news-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        height: auto !important;
        padding: 0 !important;
        margin: 0 !important;
        background: #fff !important;
        border: 1px solid var(--atkv-line, #e5e7eb) !important;
        border-radius: 18px !important;
        overflow: hidden !important;
        scroll-snap-align: none !important;
        flex-shrink: 0 !important;
    }
    .home-v2 .news-card__image-wrap,
    .main-content .news-card__image-wrap {
        height: 120px !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }
    .home-v2 .news-card__image,
    .main-content .news-card__image {
        border-radius: 0 !important;
        height: 100% !important;
        width: 100% !important;
        object-fit: cover !important;
    }
    .home-v2 .news-card__body,
    .main-content .news-card__body {
        padding: 12px 14px !important;
        gap: 2px !important;
        background: #fff !important;
    }
    .home-v2 .news-card__title,
    .main-content .news-card__title {
        font-size: 14px !important;
        font-weight: 700 !important;
        line-height: 1.2 !important;
        margin: 0 !important;
        color: var(--atkv-ink, #0f172a) !important;
    }
    .home-v2 .news-card__date,
    .main-content .news-card__date {
        font-size: 12px !important;
        font-weight: 400 !important;
        color: var(--atkv-muted, #6b7280) !important;
        margin: 2px 0 0 !important;
    }
    /* Mock-up has no tag pills on news cards - hide for visual parity. */
    .home-v2 .news-card__tags,
    .main-content .news-card__tags {
        display: none !important;
    }
    /* Match Featured experiences header spacing/alignment on news too. */
    .home-v2 .news-header,
    .main-content .news-header {
        margin-bottom: 12px !important;
    }
    .home-v2 .news-title,
    .main-content .news-title {
        text-align: left !important;
        font-size: 16px !important;
        font-weight: 700 !important;
        margin: 0 !important;
    }
    .home-v2 .news-subtitle,
    .main-content .news-subtitle {
        margin: 4px 0 0 !important;
        font-size: 12px !important;
        color: var(--atkv-muted, #6b7280) !important;
        font-weight: 400 !important;
    }
    .home-v2 .news-header__titles,
    .main-content .news-header__titles {
        display: flex !important;
        flex-direction: column !important;
    }

    /* Hero section tightening on home. */
    .main-content .hero-section,
    .main-content .home-v2__hero {
        margin-bottom: 14px !important;
    }
    .main-content .hero-title,
    .main-content .home-v2__name {
        font-size: 22px !important;
        line-height: 1.2 !important;
    }
    .main-content .hero-subtitle,
    .main-content .home-v2__subtitle {
        font-size: 13px !important;
        margin: 0 0 10px !important;
    }

    /* Wallet card on home - match mock-up height (~130px). The base
       .wallet-hero / .wallet-card has min-height: 140 + padding: 20
       which renders ~156px live vs 130 in the mock-up. */
    .main-content .wallet-card,
    .main-content .home-v2__wallet-wrap .wallet-card,
    .home-v2 .wallet-hero,
    .main-content .wallet-hero {
        padding: 16px 18px !important;
        min-height: 120px !important;
    }

    /* Section titles overall - 16px font weight 700 (mock-up size). */
    .main-content .section-title,
    .main-content h2 {
        font-size: 16px !important;
        font-weight: 700 !important;
        margin: 16px 0 10px !important;
    }
    .main-content h1 {
        font-size: 22px !important;
        font-weight: 700 !important;
    }

    /* Resorts list card tightening (already redesigned but tighten more). */
    .resorts-redesign__card {
        margin-bottom: 12px !important;
    }
    .resorts-redesign__banner {
        height: 96px !important;
    }
    .resorts-redesign__body {
        padding: 10px 12px !important;
    }
    .resorts-redesign__name {
        font-size: 14px !important;
    }

    /* Resort detail hero shrink. */
    .resort-header {
        height: 180px !important;
    }
    .resort-navigation {
        margin: 8px 16px !important;
    }

    /* News list card sizing. */
    .news-page .article-card,
    .news-page .featured-articles article,
    .news-page .articles-grid article {
        max-width: 100% !important;
    }

    /* Tighten generic section spacing. */
    .section {
        padding: 12px 16px !important;
    }

    .spacer-lg {
        height: 16px !important;
    }
}

/* ----------------------------------------------------- MOBILE APPBAR REFINEMENTS */

/* The mock-up appbar is just: logo (left), changelog + language (right).
   Hamburger and profile-avatar are redundant because the bottom tabbar
   handles all primary navigation including Profile. We hide both on
   mobile and slim the appbar to ~56px to match the design. */
@media (max-width: 1024px) {
    .navigation--top-mobile {
        min-height: 64px !important;
        max-height: 64px !important;
        height: 64px !important;
        padding: 12px 20px !important;
        box-sizing: border-box !important;
    }

    .navigation--top-mobile .navigation__left-section {
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
    }

    .navigation--top-mobile .navigation__logo {
        display: flex !important;
        align-items: center !important;
    }

    .navigation--top-mobile .navigation__logo img {
        height: 36px !important;
        width: auto;
        display: block;
    }

    /* Hamburger + slide-out mobile menu were removed - bottom tabbar
       owns navigation, Help dropdown owns Contact + My tickets. The
       supporting overrides are gone with them. */

    /* Bottom tabbar has Profile - kill the avatar button on mobile. */
    .navigation--top-mobile .navigation__user-button {
        display: none !important;
    }

    .navigation--top-mobile .navigation__changelog-button {
        width: 32px !important;
        height: 32px !important;
        font-size: 16px !important;
    }

    /* Pull the main content up to start right after the slimmer appbar
       so we don't leave a 101px gap at the top of every page. */
    .mobile-app-layout > main,
    .mobile-app-layout .mobile-content {
        padding-top: 64px !important;
    }
}

/* ----------------------------------------------------- CARD WHITESPACE TRIM */

/* The legacy .accommodation-card has a tall fixed height (~400px) that
   leaves a big empty band below the Book Now button when the card width
   shrinks. Force the card to size to its content. */
@media (max-width: 1024px) {
    .main-content .accommodation-card,
    .main-content .accommodation-card.accommodation-card {
        min-height: 0 !important;
        height: auto !important;
        display: flex !important;
        flex-direction: column !important;
    }
    .main-content .accommodation-card .accommodation-details {
        flex: 0 0 auto !important;
    }
    .main-content .accommodation-card .accommodation-footer {
        padding-top: 0 !important;
        padding-bottom: 10px !important;
        margin-top: 0 !important;
    }
    /* Compress hero spacing on home above first section. */
    .main-content > section:first-of-type,
    .main-content .home-v2__hero {
        margin-top: 0 !important;
    }
}

/* ----------------------------------- HIDE TOPNAVBAR ON PAGES THAT DRAW THEIR OWN APPBAR */
/* The redesigned /contact page draws its own blue "Contact us" appbar
   matching docs/ui-redesign/screens/26-support-contact.html. The global
   TopNavBar would stack on top of it - hide it when the page is present.
   NOTE: /support/tickets (.tickets-redesign) is a TOP-LEVEL menu destination,
   so it must keep the standard TopNavBar exactly like every other menu item -
   it no longer hides the nav or draws its own appbar (see MyTickets.razor). */
body:has(.contact-directory) .navigation--top-mobile,
body:has(.contact-directory) .navigation--top-desktop {
    display: none !important;
}
body:has(.contact-directory) .mobile-content {
    padding-top: 0 !important;
}

/* ----------------------------------------------- EMBEDDED PREVIEW (admin editor)
   When the resort detail page is loaded in the admin live-preview iframe
   (?embed=1, which sets body[data-embed="1"]), hide ALL app chrome so the preview
   shows only the resort page itself - no top nav, no bottom tabbar, no skip link. */
body[data-embed="1"] .navigation--top-mobile,
body[data-embed="1"] .navigation--top-desktop,
body[data-embed="1"] .atkv-tabbar,
body[data-embed="1"] .skip-navigation {
    display: none !important;
}
body[data-embed="1"] .mobile-content {
    padding-top: 0 !important;
}
body[data-embed="1"].has-tabbar,
body[data-embed="1"] .mobile-app-layout.has-tabbar {
    padding-bottom: 0 !important;
}
