/* =========================================================
   СВФУ УСЛУГИ — СТРАНИЦА ПОМЕЩЕНИЯ (АРЕНДА)
   Подключается ПОСЛЕ index.css (шапка, подвал, корзина, .container).
   Mobile-first: база — телефон, шире — через min-width.
   ========================================================= */

.icon { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor;
        stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: #71808a; font-size: .9rem; }
:where(.rental-page) :focus-visible { outline: 3px solid rgba(21, 90, 122, .45); outline-offset: 2px; }

.rental-page { padding-top: 16px; }

/* ---------- Хлебные крошки ---------- */
.breadcrumbs { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; font-size: .8rem; color: #71808a; min-width: 0; }
.breadcrumbs a { color: #155a7a; font-weight: 500; text-decoration: none; white-space: nowrap; }
.breadcrumbs .icon { font-size: .8rem; color: #9aa8b0; }
.breadcrumbs .current { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Раскладка ---------- */
.rental-layout { display: grid; gap: 16px; }
.rental-main, .rental-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.card { background: #fff; border-radius: 18px; box-shadow: 0 5px 18px rgba(0, 0, 0, .07); }
.block { padding: 20px 16px; }
.block h2 { margin-bottom: 16px; padding-left: 12px; border-left: 4px solid #09304a; color: #09304a; font-size: 1.2rem; font-weight: 700; line-height: 1.25; }

/* ---------- Галерея ---------- */
.gallery-stage { position: relative; overflow: hidden; border-radius: 18px; background: #e9eff2; box-shadow: 0 5px 18px rgba(0, 0, 0, .07); }
.gallery-track { display: flex; aspect-ratio: 4 / 3; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-slide { flex: 0 0 100%; scroll-snap-align: center; }
.gallery-slide img { width: 100%; height: 100%; object-fit: cover; }
.gallery-counter { position: absolute; right: 12px; bottom: 12px; padding: 4px 11px; border-radius: 20px; background: rgba(9, 48, 74, .8); color: #fff; font-size: .78rem; font-weight: 500; }
.gallery-arrow { display: none; position: absolute; top: 50%; width: 42px; height: 42px; align-items: center; justify-content: center; transform: translateY(-50%);
                 border: none; border-radius: 50%; background: rgba(255, 255, 255, .94); color: #09304a; font-size: 1.2rem; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); }
.gallery-arrow.prev { left: 12px; }
.gallery-arrow.next { right: 12px; }
.gallery-empty { aspect-ratio: 4 / 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 20px; text-align: center;
                 background: linear-gradient(135deg, #e9f0f4, #dce7ed); color: #78909c; }
.gallery-empty .icon { font-size: 3rem; margin-bottom: 4px; }
.gallery-empty strong { color: #46545c; font-size: 1rem; }
.gallery-empty span { max-width: 280px; font-size: .84rem; }

.gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; padding-bottom: 2px; overflow-x: auto; scrollbar-width: none; }
.gallery-thumbs::-webkit-scrollbar { display: none; }
.gallery-thumb { flex: 0 0 84px; height: 62px; padding: 0; overflow: hidden; opacity: .65; border: 2px solid transparent; border-radius: 10px; background: #e9eff2; }
.gallery-thumb.active { opacity: 1; border-color: #09304a; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Заголовок и характеристики ---------- */
.rental-head { padding: 20px 16px; }
.rental-category { display: inline-block; margin-bottom: 10px; padding: 5px 11px; border-radius: 20px; background: #edf4f7; color: #155a7a; font-size: .78rem; font-weight: 600; }
.rental-head h1 { margin-bottom: 8px; color: #09304a; font-size: clamp(1.5rem, 6vw, 2.2rem); font-weight: 700; line-height: 1.2; }
.rental-place { display: flex; align-items: flex-start; gap: 7px; margin-bottom: 16px; color: #66747c; font-size: .9rem; line-height: 1.45; }
.rental-place .icon { margin-top: 3px; color: #155a7a; }

.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fact { display: flex; align-items: center; gap: 10px; padding: 11px; border-radius: 12px; background: #f5f8fa; min-width: 0; }
.fact > .icon { width: 36px; height: 36px; padding: 9px; border-radius: 9px; background: #edf4f7; color: #155a7a; }
.fact strong { display: block; color: #17242c; font-size: .92rem; line-height: 1.25; }
.fact span { color: #71808a; font-size: .74rem; }

/* ---------- Описание ---------- */
.rental-text { color: #46545c; font-size: .95rem; line-height: 1.65; white-space: pre-line; overflow-wrap: anywhere; }
.info-item { margin-top: 18px; padding-top: 16px; border-top: 1px solid #edf0f2; }
.info-item h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: #09304a; font-size: 1rem; }
.info-item h3 .icon { color: #155a7a; }

/* ---------- Время работы ---------- */
.hours { list-style: none; }
.hours li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 10px; border-radius: 10px; font-size: .92rem; color: #46545c; }
.hours li:nth-child(odd) { background: #f5f8fa; }
.hours strong { color: #17242c; font-weight: 600; }
.hours em { color: #8a98a0; font-style: normal; }
.hours li.today { background: #09304a; color: #fff; }
.hours li.today strong, .hours li.today em { color: #fff; }

/* ---------- Карта ---------- */
.map-card { overflow: hidden; border: 1px solid #e4eaee; border-radius: 14px; }
.map-art { display: block; width: 100%; height: 150px; }
.map-info { display: flex; flex-direction: column; gap: 2px; padding: 14px; }
.map-info strong { color: #17242c; font-size: .98rem; }
.map-info span { color: #66747c; font-size: .88rem; }
.map-buttons { display: grid; gap: 10px; margin-top: 12px; }
.map-btn { min-height: 50px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid #09304a; border-radius: 10px;
           color: #09304a; font-size: .92rem; font-weight: 600; text-decoration: none; transition: background-color .2s ease, color .2s ease; }
.map-btn:active { background: #09304a; color: #fff; }

/* ---------- Цена и бронирование ---------- */
.booking h2 { display: none; }
.price-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 14px; }
.rental-price { color: #09304a; font-size: 1.8rem; font-weight: 700; line-height: 1.1; }
.price-note { color: #71808a; font-size: .85rem; }

.booking form { display: grid; gap: 12px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field label { display: block; margin-bottom: 6px; color: #53616a; font-size: .8rem; font-weight: 600; }
.field input, .field textarea { width: 100%; min-height: 48px; padding: 0 12px; border: 1px solid #d9e0e4; border-radius: 10px; outline: none; background: #fff; color: #26343c;
                                 font-size: 1rem; /* 16px — iOS не увеличивает страницу при фокусе */ transition: border-color .2s ease, box-shadow .2s ease; }
.field select { width: 100%; min-height: 48px; padding: 0 38px 0 12px; border: 1px solid #d9e0e4; border-radius: 10px; outline: none; color: #26343c; font-size: 1rem; cursor: pointer;
                -webkit-appearance: none; appearance: none; transition: border-color .2s ease, box-shadow .2s ease;
                background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2371808a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 16px; }
.field select option:disabled { color: #a3afb6; }
.field textarea { padding: 12px; resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: #155a7a; box-shadow: 0 0 0 3px rgba(21, 90, 122, .12); }

.hint, .availability, .contract-note { padding: 12px; border-radius: 10px; font-size: .86rem; line-height: 1.5; }
.hint { background: #f4f7f8; color: #506572; }
.availability { background: #edf4f7; color: #26485a; }
.availability.closed { background: #fff3e0; color: #8a5a00; }
.busy-list { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.busy-chip { padding: 3px 9px; border-radius: 20px; background: #fff; color: #8a5a00; font-size: .78rem; font-weight: 600; box-shadow: inset 0 0 0 1px #ead39b; }
.contract-note { margin-bottom: 14px; background: #fff8e7; border: 1px solid #ead39b; color: #6d5410; }

.form-error, .form-success { display: none; padding: 12px; border-radius: 10px; font-size: .88rem; line-height: 1.5; }
.form-error { background: #fff1f0; color: #a4231a; }
.form-success { background: #eaf8ee; color: #176b32; }
.form-success a { color: inherit; font-weight: 600; }

.rental-btn { min-height: 52px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 20px; border: none; border-radius: 10px;
              background: #09304a; color: #fff; font-size: .95rem; font-weight: 600; text-align: center; text-decoration: none; transition: background-color .2s ease; }
.rental-btn:hover { background: #155a7a; }
.rental-btn:disabled { background: #9fb0b9; cursor: wait; }
.side-note { color: #71808a; font-size: .78rem; line-height: 1.5; text-align: center; }

/* ---------- Контакты ---------- */
.contact-list { list-style: none; }
.contact-list li { display: flex; align-items: center; gap: 12px; min-height: 52px; border-bottom: 1px solid #edf0f2; color: #46545c; font-size: .92rem; }
.contact-list li:last-child { border-bottom: none; }
.contact-list .icon { width: 34px; height: 34px; padding: 8px; border-radius: 8px; background: #edf4f7; color: #155a7a; }
.contact-list a { color: #09304a; font-weight: 500; text-decoration: none; overflow-wrap: anywhere; }

/* ---------- Нижняя панель (телефон) ---------- */
.sticky-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; display: flex; align-items: center; gap: 14px;
              padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid #dde4e8;
              box-shadow: 0 -6px 20px rgba(0, 0, 0, .1); transition: transform .25s ease; }
.sticky-bar.hidden { transform: translateY(110%); }
.sticky-price { display: flex; flex-direction: column; line-height: 1.2; }
.sticky-price strong { color: #09304a; font-size: 1.1rem; white-space: nowrap; }
.sticky-price small { color: #71808a; font-size: .75rem; }
.sticky-bar .rental-btn { flex: 1; min-height: 48px; }
.footer { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }

/* =========================================================
   ПЛАНШЕТ
   ========================================================= */
@media (min-width: 720px) {
    .block, .rental-head { padding: 24px; }
    .facts { grid-template-columns: repeat(4, 1fr); }
    .fact { flex-direction: column; align-items: flex-start; }
    .map-buttons { grid-template-columns: 1fr 1fr; }
    .gallery-track, .gallery-empty { aspect-ratio: 16 / 9; }
}

/* =========================================================
   ДЕСКТОП
   ========================================================= */
@media (min-width: 901px) {
    .rental-page { padding-top: 24px; }
    .rental-layout { grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
    .rental-side { position: sticky; top: 16px; }
    .booking h2 { display: none; }
    .gallery-arrow { display: flex; }
    .sticky-bar { display: none; }
    .footer { padding-bottom: 25px; }
}

@media (hover: hover) {
    .map-btn:hover { background: #09304a; color: #fff; }
    .gallery-arrow:hover { background: #fff; }
    .gallery-thumb:hover { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .sticky-bar { transition: none; }
    .gallery-track { scroll-behavior: auto; }
}
