/* Last-minute pages (public offer pages, partner and traveler private pages).
   Built on the Vanyou theme tokens; no third-party assets on private pages. */

/* Layout rules below set display; keep the hidden attribute authoritative. */
.lm-page [hidden] {
    display: none !important;
}

.lm-page {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #f5f7f2 0%, #eef2e8 100%);
    color: var(--vanyou-gray-800, #1f2937);
    font-family: "Segoe UI", system-ui, sans-serif;
}

.lm-main {
    flex: 1 0 auto;
    width: min(880px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 56px;
    display: grid;
    gap: 16px;
    align-content: start;
}

.lm-card {
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 18px 42px rgba(17, 24, 39, 0.06);
    padding: 22px;
}

.lm-card h1,
.lm-card h2 {
    margin: 0 0 8px;
    color: var(--vanyou-green-900, #13261e);
}

.lm-card h1 { font-size: 1.6rem; }
.lm-card h2 { font-size: 1.2rem; }

.lm-muted {
    color: var(--vanyou-gray-600, #4b5563);
    margin: 0 0 8px;
    line-height: 1.55;
}

.lm-notice {
    border-radius: 14px;
    padding: 12px 14px;
    background: #eef6f1;
    color: #1f5138;
    line-height: 1.5;
}

.lm-notice[data-tone="error"] { background: #fdeeee; color: #8a1f1f; }
.lm-notice[data-tone="warning"] { background: #fff6e0; color: #6b4a00; }

.lm-form {
    display: grid;
    gap: 12px;
}

.lm-field {
    display: grid;
    gap: 6px;
}

.lm-field label,
.lm-fieldset legend {
    font-weight: 600;
}

.lm-field input,
.lm-field select,
.lm-field textarea {
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid #c9d2c5;
    background: #ffffff;
    font: inherit;
    color: inherit;
    box-sizing: border-box;
}

.lm-field textarea { min-height: 96px; resize: vertical; }

.lm-fieldset {
    border: 1px solid #dde4d8;
    border-radius: 16px;
    padding: 12px 14px;
    margin: 0;
}

.lm-choice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.45;
}

.lm-choice input { margin-top: 4px; width: 18px; height: 18px; }

.lm-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.lm-button {
    min-height: 48px;
    padding: 0 20px;
    border-radius: 999px;
    border: 0;
    font-weight: 700;
    cursor: pointer;
    background: var(--vanyou-green-700, #24543d);
    color: #ffffff;
}

.lm-button[data-variant="secondary"] {
    background: rgba(36, 84, 61, 0.1);
    color: var(--vanyou-green-700, #24543d);
}

.lm-button[data-variant="danger"] {
    background: #fdeeee;
    color: #8a1f1f;
}

.lm-button:disabled { opacity: 0.6; cursor: progress; }

.lm-page a:focus-visible,
.lm-button:focus-visible,
.lm-field input:focus-visible,
.lm-field select:focus-visible,
.lm-field textarea:focus-visible,
.lm-choice input:focus-visible {
    outline: 3px solid rgba(201, 141, 43, 0.6);
    outline-offset: 2px;
}

.lm-honeypot {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.lm-facts {
    display: grid;
    grid-template-columns: minmax(140px, max-content) 1fr;
    gap: 6px 16px;
    margin: 0;
}

.lm-facts dt { color: var(--vanyou-gray-600, #4b5563); }
.lm-facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

.lm-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    background: #eef2e8;
    color: #24543d;
}

.lm-chip[data-tone="warning"] { background: #fff6e0; color: #6b4a00; }
.lm-chip[data-tone="error"] { background: #fdeeee; color: #8a1f1f; }

/* Partner page */
.lm-stack {
    display: grid;
    gap: 16px;
    margin: 0;
    padding: 0;
}

.lm-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.lm-header-row h2,
.lm-header-row h3 {
    margin: 0;
}

.lm-eyebrow {
    margin: 0 0 4px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--vanyou-gold-700, #8a5a12);
}

.lm-subtitle {
    margin: 16px 0 8px;
    font-size: 1rem;
}

.lm-small {
    margin: 4px 0;
    font-size: 0.9rem;
    color: var(--vanyou-gray-600, #4b5563);
    line-height: 1.45;
}

.lm-link {
    color: var(--vanyou-green-700, #24543d);
    font-weight: 600;
}

a.lm-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-sizing: border-box;
}

.lm-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.lm-item {
    border: 1px solid #dde4d8;
    border-radius: 16px;
    padding: 14px;
    display: grid;
    gap: 6px;
}

.lm-item .lm-button { justify-self: start; }

.lm-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
}

.lm-thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0 8px;
    scroll-snap-type: x mandatory;
}

.lm-thumbs img {
    flex: 0 0 auto;
    width: 160px;
    height: 110px;
    object-fit: cover;
    border-radius: 12px;
    background: #eef2e8;
    scroll-snap-align: start;
}

.lm-image-list {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    display: grid;
    gap: 10px;
}

.lm-image-row {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    border: 1px solid #dde4d8;
    border-radius: 14px;
    padding: 8px;
}

.lm-image-row img {
    width: 112px;
    height: 76px;
    object-fit: cover;
    border-radius: 10px;
    background: #eef2e8;
}

.lm-image-missing {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 112px;
    min-height: 76px;
    border-radius: 10px;
    background: #eef2e8;
    color: var(--vanyou-gray-600, #4b5563);
    font-size: 0.78rem;
    text-align: center;
}

.lm-thumbs .lm-image-missing { width: 160px; height: 110px; }

.lm-image-meta {
    display: grid;
    gap: 4px;
}

.lm-image-actions {
    display: flex;
    gap: 6px;
}

.lm-icon-button {
    min-width: 44px;
    min-height: 44px;
    border-radius: 12px;
    border: 1px solid #c9d2c5;
    background: #ffffff;
    font-size: 1.05rem;
    cursor: pointer;
}

.lm-icon-button:disabled { opacity: 0.4; cursor: default; }

.lm-icon-button:focus-visible {
    outline: 3px solid rgba(201, 141, 43, 0.6);
    outline-offset: 2px;
}

@media (max-width: 640px) {
    .lm-main { width: calc(100% - 32px); padding-top: 16px; }
    .lm-card { padding: 16px; border-radius: 16px; }
    .lm-facts { grid-template-columns: 1fr; }
    .lm-button { width: 100%; }
    .lm-item .lm-button { justify-self: stretch; }
    .lm-header-row .lm-button { width: auto; min-height: 40px; padding: 0 16px; }
    .lm-image-row { grid-template-columns: 88px minmax(0, 1fr); }
    .lm-image-row img { width: 88px; height: 64px; }
    .lm-image-actions { grid-column: 1 / -1; justify-content: flex-end; }
    .lm-image-actions .lm-button { width: auto; }
}

/* Public last-minute pages, comparator home block and search matches */
.lm-main--wide {
    width: min(1120px, calc(100% - 32px));
}

.lm-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.lm-offer-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.lm-offer-grid--compact {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.lm-offer-card {
    display: grid;
    height: 100%;
    border-radius: 18px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid rgba(17, 24, 39, 0.08);
    box-shadow: 0 14px 32px rgba(17, 24, 39, 0.06);
    color: inherit;
    text-decoration: none;
    grid-template-rows: auto 1fr;
}

.lm-offer-card:hover { border-color: rgba(36, 84, 61, 0.4); }

.lm-offer-card:focus-visible {
    outline: 3px solid rgba(201, 141, 43, 0.6);
    outline-offset: 2px;
}

.lm-offer-card-media {
    position: relative;
    aspect-ratio: 3 / 2;
    background: #eef2e8;
}

.lm-offer-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.lm-offer-card-placeholder {
    display: grid;
    place-items: center;
    height: 100%;
    color: #24543d;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.lm-offer-card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #c98d2b;
    color: #1f1300;
    font-weight: 800;
    font-size: 0.9rem;
}

.lm-offer-card-body {
    padding: 14px 16px 16px;
    display: grid;
    gap: 2px;
    align-content: start;
}

.lm-offer-card-body h3 {
    margin: 0 0 4px;
    font-size: 1.1rem;
    color: var(--vanyou-green-900, #13261e);
}

.lm-offer-card-price {
    margin: 8px 0 0;
    font-size: 1rem;
}

.lm-offer-card-price strong { font-size: 1.35rem; color: var(--vanyou-green-900, #13261e); }

.lm-offer-card-benefit { color: #1f5138; }

.lm-offer-dates {
    margin: 4px 0 12px;
    font-weight: 600;
}

.lm-gallery {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 6px;
}

.lm-gallery img {
    flex: 0 0 auto;
    width: min(100%, 560px);
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border-radius: 16px;
    background: #eef2e8;
    scroll-snap-align: start;
}

.lm-price-block { margin-bottom: 8px; }

.lm-price {
    margin: 0;
    font-size: 1.05rem;
}

.lm-price strong {
    font-size: 2rem;
    color: var(--vanyou-green-900, #13261e);
}

.lm-benefit {
    margin: 0 0 12px;
    padding: 10px 14px;
    border-radius: 14px;
    background: #eef6f1;
    color: #1f5138;
    font-weight: 600;
}

.lm-procedure {
    display: grid;
    gap: 10px;
    justify-items: start;
}

.lm-promo-code {
    margin: 0;
    font-size: 1.1rem;
}

.lm-promo-code strong {
    font-family: ui-monospace, "Cascadia Mono", monospace;
    letter-spacing: 0.06em;
    padding: 2px 8px;
    border-radius: 8px;
    background: #fff6e0;
}

.lm-home-section {
    padding: 0 var(--vanyou-spacing-xl, 24px);
    margin-top: var(--vanyou-spacing-lg, 20px);
}

.lm-home-section[hidden],
.lm-search-matches[hidden] {
    display: none;
}

.lm-home-shell {
    max-width: var(--vanyou-layout-max-content, 1200px);
    margin: 0 auto;
    display: grid;
    gap: 14px;
}

.lm-home-shell h2,
.lm-search-matches h2 {
    margin: 0;
    font-size: 1.3rem;
    color: var(--vanyou-green-900, #13261e);
}

.lm-search-matches {
    margin: 0 0 20px;
    padding: 16px;
    border-radius: 18px;
    background: #fff9ec;
    border: 1px solid rgba(201, 141, 43, 0.35);
    display: grid;
    gap: 8px;
}

@media (max-width: 640px) {
    .lm-main--wide { width: calc(100% - 32px); }
    .lm-home-section { padding: 0 16px; }
    .lm-offer-grid,
    .lm-offer-grid--compact { grid-template-columns: 1fr; }
    .lm-price strong { font-size: 1.7rem; }
    .lm-gallery img { width: 88%; }
    .lm-gallery img:only-child { width: 100%; }
}
