/* ============================================================
   PRICE ESTIMATOR
   Gold "Get a price" button (bottom left) and the step-by-step
   window built by assets/js/estimator.js. Brand colours only.
   ============================================================ */

.est-root {
    --est-green: #1a3c34;
    --est-green-2: #2a5c50;
    --est-gold: #ffd700;
    --est-bg: #ffffff;
    --est-soft: #f6f8f7;
    --est-text: #1f2a27;
    --est-muted: #64748b;
    --est-border: #e2e8f0;
}

[data-theme="dark"] .est-root {
    --est-bg: #16213e;
    --est-soft: #1b2a4a;
    --est-text: #e8ecef;
    --est-muted: #a0a0b0;
    --est-border: #2a3a5c;
}

/* ---------- Launcher ---------- */
/* Rests as a round icon; grows to show its label on hover, on keyboard
   focus, and every few seconds (the script adds .is-expanded) */
.est-fab {
    position: fixed;
    left: 20px;
    bottom: 24px;
    z-index: 998;
    display: inline-flex;
    align-items: center;
    padding: 8px;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, #ffd700, #f5c800);
    color: #1a3c34;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.4), 0 0 0 0 rgba(255, 215, 0, 0.5);
    animation: est-pulse 2.8s ease-out infinite;
    transition: transform 0.3s ease, padding 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.est-fab:hover {
    transform: translateY(-3px);
}

.est-fab .est-fab-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #1a3c34;
    color: #ffd700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    transition: transform 0.5s ease;
}

.est-fab .est-fab-text {
    display: inline-block;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    margin-left: 0;
    transition: max-width 0.5s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.35s ease, margin 0.5s ease;
}

.est-fab:hover,
.est-fab:focus-visible,
.est-fab.is-expanded {
    padding-right: 20px;
}

.est-fab:hover .est-fab-text,
.est-fab:focus-visible .est-fab-text,
.est-fab.is-expanded .est-fab-text {
    max-width: 180px;
    opacity: 1;
    margin-left: 10px;
}

/* The icon gives a small turn as the label appears */
.est-fab:hover .est-fab-icon,
.est-fab.is-expanded .est-fab-icon {
    transform: rotate(-12deg);
}

@keyframes est-pulse {
    0% { box-shadow: 0 10px 30px rgba(255, 215, 0, 0.4), 0 0 0 0 rgba(255, 215, 0, 0.55); }
    70% { box-shadow: 0 10px 30px rgba(255, 215, 0, 0.4), 0 0 0 16px rgba(255, 215, 0, 0); }
    100% { box-shadow: 0 10px 30px rgba(255, 215, 0, 0.4), 0 0 0 0 rgba(255, 215, 0, 0); }
}

/* ---------- Window ---------- */
.est-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    background: rgba(10, 25, 21, 0.6);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.est-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.est-modal {
    width: 100%;
    max-width: 640px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    background: var(--est-bg);
    color: var(--est-text);
    border-radius: 24px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.35);
    transform: translateY(24px) scale(0.97);
    transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
    font-family: 'Poppins', sans-serif;
}

.est-overlay.is-open .est-modal {
    transform: none;
}

.est-head {
    position: relative;
    padding: 26px 28px 22px;
    background:
        radial-gradient(circle at 90% 0%, rgba(255, 215, 0, 0.28), transparent 45%),
        linear-gradient(135deg, var(--est-green), var(--est-green-2));
    color: #fff;
    border-radius: 24px 24px 0 0;
}

.est-head h3 {
    margin: 0;
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.est-head h3 i {
    color: var(--est-gold);
    margin-right: 8px;
}

.est-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease;
}

.est-close:hover {
    background: var(--est-gold);
    color: var(--est-green);
}

/* Progress: three dots joined by a line */
.est-steps {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
}

.est-steps span {
    height: 4px;
    flex: 1;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.2);
    transition: background 0.4s ease;
}

.est-steps span.is-done {
    background: var(--est-gold);
}

.est-body {
    padding: 24px 28px 28px;
}

.est-question {
    font-weight: 700;
    font-size: 1.05rem;
    margin: 0 0 16px;
    color: var(--est-text);
}

.est-panel {
    animation: est-in 0.4s ease both;
}

