/* ==========================================================================
   Nearby Annexe Configurator — Stylesheet
   Layers on top of nearby.css. Uses theme.css tokens (--bg, --ink, --accent).
   ========================================================================== */

/* Hide the WP page title / entry-header on pages hosting the configurator
   — the configurator provides its own header block. */
body.mol-hide-page-title .entry-header,
body.mol-hide-page-title .entry-title {
    display: none !important;
}

.mol-configurator {
    max-width: var(--container);
    margin: 0 auto;
    padding: 3rem 2rem 5rem;
    font-family: var(--font);
    color: var(--ink);
}

/* Fallback shown before boot & to no-JS users */
.mol-configurator-noscript-fallback { text-align: center; padding: 4rem 0; }
.mol-configurator-noscript-fallback .mol-configurator-header h1 {
    font-size: 1.5rem; font-weight: 700; margin: 1rem 0; color: var(--muted);
}
.mol-configurator-fallback-card {
    background: var(--dark-card); color: #fff;
    padding: 2rem; border-radius: var(--radius-lg);
    max-width: 480px; margin: 2rem auto;
}
.mol-configurator-fallback-card h2 { font-weight: 700; margin: 0 0 0.5rem; }
.mol-configurator-fallback-price { font-size: 2rem; font-weight: 700; margin-bottom: 1.5rem; }

/* Once JS boots, the fallback is removed via innerHTML replace */

/* ==========================================================================
   HEADER
   ========================================================================== */
.mol-cfg-header { text-align: center; margin-bottom: 2rem; }
.mol-cfg-header h1 {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 1rem 0 0.75rem;
}
.mol-cfg-header p {
    color: var(--muted);
    max-width: 640px;
    margin: 0 auto;
    font-size: 1rem;
    line-height: 1.55;
}

/* ==========================================================================
   MODE TOGGLE (Buy / Rent)
   ========================================================================== */
.mol-cfg-modes {
    display: inline-flex;
    background: var(--bg-alt);
    padding: 6px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--line);
    margin: 0 auto 2.5rem;
    display: flex;
    max-width: 340px;
}
.mol-cfg-mode {
    flex: 1;
    padding: 0.7rem 1.25rem;
    border: none;
    background: transparent;
    color: var(--muted);
    font-weight: 600;
    font-size: 0.95rem;
    font-family: var(--font);
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all 0.15s ease;
}
.mol-cfg-mode.is-active {
    background: var(--ink);
    color: var(--bg);
}
.mol-cfg-mode:not(.is-active):hover { color: var(--ink); }

/* ==========================================================================
   MAIN GRID — preview left, options right
   ========================================================================== */
.mol-cfg-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 2.5rem;
    align-items: start;
}
@media (max-width: 960px) {
    .mol-cfg-grid { grid-template-columns: 1fr; gap: 2rem; }
}

.mol-cfg-preview-col { position: sticky; top: 2rem; }
@media (max-width: 960px) { .mol-cfg-preview-col { position: static; } }

/* ==========================================================================
   PREVIEW SVG
   ========================================================================== */
.mol-cfg-preview {
    background: var(--bg-alt);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--line);
    overflow: hidden;
}
.mol-cfg-preview svg {
    width: 100%; height: auto;
    display: block;
    border-radius: var(--radius-md);
}

/* Install timeline strip under preview */
.mol-cfg-timeline {
    margin-top: 1rem;
    background: var(--dark-card);
    color: #fff;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
}
.mol-cfg-timeline-inner {
    display: flex; align-items: baseline; gap: 0.75rem;
    flex-wrap: wrap;
}
.mol-cfg-timeline-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.55);
}
.mol-cfg-timeline strong {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}
.mol-cfg-timeline-lead {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.6);
    margin-left: auto;
}

/* ==========================================================================
   PRICE SUMMARY
   ========================================================================== */
.mol-cfg-price-summary {
    background: var(--dark-card);
    color: #fff;
    padding: 1.75rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
}
.mol-cfg-price-eyebrow {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.6);
}
.mol-cfg-price-main {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0.4rem 0 0.5rem;
}
.mol-cfg-price-finance {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.75);
}
.mol-cfg-apr {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
    display: block;
    margin-top: 0.25rem;
}
.mol-cfg-price-rental {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0.4rem 0 0.75rem;
}
.mol-cfg-price-rental span {
    color: #fff;
}
.mol-cfg-price-buyout {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.75);
    line-height: 1.5;
    padding: 0.75rem 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 0.75rem;
}
.mol-cfg-price-buyout strong { color: #fff; font-weight: 700; }
.mol-cfg-price-total {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.55);
    padding-top: 0.5rem;
}

