/* =======================================================================
   Квартира посуточно · Муром — стили на основе дизайн-системы Airbnb
   ======================================================================= */

:root {
    /* Colors */
    --color-primary: #ff385c;
    --color-primary-active: #e00b41;
    --color-primary-disabled: #ffd1da;
    --color-error: #c13515;
    --color-error-hover: #b32505;
    --color-ink: #222222;
    --color-body: #3f3f3f;
    --color-muted: #6a6a6a;
    --color-muted-soft: #929292;
    --color-hairline: #dddddd;
    --color-hairline-soft: #ebebeb;
    --color-border-strong: #c1c1c1;
    --color-canvas: #ffffff;
    --color-surface-soft: #f7f7f7;
    --color-surface-strong: #f2f2f2;
    --color-on-primary: #ffffff;
    --color-legal-link: #428bff;
    --color-success: #0a8a3f;

    /* Radii */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 32px;
    --radius-full: 9999px;

    /* Spacing */
    --space-xxs: 2px;
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-base: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-xxl: 48px;
    --space-section: 64px;

    --shadow-card: rgba(0, 0, 0, 0.02) 0 0 0 1px, rgba(0, 0, 0, 0.04) 0 2px 6px 0, rgba(0, 0, 0, 0.1) 0 4px 8px 0;

    --font-main: 'Inter', -apple-system, system-ui, Roboto, 'Helvetica Neue', sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--color-canvas);
    color: var(--color-ink);
    font-family: var(--font-main);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: var(--font-main); cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* ---------- Typography tokens ---------- */
.t-display-xl { font-size: 28px; font-weight: 700; line-height: 1.25; letter-spacing: 0; }
.t-display-lg { font-size: 22px; font-weight: 500; line-height: 1.18; letter-spacing: -0.44px; }
.t-display-md { font-size: 21px; font-weight: 700; line-height: 1.35; }
.t-display-sm { font-size: 20px; font-weight: 600; line-height: 1.2; letter-spacing: -0.18px; }
.t-title-md { font-size: 16px; font-weight: 600; line-height: 1.25; }
.t-title-sm { font-size: 16px; font-weight: 500; line-height: 1.25; }
.t-body-md { font-size: 16px; font-weight: 400; line-height: 1.5; }
.t-body-sm { font-size: 14px; font-weight: 400; line-height: 1.43; }
.t-caption { font-size: 14px; font-weight: 500; line-height: 1.29; }
.t-caption-sm { font-size: 13px; font-weight: 400; line-height: 1.23; }
.t-badge { font-size: 11px; font-weight: 600; line-height: 1.18; }
.t-rating { font-size: 64px; font-weight: 700; line-height: 1.1; letter-spacing: -1px; }

.muted { color: var(--color-muted); }
.muted-soft { color: var(--color-muted-soft); }
.body-text { color: var(--color-body); }

@media (max-width: 743px) {
    .t-display-xl { font-size: 24px; }
    .t-display-lg { font-size: 20px; }
    .t-rating { font-size: 48px; }
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 500;
    height: 48px;
    padding: 14px 24px;
    transition: background-color .15s ease;
}
.btn-primary { background: var(--color-primary); color: var(--color-on-primary); }
.btn-primary:hover, .btn-primary:active { background: var(--color-primary-active); }
.btn-primary:disabled { background: var(--color-primary-disabled); cursor: not-allowed; }
.btn-secondary { background: var(--color-canvas); color: var(--color-ink); border: 1px solid var(--color-ink); }
.btn-tertiary { background: transparent; color: var(--color-ink); padding: 8px 4px; height: auto; }
.btn-tertiary:hover { text-decoration: underline; }
.btn-pill { background: var(--color-primary); color: var(--color-on-primary); border-radius: var(--radius-full); padding: 10px 20px; height: auto; font-size: 14px; }
.btn-block { width: 100%; }
.btn-sm { height: 36px; padding: 8px 16px; font-size: 14px; }
.admin-danger { color: var(--color-error); }

/* ---------- Top nav ---------- */
.top-nav {
    background: var(--color-canvas);
    border-bottom: 1px solid var(--color-hairline);
    height: 80px;
    position: sticky;
    top: 0;
    z-index: 50;
}
.top-nav-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 18px;
    font-weight: 700;
    color: var(--color-primary);
}
.brand-tag {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-on-primary);
    background: var(--color-primary);
    border-radius: var(--radius-full);
    padding: 3px 10px;
}
.nav-actions { display: flex; align-items: center; gap: var(--space-base); }
.nav-phone { font-weight: 600; font-size: 14px; white-space: nowrap; }

