html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Seamless scrollbars, site-wide: transparent track so the page
   background shows through, with a slim rounded thumb. The inset look
   comes from a transparent border + `background-clip: content-box`.
   Chrome/Edge/Safari use the ::-webkit-scrollbar rules. Firefox gets
   the standard properties instead — they're kept out of Chromium on
   purpose, because Chrome 121+ ignores ::-webkit-scrollbar (and the
   rounded thumb) whenever `scrollbar-color` is set. */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
    background: transparent;
}

::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    border: 3px solid transparent;
    border-radius: 999px;
    background-color: rgba(100, 116, 139, 0.38);
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(100, 116, 139, 0.6);
}

/* Quick menu: share button (partials/share_button.html), stacked under
   예약 on every page (gray). Size/shape/position come from each page's
   `.quick-menu a` rules; only the colour is set here. */
.q-bg4 a {
    background: #6b7280;
    color: #fff;
}

.q-bg4 a:hover {
    background: #4b5563;
}

/* 집중모객 popup (#popUp, admin-entered HTML): on phones its outer box is
   stretched edge to edge (left/right: 10px) while the visible panel is only
   ~250px wide, so the empty, transparent part sat on top of the quick-menu
   buttons (z-index 999999) and swallowed taps on 카톡/전화/예약/공유.
   Let clicks pass through the empty area; the panel itself (and its close
   button) stays interactive. */
#popUp {
    pointer-events: none;
}

#popUp .pop-wrap {
    pointer-events: auto;
}

/* "링크가 복사되었습니다" toast shown when the link is copied instead of
   opening the native share sheet. */
.lj-share-toast {
    position: fixed;
    left: 50%;
    bottom: calc(28px + env(safe-area-inset-bottom));
    z-index: 2000;
    max-width: calc(100vw - 32px);
    padding: 12px 20px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.92);
    color: #fff;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 12px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.lj-share-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

@supports not selector(::-webkit-scrollbar) {
    html {
        scrollbar-width: thin;
        scrollbar-color: rgba(100, 116, 139, 0.45) transparent;
    }
}

img,
video,
iframe,
canvas,
svg {
    max-width: 100%;
}

/* Utility links stacked above the mobile hamburger. Desktop already
   surfaces these in the main nav, so they only exist on small screens. */
.nav-quick-links {
    display: none;
}

