/**
 * Toast Notifications Styles
 *
 * @package Petalos_y_Raices
 */

/* Toast Container */
.petalos-toast-container {
    position: fixed;
    bottom: var(--spacing-lg);
    right: var(--spacing-lg);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    pointer-events: none;
    max-width: 400px;
    width: calc(100% - var(--spacing-lg) * 2);
}

/* Individual Toast */
.petalos-toast {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: var(--color-background);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 2px 10px rgba(0, 0, 0, 0.1);
    pointer-events: auto;
    transform: translateX(120%);
    opacity: 0;
    transition: all var(--transition-base);
    border-left: 4px solid var(--color-primary);
    max-width: 100%;
}

.petalos-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.petalos-toast.hiding {
    transform: translateX(120%);
    opacity: 0;
}

/* Toast Icon */
.petalos-toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-full);
}

.petalos-toast-icon svg {
    width: 20px;
    height: 20px;
}

/* Toast Content */
.petalos-toast-content {
    flex: 1;
    min-width: 0;
}

.petalos-toast-title {
    font-family: var(--font-heading);
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 2px;
    line-height: 1.3;
}

.petalos-toast-message {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: 1.4;
    word-wrap: break-word;
}

/* Toast Close Button */
.petalos-toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--color-text-light);
    transition: all var(--transition-fast);
    border-radius: var(--border-radius-sm);
    margin: -4px -4px -4px 0;
}

.petalos-toast-close:hover {
    color: var(--color-text-primary);
    background: var(--color-background-soft);
}

.petalos-toast-close svg {
    width: 16px;
    height: 16px;
    display: block;
}

/* Toast Progress Bar */
.petalos-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--color-border);
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
    overflow: hidden;
}

.petalos-toast-progress-bar {
    height: 100%;
    width: 100%;
    transform-origin: left;
    animation: toast-progress linear forwards;
}

@keyframes toast-progress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

/* Toast Types */

/* Success */
.petalos-toast.petalos-toast-success {
    border-left-color: #8B9D83;
}

.petalos-toast.petalos-toast-success .petalos-toast-icon {
    color: #8B9D83;
}

.petalos-toast.petalos-toast-success .petalos-toast-progress-bar {
    background: #8B9D83;
}

/* Error */
.petalos-toast.petalos-toast-error {
    border-left-color: #c0392b;
}

.petalos-toast.petalos-toast-error .petalos-toast-icon {
    color: #c0392b;
}

.petalos-toast.petalos-toast-error .petalos-toast-progress-bar {
    background: #c0392b;
}

/* Warning */
.petalos-toast.petalos-toast-warning {
    border-left-color: #f39c12;
}

.petalos-toast.petalos-toast-warning .petalos-toast-icon {
    color: #f39c12;
}

.petalos-toast.petalos-toast-warning .petalos-toast-progress-bar {
    background: #f39c12;
}

/* Info */
.petalos-toast.petalos-toast-info {
    border-left-color: #3498db;
}

.petalos-toast.petalos-toast-info .petalos-toast-icon {
    color: #3498db;
}

.petalos-toast.petalos-toast-info .petalos-toast-progress-bar {
    background: #3498db;
}

/* Cart Toast (special styling) */
.petalos-toast.petalos-toast-cart {
    border-left-color: var(--color-primary);
}

.petalos-toast-cart-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.petalos-toast-cart-image {
    width: 50px;
    height: 50px;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--color-background-soft);
}

.petalos-toast-cart-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.petalos-toast-cart-details {
    flex: 1;
    min-width: 0;
}

.petalos-toast-cart-name {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.petalos-toast-cart-price {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.petalos-toast-cart-link {
    display: inline-block;
    margin-top: var(--spacing-xs);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.petalos-toast-cart-link:hover {
    color: var(--color-text-primary);
}

/* Responsive */
@media (max-width: 480px) {
    .petalos-toast-container {
        bottom: var(--spacing-sm);
        right: var(--spacing-sm);
        left: var(--spacing-sm);
        width: auto;
        max-width: none;
    }

    .petalos-toast {
        padding: var(--spacing-sm);
    }

    .petalos-toast-title {
        font-size: var(--font-size-sm);
    }

    .petalos-toast-message {
        font-size: var(--font-size-xs);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .petalos-toast {
        transition: opacity var(--transition-fast);
        transform: none;
    }

    .petalos-toast.show {
        transform: none;
    }

    .petalos-toast.hiding {
        transform: none;
    }

    .petalos-toast-progress-bar {
        animation: none;
    }
}