@media (max-width: 600px) {
    .nav-phone { display: none; }
    .brand-tag { display: none; }
    .top-nav-inner { padding: 0 var(--space-base); }
}

/* ---------- Hero ---------- */
.hero {
    padding: var(--space-xl) 0 var(--space-section);
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    background: var(--color-surface-soft);
    color: var(--color-body);
    border-radius: var(--radius-full);
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: var(--space-base);
}
.hero h1 { margin: 0 0 var(--space-md); }
.hero-sub { margin: 0 0 var(--space-lg); max-width: 640px; }
.hero-meta-row { display: flex; flex-wrap: wrap; gap: var(--space-lg); margin-bottom: var(--space-xl); }
.hero-meta-item { display: flex; align-items: center; gap: var(--space-xs); font-size: 14px; color: var(--color-body); }

/* ---------- Gallery ---------- */
.gallery {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    grid-template-rows: 1fr;
    gap: var(--space-sm);
    border-radius: var(--radius-md);
    overflow: hidden;
    height: 420px;
}
.gallery-main { position: relative; cursor: pointer; min-height: 0; min-width: 0; }
.gallery-grid-right { display: grid; grid-auto-rows: 1fr; gap: var(--space-sm); min-height: 0; min-width: 0; }
.gallery-cell { position: relative; cursor: pointer; min-height: 0; min-width: 0; }
.photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    background: linear-gradient(135deg, #fff1f3, #fdeef5 40%, #f7f7f7);
    color: var(--color-muted);
    font-size: 13px;
    text-align: center;
    border: 1px dashed var(--color-hairline);
}
.photo-placeholder svg { width: 36px; height: 36px; opacity: .55; }

.gallery-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-main:hover .photo-placeholder, .gallery-cell:hover .photo-placeholder { filter: brightness(0.96); }

.gallery-show-all {
    position: absolute;
    right: var(--space-base);
    bottom: var(--space-base);
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    background: var(--color-canvas);
    color: var(--color-ink);
    border: 1px solid var(--color-ink);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--shadow-card);
}
.gallery-show-all svg { width: 16px; height: 16px; }

@media (max-width: 743px) {
    .gallery-show-all { right: var(--space-base); bottom: var(--space-base); padding: 7px 12px; font-size: 12px; }
}

/* ---------- Lightbox carousel ---------- */
.lightbox-scrim {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
}
.lightbox-scrim.open { display: flex; }

.lightbox-stage {
    width: min(86vw, 760px);
    height: min(74vh, 520px);
    display: flex;
    align-items: center;
    justify-content: center;
}
.lightbox-stage img { max-width: 100%; max-height: 100%; border-radius: var(--radius-sm); }
.lightbox-stage .photo-placeholder {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-md);
    border: 1px dashed rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, #2a2a2a, #1c1c1c);
    color: rgba(255, 255, 255, 0.7);
    font-size: 15px;
}
.lightbox-stage .photo-placeholder svg { opacity: .4; color: #fff; }

.lightbox-close {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 16px;
}
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 22px;
    line-height: 1;
}
.lightbox-nav:disabled { opacity: 0.25; cursor: not-allowed; }
.lightbox-prev { left: var(--space-lg); }
.lightbox-next { right: var(--space-lg); }
.lightbox-counter {
    position: absolute;
    bottom: var(--space-lg);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 13px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
}

@media (max-width: 743px) {
    .lightbox-stage { width: 92vw; height: 60vh; }
    .lightbox-nav { width: 38px; height: 38px; font-size: 18px; }
    .lightbox-prev { left: var(--space-sm); }
    .lightbox-next { right: var(--space-sm); }
    .lightbox-close { top: var(--space-base); right: var(--space-base); }
}

@media (max-width: 743px) {
    .gallery { grid-template-columns: 1fr; height: auto; }
    .gallery-main { height: 220px; }
    .gallery-grid-right { display: none; }
}

/* ---------- Quick facts ---------- */
.quick-facts {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xl);
    padding: var(--space-lg) 0;
    border-bottom: 1px solid var(--color-hairline-soft);
    margin-bottom: var(--space-xl);
}
.quick-fact { display: flex; align-items: center; gap: var(--space-sm); }
.quick-fact svg { width: 22px; height: 22px; color: var(--color-ink); flex-shrink: 0; }

/* ---------- Two-column listing layout ---------- */
.listing-grid {
    display: grid;
    grid-template-columns: 64% 32%;
    justify-content: space-between;
    gap: var(--space-xl);
    align-items: start;
}
@media (max-width: 1023px) {
    .listing-grid { grid-template-columns: 1fr; }
}

