/**
 * Krontix Real Estate — Frontend Styles
 * Premium design matching mockup specifications.
 *
 * @package KrontixRE
 */

/* ================================================================
   CSS CUSTOM PROPERTIES
   ============================================================= */
:root {
    --krx-primary: #0B2545;
    --krx-primary-light: #134074;
    --krx-accent: #1565C0;
    --krx-accent-hover: #0D47A1;
    --krx-success: #2E7D32;
    --krx-warning: #E65100;
    --krx-sold: #757575;
    --krx-text: #1a1a2e;
    --krx-text-light: #5a5a6e;
    --krx-text-muted: #8e8e9e;
    --krx-bg: #f5f7fa;
    --krx-white: #ffffff;
    --krx-border: #e2e6ed;
    --krx-shadow-sm: 0 1px 3px rgba(11,37,69,.08);
    --krx-shadow: 0 4px 16px rgba(11,37,69,.1);
    --krx-shadow-lg: 0 8px 32px rgba(11,37,69,.14);
    --krx-radius: 0;
    --krx-radius-sm: 0;
    --krx-radius-xs: 0;
    --krx-transition: .25s cubic-bezier(.4,0,.2,1);
    --krx-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --krx-max-width: 1366px;
}

/*
 * Google Fonts: Inter is loaded via wp_enqueue_style() in class-assets.php.
 * Do NOT use @import here — it blocks rendering and may duplicate the font
 * if Astra already loads Inter.
 */

/* ================================================================
   BASE / RESET
   ============================================================= */
.krx-listing,
.krx-grid-wrapper,
.krx-search,
.krx-single-layout,
.krx-sidebar-form,
.krx-cta-buttons {
    font-family: var(--krx-font);
    color: var(--krx-text);
    box-sizing: border-box;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.krx-listing *, .krx-grid-wrapper *, .krx-search *,
.krx-single-layout *, .krx-sidebar-form *, .krx-cta-buttons *,
.krx-hero *, .krx-summary *, .krx-features *,
.krx-amenities *, .krx-gallery-block *, .krx-location *,
.krx-description-block * {
    box-sizing: border-box;
}

/* ================================================================
   SHARED CONTAINER
   Single source of truth for max-width + centering.
   Used inside .krx-hero AND .krx-single-body so both sections
   share identical left/right edges — eliminates staircase effect.
   ============================================================= */
.krx-container {
    width: 100%;
    max-width: 1366px;
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
    box-sizing: border-box;
}

/* ================================================================
   LISTING HEADER
   ============================================================= */
.krx-listing__header {
    width: 100%;
    margin: 0 auto 32px;
    padding: 0;
}

.krx-listing__title {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--krx-primary);
    margin: 0 0 8px;
    line-height: 1.2;
}

.krx-listing__title em,
.krx-listing__title i {
    font-style: italic;
    font-weight: 800;
}

.krx-listing__desc {
    font-size: 1.05rem;
    color: var(--krx-text-light);
    margin: 0;
    max-width: 600px;
}

/* ================================================================
   SEARCH BAR
   ============================================================= */
.krx-search {
    max-width: 100%;
    margin: 0 auto 40px;
    padding: 0;
}

.krx-search__form {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    flex-wrap: wrap;
    --krx-input-height: 48px;
}

.krx-search__field {
    flex: 1;
    min-width: 180px;
}

.krx-search__label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--krx-text-light);
    margin-bottom: 8px;
}

.krx-search__label svg {
    opacity: .6;
}

.krx-search__select {
    width: 100%;
    height: var(--krx-input-height, 48px);
    padding: 0 36px 0 14px;
    font-size: .95rem;
    font-family: var(--krx-font);
    line-height: var(--krx-input-height, 48px);
    color: var(--krx-text);
    background: var(--krx-bg);
    border: 1px solid var(--krx-border);
    border-radius: 0;
    cursor: pointer;
    appearance: none;
    box-sizing: border-box;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235a5a6e' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: border-color var(--krx-transition), box-shadow var(--krx-transition);
}