/* Price breakdown accordion */
.mol-cfg-breakdown {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.mol-cfg-breakdown summary {
    cursor: pointer;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
    font-weight: 600;
    list-style: none;
    position: relative;
    padding-left: 1.25rem;
}
.mol-cfg-breakdown summary::-webkit-details-marker { display: none; }
.mol-cfg-breakdown summary::before {
    content: '▸';
    position: absolute; left: 0;
    transition: transform 0.15s ease;
}
.mol-cfg-breakdown[open] summary::before { transform: rotate(90deg); }
.mol-cfg-breakdown ul {
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
    display: flex; flex-direction: column; gap: 0.4rem;
}
.mol-cfg-breakdown li {
    display: flex; justify-content: space-between;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.85);
}
.mol-cfg-breakdown li strong { color: #fff; font-weight: 600; }

.mol-cfg-price-terms {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.65);
    padding-top: 0.25rem;
}

.mol-cfg-field-label {
    font-size: 0.75rem; font-weight: 600;
    letter-spacing: 0.1em; text-transform: uppercase;
    color: rgba(255,255,255,0.6);
    display: block; margin-bottom: 0.5rem;
}

/* Anniversary buy-out schedule */
.mol-cfg-anniversary {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.mol-cfg-anniversary-head { margin-bottom: 0.75rem; }
.mol-cfg-anniversary-head .mol-cfg-field-label { margin-bottom: 0.25rem; }
.mol-cfg-anniversary-note {
    display: block;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.6);
    line-height: 1.4;
}
.mol-cfg-anniversary-rows {
    display: flex; flex-direction: column;
    gap: 0.4rem;
}
.mol-cfg-anniversary-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    padding: 0.75rem;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    align-items: center;
}
.mol-cfg-anniversary-when {
    display: flex; flex-direction: column;
    gap: 0.1rem;
}
.mol-cfg-anniversary-when strong {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
}
.mol-cfg-anniversary-when span {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.mol-cfg-anniversary-price {
    text-align: right;
    display: flex; flex-direction: column;
    gap: 0.1rem;
}
.mol-cfg-anniversary-price strong {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
}
.mol-cfg-anniversary-price span {
    font-size: 0.75rem;
    color: rgba(127, 217, 127, 0.85);
    font-weight: 600;
}

/* ==========================================================================
   OPTIONS PANEL
   ========================================================================== */
.mol-cfg-options {
    background: var(--bg-alt);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    margin-bottom: 1.5rem;
}

.mol-cfg-section h3 {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0 0 0.75rem;
}
.mol-cfg-field-note {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 0 0 0.75rem;
    line-height: 1.4;
}
.mol-cfg-field-note-alt {
    font-size: 0.8rem;
    color: var(--muted);
    margin: 0.5rem 0 0;
}

/* Toggle rows (finish type, bedrooms) */
.mol-cfg-toggle-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}
.mol-cfg-toggle {
    padding: 0.9rem 1rem;
    background: var(--bg);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: left;
    font-family: var(--font);
    display: flex; flex-direction: column;
    gap: 0.2rem;
    transition: all 0.15s ease;
}
.mol-cfg-toggle strong {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ink);
}
.mol-cfg-toggle span {
    font-size: 0.8rem;
    color: var(--muted);
}
.mol-cfg-toggle:hover { border-color: var(--line-strong); }
.mol-cfg-toggle.is-active {
    background: var(--dark-card);
    border-color: var(--accent);
}
.mol-cfg-toggle.is-active strong { color: #fff; }
.mol-cfg-toggle.is-active span { color: rgba(255,255,255,0.7); }

/* Swatches (finish + kitchen colours) */
.mol-cfg-swatches {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.mol-cfg-swatch {
    padding: 0.6rem 0.4rem;
    background: var(--bg);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font);
    display: flex; flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.15s ease;
}
.mol-cfg-swatch:hover { border-color: var(--line-strong); }
.mol-cfg-swatch.is-active {
    border-color: var(--accent);
    background: var(--accent-soft);
}
.mol-cfg-swatch-dot {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: inset 0 -3px 6px rgba(0,0,0,0.1);
}
.mol-cfg-swatch-label {
    font-size: 0.75rem;
    color: var(--ink);
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
}

/* Stepper (heaters) */
.mol-cfg-stepper {
    display: inline-flex;
    align-items: center;
    background: var(--bg);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-pill);
    padding: 4px;
}
.mol-cfg-stepper-btn {
    width: 40px; height: 40px;
    border: none;
    background: transparent;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--ink);
    cursor: pointer;
    border-radius: 50%;
    font-family: var(--font);
    transition: background 0.15s ease;
}
.mol-cfg-stepper-btn:hover { background: var(--line); }
.mol-cfg-stepper-val {
    min-width: 40px;
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
}

