/* Space detail page  - conversion-focused layout
   Uses site tokens: --primary-color, --accent-color, --accent-light */

.space-page {
    --sd-ink: #1a1a1a;
    --sd-paper: #f3efe8;
    --sd-sand: #e8dfd2;
    --sd-gold: #b17006;
    --sd-gold-deep: #8f5a05;
    --sd-muted: #5c564e;
    --sd-white: #fffaf4;
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(177, 112, 6, 0.12), transparent 55%),
        linear-gradient(180deg, #efe8dc 0%, var(--sd-paper) 40%, #f7f3ec 100%);
    color: var(--sd-ink);
}

.sd-wrap {
    width: min(1120px, calc(100% - 2.5rem));
    margin: 0 auto;
}

.sd-section {
    padding: 4.5rem 0;
}

.sd-section__head {
    max-width: 36rem;
    margin-bottom: 2rem;
}

.sd-section__head h2 {
    font-size: clamp(1.75rem, 3vw, 2.35rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    color: var(--sd-ink);
}

.sd-section__head p {
    color: var(--sd-muted);
    font-size: 1.05rem;
    line-height: 1.6;
}

/* Buttons */
.sd-btn {
    appearance: none;
    border: 0;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.95rem 1.5rem;
    border-radius: 4px;
    transition: transform 0.25s ease, background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 48px;
}

.sd-btn:active {
    transform: translateY(1px);
}

.sd-btn--primary {
    background: var(--sd-gold);
    color: #fff;
}

.sd-btn--primary:hover {
    background: var(--sd-gold-deep);
}

.sd-btn--ghost {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.55);
}

.sd-btn--ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
}

.sd-btn--block {
    width: 100%;
}

/* Hero */
.sd-hero {
    position: relative;
    min-height: 100svh;
    min-height: 100vh;
    display: grid;
    align-items: end;
    color: #fff;
    overflow: hidden;
}

.sd-hero__media,
.sd-hero__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.sd-hero__img {
    object-fit: cover;
    transform: scale(1.04);
    animation: sdHeroZoom 18s ease-out forwards;
}

.sd-hero__veil {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(26, 26, 26, 0.25) 0%, rgba(26, 26, 26, 0.15) 35%, rgba(26, 26, 26, 0.78) 100%),
        linear-gradient(90deg, rgba(26, 26, 26, 0.45) 0%, transparent 55%);
    pointer-events: none;
}

.sd-hero__content {
    position: relative;
    z-index: 2;
    width: min(720px, calc(100% - 2.5rem));
    margin: 0 auto 0 0;
    padding: 7rem 0 5.5rem;
    margin-left: max(1.25rem, calc((100% - 1120px) / 2));
    animation: sdRise 0.9s ease both;
}

.sd-hero__brand {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--sd-sand);
    margin-bottom: 0.85rem;
}

.sd-hero__title {
    font-size: clamp(2.4rem, 6vw, 4.2rem);
    line-height: 1.05;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
    max-width: 12ch;
}

.sd-hero__pitch {
    font-size: 1.05rem;
    line-height: 1.55;
    max-width: 34rem;
    color: rgba(255, 255, 255, 0.88);
    margin-bottom: 1.75rem;
}

.sd-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.sd-hero__back {
    position: absolute;
    top: 5.5rem;
    left: max(1.25rem, calc((100% - 1120px) / 2));
    z-index: 3;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.sd-hero__back:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.7);
}

/* Sticky conversion bar */
.sd-sticky {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 900;
    transform: translateY(110%);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    background: rgba(26, 26, 26, 0.94);
    color: #fff;
    border-top: 1px solid rgba(219, 192, 160, 0.25);
    backdrop-filter: blur(10px);
}

.sd-sticky.is-visible {
    transform: translateY(0);
}

