/* SkyAdmin Cart Widget Styles */

.skyadmin-cart-widget {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.cart-widget-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 160px;
}

.cart-widget-trigger:hover {
    border-color: #3b82f6;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.15);
    transform: translateY(-1px);
}

.cart-icon {
    position: relative;
    color: #6b7280;
}

.cart-icon svg {
    width: 24px;
    height: 24px;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

.cart-count:empty,
.cart-count[data-count="0"] {
    display: none;
}

.cart-summary {
    flex: 1;
}

.cart-total {
    font-weight: 600;
    color: #1f2937;
    font-size: 16px;
}

.cart-label {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Dropdown */
.cart-widget-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    width: 380px;
    max-height: 500px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

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

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

.cart-dropdown-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.close-dropdown {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.close-dropdown:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.cart-dropdown-content {
    max-height: 300px;
    overflow-y: auto;
    padding: 16px 20px;
}

.cart-loading {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
}

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

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 500;
    color: #1f2937;
    font-size: 14px;
    margin-bottom: 4px;
}

.cart-item-details {
    font-size: 12px;
    color: #6b7280;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
}

.quantity-btn {
    background: #f3f4f6;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    color: #6b7280;
    transition: all 0.2s ease;
}

.quantity-btn:hover {
    background: #e5e7eb;
    color: #1f2937;
}

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

.quantity-display {
    width: 30px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
}

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

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

.cart-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.cart-dropdown-footer {
    border-top: 1px solid #e5e7eb;
    padding: 16px 20px;
    background: #f9fafb;
}

.cart-dropdown-total {
    text-align: center;
    margin-bottom: 16px;
}

.cart-dropdown-total strong {
    font-size: 18px;
    color: #1f2937;
}

.cart-vat-note {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

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

.cart-dropdown-actions .btn {
    flex: 1;
    padding: 12px 16px;
    border-radius: 8px;
    text-decoration: none;
    text-align: center;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    display: block;
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.btn-primary {
    background: #3b82f6;
    color: white;
    border: 1px solid #3b82f6;
}

.btn-primary:hover {
    background: #2563eb;
    border-color: #2563eb;
}

/* Responsive */
@media (max-width: 480px) {
    .skyadmin-cart-widget {
        top: 10px;
        right: 10px;
    }
    
    .cart-widget-dropdown {
        width: calc(100vw - 20px);
        right: -10px;
    }
}

/* Animation for cart count updates */
.cart-count.updating {
    animation: pulse 0.3s ease;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}