.qmx-size-guide-shell {
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
    flex-basis: 100%;
    clear: both;
    margin: 18px 0 0;
}

.woocommerce-variation-add-to-cart > .qmx-size-guide-shell,
form.cart > .qmx-size-guide-shell {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
}

.qmx-size-guide-inline-mobile {
    display: block;
    width: 100%;
    max-width: 100%;
}

.qmx-size-guide-trigger {
    width: 100%;
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 14px 20px;
    border: 1px solid #eeeeee;
    border-radius: 0;
    box-shadow: none;
    color: #333333;
    background: #f4f4f4;
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.5;
    text-align: center;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: background-color 160ms ease, border-color 160ms ease;
}

.qmx-size-guide-trigger:hover,
.qmx-size-guide-trigger:focus-visible {
    color: #222222;
    border-color: #e2e2e2;
    background: #ececec;
}

.qmx-size-guide-trigger:focus-visible,
.qmx-size-guide-close:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

body.qmx-size-guide-open {
    overflow: hidden !important;
}

.qmx-size-guide-modal[hidden] {
    display: none !important;
}

.qmx-size-guide-modal {
    position: fixed;
    z-index: 999999;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    direction: rtl;
}

.qmx-size-guide-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 20, 28, 0.56);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity 180ms ease;
}

.qmx-size-guide-dialog {
    position: relative;
    z-index: 1;
    width: min(780px, calc(100vw - 48px));
    max-height: min(86vh, 820px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
    color: #222222;
    background: #ffffff;
    opacity: 0;
    transform: translateY(12px) scale(0.985);
    transition: opacity 180ms ease, transform 180ms ease;
}

.qmx-size-guide-modal.is-open .qmx-size-guide-backdrop,
.qmx-size-guide-modal.is-open .qmx-size-guide-dialog {
    opacity: 1;
}

.qmx-size-guide-modal.is-open .qmx-size-guide-dialog {
    transform: translateY(0) scale(1);
}

.qmx-size-guide-header {
    min-height: 68px;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    border-bottom: 1px solid #ededed;
    background: #ffffff;
}

.qmx-size-guide-header h2 {
    margin: 0;
    padding: 0;
    color: #222222;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.5;
}

.qmx-size-guide-close {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    border: 1px solid #e8e8e8;
    border-radius: 50%;
    box-shadow: none;
    color: #333333;
    background: #f7f7f7;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.qmx-size-guide-close:hover {
    color: #111111;
    background: #eeeeee;
}

.qmx-size-guide-close svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
}

.qmx-size-guide-body {
    min-height: 0;
    overflow: auto;
    padding: 24px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.qmx-product-table-wrap {
    width: 100%;
    margin: 0;
}

.qmx-product-table-wrap + .qmx-product-table-wrap {
    margin-top: 28px;
    padding-top: 28px;
    border-top: 1px solid #ededed;
}

.qmx-product-table-title {
    margin: 0 0 12px;
    color: #222222;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.6;
}

.qmx-product-table-scroll {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #e4e4e4;
    border-radius: 10px;
    -webkit-overflow-scrolling: touch;
}

.qmx-product-table-wrap .qmx-product-table {
    width: 100%;
    min-width: 520px;
    margin: 0;
    border: 0;
    border-collapse: collapse;
    border-spacing: 0;
    table-layout: auto;
}

.qmx-product-table-wrap .qmx-product-table th,
.qmx-product-table-wrap .qmx-product-table td {
    padding: 13px 14px;
    border-width: 0 0 1px 1px;
    border-style: solid;
    border-color: #e4e4e4;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
}

.qmx-product-table-wrap .qmx-product-table tr:last-child td {
    border-bottom: 0;
}

.qmx-product-table-wrap .qmx-product-table tr > *:last-child {
    border-left: 0;
}

.qmx-product-table-wrap .qmx-product-table thead th {
    color: #282828;
    background: #f5f5f5;
    font-weight: 700;
}

@media (max-width: 767px) {
    .qmx-size-guide-shell {
        margin-top: 14px;
    }

    .qmx-size-guide-trigger {
        display: none !important;
        min-height: 56px;
        padding: 12px 16px;
        font-size: 15px;
    }

    .qmx-size-guide-inline-mobile {
        display: block;
    }

    .qmx-size-guide-inline-mobile .qmx-product-table-wrap {
        margin: 0;
    }

    .qmx-size-guide-inline-mobile .qmx-product-table-title {
        margin-bottom: 10px;
        font-size: 17px;
    }

    .qmx-size-guide-inline-mobile .qmx-product-table-scroll {
        border-radius: 8px;
    }

    .qmx-size-guide-inline-mobile .qmx-product-table {
        min-width: 100%;
    }

    .qmx-size-guide-modal {
        align-items: flex-end;
        padding: 0;
    }

    .qmx-size-guide-dialog {
        width: 100%;
        max-height: 88svh;
        border-width: 1px 0 0;
        border-radius: 18px 18px 0 0;
        transform: translateY(24px);
    }

    .qmx-size-guide-header {
        min-height: 62px;
        padding: 11px 16px;
    }

    .qmx-size-guide-header h2 {
        font-size: 18px;
    }

    .qmx-size-guide-close {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

    .qmx-size-guide-body {
        padding: 18px 16px max(20px, env(safe-area-inset-bottom));
    }

    .qmx-product-table-title {
        font-size: 17px;
    }

    .qmx-product-table-wrap .qmx-product-table th,
    .qmx-product-table-wrap .qmx-product-table td {
        padding: 11px 12px;
        font-size: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .qmx-size-guide-trigger,
    .qmx-size-guide-backdrop,
    .qmx-size-guide-dialog {
        transition: none;
    }
}
