/**
 * Bangles Cart Styles
 * Modern cart UI components
 */

/* ========================================
   USER DROPDOWN (Header Account Menu)
======================================== */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-dropdown .user {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.user-dropdown .user h5 {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown .dropdown-toggle::after {
    display: none;
}

.user-dropdown .dropdown-menu {
    min-width: 200px;
    padding: 8px 0;
    border: none;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    margin-top: 10px !important;
}

.user-dropdown .dropdown-item {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.user-dropdown .dropdown-item i {
    width: 20px;
    color: #666;
}

.user-dropdown .dropdown-item:hover {
    background: #f5f7fa;
    color: #ffa500;
}

.user-dropdown .dropdown-item:hover i {
    color: #ffa500;
}

.user-dropdown .dropdown-item.text-danger:hover {
    background: #fff5f5;
    color: #dc3545;
}

.user-dropdown .dropdown-item.text-danger:hover i {
    color: #dc3545;
}

.user-dropdown .dropdown-divider {
    margin: 8px 0;
}

/* ========================================
   MINI CART SIDEBAR
======================================== */
.mini-cart-container {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: #fff;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.mini-cart-container.open {
    right: 0;
}

.mini-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.mini-cart-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.mini-cart-close {
    width: 36px;
    height: 36px;
    border: none;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    color: #666;
    transition: all 0.2s ease;
}

.mini-cart-close:hover {
    background: #f0f0f0;
    color: #333;
}

.mini-cart-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Cart Overlay */
body.mini-cart-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
}

/* ========================================
   CART EMPTY STATE
======================================== */
.cart-empty {
    text-align: center;
    padding: 60px 20px;
}

.cart-empty i {
    font-size: 64px;
    color: #ddd;
    margin-bottom: 20px;
}

.cart-empty p {
    font-size: 18px;
    color: #666;
    margin-bottom: 24px;
}

.btn-continue-shopping {
    display: inline-block;
    padding: 12px 28px;
    background: #ffa500;
    color: #fff;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-continue-shopping:hover {
    background: #e69500;
    color: #fff;
    transform: translateY(-2px);
}

/* ========================================
   CART ITEMS LIST
======================================== */
.cart-items-list {
    margin-bottom: 20px;
}

.cart-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
}

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

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

.cart-item-title {
    margin: 0 0 6px 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}

.cart-item-title a {
    color: #333;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cart-item-title a:hover {
    color: #ffa500;
}

.cart-item-variants {
    margin-bottom: 6px;
}

.variant-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 11px;
    color: #666;
    margin-right: 5px;
    margin-bottom: 3px;
}

.cart-item-pricing {
    margin-bottom: 8px;
}

.cart-item-price {
    font-size: 14px;
    font-weight: 600;
    color: #ffa500;
}

.cart-item-old-price {
    font-size: 12px;
    color: #999;
    text-decoration: line-through;
    margin-left: 6px;
}

/* Quantity Controls */
.cart-item-quantity {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.qty-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 12px;
    color: #333;
    transition: all 0.2s ease;
}

.qty-btn:hover:not(:disabled) {
    background: #ffa500;
    color: #fff;
}

.qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.qty-value {
    width: 40px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
}

/* Stock Warnings */
.cart-item-stock-warning {
    font-size: 11px;
    color: #ffa500;
    margin-top: 4px;
}

.cart-item-out-of-stock {
    font-size: 11px;
    color: #dc3545;
    font-weight: 600;
    margin-top: 4px;
}

/* Item Actions */
.cart-item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
}

.cart-item-total {
    font-size: 16px;
    font-weight: 700;
    color: #333;
}

.cart-item-remove {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: #999;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.cart-item-remove:hover {
    background: #fee;
    color: #dc3545;
}

/* ========================================
   CART SUMMARY
======================================== */
.cart-summary {
    border-top: 2px solid #eee;
    padding-top: 15px;
}