.sd-sticky__inner {
    width: min(1120px, calc(100% - 1.5rem));
    margin: 0 auto;
    padding: 0.85rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.sd-sticky__name {
    display: block;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.15rem;
}

.sd-sticky__price {
    font-size: 1rem;
}

.sd-sticky__price strong {
    font-size: 1.15rem;
    color: var(--sd-accent-light, #dbc0a0);
}

.sd-sticky__cta {
    flex-shrink: 0;
    min-width: 10.5rem;
}

/* Gallery */
.sd-gallery__stage {
    position: relative;
}

.sd-gallery__viewport {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #1a1a1a;
}

.sd-gallery__slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.45s ease;
    pointer-events: none;
}

.sd-gallery__slide.is-active {
    opacity: 1;
    pointer-events: auto;
}

.sd-gallery__slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sd-gallery__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 4px;
    background: rgba(26, 26, 26, 0.65);
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.sd-gallery__nav--prev { left: 0.75rem; }
.sd-gallery__nav--next { right: 0.75rem; }

.sd-gallery__nav:hover {
    background: rgba(26, 26, 26, 0.85);
}

.sd-gallery__thumbs {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.sd-gallery__thumb {
    flex: 0 0 72px;
    height: 54px;
    border: 2px solid transparent;
    padding: 0;
    background: none;
    cursor: pointer;
    opacity: 0.65;
    transition: opacity 0.2s ease, border-color 0.2s ease;
}

.sd-gallery__thumb.is-active,
.sd-gallery__thumb:hover {
    opacity: 1;
    border-color: var(--sd-gold);
}

.sd-gallery__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* About + booking panel */
.sd-about__grid {
    display: grid;
    grid-template-columns: 1.35fr 0.9fr;
    gap: 3rem;
    align-items: start;
}

.sd-about__copy h2 {
    font-size: clamp(1.75rem, 3vw, 2.35rem);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.sd-about__text {
    color: var(--sd-muted);
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.sd-facts {
    list-style: none;
    display: grid;
    gap: 0.65rem;
    padding: 0;
}

.sd-facts li {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 500;
}

.sd-facts i {
    color: var(--sd-gold);
    font-size: 1.2rem;
}

.sd-bookpanel {
    background: var(--sd-white);
    border: 1px solid rgba(26, 26, 26, 0.08);
    padding: 1.75rem 1.5rem;
    position: sticky;
    top: 5.5rem;
}

.sd-bookpanel__label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--sd-muted);
    margin-bottom: 0.35rem;
}

.sd-bookpanel__price {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    margin-bottom: 0.35rem;
}

.sd-bookpanel__amount {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.sd-bookpanel__unit {
    color: var(--sd-muted);
}

.sd-bookpanel__alt {
    font-size: 0.9rem;
    color: var(--sd-muted);
    margin-bottom: 1.25rem;
}

.sd-bookpanel__note {
    margin: 1rem 0 1.25rem;
    font-size: 0.9rem;
    color: var(--sd-muted);
    line-height: 1.5;
}

.sd-bookpanel__trust {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.45rem;
    font-size: 0.88rem;
    color: var(--sd-ink);
}

.sd-bookpanel__trust li {
    padding-left: 1.1rem;
    position: relative;
}

.sd-bookpanel__trust li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 6px;
    height: 6px;
    background: var(--sd-gold);
}

/* Amenities */
.sd-amenities {
    background: linear-gradient(180deg, transparent, rgba(26, 26, 26, 0.03));
}

.sd-amenity-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem 1.25rem;
}

.sd-amenity-list li {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid rgba(26, 26, 26, 0.08);
    font-weight: 500;
}

.sd-amenity-list i {
    color: var(--sd-gold);
    font-size: 1.2rem;
}

.sd-amenity-list li.is-highlight {
    color: var(--sd-ink);
}

/* Steps */
.sd-steps__list {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.75rem;
    counter-reset: none;
}

.sd-steps__list li {
    padding-top: 0.25rem;
}

.sd-steps__num {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--sd-gold);
    margin-bottom: 0.75rem;
}

.sd-steps__list h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.sd-steps__list p {
    color: var(--sd-muted);
    line-height: 1.55;
}

.sd-steps__cta {
    display: flex;
    justify-content: flex-start;
}

/* Related */
.sd-related__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

