/* ============================================================
   EXPRESS SHOP CART SHEET
============================================================ */

.es-cart-sheet-overlay {
    position: fixed;
    inset: 0;

    background: rgba(0, 0, 0, 0.45);

    opacity: 0;
    visibility: hidden;

    transition:
        opacity .22s ease,
        visibility .22s ease;

    z-index: 99990;
}

.es-cart-sheet-overlay.is-open {
    opacity: 1;
    visibility: visible;
}


/* ------------------------------------------------------------
   Sheet
------------------------------------------------------------ */

.es-cart-sheet {
    position: fixed;

    right: 0;
    bottom: 0;

    width: min(470px, 100%);
    height: min(760px, 92vh);

    display: flex;
    flex-direction: column;

    background: #fff;

    border-radius: 18px 18px 0 0;

    box-shadow:
        0 -10px 40px rgba(0, 0, 0, .18);

    transform: translateY(105%);

    transition:
        transform .28s cubic-bezier(.22, .61, .36, 1);

    z-index: 99991;

    overflow: hidden;

    visibility: hidden;
}

.es-cart-sheet.is-open {
    transform: translateY(0);
    visibility: visible;
}


/* ------------------------------------------------------------
   Header
------------------------------------------------------------ */

.es-cart-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    flex: 0 0 auto;

    padding: 17px 18px;

    border-bottom: 1px solid var(--es-border);

    background: #fff;
}

.es-cart-sheet-header h2 {
    margin: 0;

    color: var(--es-text);

    font-size: 18px;
    line-height: 1.2;
    font-weight: 700;
}

.es-cart-sheet-count {
    display: block;

    margin-top: 4px;

    color: var(--es-muted);

    font-size: 11px;
}

.es-cart-sheet-close {
    width: 36px;
    height: 36px;

    display: grid;
    place-items: center;

    border: 0;
    border-radius: 50%;

    background: #f3f5f4;

    color: var(--es-text);

    font-size: 24px;
    line-height: 1;

    cursor: pointer;
}


/* ------------------------------------------------------------
   Body
------------------------------------------------------------ */

.es-cart-sheet-body {
    flex: 1 1 auto;

    min-height: 0;

    overflow-y: auto;

    padding: 12px 15px 15px;

    overscroll-behavior: contain;

    -webkit-overflow-scrolling: touch;
}


/* ------------------------------------------------------------
   Cart item
------------------------------------------------------------ */

.es-cart-item {
    display: flex;

    gap: 11px;

    padding: 12px 0;

    border-bottom: 1px solid var(--es-border);
}

.es-cart-item:last-child {
    border-bottom: 0;
}

.es-cart-item-image {
    width: 62px;
    height: 62px;

    flex: 0 0 62px;

    overflow: hidden;

    border: 1px solid var(--es-border);
    border-radius: 9px;

    background: #f7f7f7;
}

.es-cart-item-image img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;
}

.es-cart-item-content {
    min-width: 0;
    flex: 1;
}

.es-cart-item-name {
    display: -webkit-box;

    overflow: hidden;

    color: var(--es-text);

    font-size: 13px;
    line-height: 1.35;
    font-weight: 600;

    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.es-cart-item-price {
    margin-top: 4px;

    color: var(--es-muted);

    font-size: 11px;
}

.es-cart-item-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 8px;

    margin-top: 8px;
}

.es-cart-item-total {
    color: var(--es-text);

    font-size: 14px;
    font-weight: 700;

    white-space: nowrap;
}


/* ------------------------------------------------------------
   Quantity control inside cart
------------------------------------------------------------ */

.es-cart-item-qty {
    display: inline-flex;
    align-items: center;

    height: 34px;

    overflow: hidden;

    border: 1px solid var(--es-border);
    border-radius: 8px;

    background: #fff;
}

.es-cart-item-qty button {
    width: 31px;
    height: 34px;

    padding: 0;

    border: 0;

    background: transparent;

    color: var(--es-text);

    font-size: 18px;

    cursor: pointer;
}

.es-cart-item-qty button:active {
    background: #f3f5f4;
}

.es-cart-item-qty input {
    width: 35px;
    height: 34px;

    padding: 0;

    border: 0;

    outline: 0;

    background: transparent;

    color: var(--es-text);

    font-size: 12px;
    font-weight: 700;

    text-align: center;
}


/* ------------------------------------------------------------
   Empty cart
------------------------------------------------------------ */

.es-cart-sheet-empty {
    flex: 1 1 auto;

    min-height: 0;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 5px;

    padding: 30px;

    text-align: center;
}

.es-cart-sheet-empty[hidden] {
    display: none;
}

.es-cart-sheet-empty-icon {
    width: 56px;
    height: 56px;

    display: grid;
    place-items: center;

    margin-bottom: 5px;

    border-radius: 50%;

    background: #f4f7f5;

    font-size: 25px;
}

.es-cart-sheet-empty strong {
    color: var(--es-text);

    font-size: 15px;
}

.es-cart-sheet-empty span {
    color: var(--es-muted);

    font-size: 12px;
}


/* ------------------------------------------------------------
   Footer
------------------------------------------------------------ */

.es-cart-sheet-footer {
    flex: 0 0 auto;

    padding: 13px 16px 16px;

    border-top: 1px solid var(--es-border);

    background: #fff;

    box-shadow:
        0 -4px 15px rgba(0, 0, 0, .04);
}

.es-cart-total-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 27px;

    color: var(--es-muted);

    font-size: 12px;
}

.es-cart-total-row strong {
    color: var(--es-text);

    font-size: 13px;
}

.es-cart-saving-row strong {
    color: var(--es-brand-dark);
}

.es-cart-payable-row {
    margin-top: 4px;
    padding-top: 8px;

    border-top: 1px dashed var(--es-border);

    color: var(--es-text);

    font-size: 14px;
}

.es-cart-payable-row strong {
    font-size: 19px;
    font-weight: 800;
}


/* ------------------------------------------------------------
   Checkout button
------------------------------------------------------------ */

.es-cart-sheet-checkout {
    width: 100%;
    min-height: 46px;

    margin-top: 11px;

    border: 0;
    border-radius: 10px;

    background: var(--es-brand);

    color: #fff;

    font-size: 14px;
    font-weight: 700;

    cursor: pointer;

    transition:
        transform .15s ease,
        opacity .15s ease;
}

.es-cart-sheet-checkout:active {
    transform: scale(.985);
}

.es-cart-sheet-checkout:disabled {
    opacity: .45;
    cursor: not-allowed;
}


/* ============================================================
   MOBILE
============================================================ */

@media (max-width: 767px) {

    .es-cart-sheet {
        width: 100%;

        height: min(760px, 90vh);

        border-radius: 18px 18px 0 0;
    }

    .es-cart-sheet-header {
        padding: 15px 15px;
    }

    .es-cart-sheet-body {
        padding-left: 13px;
        padding-right: 13px;
    }

    .es-cart-sheet-footer {
        padding:
            11px
            13px
            calc(13px + env(safe-area-inset-bottom));
    }
}


/* ============================================================
   VERY SMALL PHONES
============================================================ */

@media (max-width: 380px) {

    .es-cart-item-image {
        width: 54px;
        height: 54px;

        flex-basis: 54px;
    }

    .es-cart-item-name {
        font-size: 12px;
    }

    .es-cart-item-total {
        font-size: 13px;
    }

    .es-cart-item-qty button {
        width: 28px;
    }

    .es-cart-item-qty input {
        width: 31px;
    }
}