@keyframes est-in {
    from { opacity: 0; transform: translateX(16px); }
    to { opacity: 1; transform: none; }
}

/* ---------- Step 1: services ---------- */
.est-services {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
}

.est-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 16px;
    border: 2px solid var(--est-border);
    border-radius: 16px;
    background: var(--est-soft);
    color: var(--est-text);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.est-option:hover,
.est-option:focus-visible {
    outline: none;
    border-color: var(--est-gold);
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(26, 60, 52, 0.12);
}

.est-option .est-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--est-green), var(--est-green-2));
    color: var(--est-gold);
    font-size: 1.05rem;
}

.est-option strong {
    font-size: 0.95rem;
}

.est-option small {
    color: var(--est-muted);
    font-size: 0.78rem;
}

/* ---------- Step 2: packages ---------- */
.est-packages {
    display: grid;
    gap: 12px;
}

.est-package {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 16px;
    align-items: center;
    padding: 16px 18px;
    border: 2px solid var(--est-border);
    border-radius: 16px;
    background: var(--est-soft);
    color: var(--est-text);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.est-package:hover,
.est-package:focus-visible {
    outline: none;
    border-color: var(--est-gold);
    transform: translateX(4px);
    box-shadow: 0 12px 30px rgba(26, 60, 52, 0.12);
}

.est-package strong {
    font-size: 0.98rem;
}

.est-package .est-price-small {
    font-weight: 700;
    color: var(--est-green-2);
    font-size: 0.85rem;
    white-space: nowrap;
}

[data-theme="dark"] .est-package .est-price-small {
    color: var(--est-gold);
}

.est-package p {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--est-muted);
    font-size: 0.8rem;
    line-height: 1.5;
}

.est-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 10px;
    border-radius: 50px;
    background: var(--est-gold);
    color: var(--est-green);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    vertical-align: middle;
}

/* ---------- Step 3: result ---------- */
.est-result {
    text-align: center;
}

.est-result-label {
    color: var(--est-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
}

.est-amount {
    margin: 10px 0 6px;
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.7rem, 6vw, 2.4rem);
    font-weight: 700;
    line-height: 1.2;
    background: linear-gradient(135deg, #e6b800, #ffd700 50%, #c9a800);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.est-chosen {
    font-weight: 600;
    color: var(--est-text);
}

.est-time {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 8px 16px;
    border-radius: 50px;
    background: var(--est-soft);
    border: 1px solid var(--est-border);
    font-size: 0.85rem;
}

.est-time i {
    color: #e6b800;
}

.est-note {
    margin: 18px auto 0;
    max-width: 460px;
    color: var(--est-muted);
    font-size: 0.78rem;
    line-height: 1.6;
}

.est-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 22px;
}

.est-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 24px;
    border-radius: 50px;
    border: none;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.est-btn:hover {
    transform: translateY(-2px);
}

.est-btn-wa {
    background: #25d366;
    color: #fff;
    box-shadow: 0 10px 24px rgba(37, 211, 102, 0.35);
}

.est-btn-wa:hover {
    color: #fff;
}

.est-btn-gold {
    background: var(--est-gold);
    color: var(--est-green);
    box-shadow: 0 10px 24px rgba(255, 215, 0, 0.35);
}

.est-btn-gold:hover {
    color: var(--est-green);
}

.est-link {
    margin-top: 18px;
    background: none;
    border: none;
    color: var(--est-muted);
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}

.est-link:hover {
    color: var(--est-text);
}

.est-link i {
    margin-right: 6px;
}

@media (max-width: 576px) {
    .est-fab {
        left: 12px;
        bottom: 14px;
        padding: 7px;
        font-size: 0.82rem;
    }

    .est-fab:hover,
    .est-fab:focus-visible,
    .est-fab.is-expanded {
        padding-right: 16px;
    }

    .est-head {
        padding: 22px 20px 18px;
    }

    .est-head h3 {
        font-size: 1.25rem;
        padding-right: 40px;
    }

    .est-body {
        padding: 20px;
    }

    .est-services {
        grid-template-columns: 1fr 1fr;
    }

    .est-package {
        grid-template-columns: 1fr;
    }

    .est-actions .est-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .est-fab,
    .est-panel {
        animation: none;
    }
}
