.psx-menu-cart-widget,
.psx-menu-cart-widget * {
    box-sizing: border-box;
}

.psx-menu-cart-widget {
    --psx-product-image-width: 80px;
    --psx-product-image-height: 126px;
}

.psx-menu-cart-widget.psx-hide-when-empty {
    display: none;
}

.psx-menu-cart-wrap {
    position: relative;
    display: flex;
    width: 100%;
}

.psx-menu-cart-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1;
    text-decoration: none !important;
    color: #004180;
    background: transparent;
    transition: color .2s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.psx-menu-cart-toggle:hover,
.psx-menu-cart-toggle:focus {
    color: inherit;
    text-decoration: none;
}

.psx-menu-cart-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.psx-menu-cart-icon svg,
.psx-menu-cart-icon img {
    display: block;
    width: 24px;
    height: 24px;
}

.psx-menu-cart-icon img {
    object-fit: contain;
}

.psx-menu-cart-count {
    --psx-count-x: 0px;
    --psx-count-y: 0px;
    position: absolute;
    top: -8px;
    right: -8px;
    z-index: 5;
    transform: translate(var(--psx-count-x), var(--psx-count-y));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    width: 16px;
    height: 16px;
    padding: 0;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    color: #fff;
    pointer-events: none;
    white-space: nowrap;
}

.psx-menu-cart-count.psx-bubble {
    background: #ff1d1d;
    border-radius: 999px;
}

.psx-menu-cart-count.psx-plain {
    position: static;
    transform: none;
    width: auto;
    min-width: auto;
    height: auto;
    line-height: 1;
    color: currentColor;
}

.psx-menu-cart-subtotal {
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    line-height: 1.2;
}

.psx-menu-cart-dropdown {
    position: absolute;
    top: 100%;
    z-index: 9999;
    width: 365px;
    max-width: calc(100vw - 24px);
    background: #fff;
    color: #000;
    box-shadow: 0 10px 30px rgba(0,0,0,.12);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity .18s ease, visibility .18s ease, transform .18s ease;
}

.psx-cart-position-left .psx-menu-cart-dropdown {
    left: 0;
}

.psx-cart-position-center .psx-menu-cart-dropdown {
    left: 50%;
    transform: translate(-50%, 8px);
}

.psx-cart-position-right .psx-menu-cart-dropdown {
    right: 0;
}

.psx-menu-cart-widget.psx-is-open .psx-menu-cart-dropdown,
.psx-menu-cart-widget.psx-open-hover:hover .psx-menu-cart-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.psx-cart-position-center.psx-is-open .psx-menu-cart-dropdown,
.psx-cart-position-center.psx-open-hover:hover .psx-menu-cart-dropdown {
    transform: translate(-50%, 0);
}

.psx-menu-cart-panel {
    position: relative;
    padding: 15px;
}

.psx-menu-cart-close {
    appearance: none;
    -webkit-appearance: none;
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #777;
    font-size: 42px;
    font-weight: 300;
    line-height: 28px;
    cursor: pointer;
    z-index: 2;
}

.psx-menu-cart-products {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 8px;
}

.psx-menu-cart-products::-webkit-scrollbar {
    width: 8px;
}

.psx-menu-cart-products::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 20px;
}

.psx-menu-cart-dropdown ul.woocommerce-mini-cart,
.psx-menu-cart-dropdown ul.product_list_widget {
    margin: 0;
    padding: 0;
    list-style: none;
}

.psx-menu-cart-dropdown .woocommerce-mini-cart-item,
.psx-menu-cart-dropdown ul.product_list_widget li {
    position: relative;
    display: grid;
    grid-template-columns: var(--psx-product-image-width) minmax(0, 1fr) 28px;
    column-gap: 20px;
    align-items: start;
    padding: 20px 0;
    margin: 0;
}

.psx-show-dividers .psx-menu-cart-dropdown .woocommerce-mini-cart-item,
.psx-show-dividers .psx-menu-cart-dropdown ul.product_list_widget li {
    border-bottom: 1px solid #ddd;
}

