/* External Cart Styles */

/* Mini Cart */
.wc-external-mini-cart {
    background: #fff;
    padding: 20px;
    max-width: 400px;
    width: 100%;
}

.widget_shopping_cart_content {
    position: relative;
    transition: all 0.3s ease;
}

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

.cart-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    position: relative;
    transition: opacity 0.2s ease;
}

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

.item-image {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    margin-right: 15px;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

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

.item-details h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-details .quantity {
    display: inline-block;
    margin-right: 10px;
    font-size: 13px;
    color: #666;
}

.item-details .price {
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    color: #000;
}

.remove-item {
    position: absolute;
    right: 0;
    top: 15px;
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s ease;
}

.remove-item:hover {
    color: #e74c3c;
}

/* Cart Total */
.cart-total {
    padding: 15px 0;
    border-top: 2px solid #000;
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
}

.cart-total strong {
    font-weight: 700;
}

.cart-total span {
    font-weight: 700;
    font-size: 18px;
}

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

.cart-actions .button {
    flex: 1;
    text-align: center;
    padding: 12px 20px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.cart-actions .button:not(.checkout) {
    background: #f5f5f5;
    color: #333;
}

.cart-actions .button.checkout {
    background: #000;
    color: #fff;
}

.cart-actions .button:hover {
    opacity: 0.8;
    transform: translateY(-1px);
}

/* Empty Cart */
.empty-cart {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}

/* Add to Cart Button Loading State */
.custom-add-to-cart.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.custom-add-to-cart.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Cart Count Badge */
.cart-count-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e74c3c;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

/* Notification Styles */
.wc-external-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    max-width: 350px;
}

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

.wc-external-notification.success {
    border-left: 4px solid #27ae60;
}

.wc-external-notification.error {
    border-left: 4px solid #e74c3c;
}

.wc-external-notification.warning {
    border-left: 4px solid #f39c12;
}

/* Cart Item Quantity Input */
.cart-item-quantity {
    width: 60px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    margin-right: 10px;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .wc-external-notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .cart-actions {
        flex-direction: column;
    }
    
    .cart-actions .button {
        width: 100%;
    }
}

/* Mini Cart Dropdown (if using dropdown style) */
.widget_shopping_cart_content.dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    margin-top: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

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

/* Cart Toggle Button */
.cart-toggle {
    position: relative;
    cursor: pointer;
    padding: 10px;
}

.cart-toggle .cart-icon {
    font-size: 24px;
}

/* Cart Count Badge */
.favourites-count-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e74c3c;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}