.tha-apartments,
.tha-details {
    --tha-ink: #162033;
    --tha-muted: #657085;
    --tha-line: #e4e8ef;
    --tha-accent: #1d6f62;
    --tha-booking: #d9ad2f;
    --tha-soft: #f5f7f9;
    color: var(--tha-ink);
}

/* Ukrywa domyslny tytul strony WordPress, ale nie naglowek/menu witryny. */
body.tha-apartments-page main > .page-header,
body.tha-apartments-page .site-main > article > .entry-header,
body.tha-apartments-page main > article > .entry-header,
body.tha-apartments-page h1.entry-title,
body.tha-apartments-page h1.wp-block-post-title,
body.tha-apartments-page .elementor-page-title {
    display: none !important;
}

/* Divi potrafi blokowac position: sticky przez overflow na kontenerach buildera. */
body.tha-apartments-page #page-container {
    overflow-x: clip !important;
    overflow-y: visible !important;
}

body.tha-apartments-page #main-content,
body.tha-apartments-page #et-main-area,
body.tha-apartments-page #main-content .et_pb_section,
body.tha-apartments-page #main-content .et_pb_row,
body.tha-apartments-page #main-content .et_pb_column,
body.tha-apartments-page #main-content .et_pb_module,
body.tha-apartments-page #main-content .et_pb_module_inner,
body.tha-apartments-page #main-content .et_pb_code,
body.tha-apartments-page #main-content .et_pb_code_inner,
body.tha-apartments-page #main-content .et_pb_text_inner {
    overflow: visible !important;
}

.tha-details {
    width: 100%;
    font-size: 16px;
}

.tha-apartments {
    display: grid;
    gap: 28px;
}

.tha-list-header {
    grid-column: 1 / -1;
    padding: 0 0 12px;
    text-align: left;
}

.tha-list-header .tha-breadcrumbs { margin-bottom: 18px; }

.tha-list-header h1 {
    margin: 0;
    color: #111;
    font-size: clamp(2rem, 4vw, 3.25rem);
    line-height: 1.08;
    letter-spacing: -.025em;
}

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

.tha-card {
    overflow: hidden;
    border: 1px solid var(--tha-line);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 30px rgba(22, 32, 51, .07);
}

.tha-card-image {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--tha-soft);
}

.tha-card-image img,
.tha-gallery img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform .25s ease;
}

.tha-card:hover .tha-card-image img { transform: scale(1.025); }
.tha-image-placeholder { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, #edf1f4, #dfe6eb); }
.tha-card-body { padding: 22px; }
.tha-card-title { margin: 0 0 10px; font-size: clamp(1.2rem, 2vw, 1.55rem); line-height: 1.2; }
.tha-card-title a { color: inherit; text-decoration: none; }
.tha-card-description { margin: 0 0 16px; color: var(--tha-muted); }

.tha-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0;
}

.tha-facts span {
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--tha-soft);
    color: var(--tha-muted);
    font-size: .85rem;
}

.tha-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.tha-card-footer { margin-top: 20px; }
.tha-price { display: flex; flex-direction: column; line-height: 1.1; }
.tha-price small { color: var(--tha-muted); }
.tha-price strong { margin-top: 4px; font-size: 1.25rem; }

.tha-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 999px;
    background: var(--tha-accent);
    border: 0;
    color: #fff !important;
    cursor: pointer;
    font: inherit;
    text-decoration: none !important;
    font-weight: 700;
}

.tha-detail-hero {
    position: relative;
    left: 50%;
    width: 100vw;
    height: clamp(250px, 31vw, 440px);
    margin-left: -50vw;
    overflow: hidden;
    background: var(--tha-soft);
}

.tha-detail-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, .04), rgba(0, 0, 0, .14));
    pointer-events: none;
}

.tha-detail-hero img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.tha-detail-shell {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: clamp(36px, 5vw, 76px);
    width: min(1600px, calc(100% - 40px));
    margin: 0 auto;
    padding: 24px 0 72px;
}

.tha-detail-shell-wide { grid-template-columns: minmax(0, 1fr); }
.tha-detail-content { min-width: 0; }

.tha-booking-sidebar {
    position: sticky;
    top: 110px;
    align-self: start;
    height: max-content;
    z-index: 5;
}

.tha-booking-card {
    position: relative;
    padding: 30px 24px;
    border: 1px solid #f0f0ef;
    border-radius: 14px;
    background: #fafafa;
    box-shadow: 0 12px 34px rgba(22, 32, 51, .06);
    text-align: center;
}

.tha-booking-card h2 {
    margin: 0 0 20px;
    font-size: 1.18rem;
}

.tha-booking-card .tha-price { align-items: center; margin: -6px 0 18px; }
.tha-booking-card .tha-button { width: 100%; min-height: 50px; border-radius: 10px; background: var(--tha-booking); text-transform: uppercase; letter-spacing: .035em; }
.tha-booking-card p { margin: 15px 0 0; color: var(--tha-muted); font-size: .78rem; line-height: 1.5; }
.tha-booking-card small { display: block; color: var(--tha-muted); line-height: 1.5; }

.tha-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    margin: 0 0 24px;
    color: #9aa0aa;
    font-size: .82rem;
}

