/* =========================================================
   MistWhip Location Pricing — Frontend Styles
   ========================================================= */

/* --- Full Screen Modal Overlay --- */
#mwlp-location-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background:
        radial-gradient(circle at 20% 20%, rgba(201, 162, 39, 0.2), transparent 45%),
        radial-gradient(circle at 80% 75%, rgba(255, 227, 153, 0.18), transparent 40%),
        rgba(17, 17, 17, 0.86);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
    padding: 20px;
    box-sizing: border-box;
}

#mwlp-location-overlay.mwlp-show {
    opacity: 1;
}

/* --- Modal Box --- */
#mwlp-location-modal {
    background: linear-gradient(160deg, #fffef8 0%, #fff9e8 100%);
    width: 90%;
    max-width: 420px;
    max-height: calc(100vh - 40px);
    overflow-x: hidden;
    overflow-y: auto;
    border-radius: 20px;
    border: 1px solid rgba(201, 162, 39, 0.35);
    box-shadow: 0 26px 56px rgba(0, 0, 0, 0.36);
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#mwlp-location-overlay.mwlp-show #mwlp-location-modal {
    transform: translateY(0);
}

.mwlp-modal-inner {
    padding: 36px 30px 30px;
    text-align: center;
    position: relative;
    box-sizing: border-box;
}

.mwlp-modal-inner::before {
    content: "";
    display: block;
    width: 74px;
    height: 5px;
    border-radius: 10px;
    background: linear-gradient(90deg, #b28617 0%, #e1be59 100%);
    margin: 0 auto 16px;
    opacity: 0.7;
}

.mwlp-icon {
    font-size: 30px;
    margin-bottom: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ad7f16;
}

.mwlp-icon-svg {
    width: 34px;
    height: 34px;
}

.mwlp-modal-inner h2 {
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    color: #1a1a1a;
    margin: 0 0 10px;
    letter-spacing: 0.01em;
}

.mwlp-modal-inner p {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #5f5a4f;
    line-height: 1.5;
    margin: 0 0 24px;
}

/* --- Input Group --- */
.mwlp-input-group {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: stretch;
    width: 100%;
    box-sizing: border-box;
}

.mwlp-input-group > * {
    min-width: 0;
}

#mwlp-postcode-input {
    flex: 1;
    min-width: 0;
    padding: 14px 16px;
    border: 2px solid #eadba9;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.1em;
    outline: none;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#mwlp-postcode-input:focus {
    border-color: #c9a227;
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.22);
}

.mwlp-submit {
    -webkit-appearance: none;
    appearance: none;
    width: auto;
    max-width: 100%;
    min-width: 138px;
    min-height: 48px;
    padding: 0 20px;
    border-radius: 12px;
    background: linear-gradient(135deg, #ba8d1f 0%, #d8b249 100%);
    color: #fffef8;
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
    touch-action: manipulation;
    box-shadow: 0 10px 22px rgba(153, 116, 22, 0.28);
    margin: 0;
    box-sizing: border-box;
}

.mwlp-submit:hover {
    filter: brightness(1.03);
    transform: translateY(-1px);
}

.mwlp-submit:disabled {
    opacity: 0.8;
    cursor: not-allowed;
}

/* --- Messages --- */
#mwlp-location-msg {
    margin-top: 16px;
    font-size: 13px;
    font-weight: 600;
}
.mwlp-msg-error {
    color: #d32f2f;
}

/* --- Header Trigger (Injected via JS) --- */
.mwlp-header-trigger {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #2c2720;
    cursor: pointer;
    padding: 7px 12px;
    border: 1px solid rgba(201, 162, 39, 0.35);
    border-radius: 14px;
    transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    margin-left: 15px;
    background: linear-gradient(160deg, #fffef8 0%, #fff9e7 100%);
    line-height: 1;
    min-height: 42px;
    position: relative;
    z-index: 5;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    pointer-events: auto;
    box-shadow: 0 10px 24px rgba(113, 83, 15, 0.16);
}

.mwlp-mobile-tooltip {
    position: fixed;
    left: 12px;
    top: 70px;
    min-width: 140px;
    max-width: 240px;
    box-shadow: 0 18px 32px rgba(0, 0, 0, 0.26);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    pointer-events: none;
    z-index: 10050;
}

.mwlp-mobile-tooltip::before {
    content: "";
    position: absolute;
    top: -6px;
    right: 14px;
    width: 12px;
    height: 12px;
    background: rgba(34, 29, 21, 0.96);
    transform: rotate(45deg);
    border-radius: 2px;
}

.mwlp-mobile-tooltip-card {
    padding: 10px 12px 12px;
    border-radius: 12px;
    background: rgba(34, 29, 21, 0.96);
    color: #fffdf8;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: 0.01em;
    text-align: left;
}

.mwlp-mobile-tooltip-kicker {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 253, 248, 0.68);
    margin-bottom: 6px;
}

