/* =========================================================
   CART DRAWER
   ========================================================= */

.dt-cart-drawer {
    position: fixed;
    inset: 0;

    z-index: 9999;

    display: flex;
    justify-content: flex-end;

    visibility: hidden;
    pointer-events: none;

    /*
     * On attend la fin de la fermeture avant de cacher
     * complètement le drawer.
     */
    transition: visibility 0s linear 0.7s;
}

.dt-cart-drawer.is-open {
    visibility: visible;
    pointer-events: auto;

    transition-delay: 0s;
}


/* =========================================================
   OVERLAY
   ========================================================= */

.dt-cart-drawer__overlay {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    padding: 0;
    border: 0;

    background: rgba(71, 62, 56, 0.60);

    opacity: 0;

    transition: opacity 0.65s ease-in-out;
}

.dt-cart-drawer.is-open .dt-cart-drawer__overlay {
    opacity: 1;

    transition-duration: 0.35s;
}


/* =========================================================
   PANEL
   ========================================================= */

.dt-cart-drawer__panel {
    position: relative;
    z-index: 2;

    display: flex;

    width: min(975px, 100%);
    height: 100vh;

    padding: 64px 125px 60px 80px;

    flex-direction: column;

    background: #fff;

    box-sizing: border-box;

    overflow: hidden;

    transform: translateX(100%);

    /* fermeture */
    transition:
        transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.dt-cart-drawer.is-open .dt-cart-drawer__panel {
    transform: translateX(0);

    /* ouverture plus rapide */
    transition-duration: 0.4s;
    transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}


/* =========================================================
   HEADER
   ========================================================= */

.dt-cart-drawer__header {
    position: relative;

    display: flex;

    width: 100%;

    padding-bottom: 24px;

    align-items: center;
    justify-content: space-between;

    border-bottom: 0.5px solid #0E0E0E;
}

.dt-cart-drawer__header,
.dt-cart-drawer__summary,
.dt-cart-drawer__actions {
    flex-shrink: 0;
}

.dt-cart-drawer__title {
    margin: 0;

    color: #0E0E0E;

    font-family: "Scheherazade New", serif;
    font-size: 45px;
    font-weight: 400;
    line-height: 50px;
}

.dt-cart-drawer__close {
    position: relative;

    display: flex;

    width: 32px;
    height: 32px;

    padding: 8px;

    align-items: center;
    justify-content: center;

    border: 0;
    background: transparent;

    cursor: pointer;
}

.dt-cart-drawer__close span {
    position: absolute;

    width: 19px;
    height: 1.5px;

    background: #0E0E0E;
}

.dt-cart-drawer__close span:first-child {
    transform: rotate(45deg);
}

.dt-cart-drawer__close span:last-child {
    transform: rotate(-45deg);
}


/* =========================================================
   ITEMS
   ========================================================= */

.dt-cart-drawer__items {
    width: 100%;

    flex: 1 1 auto;

    min-height: 0;

    overflow-y: auto;
    overflow-x: hidden;

    padding-right: 12px;
}

.dt-cart-drawer__items {
    scrollbar-width: thin;
    scrollbar-color: #818181 #eee;
}

.dt-cart-drawer__items::-webkit-scrollbar {
    width: 6px;
}

.dt-cart-drawer__items::-webkit-scrollbar-track {
    background: #eee;
}

.dt-cart-drawer__items::-webkit-scrollbar-thumb {
    background: #818181;
    border-radius: 10px;
}

.dt-cart-item {
    display: grid;

    grid-template-columns: 128px 1fr auto;

    width: 100%;
    min-height: 182px;

    padding: 32px 0;

    column-gap: 32px;

    border-bottom: 0.5px solid #0E0E0E;

    box-sizing: border-box;
}


/* IMAGE */

.dt-cart-item__image-wrapper {
    display: flex;

    width: 128px;
    height: 128px;

    align-items: center;
    justify-content: center;

    border: 1px solid #EEE;
}

.dt-cart-item__image {
    display: block;

    max-width: 100%;
    max-height: 100%;

    object-fit: contain;
}


/* CONTENT */

.dt-cart-item__content {
    display: flex;

    flex-direction: column;
    align-items: flex-start;
}

.dt-cart-item__title {
    margin: 0 0 6px;

    color: #0E0E0E;

    font-family: "Mulish", sans-serif;
    font-size: 20px;
    font-weight: 800;
    line-height: 25px;
}

.dt-cart-item__description {
    margin: 0 0 28px;

    color: #0E0E0E;

    font-family: "Mulish", sans-serif;
    font-size: 17px;
    font-weight: 400;
    line-height: 24px;
}


/* =========================================================
   QUANTITY
   ========================================================= */

.dt-cart-item__quantity {
    display: inline-flex;

    width: 128px;
    height: 43px;

    align-items: center;
    justify-content: center;

    gap: 8px;

    border: 1px solid #0E0E0E;
    border-radius: 14px;

    background: #FCFBFA;

    box-sizing: border-box;
}

.dt-cart-item__quantity-button {
    display: flex;

    width: 16px;
    height: 16px;

    padding: 0;

    align-items: center;
    justify-content: center;

    border: 1px solid #0E0E0E;

    background: transparent;

    color: #0E0E0E;

    font-family: "Mulish", sans-serif;
    font-size: 14px;
    line-height: 1;

    cursor: pointer;
}

.dt-cart-item__quantity-button:hover{
    background-color: #0E0E0E;
    color:white;
}

.dt-cart-item__quantity-value {
    width: 56px;
    min-width: 0;
    padding: 0 2px;
    border: 0;
    outline: 0;
    background: transparent;

    color: #0E0E0E;

    text-align: center;

    font-family: "Mulish", sans-serif;
    font-size: 17px;
    font-weight: 400;
    line-height: 24px;

    appearance: textfield;
    -moz-appearance: textfield;
}

.dt-cart-item__quantity-value::-webkit-inner-spin-button,
.dt-cart-item__quantity-value::-webkit-outer-spin-button {
    margin: 0;
    appearance: none;
}


/* =========================================================
   RIGHT
   ========================================================= */

.dt-cart-item__right {
    display: flex;

    min-width: 110px;

    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
}

.dt-cart-item__price {
    color: #0E0E0E;

    text-align: right;

    font-family: "Mulish", sans-serif;
    font-size: 20px;
    font-weight: 800;
    line-height: 25px;
}

.dt-cart-item__remove {
    display: inline-flex;

    padding: 0;

    align-items: center;

    gap: 6px;

    border: 0;
    background: transparent;

    color: #818181;

    font-family: "Inter", sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 28px;

    cursor: pointer;
}

.dt-cart-item__remove:hover {
    font-weight: 700;
}

.dt-cart-item__remove-icon {
    display: block;

    width: 15px;
    height: 17px;
    flex-shrink: 0;
    object-fit: contain;
    pointer-events: none;
}


/* =========================================================
   SUMMARY
   ========================================================= */

.dt-cart-drawer__summary {
    display: flex;

    width: 100%;

    padding-top: 30px;
    margin-top: 0;

    flex-direction: column;
    gap: 14px;

    flex-shrink: 0;
}

.dt-cart-drawer__summary[hidden] {
    display: none;
}

.dt-cart-drawer__summary-row {
    display: flex;

    width: 100%;

    align-items: center;
    justify-content: space-between;

    color: #818181;

    font-family: "Mulish", sans-serif;
    font-size: 17px;
    line-height: 24px;
}

.dt-cart-drawer__summary-row[hidden] {
    display: none;
}

.dt-cart-drawer__summary-row--total {
    color: #0E0E0E;
}

.dt-cart-drawer__summary-row--total strong {
    font-size: 20px;
    font-weight: 800;
}


/* =========================================================
   ACTIONS
   ========================================================= */

.dt-cart-drawer__actions {
    display: flex;

    width: 100%;

    margin-top: 36px;

    align-items: center;

    gap: 32px;
}

.dt-cart-drawer__continue,
.dt-cart-drawer__checkout {
    display: flex;

    flex: 1 1 0;
    min-width: 0;
    min-height: 43px;

    padding: 12px 26px 13px;

    align-items: center;
    justify-content: center;

    box-sizing: border-box;

    border-radius: 10px;

    font-family: "Mulish", sans-serif;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.6px;
    text-align: center;

    text-decoration: none;

    cursor: pointer;
}

.dt-cart-drawer__continue {
    border: 1px solid #0E0E0E;

    background: #fff;

    color: #0E0E0E;
}

.dt-cart-drawer__checkout {
    border: 1px solid #E3BA67;

    background: #E3BA67;

    color: #0E0E0E;
}

.dt-cart-drawer__checkout:hover , .dt-checkout-cart__order-button:hover
{
    background: #0E0E0E;
    color: white;
}


/* =========================================================
   BODY WHEN OPEN
   ========================================================= */

body.dt-cart-open {
    overflow: hidden;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1000px) {

    .dt-cart-drawer__panel {
        width: min(760px, 90vw);

        padding: 50px 50px 45px;
    }

    .dt-cart-drawer__title {
        font-size: 40px;
        line-height: 44px;
    }

    .dt-cart-item {
        grid-template-columns: 110px 1fr auto;

        column-gap: 24px;
    }

    .dt-cart-item__image-wrapper {
        width: 110px;
        height: 110px;
    }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 650px) {

    .dt-cart-drawer__panel {
        width: 100%;
        height: 100dvh;
        max-height: 100dvh;

        padding: 20px 20px calc(16px + env(safe-area-inset-bottom, 0px));
    }

    .dt-cart-drawer__items {
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .dt-cart-drawer__header {
        padding-bottom: 18px;
    }

    .dt-cart-drawer__title {
        font-size: 32px;
        line-height: 38px;
    }

    .dt-cart-item {
        grid-template-columns: 90px 1fr;

        min-height: auto;

        padding: 24px 0;

        gap: 18px;
    }

    .dt-cart-item__image-wrapper {
        width: 90px;
        height: 90px;
    }

    .dt-cart-item__right {
        grid-column: 2;

        width: 100%;

        flex-direction: row;

        align-items: center;
    }

    .dt-cart-item__title {
        font-size: 18px;
        line-height: 23px;
    }

    .dt-cart-item__description {
        margin-bottom: 18px;

        font-size: 15px;
        line-height: 22px;
    }

    .dt-cart-item__quantity {
        width: 130px;
        height: 38px;
    }

    .dt-cart-item__price {
        font-size: 17px;
    }

    .dt-cart-item__remove {
        font-size: 14px;
        flex-direction: row-reverse;
    }

    .dt-cart-drawer__summary {
        margin-top: 16px;
        padding-top: 12px;
        gap: 8px;
    }

    .dt-cart-drawer__actions {
        margin-top: 16px;
        align-items: stretch;
        gap: 10px;
    }

    .dt-cart-drawer__continue,
    .dt-cart-drawer__checkout {
        padding: 10px 12px;
        font-size: 15px;
        line-height: 1.2;
    }
}

@media (max-width: 650px) and (max-height: 500px) {
    .dt-cart-drawer__panel {
        padding: 12px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    }

    .dt-cart-drawer__header {
        padding-bottom: 8px;
    }

    .dt-cart-drawer__title {
        font-size: 28px;
        line-height: 32px;
    }

    .dt-cart-drawer__summary {
        margin-top: 8px;
        padding-top: 8px;
        gap: 4px;
    }

    .dt-cart-drawer__summary-row {
        font-size: 14px;
        line-height: 18px;
    }

    .dt-cart-drawer__summary-row--total strong {
        font-size: 17px;
    }

    .dt-cart-drawer__actions {
        margin-top: 8px;
    }

    .dt-cart-drawer__checkout {
        min-height: 38px;
    }
}

.dt-cart-item__unit-price {
    margin: 0;
    color: #0E0E0E;
    font-family: "Mulish", sans-serif;
    font-size: 14px;
    font-weight: 700;
    line-height: 20px;
}

.dt-product-availability-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    margin: 10px 0px;
}

.dt-product-availability-row__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 5px 10px;
    border-radius: 8px;
    color: #0E0E0E;
    font-family: "Mulish", sans-serif;
    font-size: 15px;
    font-weight: 600;
    line-height: 18px;
}

.dt-product-availability-row__badge--green { background: #68D54D; }
.dt-product-availability-row__badge--yellow { background: #E7E300; }
.dt-product-availability-row__badge--red { background: #D50000; color: #FFF; }
.dt-product-availability-row__badge--neutral { background: #303b4a; color: #FFF; }

.dt-product-availability-row__message {
    color: #0E0E0E;
    font-family: "Mulish", sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 16px;
}

.dt-cart-drawer__checkout.is-disabled {
    cursor: not-allowed;
    opacity: .55;
}

.dt-cart-drawer__empty {
    margin: 24px 0;
    color: #555;
    font-family: "Mulish", sans-serif;
}
