.cart_resume {
    position: fixed;
    top: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.8);
    width: 100%;
    height: 100dvh;
    z-index: 2000;

    display: none;

    --cart-size: 16px;
    --cart-sidebar-size: 400px;

    font-size: var(--cart-size);
}

@keyframes enterFromRight {
    from {
      opacity: 0;
      transform: translateX(100%);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
}

@keyframes enterFromBottom {
    from {
      opacity: 0;
      transform: translateY(100%);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
}

@keyframes spin {
    0% {
      transform: rotate(0deg);
    }
    100% {
      transform: rotate(360deg);
    }
}

.cart_resume * {
    transition: all 250ms ease;
}

.cart_resume[data-open="false"] {
    display: none;
}

.cart_resume[data-open="true"] {
    display: flex;
}

.cart_resume .cart_resume_products_wrapper:not(:empty) + .cart_empty {
    display: none;
}

.cart_resume .cart_loading {
    display: none;
}

html:has(.cart_resume[data-open="true"]) {
    overflow: hidden;
}

.cart_resume_close {
    padding: 8px;
}

.cart_resume button {
    color: currentColor;
    background-color: transparent;
    border: none;
    outline: 0;
    border-radius: unset;
    width: fit-content;
    padding: 0;
    cursor: pointer;
}

.cart_resume button:hover {
    opacity: 0.8;
}

.cart_resume svg {
    fill: currentColor;
}

.cart_resume_products {
    width: 100%;
}

.cart_resume_container {
    color: var(--bodycolortext);
    background-color: var(--bodycolorbackground);
    width: 100%;
    max-width: var(--cart-sidebar-size);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.cart_resume_header,
.cart_resume_footer {
    padding: var(--cart-size);
    display: flex;
    align-items: center;
}

.cart_resume_footer {
    flex-direction: column;
    gap: var(--cart-size);
}

.cart_resume_total {
    width: 100%;
    display: flex;
}

.cart_resume_store_btn {
    max-width: 100%;
    padding: 12px;
    background-color: var(--bodycolortext);
    color: var(--bodycolorbackground);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    font-weight: 600;
    font-size: smaller;
    text-decoration: none;
    white-space: nowrap;
}

.cart_resume_store_btn:hover {
    opacity: 0.9;
}

.cart_resume_title,
.cart_resume_total_label {
    flex-grow: 1;
    font-weight: 600;
}

.cart_resume_total_price {
    font-weight: 600;
}

.cart_resume_products_wrapper {
    flex-grow: 1;
    overflow-y: auto;
    width: 100%;
}

.cart_product {
    width: 100%;
}

.cart_empty,
.cart_loading {
    width: 100%;
    height: 100%;
}

.cart_empty_container,
.cart_loading_container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: currentColor;
    opacity: 0.6;
    font-size: smaller;
    font-weight: 400;
}

.cart_loading_container div:has(svg) {
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart_loading_container div:has(svg) svg {
    animation: spin 1s linear infinite;
    fill: currentColor;
}

/* Product common */
.cart_resume button.cart_product_delete *  {
    transition: color 0s linear;
}

.cart_product_delete:hover {
    color: #cc4747;
}

.cart_product_price_sales {
    color: #cc4747;
}

.cart_product_price_tricked {
    text-decoration: line-through;
}

.cart_product_price_sales,
.cart_product_price_tricked,
.cart_product_price_integral,
.cart_product_custom_fields {
    max-width: 100%;
    font-size: smaller;
}

.cart_product_custom_fields {
    opacity: 0.8;
    font-weight: 300;
}

.cart_product_custom_field {
    width: 100%;
    hyphens: auto;
}

.cart_product_counter {
    display: flex;
    align-items: center;
    margin-top: auto;
    padding-top: 4px;
}

.cart_resume .cart_product_counter_quantity,
.cart_resume button.cart_product_counter_button {
    padding: 4px;
    font-size: smaller;
}

.cart_resume button.disabled {
    pointer-events: none;
    opacity: 0.4;
}


/* Default */
.cart_resume.wtps-cart-default {
    --cart-sidebar-size: 400px;
}

.wtps-cart-default {
    flex-direction: row;
    justify-content: end;
}

.wtps-cart-default .cart_resume_container {
    animation: enterFromRight 0.5s ease-out forwards;
}

.wtps-cart-default .cart_resume_header {
    border-bottom: 1px solid currentColor;
}

.wtps-cart-default .cart_resume_footer {
    border-top: 1px solid currentColor;
}

.wtps-cart-default .cart_product {
    display: flex;
    padding: 16px;
    align-items: flex-start;
    gap: 8px;
    align-self: stretch;
}

.wtps-cart-default .cart_product_image {
    width: 100px;
}

.wtps-cart-default .cart_product_image img {
    width: 100%;
    object-fit: contain;
    object-position: top center;
}

.wtps-cart-default .cart_product_details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    flex: 1 0 0;
    align-self: stretch;
}

.wtps-cart-default .cart_product_title {
    font-weight: 600;
}

.wtps-cart-default .cart_product_price {
    display: flex;
    flex-direction: row;
    gap: 4px;
    padding-top: 8px;
}

.wtps-cart-default .cart_resume_store_btn {
    width: 100%;
}

.wtps-cart-default .cart_product_delete {
    opacity: 0.6;
}

/* Bottom */
.cart_resume.wtps-cart-bottom {
    --cart-sidebar-size: 80%;
    --cart-size: 14px;
}

.wtps-cart-bottom {
    justify-content: end;
    flex-direction: column;
}

.wtps-cart-bottom .cart_resume_container {
    max-width: 100%;
    max-height: var(--cart-sidebar-size);
    animation: enterFromBottom 0.5s ease-out forwards;
}

.wtps-cart-bottom .cart_resume_products {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    height: fit-content;
}

.wtps-cart-bottom .cart_resume_header {
    border-bottom: 1px solid currentColor;
}

.wtps-cart-bottom .cart_resume_footer {
    border-top: 1px solid currentColor;
    flex-direction: row;
}

.wtps-cart-bottom .cart_product {
    position: relative;
    max-width: 270px;
    display: flex;
    flex-direction: column;
    padding: 16px;
    align-items: flex-start;
    gap: 8px;
    align-self: stretch;
}

.wtps-cart-bottom .cart_product_image {
    width: 100%;
    height: 230px;
}

.wtps-cart-bottom .cart_product_image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wtps-cart-bottom .cart_product_details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    flex: 1 0 0;
    align-self: stretch;
    
    font-weight: 300;
    text-transform: uppercase;

}

.wtps-cart-bottom .cart_product_custom_fields {
    text-transform: none;
}

.wtps-cart-bottom .cart_product_price {
    display: flex;
    flex-direction: row;
    gap: 4px;
    padding-top: 8px;
}

.wtps-cart-bottom .cart_product_counter {
    width: 100%;
}

.wtps-cart-bottom .cart_product_delete {
    text-transform: uppercase;
    font-weight: 300;
    font-size: smaller;
    margin-left: auto;
}

/* Mobile */
@media (max-width: 768px) {
    .wtps-cart-bottom .cart_resume_container {
        max-height: 100%;
    }
    .wtps-cart-bottom .cart_resume_products {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--cart-size);
        padding: var(--cart-size);
    }
    .wtps-cart-bottom .cart_product {
        padding: 0;
    }
    .wtps-cart-bottom .cart_product_image {
        height: 170px;
    }
}

