/* Hide default WooCommerce ajax "View cart" link */
.added_to_cart.wc-forward:not(.ms-cart-link) {
    display: none !important;
}

/* Overlay */
.ms-cart-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background:
        radial-gradient(circle at 70% 20%, rgba(199, 163, 107, .16), transparent 32%),
        rgba(16, 8, 5, .58);
    opacity: 0;
    visibility: hidden;
    backdrop-filter: blur(8px);
    transition:
        opacity .55s cubic-bezier(.22, 1, .36, 1),
        visibility .55s cubic-bezier(.22, 1, .36, 1);
}

body.ms-cart-open .ms-cart-overlay {
    opacity: 1;
    visibility: visible;
}

/* Drawer */
.ms-cart-drawer {
    position: fixed;
    z-index: 9010;
    top: 16px;
    right: 16px;
    bottom: 16px;
    width: min(460px, calc(100vw - 32px));
    background:
        linear-gradient(180deg, rgba(255, 250, 240, .98), rgba(248, 243, 232, .98));
    border: 1px solid rgba(199, 163, 107, .38);
    box-shadow:
        0 34px 90px rgba(20, 9, 4, .42),
        inset 0 1px 0 rgba(255,255,255,.7);
    transform: translateX(calc(100% + 32px));
    opacity: 0;
    visibility: hidden;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition:
        transform .75s cubic-bezier(.22, 1, .36, 1),
        opacity .55s cubic-bezier(.22, 1, .36, 1),
        visibility .55s cubic-bezier(.22, 1, .36, 1);
}

body.ms-cart-open .ms-cart-drawer {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
}

.ms-cart-drawer::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 20% 0%, rgba(199, 163, 107, .18), transparent 28%),
        linear-gradient(135deg, rgba(255,255,255,.45), transparent 42%);
}

.ms-cart-drawer::after {
    content: "";
    position: absolute;
    right: -120px;
    top: 80px;
    width: 260px;
    height: 260px;
    border: 1px solid rgba(199, 163, 107, .22);
    border-radius: 50%;
    pointer-events: none;
}

/* Head */
.ms-cart-drawer__head {
    position: relative;
    z-index: 2;
    min-height: 104px;
    padding: 28px 30px 22px;
    border-bottom: 1px solid rgba(199, 163, 107, .22);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ms-cart-drawer__label {
    color: rgba(61, 34, 19, .62);
    font-size: 11px;
    line-height: 1;
    letter-spacing: .14em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.ms-cart-drawer__title {
    margin: 0;
    color: #160b06;
    font-size: 30px;
    line-height: 1;
    font-weight: 400;
    text-transform: uppercase;
}

.ms-cart-drawer__close {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(199, 163, 107, .42);
    border-radius: 50%;
    background: transparent;
    position: relative;
    cursor: pointer;
    transition: .45s cubic-bezier(.22, 1, .36, 1);
}

.ms-cart-drawer__close:hover {
    background: #3d2213;
    border-color: #3d2213;
}

.ms-cart-drawer__close span {
    position: absolute;
    left: 13px;
    top: 20px;
    width: 15px;
    height: 1px;
    background: #3d2213;
    transition: .45s cubic-bezier(.22, 1, .36, 1);
}

.ms-cart-drawer__close:hover span {
    background: #fff;
}

.ms-cart-drawer__close span:first-child {
    transform: rotate(45deg);
}

.ms-cart-drawer__close span:last-child {
    transform: rotate(-45deg);
}

/* Body */
.ms-cart-drawer__body {
    position: relative;
    z-index: 2;
    flex: 1;
    overflow-y: auto;
    padding: 0 30px 30px;
}

.ms-cart-drawer.is-loading .ms-cart-drawer__body {
    opacity: .55;
    pointer-events: none;
}

/* Items */
.ms-cart-items {
    padding: 22px 0;
}

.ms-cart-item {
    display: grid;
    grid-template-columns: 76px 1fr;
    gap: 16px;
    padding: 18px 0;
    border-bottom: 1px solid rgba(61, 34, 19, .12);
    animation: msCartItemIn .55s cubic-bezier(.22, 1, .36, 1) both;
}

.ms-cart-item__image {
    width: 76px;
    height: 92px;
    overflow: hidden;
    background: rgba(199, 163, 107, .14);
    border-radius: 80px 80px 0 0;
}

.ms-cart-item__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1.04);
}

.ms-cart-item__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.ms-cart-item__title {
    margin: 0;
    color: #160b06;
    font-size: 14px;
    line-height: 1.25;
    font-weight: 800;
    text-transform: uppercase;
}

.ms-cart-item__remove {
    width: 24px;
    height: 24px;
    border: 0;
    background: transparent;
    color: rgba(61, 34, 19, .45);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: .3s ease;
}

.ms-cart-item__remove:hover {
    color: #160b06;
    transform: rotate(90deg);
}

.ms-cart-item__duration {
    margin-top: 7px;
    color: rgba(26, 13, 7, .62);
    font-size: 12px;
    line-height: 1.25;
}

.ms-cart-item__bottom {
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.ms-cart-item__qty {
    display: inline-flex;
    align-items: center;
    height: 34px;
    border: 1px solid rgba(199, 163, 107, .48);
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255,255,255,.42);
}