.section { padding: var(--space-xl) 0; border-bottom: 1px solid var(--color-hairline-soft); }
.section:last-child { border-bottom: none; }
.section h2 { margin: 0 0 var(--space-base); }
.section p { margin: 0 0 var(--space-base); }

/* ---------- Amenities ---------- */
.amenity-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 var(--space-xl);
}
.amenity-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 12px 0;
}
.amenity-row svg { width: 24px; height: 24px; flex-shrink: 0; color: var(--color-ink); }
@media (max-width: 600px) {
    .amenity-grid { grid-template-columns: 1fr; }
}

/* ---------- Reservation card (sticky) ---------- */
.reservation-card {
    background: var(--color-canvas);
    border: 1px solid var(--color-hairline);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: var(--space-lg);
    position: sticky;
    top: 96px;
}
.reservation-price { display: flex; align-items: baseline; gap: var(--space-xs); margin-bottom: var(--space-base); }
.reservation-price .amount { font-size: 21px; font-weight: 700; }
.reservation-price .unit { color: var(--color-muted); font-size: 14px; }

.date-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid var(--color-hairline);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: var(--space-md);
}
.date-field {
    padding: 8px 12px;
    border-right: 1px solid var(--color-hairline);
}
.date-field:last-child { border-right: none; }
.date-field-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--color-ink);
    display: block;
    margin-bottom: 2px;
}
.date-field-value { font-size: 14px; color: var(--color-body); }

.guests-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--color-hairline);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    margin-bottom: var(--space-base);
}
.stepper { display: flex; align-items: center; gap: var(--space-md); }
.stepper button {
    width: 28px; height: 28px;
    border-radius: var(--radius-full);
    border: 1px solid var(--color-border-strong);
    background: var(--color-canvas);
    font-size: 16px;
    line-height: 1;
    color: var(--color-ink);
}
.stepper button:disabled { color: var(--color-muted-soft); border-color: var(--color-hairline-soft); cursor: not-allowed; }

.price-breakdown { margin: var(--space-base) 0; }
.price-breakdown-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--color-body);
    padding: 6px 0;
}
.price-breakdown-row.total {
    border-top: 1px solid var(--color-hairline-soft);
    margin-top: var(--space-xs);
    padding-top: var(--space-md);
    font-weight: 700;
    color: var(--color-ink);
}
.reservation-note { font-size: 12px; color: var(--color-muted); text-align: center; margin-top: var(--space-sm); }

@media (max-width: 1023px) {
    .reservation-card { position: static; margin-top: var(--space-xl); }
}

/* ---------- Calendar ---------- */
.calendar-wrap {
    background: var(--color-canvas);
    border: 1px solid var(--color-hairline);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
}
.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-base);
}
.calendar-nav button {
    width: 36px; height: 36px;
    border-radius: var(--radius-full);
    border: 1px solid var(--color-border-strong);
    background: var(--color-canvas);
}
.calendar-months { display: block; }

.calendar-month-title { text-align: center; margin-bottom: var(--space-md); font-weight: 600; text-transform: capitalize; }
.calendar-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: var(--space-xs); }
.calendar-weekdays span { text-align: center; font-size: 12px; color: var(--color-muted); }
.calendar-days { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 4px; }