.krx-search__select:focus {
    outline: none;
    border-color: var(--krx-accent);
    box-shadow: 0 0 0 3px rgba(21,101,192,.12);
}

.krx-search__action {
    flex-shrink: 0;
}

/*
 * .krx-btn--search: Astra's button selector (button:not(.menu-toggle))
 * already applies background, color, border-radius, padding, and font-*
 * from the Customizer. We keep only layout properties here.
 */
.krx-btn--search {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    flex-shrink: 0;
    height: var(--krx-input-height, 48px);
    box-sizing: border-box;
}

/* ================================================================
   BADGES
   ============================================================= */
.krx-badge {
    display: inline-block;
    padding: 5px 14px;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    border-radius: 0;
    line-height: 1.3;
    white-space: nowrap;
}

.krx-badge--en-venta {
    background: var(--krx-accent);
    color: var(--krx-white);
}

.krx-badge--en-construccion {
    background: var(--krx-warning);
    color: var(--krx-white);
}

.krx-badge--entrega-inmediata {
    background: var(--krx-success);
    color: var(--krx-white);
}

.krx-badge--en-planos {
    background: #7B1FA2;
    color: var(--krx-white);
}

.krx-badge--vendido {
    background: var(--krx-sold);
    color: var(--krx-white);
}

/* ================================================================
   PROJECT GRID
   ============================================================= */
.krx-grid-wrapper {
    width: 100%;
    margin: 0 auto;
    padding: 0;
}

.krx-grid {
    display: grid;
    gap: 24px;
}

.krx-grid--cols-2 { grid-template-columns: repeat(2, 1fr); }
.krx-grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
.krx-grid--cols-4 { grid-template-columns: repeat(4, 1fr); }

.krx-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--krx-text-muted);
    font-size: 1.1rem;
}

/* ================================================================
   PROJECT CARD
   ============================================================= */
.krx-card {
    background: var(--krx-white);
    border-radius: 0;
    overflow: hidden;
    box-shadow: var(--krx-shadow-sm);
    transition: box-shadow var(--krx-transition), transform var(--krx-transition);
}

.krx-card:hover {
    box-shadow: var(--krx-shadow);
    transform: translateY(-4px);
}

.krx-card--sold {
    /* sold cards remain fully interactive — badge is the only visual indicator */
}

/* Outer image wrapper: holds badge absolutely over the img-wrap */
.krx-card__image {
    position: relative;
    background: var(--krx-bg);
}

.krx-card__image .krx-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 2;
    background: #F3F4F6;
    color: #005398;
}

/* Inner wrapper: enforces 4:3 ratio */
.krx-card__img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--krx-bg);
}

/* The <img> fills the ratio container without distortion */
.krx-card__img-wrap .krx-card__thumb {
    display: block;
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center center;
    transition: transform .5s cubic-bezier(.4,0,.2,1);
}

.krx-card:hover .krx-card__img-wrap .krx-card__thumb {
    transform: scale(1.06);
}

.krx-card__placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--krx-bg), #dde3ed);
}

.krx-card__body {
    padding: 14px 14px 14px;
}

.krx-card__title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--krx-text);
    line-height: 1.3;
}

.krx-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    margin: 0 0 14px;
}

.krx-card__meta-item {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    flex: 1;
    font-size: .8rem;
    color: var(--krx-text-light);
    line-height: 1.3;
    white-space: nowrap;
}

.krx-card__meta-item svg {
    flex-shrink: 0;
    color: currentColor;
}

/*
 * .krx-btn--card: <a ast-button> inherits Astra's primary button visual styles.
 * We only override layout: full-width block inside the card body.
 */
.krx-btn--card {
    display: block;
    text-align: center;
    width: 100%;
    justify-content: center;
}

/* Sold state: button inherits the same styles as active project buttons. */

/* ================================================================
   PAGINATION
   ============================================================= */
.krx-pagination {
    max-width: var(--krx-max-width);
    margin: 40px auto 0;
    padding: 0 20px;
    display: flex;
    justify-content: center;
}

.krx-pagination__list {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 6px;
    align-items: center;
}

