/**
 * ============================================================
 * Ahmadiyad - Premium Women's Undergarments E-Commerce
 * Developed by: Etarnity Global Innovation
 * Website: https://etarnity.com
 * ============================================================
 * Slide-out Cart Drawer (Mini Cart Sidebar for PC & Desktop)
 */

/* Overlay */
.cart-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(42, 14, 21, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1080;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.cart-drawer-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Drawer Container */
.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 420px;
    max-width: 100vw;
    background: #FFFFFF;
    box-shadow: -8px 0 35px rgba(74, 31, 39, 0.22);
    z-index: 1090;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s ease;
    font-family: var(--font);
}

.cart-drawer.active {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
}

/* Header */
.cart-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    background: #FFFFFF;
}

.cart-drawer-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
}

.cart-drawer-title i {
    color: var(--secondary);
    font-size: 20px;
}

.cart-drawer-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-soft);
    color: var(--secondary);
    border: 1px solid rgba(213, 0, 109, 0.2);
    font-size: 12px;
    font-weight: 700;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border-radius: 50px;
}

.cart-drawer-close {
    background: #FAFAFA;
    border: 1px solid var(--border);
    color: var(--text);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.2s ease;
}

.cart-drawer-close:hover {
    background: var(--secondary);
    border-color: var(--secondary);
    color: #FFFFFF;
    transform: rotate(90deg);
}

/* Shipping Notice */
.cart-drawer-shipping-notice {
    background: var(--bg-soft);
    padding: 10px 24px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px dashed rgba(213, 0, 109, 0.25);
}

.cart-drawer-shipping-notice i {
    color: var(--secondary);
    font-size: 15px;
}

/* Body / Items Scroll Area */
.cart-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

.cart-drawer-body::-webkit-scrollbar {
    width: 5px;
}

.cart-drawer-body::-webkit-scrollbar-track {
    background: #F5F5F5;
}

.cart-drawer-body::-webkit-scrollbar-thumb {
    background: #DDD;
    border-radius: 4px;
}

.cart-drawer-body::-webkit-scrollbar-thumb:hover {
    background: #CCC;
}

/* Empty State */
.cart-drawer-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    height: 100%;
}

.cart-drawer-empty .empty-icon {
    width: 72px;
    height: 72px;
    background: var(--bg-soft);
    color: var(--secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin-bottom: 16px;
}

.cart-drawer-empty h4 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.cart-drawer-empty p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
    max-width: 240px;
}

.cart-drawer-shop-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    background: var(--text);
    color: #FFFFFF;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all 0.25s ease;
}

.cart-drawer-shop-btn:hover {
    background: var(--secondary);
    box-shadow: 0 4px 14px rgba(213, 0, 109, 0.35);
    transform: translateY(-1px);
}

/* Cart Item Card */
.cart-drawer-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid #F1F5F9;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
    overflow: hidden;
    transition: background 0.2s ease;
}

.cart-drawer-item:last-child {
    border-bottom: none;
}

.cart-drawer-item-img {
    width: 68px;
    height: 82px;
    min-width: 68px;
    max-width: 68px;
    border-radius: 10px;
    overflow: hidden;
    background: #FAF8F9;
    flex-shrink: 0;
    border: 1px solid #F1F5F9;
}

.cart-drawer-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cart-drawer-item-details {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 6px;
    overflow: hidden;
}

.cart-drawer-item-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.cart-drawer-item-title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13.5px;
    font-weight: 700;
    color: #0F172A;
    margin: 0;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    display: block;
    transition: color 0.2s ease;
}

.cart-drawer-item-title:hover {
    color: var(--secondary, #D5006D);
}

.cart-drawer-item-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #64748B;
    margin: 0;
    flex-wrap: wrap;
    min-width: 0;
}

.cart-drawer-item-meta span {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    padding: 1.5px 6px;
    border-radius: 4px;
    font-weight: 600;
    white-space: nowrap;
}

.cart-drawer-item-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-width: 0;
    gap: 8px;
    margin-top: 2px;
}

.cart-drawer-item-price {
    font-size: 14px;
    font-weight: 800;
    color: var(--secondary, #D5006D);
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Quantity Control inside Drawer */
.cart-drawer-qty {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    background: #FFFFFF;
    overflow: hidden;
    height: 28px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.cart-drawer-qty-btn {
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    color: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.15s ease;
    padding: 0;
    user-select: none;
}

.cart-drawer-qty-btn:hover {
    background: var(--bg-soft, #FFF0F5);
    color: var(--secondary, #D5006D);
}

.cart-drawer-qty-val {
    width: 28px;
    text-align: center;
    font-size: 12.5px;
    font-weight: 700;
    color: #0F172A;
    line-height: 28px;
    background: #F8FAFC;
    border-left: 1px solid #F1F5F9;
    border-right: 1px solid #F1F5F9;
}

/* Remove button */
.cart-drawer-remove-btn {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: #94A3B8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    padding: 0;
    transition: all 0.2s ease;
}

.cart-drawer-remove-btn:hover {
    background: #FEE2E2;
    color: #DC2626;
    transform: scale(1.08);
}

/* Footer & Checkout Area */
.cart-drawer-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border);
    background: #FFFFFF;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.03);
}

.cart-drawer-summary {
    margin-bottom: 16px;
}

.cart-drawer-summary .summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    margin-bottom: 6px;
    color: var(--text-muted);
}

.cart-drawer-summary .summary-row.total {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    padding-top: 6px;
    border-top: 1px dashed var(--border);
    margin-bottom: 4px;
}

.cart-drawer-summary .total-amount {
    color: var(--secondary);
    font-size: 18px;
}

.summary-taxes {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
}

/* Action Buttons in Drawer */
.cart-drawer-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cart-drawer-checkout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 0;
    background: var(--secondary);
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 14px rgba(213, 0, 109, 0.3);
}

.cart-drawer-checkout-btn:hover {
    background: var(--text);
    box-shadow: 0 4px 14px rgba(74, 31, 39, 0.35);
    transform: translateY(-1px);
    color: #FFFFFF;
}

/* Responsive adjustment */
@media (max-width: 480px) {
    .cart-drawer {
        width: 100vw;
        max-width: 100vw;
    }
    .cart-drawer-header,
    .cart-drawer-body,
    .cart-drawer-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
    .cart-drawer-item-img {
        width: 60px;
        height: 74px;
        min-width: 60px;
        max-width: 60px;
    }
    .cart-drawer-item-title {
        font-size: 13px;
    }
    .cart-drawer-item-price {
        font-size: 13.5px;
    }
}