.sd-related__item {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--sd-white);
    border: 1px solid rgba(26, 26, 26, 0.06);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.sd-related__item:hover {
    transform: translateY(-4px);
    border-color: rgba(177, 112, 6, 0.45);
}

.sd-related__item img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}

.sd-related__meta {
    padding: 1rem 1.1rem 1.2rem;
}

.sd-related__meta h3 {
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
}

.sd-related__meta p {
    color: var(--sd-muted);
    font-size: 0.92rem;
}

/* Modal */
.sd-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(26, 26, 26, 0.62);
}

.sd-modal.is-open,
.sd-modal:not([hidden]) {
    display: flex;
}

.sd-modal[hidden] {
    display: none !important;
}

.sd-modal__panel {
    width: min(480px, 100%);
    max-height: min(90vh, 720px);
    overflow: auto;
    background: var(--sd-white);
    border-radius: 4px;
    animation: sdRise 0.35s ease both;
}

.sd-modal__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.35rem 1.35rem 0.75rem;
    border-bottom: 1px solid rgba(26, 26, 26, 0.08);
}

.sd-modal__eyebrow {
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--sd-gold);
    margin-bottom: 0.25rem;
}

.sd-modal__head h3 {
    font-size: 1.35rem;
}

.sd-modal__close {
    border: 0;
    background: transparent;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    color: var(--sd-muted);
}

.sd-modal__body {
    padding: 1.25rem 1.35rem 1.5rem;
}

.sd-modal__lead {
    color: var(--sd-muted);
    margin-bottom: 1.25rem;
}

.sd-field {
    margin-bottom: 1rem;
}

.sd-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.sd-field input,
.sd-field select {
    width: 100%;
    min-height: 46px;
    border: 1px solid rgba(26, 26, 26, 0.18);
    border-radius: 4px;
    padding: 0.65rem 0.8rem;
    font: inherit;
    background: #fff;
}

.sd-field input:focus,
.sd-field select:focus {
    outline: 2px solid rgba(177, 112, 6, 0.35);
    border-color: var(--sd-gold);
}

.sd-modal__actions {
    display: flex;
    gap: 0.65rem;
    justify-content: flex-end;
    margin-top: 1.25rem;
}

.sd-modal__actions .sd-btn--ghost {
    color: var(--sd-ink);
    border-color: rgba(26, 26, 26, 0.2);
}

.sd-modal__actions .sd-btn--ghost:hover {
    background: rgba(26, 26, 26, 0.05);
}

.sd-avail {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 4px;
}

.sd-avail--loading {
    background: #f0ebe3;
    color: var(--sd-muted);
}

.sd-avail--ok {
    background: #eaf5ea;
    color: #1f5a2a;
}

.sd-avail--bad {
    background: #f8eaea;
    color: #7a2222;
}

.sd-avail .sd-btn {
    margin-top: 0.85rem;
}

@keyframes sdHeroZoom {
    from { transform: scale(1.08); }
    to { transform: scale(1); }
}

@keyframes sdRise {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .sd-hero__img,
    .sd-hero__content,
    .sd-modal__panel,
    .sd-sticky,
    .sd-related__item {
        animation: none !important;
        transition: none !important;
    }
    .sd-hero__img { transform: none; }
}

@media (max-width: 900px) {
    .sd-about__grid,
    .sd-steps__list,
    .sd-related__grid,
    .sd-amenity-list {
        grid-template-columns: 1fr;
    }

    .sd-bookpanel {
        position: static;
    }

    .sd-hero__title {
        max-width: none;
    }

    .sd-sticky__name {
        display: none;
    }

    .space-page main {
        padding-bottom: 5rem;
    }
}

@media (max-width: 600px) {
    .sd-hero__content {
        padding: 6.5rem 0 4.5rem;
        margin-left: 1.25rem;
        width: calc(100% - 2.5rem);
    }

    .sd-hero__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .sd-gallery__viewport {
        aspect-ratio: 4 / 3;
    }

    .sd-section {
        padding: 3.25rem 0;
    }
}