@media (max-width: 900px) {
    .tour-card,
    .featured-tour-card,
    .review-preview-card,
    .review-card,
    .contact-card,
    .feature-item,
    .info-card,
    .related-card,
    .tour-info-item {
        min-width: 0 !important;
    }

    .tour-grid,
    .review-grid,
    .review-preview-grid,
    .featured-tour-grid,
    .related-grid,
    .feature-grid,
    .process-grid,
    .contact-grid,
    .benefit-grid,
    .benefits-grid,
    .info-grid,
    .faq-grid,
    .tour-info-grid,
    .page-grid,
    .content-grid,
    .footer-info,
    .form-grid,
    .phone-group,
    .reservation-summary-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }

    html {
        scroll-padding-top: 112px !important;
    }

    /* Taller bar: the top 36px holds the quick-link row, the logo and the
       hamburger share the line underneath it. */
    nav {
        height: 112px !important;
        padding: 36px 16px 0 !important;
    }

    .nav-container {
        width: 100% !important;
        gap: 0 !important;
        padding: 0 !important;
    }

    .logo img {
        height: 58px !important;
    }

    .nav-quick-links {
        display: flex !important;
        position: absolute;
        top: 0;
        right: 16px;
        height: 36px;
        align-items: center;
        gap: 0.4rem;
        margin: 0;
        padding: 0;
        list-style: none;
        z-index: 102;
    }

    /* " / " divider between the links, as in the reference design. */
    .nav-quick-links li + li::before {
        content: '/';
        margin-right: 0.4rem;
        font-size: 0.8rem;
        font-weight: 400;
        color: inherit;
        opacity: 0.75;
    }

    .nav-quick-links li {
        display: flex;
        align-items: center;
        color: #fff;
        text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.35);
    }

    .nav-quick-links a {
        display: block;
        padding: 0;
        font-size: 0.82rem;
        font-weight: 600;
        line-height: 1;
        white-space: nowrap;
        text-decoration: none;
        color: inherit;
    }

    nav.nav-scrolled .nav-quick-links li,
    nav.mobile-menu-open .nav-quick-links li {
        color: #2c5aa0;
        text-shadow: none;
    }

    /* Bare bars — no bounding box — and a larger tap target. */
    .mobile-menu-toggle {
        width: 40px !important;
        height: 40px !important;
        gap: 6px !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        align-items: flex-end !important;
    }

    .mobile-menu-toggle span {
        width: 28px !important;
        height: 3px !important;
    }

    nav.nav-scrolled .mobile-menu-toggle,
    nav.mobile-menu-open .mobile-menu-toggle {
        background: transparent !important;
        border: 0 !important;
    }

    .mobile-menu-toggle.is-open span:nth-child(1) {
        transform: translateY(9px) rotate(45deg) !important;
    }

    .mobile-menu-toggle.is-open span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg) !important;
    }

    .nav-menu {
        top: 112px !important;
        max-height: calc(100svh - 112px) !important;
        padding-bottom: max(1.25rem, env(safe-area-inset-bottom)) !important;
    }

    .container,
    .content-section,
    .tour-detail-wrapper,
    .sub-header,
    .page-header,
    .section-header,
    .tour-content,
    .tour-section,
    .form-wrap,
    .tour-info-box,
    .tour-image-container,
    .reservation-wrap,
    .reservation-section,
    .review-list-section,
    .notice-list-section {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .tour-card,
    .featured-tour-card,
    .review-card,
    .review-preview-card,
    .related-card,
    .tour-info-item,
    .feature-item,
    .contact-card,
    .info-card,
    .reservation-card {
        border-radius: 16px !important;
    }

    .tour-card,
    .featured-tour-card,
    .review-card,
    .review-preview-card,
    .related-card {
        width: 100% !important;
    }

    .tour-card,
    .featured-tour-card,
    .tour-price-section,
    .reservation-steps,
    .reservation-summary,
    .privacy-header,
    .footer-bottom,
    .tour-card-footer,
    .tour-price-wrapper,
    .button-row,
    .form-actions {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .tour-card-image-wrapper,
    .featured-tour-image,
    .related-card-image,
    .review-image,
    .tour-image {
        width: 100% !important;
        min-width: 0 !important;
        border-radius: 10px !important;
        overflow: hidden !important;
    }

    .tour-card-image-wrapper,
    .featured-tour-image,
    .related-card-image {
        aspect-ratio: 16 / 9;
        height: auto !important;
    }

    .tour-card-image,
    .featured-tour-image img,
    .related-card-image img,
    .review-image,
    .tour-image,
    .hero-slide img,
    .tour-section-content img,
    .tour-section-content .image_resized,
    .tour-section-content figure.image,
    .tour-section-content figure.image img,
    .tour-section-content figure img {
        border-radius: 10px !important;
    }

    .tour-info-box,
    .tour-image-container,
    .tour-content,
    .tour-section,
    .form-wrap,
    .reservation-form,
    .reservation-summary,
    .review-card-content {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .featured-carousel-arrow,
    .review-carousel-arrow {
        width: 42px !important;
        height: 42px !important;
    }

    /* Anchor the quick buttons to the right edge, vertically centred
       (same placement as desktop) instead of parking them at the bottom. */
    .quick-menu {
        right: 10px !important;
        top: 50% !important;
        bottom: auto !important;
        transform: translateY(-50%) !important;
    }

    .quick-menu a {
        width: 50px !important;
        height: 50px !important;
        font-size: 0.58rem !important;
    }

    .quick-menu a i {
        font-size: 1rem !important;
        margin-bottom: 2px !important;
    }

    #popUp {
        left: 10px !important;
        right: 10px !important;
        bottom: calc(12px + env(safe-area-inset-bottom)) !important;
    }

    .pop-wrap {
        width: min(92vw, 360px) !important;
        max-width: 100% !important;
        max-height: min(72svh, 520px) !important;
        box-sizing: border-box !important;
    }

    .pop-wrap ul li {
        overflow-wrap: anywhere !important;
        word-break: keep-all !important;
    }

    .status-text-white,
    .status-tag-red {
        white-space: normal !important;
    }

    #popReopen {
        bottom: calc(90px + env(safe-area-inset-bottom)) !important;
    }

    .phone-modal-content,
    .inquiry-modal-content,
    .modal-content,
    .popup-modal-content {
        width: min(92vw, 420px) !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .phone-number {
        font-size: clamp(1.5rem, 6vw, 2rem) !important;
        letter-spacing: 0.5px !important;
    }

    input,
    select,
    textarea,
    button {
        font-size: 16px !important;
    }

    input,
    select,
    textarea {
        max-width: 100% !important;
    }

    .phone-group,
    .date-group,
    .form-row,
    .search-row,
    .filter-row,
    .action-row,
    .reservation-steps {
        gap: 0.75rem !important;
    }

    .phone-separator,
    .step-arrow {
        display: none !important;
    }

    .tour-grid .tour-price-block {
        flex-direction: column !important;
        align-items: flex-start !important;
        width: 100% !important;
    }

    .tour-grid .tour-price-wrapper {
        flex-direction: row !important;
        justify-content: flex-start !important;
        align-items: baseline !important;
        gap: 0.45rem !important;
        width: 100% !important;
    }

    .submenu-container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .sub-content {
        padding: 0px !important;
    }

    .submenu ul {
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }

    .submenu a {
        display: block !important;
        text-align: center !important;
        padding: 0.8rem 1rem !important;
        border: 1px solid #eee !important;
    }

    table {
        width: 100% !important;
    }

    .tour-section-content table,
    .form-table,
    .reservation-table,
    .price-table {
        table-layout: fixed !important;
        font-size: 0.82rem !important;
    }

    .tour-section-content table th,
    .tour-section-content table td,
    .form-table th,
    .form-table td,
    .reservation-table th,
    .reservation-table td,
    .price-table th,
    .price-table td {
        white-space: normal !important;
        word-break: keep-all !important;
        overflow-wrap: anywhere !important;
        padding: 0.55rem 0.4rem !important;
    }

    .tour-section-content div:has(> table),
    .tour-section-content div:has(> figure > table),
    .form-table-wrapper,
    .table-responsive {
        overflow-x: visible !important;
    }

    footer .footer-bottom,
    footer .footer-links {
        justify-content: center !important;
        text-align: center !important;
        flex-wrap: wrap !important;
    }
}

@media (max-width: 480px) {
    nav {
        padding: 34px 12px 0 !important;
        height: 108px !important;
    }

    html {
        scroll-padding-top: 108px !important;
    }

    .nav-menu {
        top: 108px !important;
        max-height: calc(100svh - 108px) !important;
    }

    .nav-quick-links {
        right: 12px;
        height: 34px;
        gap: 0.3rem;
    }

    .nav-quick-links li + li::before {
        margin-right: 0.3rem;
    }

    .nav-quick-links a {
        font-size: 0.74rem;
    }

    /* Default: every page's container gets uniform side padding. */
    .container {
        padding-left: 0.9rem !important;
        padding-right: 0.9rem !important;
    }

    .form-wrap {
        padding-left: 1.1rem !important;
        padding-right: 1.1rem !important;
    }

    .content-section,
    .tour-detail-wrapper,
    .sub-header,
    .page-header,
    .section-header,
    .tour-content,
    .tour-section,
    .tour-image-container,
    .reservation-wrap,
    .reservation-section,
    .review-list-section,
    .notice-list-section {
        padding-left: 0.9rem !important;
        padding-right: 0.9rem !important;
    }

    body .tour-content {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .tour-info-box {
        padding-left: 0.9rem !important;
        padding-right: 0.9rem !important;
    }

    body .tour-section {
        padding: 0 !important;
    }

    .tour-section-content p {
        margin-bottom: 1.25rem;
        padding: 1rem;
    }

    .tour-section > h2 {
        font-size: 1.2rem;
        margin-left: 1rem;
    }

    .hero {
        min-height: 0 !important;
    }

    .hero-content {
        padding: 0.85rem !important;
    }

    .hero-content h1 {
        font-size: 1.55rem !important;
        line-height: 1.25 !important;
    }

    .hero-content p {
        font-size: 0.92rem !important;
        padding: 0 !important;
    }

    .tour-title,
    .page-header h1,
    .sub-header-content h1 {
        font-size: clamp(1.45rem, 6vw, 1.8rem) !important;
    }

    .tour-price,
    .tour-price-value,
    .phone-number {
        font-size: clamp(1.35rem, 5.5vw, 1.9rem) !important;
    }

    .quick-menu {
        right: 6px !important;
    }

    .quick-menu a {
        width: 44px !important;
        height: 44px !important;
        font-size: 0.5rem !important;
    }

    .quick-menu a i {
        font-size: 0.9rem !important;
    }

    .pop-wrap {
        width: min(100%, 250px) !important;
        max-width: max-content !important;
        padding: 32px 0 18px !important;
    }

    .pop-wrap ul li {
        padding-left: 22px !important;
    }

    .pop-wrap ul li::before {
        left: 8px !important;
    }

    .featured-carousel-arrow,
    .review-carousel-arrow {
        width: 38px !important;
        height: 38px !important;
    }

    .featured-carousel-viewport,
    .review-carousel-viewport {
        overflow: hidden !important;
    }

    .pagination a,
    .pagination span {
        min-width: 2.1rem !important;
        padding: 0.4rem 0.55rem !important;
        font-size: 0.82rem !important;
    }
}

/* Mobile category shortcuts (partials/quick_cats.html): one navy row of
   white text links with thin dividers, under the home hero and under the
   header of every category page. Phones/tablets only. */
.quick-cats {
    display: none;
}

@media (max-width: 768px) {
    /* Right padding keeps the last item clear of the floating
       카톡/전화/예약/공유 column (50px wide, 10px from the edge). */
    .quick-cats {
        display: block;
        padding: 4px 64px 4px 6px;
        background: #001f5b;
    }

    /* Items keep their natural width and share any spare space; when they
       don't fit (narrow phones) the row scrolls sideways like a tab bar. */
    .quick-cats-list {
        display: flex;
        align-items: center;
        margin: 0;
        padding: 0;
        list-style: none;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .quick-cats-list::-webkit-scrollbar {
        display: none;
    }

    .quick-cats-list li {
        position: relative;
        flex: 1 0 auto;
        margin: 0;
    }

    /* Divider: short centred line before every item but the first */
    .quick-cats-list li + li::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 0;
        width: 1px;
        height: 14px;
        background: rgba(255, 255, 255, 0.35);
        transform: translateY(-50%);
    }

    .quick-cats .quick-cat {
        position: relative;
        display: block;
        padding: 13px 11px;
        color: #fff;
        font-size: 0.86rem;
        font-weight: 700;
        line-height: 1.25;
        letter-spacing: -0.03em;
        text-align: center;
        text-decoration: none;
        white-space: nowrap;
        -webkit-tap-highlight-color: transparent;
        transition: color 0.15s ease;
    }

    .quick-cats .quick-cat:active,
    .quick-cats .quick-cat:hover {
        color: #bfdbfe;
    }

    /* Current group on category pages */
    .quick-cats .quick-cat.is-active::after {
        content: '';
        position: absolute;
        left: 50%;
        bottom: 6px;
        width: 22px;
        height: 2px;
        border-radius: 2px;
        background: #60a5fa;
        transform: translateX(-50%);
    }
}

@media (max-width: 480px) {
    /* Floating column is 44px wide, 6px from the edge here. */
    .quick-cats {
        padding-right: 54px;
    }
}

@media (max-width: 374px) {
    .quick-cats .quick-cat {
        font-size: 0.8rem;
    }
}

/* Page-header banners on phones. Every template's `.page-header` /
   `.sub-header` background is written as
   `var(--cat-bg-NAME, url(.../categories/NAME.jpg))`, so desktop keeps the
   wide 1920px originals while phones swap in 4:3 crops from
   static/images/categories/mobile/ (narrower, taller, framed on each
   photo's subject). The header itself becomes a 4:3 frame with its title
   centred below the ~108px fixed menu bar. Absolute /static/ paths: url()s
   inside custom properties resolve against the page, not this file. */
@media (max-width: 600px) {
    :root {
        --cat-bg-cruise-bg: url('/static/images/categories/mobile/cruise-bg.jpg');
        --cat-bg-europe1-bg: url('/static/images/categories/mobile/europe1-bg.jpg');
        --cat-bg-europe2-bg: url('/static/images/categories/mobile/europe2-bg.jpg');
        --cat-bg-other-bg: url('/static/images/categories/mobile/other-bg.jpg');
        --cat-bg-golf-cruise-bg: url('/static/images/categories/mobile/golf-cruise-bg.jpg');
        --cat-bg-california-cruise-bg: url('/static/images/categories/mobile/california-cruise-bg.jpg');
        --cat-bg-review-bg: url('/static/images/categories/mobile/review-bg.jpg');
        --cat-bg-sub_top_01: url('/static/images/categories/mobile/sub_top_01.jpg');
        --cat-bg-sub_top_06: url('/static/images/categories/mobile/sub_top_06.jpg');
    }

    body .page-header,
    body .sub-header {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        min-height: 75vw;
        padding-top: 118px;
        padding-bottom: 22px;
        background-size: cover;
        background-position: center;
    }
}