.krx-pagination__item a,
.krx-pagination__item span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 6px;
    font-size: .88rem;
    font-weight: 500;
    font-family: var(--krx-font);
    border-radius: 0;
    text-decoration: none;
    color: var(--krx-text);
    background: #F9FAFB;
    transition: all var(--krx-transition);
}

.krx-pagination__item a:hover {
    background: var(--krx-bg);
    color: var(--krx-accent);
}

.krx-pagination__item .current {
    background: var(--krx-accent);
    color: var(--krx-white);
    font-weight: 700;
}

.krx-pagination__item .dots {
    color: var(--krx-text-muted);
}

/* ================================================================
   LISTING CTA
   ============================================================= */
.krx-listing-cta {
    max-width: var(--krx-max-width);
    margin: 56px auto 0;
    padding: 48px 40px;
    background: var(--krx-primary);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    flex-wrap: wrap;
}

.krx-listing-cta__title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--krx-white);
    margin: 0 0 8px;
}

.krx-listing-cta__text {
    font-size: .95rem;
    color: rgba(255,255,255,.75);
    margin: 0;
    max-width: 520px;
}

.krx-listing-cta__actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

/* ================================================================
   GENERIC BUTTONS — layout utilities only.
   Visual styles (background, color, border-radius, padding, font-*)
   are intentionally omitted here and delegated to Astra:
   • <button> elements → Astra's "button:not(.menu-toggle)" selector.
   • <a> elements      → Astra's ".ast-button" class (added in HTML).
   This prevents double-definition conflicts with the theme Customizer.
   ============================================================= */
.krx-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

/*
 * .krx-btn--primary: no custom visual styles needed.
 * Astra's ast-button (for <a>) or button selector applies automatically.
 */

/*
 * .krx-btn--outline: outline variant on LIGHT backgrounds.
 * Uses Astra's primary color variable so it auto-updates when the
 * user changes theme colors in the Customizer.
 * For the dark-background listing CTA, see .krx-listing-cta override below.
 */
.krx-btn--outline {
    background: transparent;
    color: var(--ast-global-color-0, var(--krx-accent));
    border-color: var(--ast-global-color-0, var(--krx-accent));
}

.krx-btn--outline:hover {
    background: var(--ast-global-color-0, var(--krx-accent));
    color: #ffffff;
    text-decoration: none;
}

/* Dark-background listing CTA: override outline to white-on-dark */
.krx-listing-cta .krx-btn--outline {
    border-color: var(--krx-white);
    color: var(--krx-white);
    background: transparent;
}

.krx-listing-cta .krx-btn--outline:hover {
    background: var(--krx-white);
    color: var(--krx-primary);
}

/* ================================================================
   HERO (SINGLE) — full-bleed via natural width.
   Relies on Astra's ast-page-builder-template body class (added by
   class-kre-compat-astra.php) which removes Astra's .ast-container
   max-width constraint from the content area, letting .krx-hero fill
   100% of the viewport with no JS needed.
   ============================================================= */
.krx-hero {
    position: relative;
    width: 100%;
    min-height: 480px;
    display: flex;
    align-items: flex-end;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-color: var(--krx-primary);
    padding: 0;
    margin: 0;
    max-width: none;
    box-sizing: border-box;
    overflow: hidden;
}

.krx-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(11,37,69,.85) 0%, rgba(11,37,69,.35) 50%, rgba(11,37,69,.15) 100%);
    z-index: 1;
}

.krx-hero__content {
    position: relative;
    z-index: 2;
    width: 100%;
    padding-top: 40px;
    padding-bottom: 48px;
    /* Horizontal padding comes from the parent .krx-container */
}

.krx-hero__content .krx-badge {
    margin-bottom: 16px;
}

.krx-hero__title {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--krx-white);
    margin: 0 0 12px;
    line-height: 1.15;
    text-shadow: 0 2px 8px rgba(0,0,0,.2);
}

.krx-hero__address {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.05rem;
    color: rgba(255,255,255,.85);
    margin: 0;
}

.krx-hero__address svg {
    flex-shrink: 0;
}

