/* 
      ============================================= MODAL DRAWER CART =============================================
*/
.modal-drawer-overlay-cart {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9997;
    opacity: 0;
    transition: all 0.3s ease-in-out;
    visibility: hidden;
}

.modal-drawer-overlay-cart.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Drawer Cart */
.modal-drawer-cart {
    position: fixed;
    top: 0;
    right: -448px;
    /* Inicialmente oculto fuera de la pantalla */
    max-width: 448px;
    width: 100%;
    height: 100vh;
    background-color: var(--white-color);
    box-shadow: -4px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 9998;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease-in-out;
    overflow-y: auto;
}

.modal-drawer-cart.active {
    right: 0;
}

/*
====================== HEADER DEL CARRITO ================
*/
.modal-drawer-header-cart {
    padding: 0.5rem;
    border-bottom: 1px solid var(--gray-color-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--gray-color-100);
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-drawer-header-cart-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-drawer-title-cart {
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
    color: var(--gray-color-900);
}

.modal-drawer-item-count-cart {
    font-size: 0.875rem;
    color: var(--gray-color-600);
    margin: 0;
}

.modal-drawer-close-cart {
    font-size: 1rem;
    background: none;
    border: none;
    color: var(--gray-color-900);
    padding: 8px;
    cursor: pointer;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.modal-drawer-close-cart:hover {
    background-color: var(--gray-color-100);
}

.modal-drawer-close-cart svg {
    width: 24px;
    height: 24px;
}

/*
====================== CONTENIDO DEL CARRITO ================
*/
.modal-drawer-content-cart {
    flex: 1;
    padding: 0.5rem;
    overflow-y: auto;
    background-color: var(--gray-color-50);
}

/*-------------------------------- Mensaje de carrito vacío */
.empty-cart-message {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray-color-500);
}

.empty-cart-message svg {
    width: 4rem;
    height: 4rem;
    color: var(--gray-color-300);
}

.empty-cart-message-text {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    color: var(--gray-color-500);
}

.empty-cart-message-text p {
    margin: 0;
    font-size: 0.875rem;
}

.empty-cart-message-text p:first-child {
    font-weight: 600;
    color: var(--dark-color);
}





/* ------------------- TARJETA DEL CARRITO ----------------------------- */
.cart-items-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-item {
    display: flex;
    gap: 1rem;
    border: 1px solid var(--gray-color-200);
    border-radius: 8px;
    background-color: var(--white-color);
    padding: 0.5rem;
}

.cart-item-image {
    height: 100px;
    width: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--gray-color-100);
}


.cart-item-details {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
}


.cart-item-name {
    font-size: 0.875rem;
    font-weight: 500;
    margin: 0;
    color: var(--gray-color-900);
    line-height: 1.3;
}

.cart-item-price {
    margin-top: 0.6rem;
    width: 100%;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.cart-unit-price {
    font-size: 0.875rem;
    color: var(--gray-color-500);
    margin: 0;
}

.cart-total-price {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-color-900);
    margin: 0;
}

.cart-item-controls {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 0.5rem;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--gray-color-500);
    border-radius: 8px;
    padding: 4px;
}

.btn-quantity-minus,
.btn-quantity-plus {
    background: none;
    border: none;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.btn-quantity-minus:hover,
.btn-quantity-plus:hover {
    background-color: var(--gray-color-200);
}

.btn-quantity-minus svg,
.btn-quantity-plus svg {
    width: 20px;
    height: 20px;
    color: var(--gray-color-600);
}

.quantity {
    min-width: 32px;
    text-align: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-color-900);
}

.btn-remove-item {
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove-item svg {
    width: 20px;
    height: 20px;
    color: red;
}

.btn-remove-item:hover {
    background-color: #fee;
}

.btn-remove-item:focus {
    outline: 2px solid var(--primary-color-500);
    outline-offset: 2px;
}


/*
====================== FOOTER DEL CARRITO ================
*/
.modal-drawer-footer-cart {
    padding: 1rem 0.5rem;
    border-top: 1px solid var(--gray-color-200);
    background-color: var(--gray-color-50);
    position: sticky;
    bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.modal-drawer-footer-cart-link-continue,
.modal-drawer-footer-cart-link-see {
    width: 100%;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    transition: background-color 0.2s ease;
    display: block;
    font-weight: 500;
    font-size: 0.875rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.modal-drawer-footer-cart-link-continue {
    background-color: var(--primary-color-500);
    color: var(--white-color);
}

.modal-drawer-footer-cart-link-see {
    background-color: var(--white-color);
    border: 1px solid var(--gray-color-500);
    color: var(--gray-color-900);
}

.modal-drawer-footer-cart-link-continue:hover {
    background-color: var(--primary-color-600);
    color: var(--white-color);
    text-decoration: none;
}

.modal-drawer-footer-cart-link-see:hover {
    background-color: var(--gray-color-200);
    color: var(--gray-color-900);
    text-decoration: none;
}

.modal-drawer-footer-cart-link-continue svg,
.modal-drawer-footer-cart-link-see svg {
    width: 1.25rem;
    height: 1.25rem;
}

.modal-drawer-footer-cart-security {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-color-500);
    justify-content: center;
}

.modal-drawer-footer-cart-security svg {
    width: 1rem;
    height: 1rem;
    color: var(--gray-color-600);
}

.modal-drawer-footer-cart-security p {
    margin: 0;
    font-size: 0.875rem;
}

.cart-total-section {
    margin-bottom: 1rem;
}

.modal-cart-footer-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Prevenir scroll cuando el modal está abierto */
body.modal-drawer-open-cart {
    overflow: hidden;
}