/* ============================================================
   Website For Sale Popup - Reusable Component Styles
   All selectors are prefixed with "wfs-" to avoid conflicts.
   Wording, price and behaviour are configured in website-for-sale.php.
   ============================================================ */

.wfs-popup {
    --wfs-navy: #0b1f3a;
    --wfs-blue: #1d4ed8;
    --wfs-blue-hover: #1e40af;
    --wfs-text: #1f2937;
    --wfs-text-muted: #4b5563;
    --wfs-gap: 20px;

    position: fixed;
    left: var(--wfs-gap);
    bottom: calc(env(safe-area-inset-bottom, 0px) + var(--wfs-gap));
    z-index: var(--wfs-z-index, 9999);
    box-sizing: border-box;
    width: 350px;
    max-width: calc(100vw - (var(--wfs-gap) * 2));
    max-height: calc(100vh - (var(--wfs-gap) * 2));
    max-height: calc(100dvh - (var(--wfs-gap) * 2));
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    background: #ffffff;
    color: var(--wfs-text);
    border: 1px solid rgba(11, 31, 58, 0.15);
    border-radius: 10px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.32), 0 3px 8px rgba(0, 0, 0, 0.18);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    text-align: left;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.wfs-popup[hidden] {
    display: none;
}

.wfs-popup--visible {
    opacity: 1;
    transform: translateY(0);
}

.wfs-popup *,
.wfs-popup *::before,
.wfs-popup *::after {
    box-sizing: border-box;
}

.wfs-popup svg {
    display: block;
    flex-shrink: 0;
}

/* Header bar */
.wfs-popup__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0;
    padding: 9px 10px 9px 16px;
    background: var(--wfs-navy);
    color: #ffffff;
}

.wfs-popup__label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.wfs-popup__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 6px;
    box-shadow: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.wfs-popup__close:hover {
    background: rgba(255, 255, 255, 0.28);
}

.wfs-popup__close:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* Body content */
.wfs-popup__body {
    margin: 0;
    padding: 14px 16px 14px;
}

.wfs-popup__heading {
    margin: 0 0 8px;
    padding: 0;
    color: var(--wfs-navy);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
}

.wfs-popup__text {
    margin: 0 0 8px;
    padding: 0;
    color: var(--wfs-text);
}

.wfs-popup__price {
    padding: 1px 5px;
    background: #fde68a;
    color: var(--wfs-navy);
    border-radius: 4px;
    font-size: 1.1em;
    font-weight: 800;
    white-space: nowrap;
}

/* Enquiry button */
.wfs-popup__button,
.wfs-popup__button:visited {
    display: block;
    width: 100%;
    margin: 12px 0 8px;
    padding: 11px 14px;
    background: var(--wfs-blue);
    color: #ffffff;
    border: 0;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(29, 78, 216, 0.35);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.wfs-popup__button:hover {
    background: var(--wfs-blue-hover);
    color: #ffffff;
    text-decoration: none;
}

.wfs-popup__button:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: 2px;
}

/* Email address and copy button */
.wfs-popup__email-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
}

.wfs-popup__email {
    color: var(--wfs-text);
    font-size: 13px;
    font-weight: 600;
    overflow-wrap: anywhere;
    -webkit-user-select: all;
    user-select: all;
}

.wfs-popup__copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    background: #f3f4f6;
    color: var(--wfs-text-muted);
    border: 1px solid #d1d5db;
    border-radius: 5px;
    box-shadow: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.wfs-popup__copy:hover {
    background: #e0e7ff;
    color: var(--wfs-navy);
}

.wfs-popup__copy:focus-visible {
    outline: 2px solid var(--wfs-blue);
    outline-offset: 2px;
}

.wfs-popup .wfs-popup__icon-check,
.wfs-popup .wfs-popup__copy--done .wfs-popup__icon-copy {
    display: none;
}

.wfs-popup .wfs-popup__copy--done .wfs-popup__icon-check {
    display: block;
}

.wfs-popup__copy--done {
    background: #dcfce7;
    color: #15803d;
    border-color: #86efac;
}

.wfs-popup__copy-status {
    color: #15803d;
    font-size: 12px;
    font-weight: 600;
}

.wfs-popup__copy-status:empty {
    display: none;
}

.wfs-popup__closing {
    margin: 8px 0 0;
    padding: 0;
    color: var(--wfs-text-muted);
    font-size: 12px;
    text-align: center;
}

/* Mobile */
@media (max-width: 480px) {
    .wfs-popup {
        --wfs-gap: 10px;

        right: var(--wfs-gap);
        width: auto;
        max-width: none;
        font-size: 13px;
    }

    .wfs-popup__body {
        padding: 12px 14px;
    }

    .wfs-popup__heading {
        font-size: 15px;
    }

    .wfs-popup__text {
        margin-bottom: 6px;
    }

    .wfs-popup__button,
    .wfs-popup__button:visited {
        margin: 10px 0 6px;
        padding: 10px 12px;
        font-size: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wfs-popup,
    .wfs-popup__button {
        transition: none;
    }

    .wfs-popup {
        transform: none;
    }
}

@media print {
    .wfs-popup {
        display: none !important;
    }
}