/* ================================================================
   ASTRA FULL-WIDTH OVERRIDE
   Scoped to body.ast-page-builder-template which we add via PHP only
   on proyecto pages. Removes Astra's container max-width, padding,
   and any sidebar float so the plugin controls all widths via
   .krx-container.

   IMPORTANT: Selectors are intentionally scoped to .site-content so
   the header's .ast-container is NEVER affected. Astra uses
   .ast-container inside .site-header — a global selector would break
   the header max-width on large screens.
   ============================================================= */

/* Neutralise Astra's .ast-container ONLY inside the content area.
   .site-header .ast-container and .main-header-bar .ast-container
   are intentionally excluded to keep the header intact. */
body.ast-page-builder-template .site-content .ast-container {
    max-width: none;
    padding-left: 0;
    padding-right: 0;
}

/* Make #primary fill the full width — no float, no sidebar offset */
body.ast-page-builder-template #primary,
body.ast-page-builder-template #primary.content-area {
    width: 100%;
    max-width: 100%;
    float: none;
    padding: 0;
}

/* Remove any residual entry-content padding Astra may add */
body.ast-page-builder-template .entry-content {
    max-width: 100%;
    padding: 0;
}

/* Hide sidebar HTML if Astra still renders it (belt-and-suspenders) */
body.ast-page-builder-template #secondary,
body.ast-page-builder-template #secondary.widget-area {
    display: none;
}

/* ================================================================
   SINGLE LAYOUT (main + sidebar)
   ============================================================= */

/*
 * All wrapper divs in the plugin's single layout are intentionally
 * width: 100% with zero margin/padding. .krx-container is the only
 * element that applies max-width and centering — applied identically
 * inside .krx-hero and .krx-single-body so both have the same left edge.
 */
.krx-single-layout {
    font-family: var(--krx-font);
    width: 100%;
    margin: 0;
    padding: 0;
}

/*
 * Full-width wrapper only — no max-width, no centering.
 * .krx-container inside it handles max-width + centering, matching
 * the .krx-container used inside .krx-hero for pixel-perfect alignment.
 */
.krx-single-body {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

/*
 * Grid + spacing container.
 * Horizontal padding is intentionally 0 on desktop so sections fill
 * the full 1366px without exposing the page background on the sides.
 * On mobile, padding-x is added via responsive rule below.
 */
.krx-inner {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 36px;
    align-items: start;
    padding: 36px 0 60px;
}

.krx-single-main {
    min-width: 0; /* prevents grid blowout */
    width: 100%;
    margin: 0;
    padding: 0;
}

.krx-single-sidebar {
    position: sticky;
    top: 24px;
}

/* ================================================================
   SECTION TITLE
   ============================================================= */
.krx-section-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--krx-primary);
    margin: 0 0 20px;
    padding-left: 14px;
    border-left: 4px solid var(--krx-accent);
    display: block;
}

/* ================================================================
   SUMMARY CARD
   ============================================================= */
.krx-summary-card {
    position: relative;
    background: linear-gradient(135deg, var(--krx-white) 0%, var(--krx-bg) 100%);
    border: 1px solid var(--krx-border);
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: 0 1px 3px rgba(11,37,69,.07), 0 4px 14px rgba(11,37,69,.05);
    overflow: hidden;
}

/* Decorative accent shape — purely visual, clip-path avoids border-radius on UI */
.krx-summary-card__deco {
    display: block;
    position: absolute;
    top: -72px;
    right: -72px;
    width: 200px;
    height: 200px;
    background: rgba(0, 83, 152, 0.06);
    clip-path: circle(50%);
    pointer-events: none;
}

.krx-summary-card__layout {
    display: flex;
    align-items: stretch;
    position: relative;
    z-index: 1;
}

/* ── Main block: Investment ──────────────────────────────────── */
.krx-summary-main {
    flex: 0 0 40%;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding-right: 32px;
}

.krx-summary-main__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--krx-accent);
    margin: 0 0 6px;
}

.krx-summary-main__eyebrow svg {
    flex-shrink: 0;
}

.krx-summary-main__price {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--krx-primary);
    line-height: 1.1;
    letter-spacing: -.025em;
    margin: 0;
}

