.ps-bwu-overlay[hidden] {
    display: none !important;
}

.ps-bwu-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

body.ps-bwu-open {
    overflow: hidden;
}

.ps-bwu-modal {
    position: relative;
    width: min(760px, 100%);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 34px;
    border: 1px solid #dedede;
    border-radius: 18px;
    background: #fff;
    color: #090909;
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.38);
    text-align: center;
}

.ps-bwu-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #111;
    font-size: 32px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
}

.ps-bwu-close:hover,
.ps-bwu-close:focus-visible {
    background: #f1f1f1;
    outline: none;
}

.ps-bwu-kicker {
    margin-bottom: 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.28em;
}

.ps-bwu-modal h2 {
    margin: 0;
    color: #050505;
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.035em;
}

.ps-bwu-modal > p {
    margin: 12px 0 25px;
    color: #595959;
    font-size: 16px;
}

.ps-bwu-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.ps-bwu-card {
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    padding: 12px 12px 16px;
    border: 2px solid #e7e7e7;
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.ps-bwu-card:hover {
    border-color: #a8a8a8;
    transform: translateY(-2px);
}

.ps-bwu-card:focus-visible {
    outline: 3px solid rgba(0, 0, 0, 0.22);
    outline-offset: 2px;
}

.ps-bwu-card.is-selected {
    border-color: #000;
    box-shadow: 0 0 0 1px #000, 0 12px 28px rgba(0, 0, 0, 0.11);
}

.ps-bwu-checkbox {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.ps-bwu-checkmark {
    position: absolute;
    top: 10px;
    right: 10px;
    display: grid;
    width: 27px;
    height: 27px;
    place-items: center;
    border: 1px solid #c9c9c9;
    border-radius: 50%;
    background: #fff;
    color: transparent;
    font-size: 15px;
    font-weight: 900;
    z-index: 2;
}

.ps-bwu-card.is-selected .ps-bwu-checkmark {
    border-color: #000;
    background: #000;
    color: #fff;
}

.ps-bwu-card img {
    display: block;
    width: 100%;
    height: 190px;
    margin: 0 auto 8px;
    object-fit: contain;
}

.ps-bwu-size {
    display: block;
    color: #0a0a0a;
    font-size: 18px;
    font-weight: 800;
}

.ps-bwu-price {
    display: block;
    min-height: 24px;
    margin-top: 3px;
    color: #555;
    font-size: 15px;
    font-weight: 600;
}

.ps-bwu-price del {
    opacity: 0.55;
}

.ps-bwu-price ins {
    background: transparent;
    text-decoration: none;
}

.ps-bwu-add {
    width: 100%;
    min-height: 54px;
    padding: 14px 20px;
    border: 2px solid #000;
    border-radius: 8px;
    background: #000;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: background 150ms ease, color 150ms ease, opacity 150ms ease;
}

.ps-bwu-add:hover:not(:disabled),
.ps-bwu-add:focus-visible:not(:disabled) {
    background: #fff;
    color: #000;
}

.ps-bwu-add:disabled {
    cursor: not-allowed;
    opacity: 0.35;
}

/* Quiet text link. Using an anchor keeps Astra/Elementor button hover rules away. */
.ps-bwu-modal .ps-bwu-dismiss,
.ps-bwu-modal .ps-bwu-dismiss:visited {
    display: inline-block !important;
    width: auto !important;
    min-width: 0 !important;
    margin: 14px auto 0 !important;
    padding: 4px 6px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    color: #5d5d5d !important;
    font-family: inherit !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.35 !important;
    letter-spacing: 0 !important;
    text-decoration: underline !important;
    text-decoration-thickness: 1px !important;
    text-underline-offset: 3px !important;
    text-transform: none !important;
    cursor: pointer;
    transform: none !important;
    transition: color 150ms ease !important;
}

.ps-bwu-modal .ps-bwu-dismiss:hover,
.ps-bwu-modal .ps-bwu-dismiss:active,
.ps-bwu-modal .ps-bwu-dismiss:focus,
.ps-bwu-modal .ps-bwu-dismiss:focus-visible {
    border: 0 !important;
    outline: 1px dotted #777 !important;
    outline-offset: 2px !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    color: #111 !important;
    transform: none !important;
}

.ps-bwu-modal .ps-bwu-dismiss::before,
.ps-bwu-modal .ps-bwu-dismiss::after {
    content: none !important;
    display: none !important;
}

.ps-bwu-status {
    min-height: 20px;
    margin-top: 8px;
    color: #252525;
    font-size: 13px;
    font-weight: 600;
}

@media (max-width: 640px) {
    .ps-bwu-overlay {
        align-items: end;
        padding: 0;
    }

    .ps-bwu-modal {
        width: 100%;
        max-height: 91vh;
        padding: 27px 18px 22px;
        border-radius: 20px 20px 0 0;
    }

    .ps-bwu-modal h2 {
        padding-right: 28px;
        padding-left: 28px;
        font-size: 30px;
    }

    .ps-bwu-modal > p {
        margin-bottom: 17px;
        font-size: 15px;
    }

    .ps-bwu-options {
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .ps-bwu-card {
        display: grid;
        grid-template-columns: 86px 1fr 34px;
        grid-template-rows: auto auto;
        column-gap: 12px;
        min-height: 104px;
        padding: 9px 11px;
        text-align: left;
    }

    .ps-bwu-card img {
        grid-column: 1;
        grid-row: 1 / 3;
        width: 86px;
        height: 86px;
        margin: 0;
    }

    .ps-bwu-size {
        grid-column: 2;
        grid-row: 1;
        align-self: end;
        font-size: 18px;
    }

    .ps-bwu-price {
        grid-column: 2;
        grid-row: 2;
        align-self: start;
        margin: 0;
    }

    .ps-bwu-checkmark {
        position: static;
        grid-column: 3;
        grid-row: 1 / 3;
        align-self: center;
        justify-self: end;
    }

    .ps-bwu-close {
        top: 8px;
        right: 8px;
    }
}

/* Desktop only: make the dismissal link 30% larger. Mobile stays unchanged. */
@media (min-width: 641px) {
    .ps-bwu-modal .ps-bwu-dismiss,
    .ps-bwu-modal .ps-bwu-dismiss:visited,
    .ps-bwu-modal .ps-bwu-dismiss:hover,
    .ps-bwu-modal .ps-bwu-dismiss:active,
    .ps-bwu-modal .ps-bwu-dismiss:focus,
    .ps-bwu-modal .ps-bwu-dismiss:focus-visible {
        font-size: 18.2px !important;
    }
}
