/* Overlay */
.cart-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cart-drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Sidebar structure */
.cart-drawer {
    position: fixed;
    top: 0;
    right: -450px;
    width: 100%;
    max-width: 450px;
    height: 100vh;
    background-color: #ffffff;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 15px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease-in-out;
    font-family: inherit;
}

.cart-drawer.active {
    right: 0;
}

/* Header */
.cart-drawer-header {
    display: flex;
    align-items: center;
    background-color: #1a1a1a;
    color: #ffffff;
    padding: 16px 20px;
}

.cart-drawer-close {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.cart-drawer-close i {
    width: 20px;
    height: 20px;
}

.cart-drawer-title {
    font-size: 1rem;
    font-weight: 500;
}

/* Body */
.cart-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px;
}

/* Item styling */
.cart-item {
    display: flex;
    padding-bottom: 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid #e0e0e0;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
}

.cart-item-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.cart-item-details {
    flex: 1;
}

.cart-item-sku {
    font-size: 0.65rem;
    color: #888;
    display: block;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.cart-item-name {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 10px 0;
    line-height: 1.3;
    color: #333;
}

.cart-item-price-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.cart-item-price-block {
    display: flex;
    flex-direction: column;
}

.cart-item-price-label {
    font-size: 0.65rem;
    color: #888;
}

.cart-item-price {
    font-size: 0.95rem;
    font-weight: 700;
    color: #000;
}

.cart-item-iva-note {
    font-size: 0.6rem;
    color: #999;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    border: 1px solid #ccc;
    border-radius: 20px;
    overflow: hidden;
    height: 28px;
    margin-top: 5px;
}

.qty-btn {
    background: none;
    border: none;
    width: 25px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #555;
    font-size: 1rem;
    padding: 0;
}

.qty-input {
    width: 30px;
    height: 100%;
    border: none;
    text-align: center;
    font-size: 0.85rem;
    outline: none;
    color: #333;
    -moz-appearance: textfield;
}
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.cart-item-delete {
    background: none;
    border: none;
    color: #fca311;
    cursor: pointer;
    margin-top: 5px;
    padding: 0;
}
.cart-item-delete i {
    width: 16px;
    height: 16px;
}

/* Footer (Summary & Checkout) */
.cart-drawer-footer {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    background-color: #fff;
}

.cart-coupon {
    display: flex;
    align-items: center;
    background-color: #f6f6f6;
    border-radius: 20px;
    padding: 4px 16px;
    margin-bottom: 20px;
}

.coupon-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.85rem;
    outline: none;
    padding: 6px 0;
}

.coupon-apply {
    background: none;
    border: none;
    color: #fca311;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0;
}

.cart-details-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 0px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.cart-summary {
    margin-top: 15px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: #333;
}

.summary-row strong {
    font-weight: 700;
    color: #000;
}

.cart-checkout-btn {
    width: 100%;
    background-color: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 14px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 20px;
}

.cart-checkout-btn:hover {
    background-color: #000;
}

.checkout-total {
    font-weight: 700;
}

@media (max-width: 991px) {
    .cart-drawer {
        right: 0;
        max-width: calc(100vw - var(--spacing-lg));
        width: calc(100vw - var(--spacing-lg));
        height: 100vh;
        height: 100dvh;
        max-height: 100vh;
        max-height: 100dvh;
        transform: translateX(100%);
        transition: transform 0.35s cubic-bezier(0.165, 0.84, 0.44, 1);
        will-change: transform;
    }

    .cart-drawer.active {
        right: 0;
        transform: translateX(0);
    }
}
