/* Ryjik Cart Toast — v1.2.0
   Дизайн-цель: ненавязчивая confirmation-плашка в духе Stripe/Linear.
   Десктоп: компактная одно-строчная карта, CTA — inline link с arrow.
   Мобильный: двух-рядная, CTA становится filled-button (thumb-tap).

   Токены матчат сайт: --ryjik-main (#f97316), Plus Jakarta Sans (inherit), 14px radius.
   z-index 9999900 ниже bottom-sheet фильтра (9999999). */

.ryjik-cart-toast {
    position: fixed;
    z-index: 9999900;
    bottom: 24px;
    right: 24px;
    max-width: calc(100vw - 32px);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px 12px 14px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 28px rgba(17, 24, 39, 0.10), 0 1px 2px rgba(17, 24, 39, 0.04);
    color: #1f2937;
    font-size: 14px;
    line-height: 1.35;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .22s ease, transform .22s ease;
    pointer-events: none;
}

.ryjik-cart-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* === icon (tinted circle, не filled — мягкое присутствие бренда) === */
.ryjik-cart-toast__icon {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(249, 115, 22, 0.12);
    color: var(--ryjik-main, #f97316);
}
.ryjik-cart-toast.is-warn .ryjik-cart-toast__icon {
    background: rgba(107, 114, 128, 0.12);
    color: #4b5563;
}
.ryjik-cart-toast__icon svg { display: block; }

/* === message === */
.ryjik-cart-toast__msg {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 600;
    color: #111827;
    word-wrap: break-word;
    /* Ограничиваем длину чтобы не растягивать карту на всю ширину */
    max-width: 240px;
}

/* === CTA (desktop = inline ghost-link с arrow) === */
.ryjik-cart-toast__cta {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 4px;
    color: var(--ryjik-main, #f97316);
    font-weight: 600;
    font-size: 14px;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: color .15s;
}
.ryjik-cart-toast__cta:hover,
.ryjik-cart-toast__cta:focus {
    color: var(--ryjik-main-hover, #ea580c);
    text-decoration: none;
}
.ryjik-cart-toast__cta-arrow {
    width: 14px;
    height: 14px;
    transition: transform .15s;
}
.ryjik-cart-toast__cta:hover .ryjik-cart-toast__cta-arrow {
    transform: translateX(2px);
}

/* === Close (×) === */
.ryjik-cart-toast__close {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    border: 0;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 6px;
    padding: 0;
    position: relative;
    transition: color .15s, background-color .15s;
}
.ryjik-cart-toast__close::before,
.ryjik-cart-toast__close::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 11px;
    height: 1.5px;
    background: currentColor;
    border-radius: 1px;
}
.ryjik-cart-toast__close::before { transform: translate(-50%, -50%) rotate(45deg); }
.ryjik-cart-toast__close::after  { transform: translate(-50%, -50%) rotate(-45deg); }
.ryjik-cart-toast__close:hover { color: #374151; background: #f3f4f6; }

/* CTA отключён на /cart/ и /checkout/ */
.ryjik-cart-toast.is-no-cta .ryjik-cart-toast__cta { display: none; }

/* ===== Mobile (<=600px) ===== */
/* Двух-рядная: icon+msg+close сверху, CTA filled-button снизу */
@media (max-width: 600px) {
    .ryjik-cart-toast {
        left: 12px;
        right: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        max-width: none;
        flex-wrap: wrap;
        column-gap: 12px;
        row-gap: 12px;
        padding: 14px;
        border-radius: 16px;
    }
    .ryjik-cart-toast__msg {
        max-width: none;
    }
    /* CTA на отдельную строку, filled-button с большим tap-target'ом */
    .ryjik-cart-toast__cta {
        order: 10;
        flex: 1 1 100%;
        height: 46px;
        padding: 0 16px;
        justify-content: center;
        background: var(--ryjik-main, #f97316);
        color: #fff;
        border-radius: 10px;
        font-size: 15px;
    }
    .ryjik-cart-toast__cta:hover,
    .ryjik-cart-toast__cta:focus {
        background: var(--ryjik-main-hover, #ea580c);
        color: #fff;
    }
    .ryjik-cart-toast__cta-arrow { display: none; }
    .ryjik-cart-toast__close {
        width: 28px;
        height: 28px;
    }
}

/* === Reduced motion === */
@media (prefers-reduced-motion: reduce) {
    .ryjik-cart-toast { transition: opacity .1s linear; transform: none; }
    .ryjik-cart-toast.is-visible { transform: none; }
    .ryjik-cart-toast__cta-arrow { transition: none; }
}