.tha-breadcrumbs a { color: inherit; text-decoration: none; }
.tha-breadcrumbs a:hover { color: var(--tha-accent); }
.tha-details-header { margin: 0 0 30px; }
.tha-details-header h1 { margin: 0 0 25px; color: #111; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.08; letter-spacing: -.025em; }

.tha-detail-facts { display: grid; gap: 9px; color: #5f6672; }
.tha-detail-fact { display: flex; align-items: center; gap: 10px; line-height: 1.35; }
.tha-detail-fact strong { color: inherit; font-weight: 500; }
.tha-detail-fact-icon { display: inline-flex; flex: 0 0 19px; width: 19px; height: 19px; color: #68717e; }
.tha-detail-fact-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.tha-gallery {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.tha-gallery-item { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--tha-soft); }
.tha-gallery-item:hover img { transform: scale(1.035); }

.tha-lightbox-open { overflow: hidden; }

.tha-lightbox {
    position: fixed;
    z-index: 999999;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 54px 76px;
    background: rgba(7, 10, 15, .94);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
}

.tha-lightbox.is-open { opacity: 1; visibility: visible; }
.tha-lightbox-figure { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; height: 100%; margin: 0; }
.tha-lightbox-image { display: block; max-width: 100%; max-height: calc(100vh - 125px); width: auto; height: auto; object-fit: contain; box-shadow: 0 12px 60px rgba(0, 0, 0, .45); }
.tha-lightbox-counter { margin-top: 13px; color: rgba(255, 255, 255, .85); font-size: .9rem; }

.tha-lightbox button {
    position: absolute;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 50%;
    background: rgba(0, 0, 0, .25);
    color: #fff;
    cursor: pointer;
    font: 300 32px/1 Arial, sans-serif;
}

.tha-lightbox button:hover,
.tha-lightbox button:focus-visible { background: rgba(255, 255, 255, .16); outline: 2px solid #fff; outline-offset: 2px; }
.tha-lightbox button[hidden] { display: none; }
.tha-lightbox-close { top: 18px; right: 22px; }
.tha-lightbox-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.tha-lightbox-next { right: 20px; top: 50%; transform: translateY(-50%); }
.tha-section { margin-top: 55px; }
.tha-description-section { margin-top: 0; }
.tha-description { color: #59616c; font-size: 1rem; line-height: 1.8; }
.tha-description > :first-child { margin-top: 0; }
.tha-description > :last-child { margin-bottom: 0; }

.tha-section-heading {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 0 0 24px;
}

.tha-section-heading h2 { flex: 0 0 auto; margin: 0; color: #20242b; font-size: 1.45rem; line-height: 1.2; }
.tha-section-heading span { width: 100%; height: 1px; background: #74787e; opacity: .55; }

.tha-location-label { margin: -10px 0 15px; color: var(--tha-muted); }
.tha-map { position: relative; overflow: hidden; width: 100%; height: 410px; background: var(--tha-soft); }
.tha-map iframe { display: block; width: 100%; height: 100%; border: 0; }
.tha-map-link { display: inline-block; margin-top: 10px; color: var(--tha-accent); font-size: .85rem; font-weight: 700; text-decoration: none; }

.tha-facilities {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
}

.tha-facility {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 92px;
    padding: 13px 8px;
    background: #fafafa;
    color: #555d68;
    text-align: center;
    font-size: .78rem;
    line-height: 1.25;
}

.tha-facility img { width: 31px; height: 31px; object-fit: contain; opacity: .78; }
.tha-message { padding: 16px 18px; border-radius: 10px; background: var(--tha-soft, #f5f7f9); }
.tha-message-error { border-left: 4px solid #c62828; background: #fff3f3; }

.tha-booking-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 24px;
    border-radius: 16px;
    background: var(--tha-soft);
}

.tha-booking-cta h2 { margin: 0 0 6px; }
.tha-booking-cta p { margin: 0; color: var(--tha-muted); }

.tha-availability {
    padding: 24px;
    border-radius: 16px;
    background: var(--tha-soft);
}

.tha-availability-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
    align-items: end;
    gap: 14px;
}

.tha-availability-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; }
.tha-availability-form input { min-height: 46px; padding: 8px 12px; border: 1px solid var(--tha-line); border-radius: 9px; background: #fff; }
.tha-availability-result { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 18px; padding: 16px; border-radius: 10px; }
.tha-available { color: #155b37; background: #eaf8f0; }
.tha-unavailable { color: #8c2525; background: #fff0f0; }
.tha-availability-result small { display: block; max-width: 420px; }

@media (max-width: 900px) {
    .tha-columns-3,
    .tha-columns-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tha-detail-shell { grid-template-columns: 210px minmax(0, 1fr); gap: 30px; }
    .tha-gallery,
    .tha-facilities { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
    .tha-detail-hero { height: clamp(210px, 58vw, 330px); }
    .tha-detail-shell { display: flex; width: min(680px, calc(100% - 30px)); padding: 20px 0 50px; flex-direction: column; gap: 32px; }
    .tha-booking-sidebar { position: static; height: auto; }
    .tha-booking-card { position: static; padding: 24px 20px; }
    .tha-details-header h1 { font-size: clamp(1.8rem, 9vw, 2.5rem); }
    .tha-section { margin-top: 42px; }
    .tha-map { height: 330px; }
}

@media (max-width: 620px) {
    .tha-columns-2,
    .tha-columns-3,
    .tha-columns-4 { grid-template-columns: 1fr; }
    .tha-gallery,
    .tha-facilities { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tha-card-footer { align-items: flex-start; flex-direction: column; }
    .tha-availability-form { grid-template-columns: 1fr; }
    .tha-availability-result { align-items: flex-start; flex-direction: column; }
    .tha-booking-cta { align-items: flex-start; flex-direction: column; }
    .tha-section-heading { gap: 12px; }
    .tha-section-heading h2 { font-size: 1.25rem; }
    .tha-map { height: 285px; }
    .tha-lightbox { padding: 62px 12px 55px; }
    .tha-lightbox-image { max-height: calc(100vh - 135px); }
    .tha-lightbox-prev { left: 8px; }
    .tha-lightbox-next { right: 8px; }
    .tha-lightbox-close { top: 10px; right: 10px; }
    .tha-lightbox button { width: 42px; height: 42px; }
}

