/* ============================================================
   Sticky Add-to-Cart + Toast notification (Fungiline)
   File: feature-sticky-toast.css
   ============================================================ */

/* ---------- Sticky ATC bar ---------- */
.sticky-atc {
    position: fixed;
    left: 0;
    right: 0;
    bottom: -120px;
    z-index: 999;
    background: #fff;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
    padding: 12px 16px;
    transition: bottom 0.25s ease;
    pointer-events: none;
    opacity: 0;
}

.sticky-atc.is-visible {
    bottom: 0;
    pointer-events: auto;
    opacity: 1;
}

.sticky-atc__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.sticky-atc__left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1 1 auto;
}

.sticky-atc__thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    background: #F8F6F0;
    flex: 0 0 48px;
}

.sticky-atc__meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.sticky-atc__name {
    font-size: 14px;
    font-weight: 600;
    color: #243F2F;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 480px;
}

.sticky-atc__price {
    font-size: 14px;
    color: #243F2F;
    line-height: 1.25;
}

.sticky-atc__price ins {
    text-decoration: none;
    font-weight: 600;
}

.sticky-atc__price del {
    opacity: 0.55;
    margin-right: 6px;
}

.sticky-atc__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #243F2F;
    color: #fff;
    text-decoration: none;
    border: 0;
    border-radius: 999px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
    flex: 0 0 auto;
}

.sticky-atc__btn:hover,
.sticky-atc__btn:focus {
    background: #1a2f23;
    color: #fff;
    text-decoration: none;
}

.sticky-atc__btn:active {
    transform: scale(0.98);
}

@media (max-width: 768px) {
    .sticky-atc {
        padding: 10px 12px;
    }
    .sticky-atc__inner {
        gap: 10px;
    }
    .sticky-atc__thumb {
        width: 40px;
        height: 40px;
        flex: 0 0 40px;
    }
    .sticky-atc__price {
        display: none;
    }
    .sticky-atc__name {
        font-size: 13px;
        max-width: 60vw;
    }
    .sticky-atc__btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}

@media (max-width: 420px) {
    .sticky-atc__meta {
        flex: 1 1 auto;
    }
    .sticky-atc__name {
        max-width: 45vw;
    }
}

/* ---------- Toast notification ---------- */
.toast {
    position: fixed;
    top: 100px;
    right: 24px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border-left: 4px solid #243F2F;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    padding: 16px 20px;
    max-width: 360px;
    transform: translateX(120%);
    transition: transform 0.25s ease, opacity 0.25s ease;
    opacity: 0;
}

.toast.is-visible {
    transform: translateX(0);
    opacity: 1;
}

.toast__check {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #243F2F;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
}

.toast__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1 1 auto;
    min-width: 0;
}

.toast__title {
    font-size: 13px;
    font-weight: 600;
    color: #243F2F;
    line-height: 1.2;
}

.toast__name {
    font-size: 13px;
    color: rgba(36, 63, 47, 0.75);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 220px;
}

.toast__link {
    font-size: 13px;
    font-weight: 600;
    color: #243F2F;
    text-decoration: underline;
    text-underline-offset: 3px;
    white-space: nowrap;
    flex: 0 0 auto;
}

.toast__link:hover,
.toast__link:focus {
    color: #1a2f23;
}

.toast__close {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    border: 0;
    background: transparent;
    color: rgba(36, 63, 47, 0.6);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    border-radius: 4px;
    transition: color 0.15s ease, background 0.15s ease;
}

.toast__close:hover,
.toast__close:focus {
    color: #243F2F;
    background: rgba(36, 63, 47, 0.06);
}

@media (max-width: 768px) {
    .toast {
        top: auto;
        right: 16px;
        left: 16px;
        bottom: 20px;
        max-width: none;
        transform: translateY(150%);
    }
    .toast.is-visible {
        transform: translateY(0);
    }
    .toast__name {
        max-width: none;
    }
}

/* Keep toast above sticky ATC visually on mobile by shifting sticky a bit when toast active */
@media (max-width: 768px) {
    body.has-toast .sticky-atc.is-visible {
        bottom: 100px;
    }
}