.psx-menu-cart-dropdown .woocommerce-mini-cart-item img,
.psx-menu-cart-dropdown ul.product_list_widget li img {
    grid-column: 1;
    width: var(--psx-product-image-width);
    height: var(--psx-product-image-height);
    object-fit: cover;
    margin: 0;
    float: none;
}

.psx-menu-cart-dropdown .woocommerce-mini-cart-item a:not(.remove),
.psx-menu-cart-dropdown ul.product_list_widget li a:not(.remove) {
    grid-column: 2;
    display: block;
    padding: 0;
    margin: 0 0 16px;
    color: #004180;
    font-weight: 700;
    line-height: 1.25;
    text-decoration: none;
}

.psx-menu-cart-dropdown .quantity {
    grid-column: 2;
    display: block;
    color: #000;
    font-weight: 600;
    line-height: 1.4;
}

.psx-menu-cart-dropdown a.remove,
.psx-menu-cart-dropdown .remove_from_cart_button {
    grid-column: 3;
    grid-row: 1 / span 2;
    align-self: center;
    justify-self: end;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin: 0 !important;
    border: 1px solid currentColor;
    border-radius: 50%;
    background: transparent !important;
    color: #000 !important;
    font-size: 20px;
    line-height: 20px;
    text-decoration: none;
}

.psx-hide-remove-icon .psx-menu-cart-dropdown a.remove,
.psx-hide-remove-icon .psx-menu-cart-dropdown .remove_from_cart_button {
    display: none !important;
}

.psx-hide-remove-icon .psx-menu-cart-dropdown .woocommerce-mini-cart-item,
.psx-hide-remove-icon .psx-menu-cart-dropdown ul.product_list_widget li {
    grid-template-columns: var(--psx-product-image-width) minmax(0, 1fr);
}

.psx-menu-cart-dropdown .woocommerce-mini-cart__total {
    margin: 18px 0 0;
    padding: 12px 0 0;
    border-top: 1px solid #ddd;
    color: #333;
    font-size: 16px;
    line-height: 1.4;
    font-weight: 400;
}

.psx-menu-cart-dropdown .woocommerce-mini-cart__total strong {
    font-weight: 400;
}

.psx-menu-cart-dropdown .woocommerce-mini-cart__buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0 0;
}

.psx-menu-cart-dropdown .button {
    flex: 1 1 0;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 0;
    border: 0;
    border-radius: 50px;
    background: #004180;
    color: #fff;
    text-align: center;
    text-decoration: none !important;
    font-weight: 700;
    line-height: 1.1;
}

.psx-hide-view-cart .psx-menu-cart-dropdown .woocommerce-mini-cart__buttons .button.wc-forward:not(.checkout),
.psx-hide-checkout .psx-menu-cart-dropdown .woocommerce-mini-cart__buttons .button.checkout {
    display: none !important;
}

.psx-menu-cart-dropdown .woocommerce-mini-cart__empty-message {
    margin: 0;
    padding: 20px 0;
    text-align: center;
}

@media (max-width: 767px) {
    .psx-menu-cart-dropdown {
        position: fixed;
        top: 64px;
        right: 0 !important;
        left: auto !important;
        width: min(365px, calc(100vw - 24px));
        max-height: calc(100vh - 80px);
        transform: translateX(12px);
    }

    .psx-cart-position-center .psx-menu-cart-dropdown {
        transform: translateX(12px);
    }

    .psx-menu-cart-widget.psx-is-open .psx-menu-cart-dropdown,
    .psx-menu-cart-widget.psx-open-hover:hover .psx-menu-cart-dropdown,
    .psx-cart-position-center.psx-is-open .psx-menu-cart-dropdown,
    .psx-cart-position-center.psx-open-hover:hover .psx-menu-cart-dropdown {
        transform: translateX(0);
    }

    .psx-menu-cart-dropdown .woocommerce-mini-cart-item,
    .psx-menu-cart-dropdown ul.product_list_widget li {
        grid-template-columns: var(--psx-product-image-width) minmax(0, 1fr) 28px;
        column-gap: 20px;
    }
}
