/* Cart Dropdown Styles */
.cart-icon-wrapper {
    position: relative;
    display: inline-block;
    text-decoration: none !important;
}

.cart-icon {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cart-icon:hover {
    transform: scale(1.05);
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    min-width: 20px;
    padding: 2px;
}

/* .cart-badge.hidden {
    display: none;
} */

/* Cart Dropdown */
.cart-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 400px;
    max-width: 90vw;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    border: 1px solid #e1e8ed;
}

.cart-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

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

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

.close-cart {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

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

/* Cart Items */
.cart-items {
    max-height: 400px;
    overflow-y: auto;
    padding: 0;
}

.empty-cart {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-cart img {
    width: 60px;
    height: 60px;
    opacity: 0.3;
    margin-bottom: 15px;
}

.empty-cart p {
    font-size: 16px;
    margin: 10px 0 5px;
    color: #333;
}

.empty-cart small {
    color: #999;
    font-size: 14px;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #f1f3f4;
    transition: background-color 0.2s ease;
}

.cart-item:hover {
    background-color: #f8f9fa;
}

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

.cart-item-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    margin-right: 15px;
    flex-shrink: 0;
}

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

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

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

.cart-item-price {
    font-size: 14px;
    color: var(--text-color);
    font-weight: 600;
    margin: 0;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 15px;
    flex-shrink: 0;
}

.quantity-controls {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border-radius: 6px;
    overflow: hidden;
}

.quantity-btn {
    background: none;
    border: none;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #666;
    font-size: 16px;
    transition: all 0.2s ease;
}

.quantity-btn:hover {
    background: #e9ecef;
    color: #333;
}

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

.quantity-display {
    min-width: 30px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    padding: 0 5px;
}

.remove-item {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 16px;
}

.remove-item:hover {
    background: #f8d7da;
}

/* Cart Footer */
.cart-footer {
    padding: 20px;
    border-top: 1px solid #f1f3f4;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

.cart-total {
    margin-bottom: 20px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.total-row.shipping {
    color: var(--text-color);
    font-size: 13px;
}

.total-row.final {
    border-top: 1px solid #dee2e6;
    padding-top: 10px;
    margin-top: 10px;
    font-size: 16px;
}

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

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

.btn-view-cart {
    background: transparent;
    color: #333;
    border: 2px solid #333;
}

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

.btn-checkout {
    background: #333;
    color: white;
}

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

/* Animations */
.cart-item-enter {
    animation: slideInFromRight 0.3s ease-out;
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.cart-item-remove {
    animation: slideOutToRight 0.3s ease-out forwards;
}

@keyframes slideOutToRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(20px);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .cart-dropdown {
        width: 350px;
        right: 5px;
    }
    
    .cart-item-name {
        font-size: 13px;
    }
    
    .cart-item-price {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .cart-dropdown {
        width: 300px;
        right: 5px;
    }
    
    .cart-dropdown-header {
        padding: 15px;
    }
    
    .cart-item {
        padding: 12px 15px;
    }
    
    .cart-item-image {
        width: 50px;
        height: 50px;
        margin-right: 12px;
    }
    
    .cart-footer {
        padding: 15px;
    }
    
    .cart-actions {
        flex-direction: column;
    }
}

/* Scrollbar Styling */
.cart-items::-webkit-scrollbar {
    width: 6px;
}

.cart-items::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.cart-items::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.cart-items::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Cart Icon Highlight Effect */
.cart-highlight {
    animation: cartHighlight 2s ease-in-out;
    position: relative;
}

.cart-highlight::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 2px solid #ff4757;
    border-radius: 50%;
    animation: highlightPulse 2s ease-in-out;
    pointer-events: none;
}

@keyframes cartHighlight {
    0%, 100% { 
        transform: scale(1); 
        filter: brightness(1);
    }
    25% { 
        transform: scale(1.1); 
        filter: brightness(1.2);
    }
    50% { 
        transform: scale(1.05); 
        filter: brightness(1.1);
    }
    75% { 
        transform: scale(1.1); 
        filter: brightness(1.2);
    }
}

@keyframes highlightPulse {
    0% { 
        opacity: 0; 
        transform: scale(0.8); 
    }
    25% { 
        opacity: 1; 
        transform: scale(1.2); 
    }
    50% { 
        opacity: 0.7; 
        transform: scale(1.1); 
    }
    75% { 
        opacity: 1; 
        transform: scale(1.2); 
    }
    100% { 
        opacity: 0; 
        transform: scale(1.3); 
    }
}

/* Scroll Indicator */
.scroll-indicator {
    position: fixed;
    top: 20px;
    right: 50%;
    transform: translateX(50%);
    z-index: 9998;
    background: rgba(255, 71, 87, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.scroll-indicator.show {
    opacity: 1;
    transform: translateX(50%) translateY(10px);
}

.scroll-indicator::after {
    content: '↑';
    margin-left: 5px;
    animation: arrowBounce 1s ease-in-out infinite;
}

@keyframes arrowBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}