.mwlp-mobile-tooltip-text {
    font-size: 12px;
    font-weight: 700;
    color: #fffdf8;
    word-break: break-word;
}

.mwlp-mobile-tooltip-change {
    margin-top: 10px;
    width: 100%;
    border: none;
    border-radius: 9px;
    background: linear-gradient(135deg, #ba8d1f 0%, #d8b249 100%);
    color: #fffef8;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 9px 10px;
    cursor: pointer;
    box-shadow: 0 8px 16px rgba(153, 116, 22, 0.22);
}

.mwlp-mobile-tooltip.mwlp-tooltip-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.mwlp-header-trigger:hover {
    border-color: #c9a227;
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(113, 83, 15, 0.22);
}

.mwlp-header-text {
    display: block;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-align: left;
}

.mwlp-header-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.mwlp-header-kicker {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8a7a51;
    text-align: left;
}

.mwlp-header-pin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: rgba(201, 162, 39, 0.15);
    color: #8f6914;
    font-size: 12px;
    flex: 0 0 24px;
}

.mwlp-header-pin-svg {
    width: 14px;
    height: 14px;
    display: block;
}

.mwlp-header-chevron {
    color: #8f7440;
    font-size: 12px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.mwlp-header-chevron-svg {
    width: 14px;
    height: 14px;
    display: block;
}

.mwlp-current-selection {
    margin: 0 0 16px;
    padding: 10px 12px;
    border: 1px solid rgba(201, 162, 39, 0.32);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.86);
    color: #5f5220;
    font-size: 13px;
    line-height: 1.4;
}

.mwlp-current-selection.is-hidden {
    display: none;
}

.mwlp-current-selection strong {
    color: #1f1a0b;
}

/* Hide close button if we want to force selection, or add one if optional */
.mwlp-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    color: #9b936f;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}
.mwlp-close:hover { color: #1a1a1a; }

@media (max-width: 640px) {
    #mwlp-location-modal {
        width: 100%;
        max-width: 100%;
        border-radius: 18px;
    }

    .mwlp-modal-inner {
        padding: 24px 16px 18px;
    }

    .mwlp-modal-inner h2 {
        font-size: 23px;
    }

    .mwlp-modal-inner p {
        font-size: 13px;
        margin-bottom: 16px;
    }

    .mwlp-input-group {
        grid-template-columns: 1fr;
    }

    #mwlp-postcode-input,
    .mwlp-submit {
        width: 100%;
        min-width: 0;
    }

    .mwlp-submit {
        min-height: 46px;
    }

    .mwlp-header-trigger {
        margin-left: 6px;
        padding: 0;
        gap: 0;
        width: 38px;
        min-width: 38px;
        max-width: 38px;
        height: 38px;
        min-height: 38px;
        justify-content: center;
        border-radius: 999px;
        box-shadow: 0 6px 14px rgba(113, 83, 15, 0.12);
    }

    .mwlp-header-meta {
        display: none;
    }

    .mwlp-header-pin {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
        background: transparent;
    }

    .mwlp-header-pin-svg,
    .mwlp-header-chevron-svg {
        width: 16px;
        height: 16px;
    }

    .mwlp-header-chevron {
        display: none;
    }

    .mwlp-mobile-tooltip {
        display: block;
    }
}

@media (max-width: 480px) {
    .mwlp-header-trigger {
        width: 36px;
        min-width: 36px;
        max-width: 36px;
        height: 36px;
        min-height: 36px;
    }

    .mwlp-header-pin {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }

    .mwlp-mobile-tooltip {
        min-width: 128px;
        max-width: 208px;
    }
}
