:root {
    --bg: #f7fbfa;
    --surface: #ffffff;
    --surface-muted: #eef5f4;
    --text: #1e2b2a;
    --text-soft: #4a5b59;
    --primary: #2d7a73;
    --primary-dark: #205952;
    --border: #d6e4e2;
    --radius: 16px;
    --shadow: 0 10px 30px rgba(16, 45, 42, 0.08);
    --site-bg-image: none;
    --site-bg-position: center top;
    --site-bg-size: cover;
    --site-bg-repeat: no-repeat;
    --site-bg-attachment: fixed;
    --site-bg-mobile-image: var(--site-bg-image);
    --site-bg-mobile-position: var(--site-bg-position);
    --site-bg-mobile-size: var(--site-bg-size);
    --site-bg-mobile-repeat: var(--site-bg-repeat);
    --site-bg-mobile-attachment: scroll;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    color: var(--text);
    position: relative;
    min-height: 100vh;
    background-color: var(--bg);
    background-image: var(--site-bg-image);
    background-position: var(--site-bg-position);
    background-size: var(--site-bg-size);
    background-repeat: var(--site-bg-repeat);
    background-attachment: var(--site-bg-attachment);
    line-height: 1.55;
}

a {
    color: var(--primary-dark);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    width: min(1120px, calc(100% - 2rem));
    margin-inline: auto;
}

.section {
    padding: 4rem 0;
}

.section-muted {
    background: var(--surface-muted);
}

.section-head {
    max-width: 640px;
    margin-bottom: 1.5rem;
}

.section-head p {
    margin: 0;
    color: var(--text-soft);
}

h1,
h2,
h3 {
    margin: 0 0 0.75rem;
    line-height: 1.2;
}

p {
    margin: 0 0 1rem;
}

.lead {
    color: var(--text-soft);
    font-size: 1.1rem;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(247, 251, 250, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    gap: 1rem;
}

.logo {
    font-weight: 700;
    color: var(--text);
}

.main-nav {
    display: flex;
    gap: 1rem;
}

.main-nav a {
    font-weight: 500;
}

.menu-toggle {
    display: none;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
    color: var(--text);
}

.hero-grid {
    display: grid;
    gap: 2rem;
}

/* .hero-badge {
    display: inline-block;
    margin-bottom: 0.75rem;
    background: #dff1ef;
    color: #204d48;
    border: 1px solid #c0e0dc;
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
    font-size: 0.9rem;
} */

.benefits {
    margin: 0 0 1.25rem;
    display: grid;
    gap: 0.45rem;
}

.benefits p {
    margin: 0;
    color: var(--text);
}

.hero-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 1.25rem;
}

.hero-card ul {
    margin: 0;
    padding-left: 1rem;
}

.hero-links {
    display: grid;
    gap: 0.65rem;
}

.hero-links .btn {
    width: 100%;
}

.booking-link {
    flex-direction: column;
    gap: 0.15rem;
}

.booking-line-title {
    display: block;
    font-weight: 700;
    line-height: 1.15;
}

.booking-line-address {
    display: block;
    font-weight: 600;
    line-height: 1.15;
    font-size: 0.95em;
}

.cta-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin: 1rem 0 0.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid transparent;
    padding: 0.7rem 1rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-booking {
    background: #e78d2f;
    border-color: #d27c22;
    color: #fff;
}

.btn-booking:hover {
    background: #d97e21;
}

.btn-booking.is-disabled {
    background: #ccb8a1;
    border-color: #baa489;
    color: #fff;
    cursor: not-allowed;
    pointer-events: none;
}

.booking-line-status {
    display: block;
    font-size: 0.72rem;
    line-height: 1.15;
    opacity: 0.95;
}

.btn-secondary {
    background: #edf4ff;
    border-color: #d8e7ff;
    color: #244d7a;
}

.btn-ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}

.consent {
    margin-top: 0.4rem;
    color: var(--text-soft);
    font-size: 0.92rem;
}