.krx-summary-main__price-alt {
    font-size: .95rem;
    font-weight: 500;
    color: var(--krx-text-light);
    margin: 0;
    line-height: 1.5;
}

.krx-summary-main__note {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 10px 0 0;
    font-size: .78rem;
    color: var(--krx-text-light);
    line-height: 1.4;
}

.krx-summary-main__note svg {
    color: var(--krx-success);
    flex-shrink: 0;
}

/* ── Side block: Financing + Maintenance ────────────────────── */
.krx-summary-side {
    flex: 0 0 60%;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    padding-left: 32px;
    border-left: 1px solid var(--krx-border);
}

.krx-summary-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 20px;
}

.krx-summary-item:first-child {
    padding-left: 0;
    border-right: 1px solid var(--krx-border);
}

.krx-summary-item:last-child {
    padding-right: 0;
}

.krx-summary-item__label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--krx-text-muted);
    line-height: 1;
}

.krx-summary-item__label svg {
    flex-shrink: 0;
    color: var(--krx-accent);
}

.krx-summary-item__value {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    font-size: .95rem;
    font-weight: 700;
    color: var(--krx-text);
    line-height: 1.35;
}

.krx-summary-item__value svg {
    color: var(--krx-accent);
    flex-shrink: 0;
    margin-top: 2px;
}

.krx-summary-item__value--plain {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* ================================================================
   DESCRIPTION BLOCK
   ============================================================= */
.krx-description-block {
    margin-bottom: 32px;
}

.krx-description-content {
    font-size: .95rem;
    line-height: 1.75;
    color: var(--krx-text-light);
}

.krx-description-content p {
    margin: 0 0 16px;
}

/* ================================================================
   FEATURES
   ============================================================= */
.krx-features {
    margin-bottom: 32px;
    padding: 24px 0;
    border-top: 1px solid var(--krx-border);
    border-bottom: 1px solid var(--krx-border);
}

.krx-features__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.krx-features__item {
    text-align: center;
}

.krx-features__icon {
    color: var(--krx-accent);
    margin-bottom: 8px;
}

.krx-features__label {
    display: block;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--krx-text-muted);
    margin-bottom: 4px;
}

.krx-features__value {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--krx-text);
}

/* ================================================================
   AMENITIES
   ============================================================= */
.krx-amenities {
    margin-bottom: 36px;
}

.krx-amenities__description {
    font-size: .95rem;
    color: var(--krx-text-light);
    line-height: 1.7;
    margin: 0 0 20px;
}

.krx-amenities__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.krx-amenities__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--krx-bg);
    border-radius: 0;
    transition: background var(--krx-transition);
}

.krx-amenities__item:hover {
    background: #e8ecf2;
}

.krx-amenities__icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.krx-amenities__icon svg {
    width: 7px;
    height: 18px;
}

.krx-amenities__text {
    font-size: .9rem;
    font-weight: 500;
    color: var(--krx-text);
}

/* ================================================================
   GALLERY
   ============================================================= */
.krx-gallery-block {
    margin-bottom: 36px;
}

.krx-gallery-block__header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.krx-gallery-block__header .krx-section-title {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.krx-gallery-tabs {
    display: flex;
    gap: 4px;
    margin-left: 16px;
}

.krx-gallery-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    font-size: .8rem;
    font-weight: 500;
    font-family: var(--krx-font);
    color: var(--krx-text-light);
    background: transparent;
    border: 1px solid var(--krx-border);
    border-radius: 0;
    cursor: pointer;
    transition: all var(--krx-transition);
}

.krx-gallery-tab:hover {
    color: #ffffff;
    border-color: var(--krx-accent);
}

.krx-gallery-tab--active {
    color: var(--krx-white);
    background: var(--krx-accent);
    border-color: var(--krx-accent);
}

.krx-gallery-block__viewall {
    margin-left: auto;
    font-size: .85rem;
    font-weight: 600;
    color: var(--krx-accent);
    text-decoration: none;
}

.krx-gallery-block__viewall:hover {
    text-decoration: underline;
}