.ms-cart-item__qty button {
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: #3d2213;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

.ms-cart-item__qty button:hover {
    background: rgba(199, 163, 107, .14);
}

.ms-cart-item__qty input {
    width: 34px;
    height: 32px;
    border: 0;
    background: transparent;
    text-align: center;
    color: #160b06;
    font-size: 12px;
    outline: none;
    appearance: textfield;
}

.ms-cart-item__qty input::-webkit-outer-spin-button,
.ms-cart-item__qty input::-webkit-inner-spin-button {
    appearance: none;
    margin: 0;
}

.ms-cart-item__price {
    color: #160b06;
    font-size: 13px;
    line-height: 1.2;
    font-weight: 700;
    white-space: nowrap;
}

.ms-cart-item__price ins {
    text-decoration: none;
}

.ms-cart-item__price del {
    opacity: .45;
    margin-right: 4px;
}

/* Summary */
.ms-cart-summary {
    position: sticky;
    bottom: 0;
    margin: 14px -30px -30px;
    padding: 24px 30px 30px;
    background:
        linear-gradient(180deg, rgba(248,243,232,.74), #f8f3e8 28%);
    border-top: 1px solid rgba(199, 163, 107, .24);
}

.ms-cart-summary__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #160b06;
    margin-bottom: 18px;
}

.ms-cart-summary__row span {
    font-size: 12px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(61, 34, 19, .68);
}

.ms-cart-summary__row strong {
    font-size: 20px;
    line-height: 1;
    font-weight: 700;
}

.ms-cart-summary__actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.ms-cart-checkout {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #3d2213;
    color: #fff;
    border: 1px solid #3d2213;
    text-decoration: none;
    font-size: 11px;
    letter-spacing: .11em;
    text-transform: uppercase;
    transition: .45s cubic-bezier(.22, 1, .36, 1);
}

.ms-cart-checkout:hover {
    background: #160b06;
    color: #fff;
    border-color: #160b06;
    transform: translateY(-2px);
}

.ms-cart-link {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #3d2213;
    border: 1px solid rgba(199, 163, 107, .52);
    text-decoration: none;
    font-size: 10px;
    letter-spacing: .1em;
    text-transform: uppercase;
    transition: .45s cubic-bezier(.22, 1, .36, 1);
}

.ms-cart-link:hover {
    background: #fffaf2;
    color: #160b06;
}

/* Empty */
.ms-cart-empty {
    min-height: 360px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #160b06;
    text-align: center;
}

.ms-cart-empty__decor {
    width: 138px;
    height: 138px;
    border: 1px solid rgba(199, 163, 107, .34);
    border-radius: 50%;
    margin-bottom: 24px;
    position: relative;
}

.ms-cart-empty__decor::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 9px;
    height: 9px;
    background: #c7a36b;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 32px rgba(199, 163, 107, .66);
}

.ms-cart-empty__title {
    font-size: 18px;
    line-height: 1.2;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.ms-cart-empty__text {
    max-width: 260px;
    color: rgba(61, 34, 19, .62);
    font-size: 12px;
    line-height: 1.45;
    text-transform: uppercase;
}

/* Floating cart */
.ms-floating-cart {
    position: fixed;
    z-index: 8990;
    right: 28px;
    bottom: 28px;
    width: 62px;
    height: 62px;
    border: 1px solid rgba(199, 163, 107, .58);
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 20%, rgba(255,255,255,.42), transparent 28%),
        #3d2213;
    color: #fff;
    box-shadow: 0 18px 44px rgba(22, 11, 6, .28);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: .45s cubic-bezier(.22, 1, .36, 1);
}

.ms-floating-cart:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 24px 58px rgba(22, 11, 6, .36);
}

.ms-floating-cart__icon {
    width: 24px;
    height: 24px;
    display: block;
}

.ms-floating-cart__icon svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.ms-floating-cart__count {
    position: absolute;
    right: -3px;
    top: -3px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: #c7a36b;
    color: #160b06;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    line-height: 1;
    font-weight: 700;
    transition: .35s cubic-bezier(.22, 1, .36, 1);
}

.ms-floating-cart__count.is-pulse {
    animation: msCartPulse .45s cubic-bezier(.22, 1, .36, 1);
}

/* Animations */
@keyframes msCartPulse {
    0% {
        transform: scale(1);
    }

    45% {
        transform: scale(1.28);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes msCartItemIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile */
@media (max-width: 767px) {
    .ms-cart-drawer {
        top: 8px;
        right: 8px;
        bottom: 8px;
        width: calc(100vw - 16px);
    }

    .ms-cart-drawer__head {
        min-height: 88px;
        padding: 22px 20px 18px;
    }

    .ms-cart-drawer__title {
        font-size: 24px;
    }

    .ms-cart-drawer__body {
        padding: 0 20px 24px;
    }

    .ms-cart-summary {
        margin: 14px -20px -24px;
        padding: 22px 20px 24px;
    }

    .ms-cart-item {
        grid-template-columns: 64px 1fr;
        gap: 13px;
    }

    .ms-cart-item__image {
        width: 64px;
        height: 80px;
    }

    .ms-cart-item__title {
        font-size: 12px;
    }

    .ms-floating-cart {
        right: 18px;
        bottom: 18px;
        width: 56px;
        height: 56px;
    }
}
