/* Desktop cart side drawer */
.cart-drawer {
    position: fixed;
    inset: 0;
    z-index: 100000;
    pointer-events: none;
    visibility: hidden;
}

.cart-drawer.is-open {
    pointer-events: auto;
    visibility: visible;
}

.cart-drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.cart-drawer.is-open .cart-drawer-backdrop {
    opacity: 1;
}

.cart-drawer-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 420px;
    height: 100%;
    background: #fff;
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.cart-drawer.is-open .cart-drawer-panel {
    transform: translateX(0);
}

.cart-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e8ecf0;
    flex-shrink: 0;
}

.cart-drawer-title {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #333;
}

.cart-drawer-close {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 18px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.cart-drawer-close:hover {
    background: #f0f3f6;
    color: #333;
}

.cart-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

.cart-drawer-item {
    display: flex;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid #f0f2f5;
}

.cart-drawer-item:first-child {
    padding-top: 0;
}

.cart-drawer-item-thumb {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e8ecf0;
}

.cart-drawer-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-drawer-item-info {
    flex: 1;
    min-width: 0;
}

.cart-drawer-item-name {
    font-size: 12px;
    color: #888;
    margin: 0 0 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cart-drawer-item-brand {
    font-size: 14px;
    font-weight: 700;
    color: #111;
    margin: 0 0 6px;
}

.cart-drawer-item-price {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px;
}

.cart-drawer-item-remove {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: none;
    background: none;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    text-decoration: underline;
}

.cart-drawer-item-remove:hover {
    color: #e74c3c;
}

.cart-drawer-empty {
    text-align: center;
    padding: 48px 16px;
    color: #888;
}

.cart-drawer-empty i {
    font-size: 40px;
    color: #c5d0da;
    margin-bottom: 12px;
}

.cart-drawer-footer {
    flex-shrink: 0;
    padding: 20px 24px 24px;
    border-top: 1px solid #e8ecf0;
    background: #fafbfc;
}

.cart-drawer-totals {
    margin-bottom: 16px;
}

.cart-drawer-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 14px;
    color: #666;
}

.cart-drawer-total-grand {
    padding-top: 12px;
    margin-top: 8px;
    border-top: 1px solid #e0e4e8;
    font-size: 15px;
    color: #333;
}

.cart-drawer-total-grand strong {
    font-size: 18px;
    font-weight: 800;
    color: #111;
}

.cart-drawer-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 4px;
    text-decoration: none !important;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    margin-bottom: 10px;
    box-sizing: border-box;
}

.cart-drawer-btn:last-child {
    margin-bottom: 0;
}

.cart-drawer-btn.outline {
    background: #fff;
    color: #333;
    border: 1px solid #ccc;
}

.cart-drawer-btn.outline:hover {
    border-color: #333;
    color: #111;
}

.cart-drawer-btn.primary {
    background: #fff;
    color: #111 !important;
    border: 1px solid #111;
}

.cart-drawer-btn.primary:hover {
    background: #111;
    color: #fff !important;
}

body.cart-drawer-open {
    overflow: hidden;
}

/* Mobile: drawer hidden, use page redirect */
@media (max-width: 991px) {
    .cart-drawer {
        display: none !important;
    }
}
