:root {
    --faw-accent: #f5a400;
    --faw-text: #353535;
    --faw-body: #666666;
    --faw-border: #dedede;
    --faw-surface: #f6f6f6;
    --faw-white: #ffffff;
}

html.faw-modal-open,
html.faw-modal-open body {
    overflow: hidden;
}

.faw-modal,
.faw-modal * {
    box-sizing: border-box;
}

.faw-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    font-family: inherit;
    color: var(--faw-text);
}

.faw-modal.is-open {
    display: block;
}

.faw-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 20, 20, .42);
    backdrop-filter: blur(2px);
}

.faw-modal__dialog {
    position: absolute;
    top: 4vh;
    right: 3vw;
    bottom: 4vh;
    left: 3vw;
    width: min(1480px, 94vw);
    margin: 0 auto;
    background: var(--faw-white);
    overflow: auto;
    overscroll-behavior: contain;
    box-shadow: 0 18px 55px rgba(0, 0, 0, .17);
}

.faw-modal__close {
    position: absolute;
    top: 18px;
    right: 22px;
    z-index: 4;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--faw-text);
    font: inherit;
    font-size: 34px;
    font-weight: 300;
    line-height: 38px;
    cursor: pointer;
    transition: color .2s ease, transform .2s ease;
}

.faw-modal__close:hover,
.faw-modal__close:focus-visible {
    color: var(--faw-accent);
    transform: rotate(4deg);
}

.faw-modal__topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 32px;
    min-height: 106px;
    padding: 24px clamp(28px, 5vw, 72px);
    padding-right: clamp(74px, 7vw, 100px);
    background: #f4f4f4;
    border-bottom: 1px solid #ebebeb;
}

.faw-modal__success {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--faw-body);
    font-size: clamp(16px, 1.5vw, 20px);
    line-height: 1.35;
}

.faw-modal__success strong {
    color: var(--faw-text);
    font-weight: 600;
}

.faw-modal__success > span:last-child {
    color: var(--faw-accent);
    font-weight: 600;
}

.faw-modal__check {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 31px;
    height: 31px;
    border-radius: 50%;
    color: #fff;
    background: var(--faw-accent);
    font-size: 18px;
    font-weight: 700;
}

.faw-modal__actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.faw-button,
.faw-modal .button,
.faw-modal button.faw-button,
.faw-modal a.faw-button {
    min-height: 52px;
    padding: 13px 28px;
    border: 1px solid var(--faw-text);
    border-radius: 0;
    box-shadow: none;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none !important;
    text-transform: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}

.faw-button:hover,
.faw-button:focus-visible {
    transform: translateY(-1px);
}

.faw-button:disabled {
    opacity: .6;
    cursor: wait;
    transform: none;
}

.faw-button--primary {
    border-color: var(--faw-text) !important;
    background: var(--faw-text) !important;
    color: var(--faw-accent) !important;
}

.faw-button--primary:hover,
.faw-button--primary:focus-visible {
    border-color: var(--faw-accent) !important;
    background: var(--faw-accent) !important;
    color: #fff !important;
}

.faw-button--secondary {
    border-color: #8e8e8e !important;
    background: #fff !important;
    color: var(--faw-text) !important;
}

.faw-button--secondary:hover,
.faw-button--secondary:focus-visible {
    border-color: var(--faw-text) !important;
    background: var(--faw-text) !important;
    color: #fff !important;
}

.faw-button--full {
    width: 100%;
}

.faw-modal__content {
    width: min(1240px, calc(100% - 64px));
    margin: 0 auto;
    padding: clamp(42px, 5vw, 72px) 0 clamp(54px, 6vw, 86px);
}

.faw-modal__header {
    max-width: 720px;
    margin: 0 auto clamp(36px, 4vw, 54px);
    text-align: center;
}

.faw-modal__header h2 {
    position: relative;
    margin: 0;
    padding-bottom: 19px;
    color: var(--faw-text);
    font-size: clamp(25px, 2.5vw, 34px);
    font-weight: 500;
    line-height: 1.2;
}

.faw-modal__header h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 45px;
    height: 2px;
    background: var(--faw-accent);
    transform: translateX(-50%);
}

.faw-modal__header p {
    margin: 18px 0 0;
    color: var(--faw-body);
    font-size: 16px;
    line-height: 1.7;
}

.faw-modal__header small {
    display: inline-block;
    margin-top: 9px;
    color: #8a8a8a;
    font-size: 14px;
}

.faw-accessories {
    display: grid;
    grid-template-columns: repeat(var(--faw-cols, 3), minmax(0, 1fr));
    gap: clamp(24px, 3vw, 42px);
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    align-items: stretch;
}

.faw-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    background: #fff;
}

