/* Base toast styling */
.toastify.toast-woo {
    position: fixed !important; /* Sticky positioning - stays in place during scroll */
    font-size: 14px;
    border-radius: 6px;
    padding: 12px 32px 12px 14px; /* Extra right padding for close button */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-width: 280px;
    max-width: 500px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.5;
    letter-spacing: 0.01em;
    z-index: 9999 !important; /* High z-index to stay on top */
}

/* Close button positioning - top right */
.toastify.toast-woo .toast-close,
.toastify.toast-woo button[aria-label="Close"],
.toastify.toast-woo button.close {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    left: auto !important;
    width: 24px !important;
    height: 24px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 20px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    opacity: 0.85 !important;
    transition: opacity 0.2s ease, transform 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10 !important;
    transform: none !important;
}

.toastify.toast-woo .toast-close:hover,
.toastify.toast-woo button[aria-label="Close"]:hover,
.toastify.toast-woo button.close:hover {
    opacity: 1 !important;
    transform: scale(1.15) !important;
    color: #ffffff !important;
}

.toastify.toast-woo .toast-close:active,
.toastify.toast-woo button[aria-label="Close"]:active,
.toastify.toast-woo button.close:active {
    transform: scale(0.9) !important;
}

/* Types */
.toastify.toast-woo-success {
    background: #5a9e3a !important;
    color: #fff !important;
}

.toastify.toast-woo-error {
    background: #c0392b !important;
    color: #fff !important;
}

.toastify.toast-woo-notice,
.toastify.toast-woo-info {
    background: #2980b9 !important;
    color: #fff !important;
}

/* Slight hover polish - subtle lift effect */
.toastify.toast-woo:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Close button should scale independently on hover */
.toastify.toast-woo .toast-close:hover,
.toastify.toast-woo button[aria-label="Close"]:hover,
.toastify.toast-woo button.close:hover {
    transform: scale(1.15) !important;
}

/* Multi-buy offer toast: slightly different tone */
.toastify.toast-woo-mbo {
    background: linear-gradient(90deg, #6fb3d2, #4aa3c9) !important;
    color: #ffffff !important;
    box-shadow: 0 6px 18px rgba(74, 163, 201, 0.25);
}

/* Small screens: inset toast by 15px from left and right */
@media (max-width: 768px) {
    /* Target Toastify toast containers with our toast class */
    /* Toastify creates elements with class "toastify" plus our custom classes */
    .toastify.toast-woo {
        position: fixed !important; /* Keep fixed on mobile too */
        max-width: calc(100vw - 30px) !important;
        min-width: auto;
        left: 15px !important;
        right: 15px !important;
        width: auto !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        transform: none !important;
        z-index: 9999 !important;
    }
    
    /* Adjust padding on small screens */
    .toastify.toast-woo {
        padding: 12px 32px 12px 14px;
    }
    
    /* Override Toastify's centering on small screens */
    /* When position is 'center', Toastify uses transforms for centering */
    .toastify-center.toastify.toast-woo,
    .toastify.toast-woo.toastify-center {
        left: 15px !important;
        right: 15px !important;
        transform: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* Ensure all toast-woo variants get the same treatment */
    .toastify.toast-woo-success,
    .toastify.toast-woo-error,
    .toastify.toast-woo-notice,
    .toastify.toast-woo-info,
    .toastify.toast-woo-mbo {
        max-width: calc(100vw - 30px) !important;
        left: 15px !important;
        right: 15px !important;
        transform: none !important;
    }
}