.krx-gallery-panel {
    display: none;
}

.krx-gallery-panel--active {
    display: block;
}

.krx-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto;
    gap: 10px;
}

.krx-gallery-grid__item {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 0;
    aspect-ratio: 4 / 3;
}

.krx-gallery-grid__item--main {
    grid-row: 1 / 3;
    aspect-ratio: auto;
}

.krx-gallery-grid__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s cubic-bezier(.4,0,.2,1);
}

.krx-gallery-grid__item:hover img {
    transform: scale(1.06);
}

/* Padded cells: fill empty grid slots with a visual repeat — no interaction */
.krx-gallery-grid__item--padded {
    cursor: default;
    pointer-events: none;
}

.krx-gallery-grid__item--padded img {
    opacity: .55;
    filter: saturate(.6);
}

.krx-gallery-grid__item--padded:hover img {
    transform: none;
}

.krx-gallery-grid__more {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(11,37,69,.65);
    color: var(--krx-white);
    font-size: 1.1rem;
    font-weight: 700;
}

/* Lightbox Overlay */
.krx-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0,0,0,.92);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all .3s ease;
}

.krx-lightbox--open {
    opacity: 1;
    visibility: visible;
}

.krx-lightbox__img {
    max-width: 90vw;
    max-height: 88vh;
    border-radius: 0;
    box-shadow: 0 0 60px rgba(0,0,0,.5);
}

.krx-lightbox__close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: none;
    border: none;
    color: var(--krx-white);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 8px;
}

.krx-lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,.15);
    border: none;
    color: var(--krx-white);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 12px 16px;
    border-radius: 0;
    transition: background var(--krx-transition);
}

.krx-lightbox__nav:hover {
    background: rgba(255,255,255,.3);
}

.krx-lightbox__nav--prev {
    left: 20px;
}

.krx-lightbox__nav--next {
    right: 20px;
}

.krx-lightbox__counter {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,.6);
    font-size: .85rem;
    font-family: var(--krx-font);
}

/* ================================================================
   VIDEO / TOUR EMBED
   ============================================================= */
.krx-video-embed,
.krx-tour-embed {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: 0;
    overflow: hidden;
    background: #000;
}

.krx-video-embed iframe,
.krx-video-embed video,
.krx-video-embed .krx-video-placeholder,
.krx-tour-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ================================================================
   LOCATION
   ============================================================= */
.krx-location {
    margin-bottom: 36px;
}

.krx-location__wrapper {
    position: relative;
    border-radius: 0;
    overflow: hidden;
}

.krx-location__map {
    width: 100%;
    min-height: 350px;
    border-radius: 0;
    overflow: hidden;
}

.krx-location__map iframe {
    width: 100%;
    min-height: 350px;
    border: 0;
    display: block;
}

.krx-location__card {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: var(--krx-white);
    border-radius: 0;
    padding: 18px 22px;
    box-shadow: var(--krx-shadow-lg);
    max-width: 320px;
    z-index: 2;
}

.krx-location__card-title {
    font-size: .85rem;
    font-weight: 700;
    color: var(--krx-primary);
    margin: 0 0 6px;
}

.krx-location__card-text {
    font-size: .82rem;
    color: var(--krx-text-light);
    margin: 0 0 10px;
    line-height: 1.5;
}

.krx-location__link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .8rem;
    font-weight: 600;
    color: var(--krx-accent);
    text-decoration: none;
}

.krx-location__link:hover {
    text-decoration: underline;
}

/* ================================================================
   SIDEBAR FORM
   ============================================================= */
.krx-sidebar-form {
    background: var(--krx-white);
    border: 1px solid var(--krx-border);
    border-radius: 0;
    padding: 28px 24px 24px;
    box-shadow: var(--krx-shadow-sm);
    margin-bottom: 20px;
}

.krx-sidebar-form__title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--krx-primary);
    margin: 0 0 6px;
}

.krx-sidebar-form__desc {
    font-size: .88rem;
    color: var(--krx-text-light);
    margin: 0 0 20px;
    line-height: 1.5;
}