.faw-card__image {
    display: flex !important;
    width: 100% !important;
    height: clamp(230px, 25vw, 330px);
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 2vw, 26px);
    background: var(--faw-surface);
    overflow: hidden;
    text-decoration: none;
}

.faw-card__image img,
.faw-modal .faw-card__image img,
.faw-modal .woocommerce-placeholder {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    object-fit: contain;
    object-position: center;
    border: 0;
    box-shadow: none;
}

.faw-card__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    padding-top: 20px;
}

.faw-card h3 {
    margin: 0 0 9px;
    padding: 0;
    color: var(--faw-text);
    font-size: clamp(17px, 1.5vw, 20px);
    font-weight: 500;
    line-height: 1.35;
}

.faw-card h3 a {
    color: inherit !important;
    text-decoration: none !important;
}

.faw-card h3 a:hover {
    color: var(--faw-accent) !important;
}

.faw-card__price {
    margin: 0 0 12px;
    color: var(--faw-body);
    font-size: 16px;
    font-weight: 600;
}

.faw-card__price .amount {
    color: inherit;
}

.faw-card__coverage,
.faw-card__recommendation {
    margin: 5px 0;
    color: var(--faw-body);
    font-size: 13px;
    line-height: 1.55;
}

.faw-card__recommendation {
    color: var(--faw-accent);
    font-weight: 600;
}

.faw-card__purchase {
    display: grid;
    grid-template-columns: minmax(92px, 120px) minmax(130px, 1fr);
    gap: 12px;
    margin-top: auto;
    padding-top: 18px;
    align-items: end;
}

.faw-card__purchase label {
    display: block;
    margin: 0;
}

.faw-card__purchase label span {
    display: block;
    margin-bottom: 7px;
    color: var(--faw-body);
    font-size: 12px;
    font-weight: 600;
}

.faw-card__purchase input,
.faw-modal .faw-card__purchase input[type='number'] {
    display: block;
    width: 100% !important;
    height: 52px;
    margin: 0;
    padding: 8px 13px;
    border: 1px solid var(--faw-border) !important;
    border-radius: 0 !important;
    outline: 0;
    background: #fff !important;
    color: var(--faw-text) !important;
    box-shadow: none !important;
    font: inherit;
    font-size: 14px;
}

.faw-card__purchase input:focus {
    border-color: var(--faw-accent) !important;
}

.faw-card__purchase .faw-button {
    width: 100%;
}

.faw-card__total {
    margin-top: 13px;
    color: var(--faw-body);
    font-size: 14px;
    line-height: 1.4;
}

.faw-card__total strong {
    color: var(--faw-text);
    font-weight: 600;
}

.faw-card__status {
    min-height: 20px;
    margin-top: 7px;
    color: var(--faw-accent);
    font-size: 12px;
}

@media (max-width: 980px) {
    .faw-modal__dialog {
        top: 2vh;
        right: 2vw;
        bottom: 2vh;
        left: 2vw;
        width: 96vw;
    }

    .faw-modal__topbar {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 26px 68px 26px 26px;
    }

    .faw-modal__actions {
        width: 100%;
    }

    .faw-modal__actions .faw-button {
        flex: 1 1 0;
    }

    .faw-modal__content {
        width: calc(100% - 48px);
    }

    .faw-accessories {
        display: flex;
        gap: 22px;
        max-width: none;
        padding: 0 0 12px;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scroll-snap-type: x mandatory;
        scrollbar-width: thin;
        scrollbar-color: #c9c9c9 transparent;
    }

    .faw-card {
        flex: 0 0 min(68vw, 360px);
        scroll-snap-align: start;
    }

    .faw-card__image {
        height: 280px;
    }
}

@media (max-width: 560px) {
    .faw-modal__dialog {
        inset: 0;
        width: 100%;
    }

    .faw-modal__close {
        top: 13px;
        right: 13px;
    }

    .faw-modal__topbar {
        gap: 16px;
        min-height: 0;
        padding: 22px 58px 22px 18px;
    }

    .faw-modal__success {
        gap: 8px;
        font-size: 15px;
    }

    .faw-modal__check {
        width: 27px;
        height: 27px;
        font-size: 15px;
    }

    .faw-modal__actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .faw-button,
    .faw-modal button.faw-button,
    .faw-modal a.faw-button {
        min-height: 48px;
        padding: 11px 18px;
    }

    .faw-modal__content {
        width: calc(100% - 36px);
        padding: 36px 0 44px;
    }

    .faw-modal__header {
        margin-bottom: 30px;
    }

    .faw-modal__header h2 {
        font-size: 25px;
    }

    .faw-modal__header p {
        margin-top: 15px;
        font-size: 14px;
    }

    .faw-card {
        flex-basis: min(84vw, 330px);
    }

    .faw-card__image {
        height: 245px;
    }

    .faw-card__purchase {
        grid-template-columns: 96px minmax(0, 1fr);
    }
}