.cal-day {
    position: relative;
    height: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    font-size: 13px;
    color: var(--color-ink);
    cursor: pointer;
    user-select: none;
}
.cal-day .num { font-size: 13px; line-height: 1.1; }
.cal-day .price { font-size: 10px; color: var(--color-muted); line-height: 1.1; white-space: nowrap; }
.cal-day.empty { cursor: default; visibility: hidden; }
.cal-day.unavailable { color: var(--color-muted-soft); cursor: not-allowed; text-decoration: line-through; }
.cal-day.unavailable .price { visibility: hidden; }
.cal-day.in-range { background: var(--color-surface-soft); border-radius: 0; }
.cal-day.range-start { background: var(--color-ink); color: #fff; border-radius: var(--radius-full) 0 0 var(--radius-full); }
.cal-day.range-start .price, .cal-day.range-end .price { color: rgba(255,255,255,.75); }
.cal-day.range-end { background: var(--color-ink); color: #fff; border-radius: 0 var(--radius-full) var(--radius-full) 0; }
.cal-day.single-select { background: var(--color-ink); color: #fff; border-radius: var(--radius-full); }
.cal-day:not(.unavailable):not(.empty):hover { box-shadow: inset 0 0 0 1px var(--color-ink); border-radius: var(--radius-full); }

.calendar-legend { display: flex; gap: var(--space-lg); margin-top: var(--space-base); flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: var(--space-xs); font-size: 13px; color: var(--color-muted); }
.legend-dot { width: 12px; height: 12px; border-radius: var(--radius-full); display: inline-block; }
.legend-dot.available { background: var(--color-canvas); border: 1px solid var(--color-border-strong); }
.legend-dot.selected { background: var(--color-ink); }
.legend-dot.unavailable { background: var(--color-surface-strong); }

/* ---------- Forms ---------- */
.text-input {
    width: 100%;
    background: var(--color-canvas);
    border: 1px solid var(--color-hairline);
    border-radius: var(--radius-sm);
    height: 48px;
    padding: 12px 14px;
    font-size: 16px;
    font-family: var(--font-main);
    color: var(--color-ink);
}
.text-input:focus { outline: none; border: 2px solid var(--color-ink); padding: 11px 13px; }
textarea.text-input { height: auto; min-height: 80px; padding-top: 12px; resize: vertical; }
.form-row { margin-bottom: var(--space-base); }
.form-row label { display: block; font-size: 13px; font-weight: 500; margin-bottom: var(--space-xs); color: var(--color-body); }
.form-error { color: var(--color-error); font-size: 13px; margin-top: var(--space-xs); }

/* ---------- House rules ---------- */
.rules-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-base) var(--space-xl); }
.rule-item { display: flex; justify-content: space-between; gap: var(--space-lg); padding: 10px 0; border-bottom: 1px solid var(--color-hairline-soft); font-size: 14px; }
.rule-item span:first-child { flex-shrink: 0; }
.rule-item span:last-child { text-align: right; }
@media (max-width: 600px) { .rules-grid { grid-template-columns: 1fr; } }

/* ---------- Map ---------- */
.map-frame {
    width: 100%;
    height: 320px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--color-hairline);
}
.map-frame iframe { width: 100%; height: 100%; border: 0; }

/* ---------- Reviews ---------- */
.reviews-empty {
    background: var(--color-surface-soft);
    border-radius: var(--radius-md);
    padding: var(--space-xl);
    text-align: center;
    color: var(--color-body);
}

/* ---------- FAQ accordion ---------- */
.faq-item { border-bottom: 1px solid var(--color-hairline-soft); }
.faq-question {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: var(--space-base) 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: 500;
    color: var(--color-ink);
}
.faq-question .chev { transition: transform .2s ease; color: var(--color-muted); }
.faq-item.open .faq-question .chev { transform: rotate(180deg); }
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s ease;
    color: var(--color-body);
    font-size: 14px;
    line-height: 1.55;
}
.faq-item.open .faq-answer { max-height: 320px; }
.faq-answer-inner { padding-bottom: var(--space-base); }

/* ---------- Contact band ---------- */
.contact-band {
    background: var(--color-surface-soft);
    border-radius: var(--radius-md);
    padding: var(--space-xl);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
}
.contact-actions { display: flex; gap: var(--space-md); flex-wrap: wrap; }

/* ---------- Footer ---------- */
.footer-light { background: var(--color-canvas); padding: var(--space-xxl) 0 var(--space-lg); border-top: 1px solid var(--color-hairline); }
.footer-columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-lg); margin-bottom: var(--space-xl); }
.footer-col-title { font-size: 16px; font-weight: 500; margin-bottom: var(--space-base); }
.footer-link { display: block; font-size: 14px; color: var(--color-ink); padding: 6px 0; }
.footer-link:hover { text-decoration: underline; }
.legal-band { border-top: 1px solid var(--color-hairline-soft); padding-top: var(--space-base); display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--space-sm); color: var(--color-muted); font-size: 13px; }
@media (max-width: 743px) { .footer-columns { grid-template-columns: 1fr; } }

/* ---------- Mobile sticky CTA ---------- */
.mobile-cta {
    display: none;
}
@media (max-width: 1023px) {
    .mobile-cta {
        display: flex;
        position: sticky;
        bottom: 0;
        background: var(--color-canvas);
        border-top: 1px solid var(--color-hairline);
        padding: var(--space-md) var(--space-lg);
        align-items: center;
        justify-content: space-between;
        z-index: 40;
    }
}

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--color-ink);
    color: #fff;
    padding: 14px 22px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    transition: all .25s ease;
    z-index: 100;
    max-width: 90vw;
    text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--color-error); }

/* ---------- Modal ---------- */
.modal-scrim {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 90;
    padding: var(--space-lg);
}
.modal-scrim.open { display: flex; }
.modal-card {
    background: var(--color-canvas);
    border-radius: var(--radius-md);
    padding: var(--space-xl);
    max-width: 440px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-close { float: right; background: none; border: none; font-size: 20px; color: var(--color-muted); }