.krx-form__group {
    margin-bottom: 16px;
}

.krx-form__label {
    display: block;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--krx-text-light);
    margin-bottom: 6px;
}

.krx-form__input {
    width: 100%;
    padding: 10px 14px;
    font-size: .92rem;
    font-family: var(--krx-font);
    color: var(--krx-text);
    background: var(--krx-bg);
    border: 1px solid var(--krx-border);
    border-radius: 0;
    transition: border-color var(--krx-transition), box-shadow var(--krx-transition);
}

/* Specificity boost — neutralises Astra's border-radius override (0,1,0 → 0,2,0) */
.krx-form .krx-form__input,
.krx-form .krx-form__select {
    border-radius: 0;
}

.krx-form__input:focus {
    outline: none;
    border-color: var(--krx-accent);
    box-shadow: 0 0 0 3px rgba(21,101,192,.12);
}

.krx-form__input--error {
    border-color: #c62828;
}

.krx-form__select {
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}

.krx-form__group--checkbox {
    margin-top: 8px;
}

.krx-form__checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: .70rem;
    color: var(--krx-text-light);
    cursor: pointer;
    line-height: 1.4;
}

.krx-form__checkbox-label input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--krx-accent);
}

/*
 * .krx-btn--submit: <button> → Astra styles it via button:not(.menu-toggle).
 * We only add layout overrides: full-width block inside sidebar form.
 */
.krx-btn--submit {
    display: block;
    width: 100%;
    text-align: center;
    justify-content: center;
    margin-top: 4px;
}

/* Disabled state: functional, not cosmetic — must stay. */
.krx-btn--submit:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.krx-form__message {
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: 0;
    font-size: .85rem;
    font-weight: 500;
    text-align: center;
}

.krx-form__message--success {
    background: #e8f5e9;
    color: var(--krx-success);
    border: 1px solid #c8e6c9;
}

.krx-form__message--error {
    background: #fbe9e7;
    color: #c62828;
    border: 1px solid #ffccbc;
}

/* ================================================================
   CTA BUTTONS (sidebar)
   ============================================================= */
.krx-cta-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/*
 * .krx-btn--brochure: outline variant — transparent bg, accent border/text.
 * Uses Astra's primary color variable (auto-syncs with Customizer).
 * Border-radius, padding, font-* come from Astra's ast-button class.
 */
.krx-btn--brochure {
    background: transparent;
    color: var(--ast-global-color-0, var(--krx-accent));
    border-color: var(--ast-global-color-0, var(--krx-accent));
    justify-content: center;
}

.krx-btn--brochure:hover {
    background: var(--ast-global-color-0, var(--krx-accent));
    color: #ffffff;
    text-decoration: none;
}

/*
 * .krx-btn--plans: outline variant identical to brochure.
 */
.krx-btn--plans {
    background: transparent;
    color: var(--ast-global-color-0, var(--krx-accent));
    border-color: var(--ast-global-color-0, var(--krx-accent));
    justify-content: center;
}

.krx-btn--plans:hover {
    background: var(--ast-global-color-0, var(--krx-accent));
    color: #ffffff;
    text-decoration: none;
}

/*
 * .krx-btn--whatsapp: brand color — must stay (#25D366).
 * Shape/size (border-radius, padding, font-*) comes from Astra's ast-button.
 */
.krx-btn--whatsapp {
    background: #25D366;
    border-color: #25D366;
    color: #ffffff;
    justify-content: center;
}

.krx-btn--whatsapp:hover {
    background: #1eb851;
    border-color: #1eb851;
    color: #ffffff;
    text-decoration: none;
}

/* ================================================================
   MAPS LINK
   ============================================================= */
.krx-maps-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .85rem;
    font-weight: 600;
    color: var(--krx-accent);
    text-decoration: none;
}

.krx-maps-link:hover {
    text-decoration: underline;
}

/* ================================================================
   GALLERY IMAGES (simple grid)
   ============================================================= */