.cart-savings {
    background: linear-gradient(135deg, #ffa500 0%, #e69500 100%);
    color: #fff;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
}

.cart-savings i {
    margin-right: 6px;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.cart-total-label {
    font-size: 14px;
    color: #666;
}

.cart-total-value {
    font-size: 20px;
    font-weight: 700;
    color: #333;
}

.cart-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-view-cart,
.btn-checkout {
    flex: 1;
    padding: 14px 20px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-view-cart {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

.btn-view-cart:hover {
    background: #eee;
    color: #333;
}

.btn-checkout {
    background: #ffa500;
    color: #fff;
}

.btn-checkout:hover {
    background: #e69500;
    color: #fff;
    transform: translateY(-1px);
}

/* ========================================
   CART COUNT BADGE
======================================== */
.cart-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #dc3545;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 50px;
    position: absolute;
    top: -5px;
    right: -5px;
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s ease;
}

.cart-count.has-items {
    opacity: 1;
    transform: scale(1);
}

/* ========================================
   LOADING & NOTIFICATIONS
======================================== */
.cart-loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.cart-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f0f0f0;
    border-top-color: #ffa500;
    border-radius: 50%;
    animation: cart-spin 0.8s linear infinite;
}

@keyframes cart-spin {
    to {
        transform: rotate(360deg);
    }
}

.cart-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    z-index: 9999999;
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.3s ease;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    min-width: 280px;
    max-width: 400px;
}

.cart-notification i {
    font-size: 20px;
    flex-shrink: 0;
}

.cart-notification span {
    flex: 1;
    line-height: 1.4;
}

.cart-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.cart-notification-success {
    background: linear-gradient(135deg, #ffa500 0%, #e69500 100%);
    color: #fff !important;
}

.cart-notification-success i,
.cart-notification-success span {
    color: #fff !important;
}

.cart-notification-error {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: #fff !important;
}

.cart-notification-error i,
.cart-notification-error span {
    color: #fff !important;
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 480px) {
    .mini-cart-container {
        width: 100%;
        right: -100%;
    }

    .cart-item-image {
        width: 60px;
        height: 60px;
    }

    .cart-item-title {
        font-size: 13px;
    }

    .cart-notification {
        left: 20px;
        right: 20px;
        top: auto;
        bottom: 20px;
    }
}

/* ========================================
   CONFIRMATION MODAL
======================================== */
.cart-confirm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cart-confirm-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.cart-confirm-modal {
    background: #fff;
    border-radius: 16px;
    padding: 0;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.8) translateY(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cart-confirm-modal-overlay.show .cart-confirm-modal {
    transform: scale(1) translateY(0);
}

.cart-confirm-modal-header {
    padding: 30px 30px 20px;
    text-align: center;
}

.cart-confirm-modal-header i {
    font-size: 48px;
    color: #ffc107;
    margin-bottom: 15px;
    display: block;
}

.cart-confirm-modal-header h4 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #333;
}

.cart-confirm-modal-body {
    padding: 0 30px 25px;
    text-align: center;
}

.cart-confirm-modal-body p {
    margin: 0;
    font-size: 15px;
    color: #666;
    line-height: 1.6;
}

.cart-confirm-modal-footer {
    display: flex;
    border-top: 1px solid #eee;
}

.cart-modal-btn {
    flex: 1;
    padding: 18px 20px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cart-modal-btn-cancel {
    background: #f8f9fa;
    color: #666;
    border-radius: 0 0 0 16px;
}

.cart-modal-btn-cancel:hover {
    background: #e9ecef;
    color: #333;
}

.cart-modal-btn-confirm {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: #fff;
    border-radius: 0 0 16px 0;
}

.cart-modal-btn-confirm:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    transform: translateY(-1px);
}

/* Mobile responsive modal */
@media (max-width: 480px) {
    .cart-confirm-modal {
        width: 95%;
        margin: 20px;
    }

    .cart-confirm-modal-header {
        padding: 25px 20px 15px;
    }

    .cart-confirm-modal-header i {
        font-size: 40px;
    }

    .cart-confirm-modal-header h4 {
        font-size: 18px;
    }

    .cart-confirm-modal-body {
        padding: 0 20px 20px;
    }

    .cart-confirm-modal-body p {
        font-size: 14px;
    }

    .cart-modal-btn {
        padding: 15px;
        font-size: 14px;
    }
}