/* A/C toggle button — behaves as a checkbox but built from a button */
.mol-cfg-ac-toggle {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1rem;
    background: var(--bg);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: left;
    font-family: var(--font);
    width: 100%;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.mol-cfg-ac-toggle:hover { border-color: var(--line-strong); }
.mol-cfg-ac-toggle.is-active {
    border-color: var(--accent);
    background: var(--accent-soft);
}
.mol-cfg-ac-fake {
    width: 22px; height: 22px;
    border-radius: 6px;
    border: 2px solid var(--line-strong);
    background: #fff;
    flex-shrink: 0;
    position: relative;
    transition: all 0.15s ease;
    margin-top: 2px;
}
.mol-cfg-ac-toggle.is-active .mol-cfg-ac-fake {
    background: var(--accent);
    border-color: var(--accent);
}
.mol-cfg-ac-toggle.is-active .mol-cfg-ac-fake::after {
    content: '';
    position: absolute;
    left: 5px; top: 1px;
    width: 6px; height: 12px;
    border: solid #fff;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}
.mol-cfg-ac-label { display: flex; flex-direction: column; gap: 0.15rem; }
.mol-cfg-ac-label strong { font-size: 0.95rem; font-weight: 700; }
.mol-cfg-ac-label span { font-size: 0.85rem; color: var(--muted); }

/* Model switcher */
.mol-cfg-section-model {
    border-top: 1px solid var(--line);
    padding-top: 1.75rem;
    margin-top: 0.25rem;
}
.mol-cfg-model-switch {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}
.mol-cfg-model-btn {
    padding: 0.75rem 0.5rem;
    background: var(--bg);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font);
    display: flex; flex-direction: column;
    gap: 0.2rem;
    transition: all 0.15s ease;
}
.mol-cfg-model-btn strong {
    font-size: 0.9rem;
    font-weight: 700;
}
.mol-cfg-model-btn span {
    font-size: 0.75rem;
    color: var(--muted);
}
.mol-cfg-model-btn.is-active {
    border-color: var(--accent);
    background: var(--accent-soft);
}

/* ==========================================================================
   RESERVE CTA
   ========================================================================== */
.mol-cfg-reserve {
    display: flex; align-items: center; justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1.25rem 1.5rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-pill);
    font-family: var(--font);
    font-weight: 700;
    font-size: 1.05rem;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
}
.mol-cfg-reserve:hover { transform: translateY(-1px); background: #1a6f1a; }
.mol-cfg-reserve:disabled { opacity: 0.6; cursor: wait; transform: none; }
.mol-cfg-reserve-note {
    font-size: 0.8rem;
    color: var(--muted);
    text-align: center;
    margin: 0.75rem 0 0;
    line-height: 1.4;
}

/* ==========================================================================
   STICKY BAR
   ========================================================================== */
.mol-cfg-sticky {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--dark-card);
    color: #fff;
    padding: 0.85rem 1rem;
    z-index: 100;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.mol-cfg-sticky.is-visible { transform: translateY(0); }
.mol-cfg-sticky-inner {
    max-width: var(--container);
    margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem;
}
.mol-cfg-sticky-info { display: flex; flex-direction: column; }
.mol-cfg-sticky-info strong { font-size: 1.05rem; font-weight: 700; }
.mol-cfg-sticky-info span { font-size: 0.8rem; color: rgba(255,255,255,0.65); }
.mol-cfg-sticky-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: var(--font);
}
.mol-cfg-sticky-btn:disabled { opacity: 0.6; cursor: wait; }

/* ==========================================================================
   MOBILE
   ========================================================================== */
@media (max-width: 640px) {
    .mol-configurator { padding: 2rem 1.25rem 6rem; }
    .mol-cfg-price-main { font-size: 2rem; }
    .mol-cfg-price-rental { font-size: 1.25rem; }
    .mol-cfg-options { padding: 1.25rem; }
    .mol-cfg-model-switch { grid-template-columns: 1fr; }
}