.krx-gallery-images {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.krx-gallery-img {
    width: 100%;
    height: auto;
    border-radius: 0;
    object-fit: cover;
    aspect-ratio: 4 / 3;
}

/* ================================================================
   AMENITIES LIST (simple shortcode)
   ============================================================= */
.krx-amenities-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.krx-amenity {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .9rem;
}

/* ================================================================
   RESPONSIVE
   ============================================================= */
@media (max-width: 1024px) {
    /* Grid moves to single column — target .krx-inner (grid container) */
    .krx-inner {
        grid-template-columns: 1fr;
    }

    .krx-single-sidebar {
        position: static;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }

    .krx-hero__title {
        font-size: 2.2rem;
    }

}

@media (max-width: 768px) {
    .krx-grid--cols-3,
    .krx-grid--cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .krx-search__form {
        flex-direction: column;
        gap: 12px;
    }

    .krx-search__field {
        min-width: 100%;
    }

    .krx-search__action {
        width: 100%;
    }

    .krx-btn--search {
        width: 100%;
        justify-content: center;
    }

    .krx-listing-cta {
        flex-direction: column;
        text-align: center;
        padding: 36px 24px;
    }

    .krx-listing-cta__actions {
        width: 100%;
        flex-direction: column;
    }

    .krx-listing-cta__actions .krx-btn {
        justify-content: center;
    }

    .krx-listing__title {
        font-size: 1.8rem;
    }

    .krx-hero {
        min-height: 320px;
    }

    .krx-hero__title {
        font-size: 1.8rem;
    }

    .krx-summary-card {
        padding: 24px 20px;
    }

    .krx-summary-card__layout {
        flex-direction: column;
        gap: 0;
    }

    .krx-summary-main {
        padding-right: 0;
        padding-bottom: 24px;
        border-bottom: 1px solid var(--krx-border);
        margin-bottom: 24px;
    }

    .krx-summary-main__price {
        font-size: 1.85rem;
    }

    .krx-summary-side {
        flex-direction: row;
        padding-left: 0;
        border-left: none;
    }

    .krx-summary-item:first-child {
        padding-left: 0;
    }

    .krx-features__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .krx-amenities__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .krx-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .krx-gallery-grid__item--main {
        grid-column: 1 / -1;
        grid-row: auto;
        aspect-ratio: 16 / 9;
    }

    .krx-single-sidebar {
        grid-template-columns: 1fr;
    }

    .krx-amenities-list,
    .krx-gallery-images {
        grid-template-columns: repeat(2, 1fr);
    }

    .krx-location__card {
        position: relative;
        bottom: auto;
        left: auto;
        max-width: 100%;
        margin-top: 12px;
        box-shadow: var(--krx-shadow-sm);
    }
}

@media (max-width: 480px) {
    .krx-grid--cols-2,
    .krx-grid--cols-3,
    .krx-grid--cols-4 {
        grid-template-columns: 1fr;
    }

    .krx-summary-side {
        flex-direction: column;
        gap: 20px;
    }

    .krx-summary-item {
        padding: 0;
    }

    .krx-summary-item:first-child {
        border-right: none;
        padding-bottom: 20px;
        border-bottom: 1px solid var(--krx-border);
    }

    .krx-hero__title {
        font-size: 1.5rem;
    }

    .krx-features__grid {
        grid-template-columns: 1fr 1fr;
    }

    .krx-amenities__grid {
        grid-template-columns: 1fr;
    }

    .krx-gallery-grid {
        grid-template-columns: 1fr;
    }
}

/* ================================================================
   ACCESSIBILITY — Respect user's motion preference
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
    .krx-card,
    .krx-card__thumb,
    .krx-gallery-grid__item img,
    .krx-btn,
    .krx-btn--card,
    .krx-btn--search,
    .krx-btn--submit,
    .krx-gallery-tab,
    .krx-lightbox,
    .krx-amenities__item,
    .krx-search__select,
    .krx-form__input,
    .krx-location__link {
        transition: none !important;
        animation: none !important;
    }

    .krx-card:hover {
        transform: none;
    }

    .krx-card:hover .krx-card__img-wrap .krx-card__thumb,
    .krx-gallery-grid__item:hover img {
        transform: none;
    }

}
