/* Custom Toast Styles - Modern UI, RTL & Responsive */

/* Base toast styles */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px; /* Visual right corner for both LTR/RTL */
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse; /* Stack new toasts at bottom, upwards */
    gap: 10px;
    align-items: flex-end;
    max-width: 350px;
    width: calc(100% - 40px); /* Responsive width */
    font-family: inherit;
    direction: rtl; /* Ensure RTL direction for Hebrew content */
}

.toast {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(20px); /* Slide up from below */
    transition: all 0.3s ease-in-out;
    font-size: 14px;
    line-height: 1.4;
    unicode-bidi: embed; /* Better RTL embedding */
    width: 100%; /* Full width of container */
    text-align: right; /* RTL text alignment */
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-inline-end: 12px; /* Logical spacing: works in RTL */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 12px;
    color: white;
}

.toast-content {
    flex: 1;
    word-wrap: break-word;
    text-align: right; /* Ensure RTL alignment for content */
    direction: rtl;
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    margin-inline-start: 12px; /* Logical spacing: works in RTL */
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
}

.toast-close:hover {
    opacity: 1;
}

/* Cart reminder specific: Stack text above button with no offset */
.cart-reminder .toast-content {
    display: flex;
    flex-direction: column;
    align-items: stretch; /* Full width alignment */
    gap: 6px; /* Tight spacing between text and button */
    margin: 0; /* No margins for flush alignment */
}

.cart-reminder .toast-text {
    margin: 0; /* No offset for text */
    line-height: 1.3;
}

/* Cart link/button styling - Make it noticeable, now full-width below text */
.cart-link {
    display: block; /* Block for full width */
    background-color: #28a745; /* Green background for success/CTA feel */
    color: white !important;
    text-decoration: none;
    padding: 8px 12px; /* Slightly more vertical padding for button feel */
    border-radius: 4px;
    font-weight: bold;
    font-size: 14px;
    line-height: 1.3;
    margin: 0; /* No margins for no offset */
    transition: background-color 0.2s ease, transform 0.1s ease;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
    direction: rtl;
    text-align: center;
    width: 100%; /* Full width */
}

.cart-link:hover {
    background-color: #218838; /* Darker green on hover */
    transform: translateY(-1px); /* Subtle lift effect */
    box-shadow: 0 3px 6px rgba(40, 167, 69, 0.4);
}

.cart-link:active {
    transform: translateY(0);
}

/* Type-specific styles */
.toast-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.toast-success .toast-icon {
    background-color: #28a745;
}

.toast-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.toast-error .toast-icon {
    background-color: #dc3545;
}

.toast-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.toast-info .toast-icon {
    background-color: #17a2b8;
}

.toast-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.toast-warning .toast-icon {
    background-color: #ffc107;
}

/* Hide default WooCommerce messages */
.woocommerce-message,
.woocommerce-error,
.woocommerce-info,
.woocommerce-notices-wrapper .notice {
    display: none !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .toast-container {
        right: 10px;
        bottom: 10px;
        gap: 8px;
        max-width: calc(100% - 20px);
    }
    
    .toast {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .toast-icon {
        width: 18px;
        height: 18px;
        font-size: 11px;
        margin-inline-end: 10px;
    }
    
    .toast-close {
        width: 18px;
        height: 18px;
        font-size: 16px;
        margin-inline-start: 10px;
    }

    .cart-reminder .toast-content {
        gap: 4px;
    }

    .cart-link {
        padding: 6px 10px;
        font-size: 13px;
    }
}