/**
 * Shared Cart Styles
 * Used across all cart-related pages and components
 */

/* ===== CART LOADING SKELETON STYLES ===== */
.cart-skeleton {
    animation: pulse 1.5s ease-in-out infinite alternate;
}

@keyframes pulse {
    0% { opacity: 1; }
    100% { opacity: 0.6; }
}

.skeleton-item {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-header { 
    height: 40px; 
    width: 200px; 
    margin-bottom: 20px; 
}

.skeleton-item-row { 
    height: 120px; 
    margin-bottom: 15px; 
}

.skeleton-pricing { 
    height: 200px; 
    width: 100%; 
}

.skeleton-button { 
    height: 40px; 
    width: 150px; 
}

.skeleton-text { 
    height: 20px; 
    margin-bottom: 10px; 
}

.skeleton-text.short { 
    width: 60%; 
}

.skeleton-text.medium { 
    width: 80%; 
}

.skeleton-text.long { 
    width: 100%; 
}

/* ===== NAVIGATION CART DROPDOWN STYLES ===== */
.dropdown-toggle::after {
    content: none;
}

/* .navbar .nav-item:not(:last-child) {
    margin-right: 35px; 
} */

.dropdown-toggle::after {
    transition: transform 0.15s linear;
}

.show.dropdown .dropdown-toggle::after {
    transform: translateY(3px);
}

.dropdown-menu {
    margin-top: 0;
}

/* Badge positioning handled by original _ecommerce.scss - don't override */

/* ===== CART INTERACTION STYLES ===== */
.cart-item-updating {
    opacity: 0.6;
    pointer-events: none;
}

.cart-item-error {
    border: 2px solid #dc3545;
    background-color: #f8d7da;
}

.cart-item-success {
    border: 2px solid #28a745;
    background-color: #d4edda;
}

/* Loading states for buttons */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== RESPONSIVE CART STYLES ===== */
@media (max-width: 768px) {
    .cart-skeleton .col-lg-8,
    .cart-skeleton .col-lg-4 {
        margin-bottom: 20px;
    }
    
    .skeleton-header {
        width: 100%;
    }
    
    .skeleton-button {
        width: 100%;
    }
}

/* ===== CART MINI DROPDOWN STYLES ===== */
.mini-basket-item table {
    width: 100%;
    font-size: 12px;
}

.mini-basket-item td {
    padding: 2px 5px;
    border: none;
}

.mini-basket-item .currency {
    text-align: right;
    font-weight: bold;
}

/* Ensure dropdown behaves consistently */
.dropdown-menu.cart-dropdown {
    min-width: 250px;
    max-width: 350px;
}

.dropdown-item.no-highlights:hover {
    background-color: transparent;
}

/* ===== TOAST NOTIFICATION FIXES ===== */
/* Remove any background images and pseudo-elements from toast notifications */
.product-toast,
.cart-toast {
    background-image: none !important;
}

.product-toast::before,
.product-toast::after,
.cart-toast::before,
.cart-toast::after {
    content: none !important;
    display: none !important;
    background-image: none !important;
}

.product-toast .alert,
.cart-toast .alert {
    background-image: none !important;
}

.product-toast.alert::before,
.product-toast.alert::after,
.cart-toast.alert::before,
.cart-toast.alert::after {
    content: none !important;
    display: none !important;
    background-image: none !important;
}

/* Remove any content from alert children except icons */
.product-toast span::before,
.product-toast span::after,
.cart-toast span::after,
.cart-toast span::before {
    content: none !important;
    display: none !important;
}

/* Ensure Font Awesome icons still work */
.product-toast i::before,
.cart-toast i::before {
    content: inherit !important;
    display: inline-block !important;
}