.cards-grid,
.price-grid,
.portfolio-grid,
.reviews-grid,
.safety-grid {
    display: grid;
    gap: 1rem;
}

.card,
.price-card,
.review-card,
.safety-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
}

#services .card,
#reviews .review-card,
#safety .safety-item {
    background: #e8f3f1;
    border-color: #cbe3df;
}

.price-from {
    margin-top: 0.8rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.price-card ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.price-card li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--border);
}

.price-card li:last-child {
    border-bottom: 0;
}

.portfolio-item {
    margin: 0;
}

.portfolio-image {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border: 1px solid var(--border);
    border-radius: 14px;
}

.portfolio-placeholder {
    aspect-ratio: 1 / 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed #abcac5;
    border-radius: 14px;
    color: #3e6661;
    background: linear-gradient(145deg, #e7f3f1, #f7fbfa);
    font-weight: 600;
}

.portfolio-item figcaption {
    margin-top: 0.5rem;
    color: var(--text-soft);
}

.review-card {
    margin: 0;
}

.review-card cite {
    display: block;
    margin-top: 0.75rem;
    color: var(--text-soft);
    font-style: normal;
}

.master-block {
    display: grid;
    gap: 1.2rem;
}

.master-hero {
    position: relative;
    width: fit-content;
    max-width: 100%;
    margin-inline: auto;
    min-height: 0;
    height: auto;
    border-radius: var(--radius);
    overflow: hidden;
    /* border: 1px solid var(--border); */ /* кбрать если фон не прозрачный */
    /* box-shadow: var(--shadow); */ /* кбрать если фон не прозрачный */
    border: 0;
    box-shadow: none;
    /* background: #dce8e5; */ /* кбрать если фон не прозрачный */
    background: transparent;
}

.master-photo-img {
    display: block;
    width: auto;
    max-width: 100%;
    height: min(68vh, 760px);
    min-height: 0;
    background: transparent; /* кбрать если фон не прозрачный */
    object-fit: contain;
    object-position: center;
}

.master-overlay {
    position: absolute;
    inset: auto 0 0 0;
    padding: 1.2rem;
    color: #ffffff;
    font-size: 16px;
    background: linear-gradient(180deg, rgba(20, 34, 33, 0) 0%, rgba(20, 34, 33, 0.74) 100%);
}

.master-name {
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: #ffffff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.master-exp {
    color: rgba(255, 255, 255, 0.88);
}

.contacts-grid {
    display: grid;
    gap: 1rem;
}

.location-buttons {
    display: grid;
    gap: 0.75rem;
}

.location-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    text-align: left;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    padding: 0.8rem 1rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.location-button-address {
    display: block;
}

.location-button-status {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    font-size: 0.8rem;
    color: #b86200;
    background: #fff2e2;
    border: 1px solid #f2cfaa;
    border-radius: 999px;
    padding: 0.12rem 0.55rem;
}

.location-button:hover {
    border-color: #9ac4bf;
}

.location-button.is-unavailable {
    border-style: dashed;
}

.location-button.is-active {
    border-color: var(--primary);
    background: #e8f3f1;
    color: var(--primary-dark);
}

.location-panels {
    margin-top: 1rem;
}

.location-panel {
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow);
}

.location-contact-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fbfdfc;
    padding: 1rem;
    margin-top: 1rem;
    display: grid;
    gap: 1rem;
}

.location-contact-meta .contact-list {
    margin-bottom: 0.5rem;
}

.location-note {
    margin: 0 0 0.75rem;
    color: var(--text-soft);
}

.location-unavailable-alert {
    margin: 0 0 0.75rem;
    color: #8a4f16;
    background: #fff2e6;
    border: 1px solid #f2cfaa;
    border-radius: 10px;
    padding: 0.65rem 0.8rem;
}

.location-booking-btn {
    width: 100%;
    margin: 0 0 1rem;
}

.location-price-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.contact-list {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
}

.contact-list li {
    margin-bottom: 0.45rem;
}

.map-wrap {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.map-wrap iframe {
    width: 100%;
    min-height: 320px;
    border: 0;
}

.site-footer {
    background: #e6efee;
    border-top: 1px solid var(--border);
    padding: 1.5rem 0 5.5rem;
}

.footer-inner {
    display: grid;
    gap: 0.4rem;
}

.mobile-cta {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--border);
    padding: 0.6rem;
}

.mobile-cta a,
.mobile-cta .booking-link {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    padding: 0.55rem 0.4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.12rem;
    min-height: 54px;
    text-align: center;
    font-weight: 600;
    color: var(--text);
    font-size: 0.86rem;
    line-height: 1.25;
    width: 100%;
    text-decoration: none;
}

.mobile-cta .btn-booking {
    background: #e78d2f;
    border-color: #d27c22;
    color: #fff;
}

.mobile-cta .btn-booking.is-disabled {
    background: #ccb8a1;
    border-color: #baa489;
    color: #fff;
    pointer-events: none;
}

.mobile-cta .booking-line-title {
    font-size: 0.78rem;
}

.mobile-cta .booking-line-address {
    font-size: 0.72rem;
    line-height: 1.2;
}

.policy {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 1.4rem;
}

.back-link {
    display: inline-block;
    margin-bottom: 1rem;
    font-weight: 600;
}

@media (min-width: 768px) {
    .hero-grid {
        grid-template-columns: 1.2fr 0.9fr;
        align-items: start;
    }

    .cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .price-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .portfolio-grid,
    .reviews-grid,
    .safety-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .contacts-grid {
        grid-template-columns: 1fr 1fr;
        align-items: stretch;
    }

    .location-buttons {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .location-price-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .cards-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .portfolio-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-template-rows: repeat(3, auto);
        grid-auto-flow: column;
    }

    .location-price-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    body {
        background-image: none;
    }

    /* iOS-safe mobile background pinned to viewport */
    body::before {
        content: "";
        position: fixed;
        inset: 0;
        z-index: -1;
        pointer-events: none;
        background-image: var(--site-bg-mobile-image);
        background-position: var(--site-bg-mobile-position);
        background-size: var(--site-bg-mobile-size);
        background-repeat: var(--site-bg-mobile-repeat);
        background-attachment: var(--site-bg-mobile-attachment);
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }

    .menu-toggle {
        display: inline-flex;
    }

    .main-nav {
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        gap: 0;
        background: var(--surface);
        border-top: 1px solid var(--border);
        border-bottom: 1px solid var(--border);
    }

    .main-nav a {
        padding: 0.85rem 1rem;
        border-bottom: 1px solid var(--border);
    }

    .main-nav a:last-child {
        border-bottom: 0;
    }

    .main-nav.is-open {
        display: flex;
    }

    .hero-card {
        display: none;
    }

    .master-hero {
        width: fit-content;
        max-width: 100%;
        margin-inline: auto;
        height: auto;
        min-height: 0;
    }

    .master-photo-img {
        width: auto;
        max-width: 100%;
        height: auto;
        max-height: 70vh;
        min-height: 0;
    }
}

@media (min-width: 861px) {
    .master-hero {
        display: grid;
        grid-template-columns: minmax(260px, 340px) auto;
        align-items: end;
        gap: 1rem;
    }

    .master-overlay {
        position: static;
        inset: auto;
        padding: 0 0.5rem 0.75rem 0;
        font-size: 20px;
        background: none;
        color: var(--text);
        order: 1;
    }

    .master-overlay p {
        color: var(--text);
    }

    .master-name {
        color: var(--text);
        text-shadow: none;
    }

    .master-exp {
        color: var(--text-soft);
    }

    .master-photo-img {
        order: 2;
    }

    .mobile-cta {
        display: none;
    }

    .site-footer {
        padding-bottom: 1.5rem;
    }
}
