/* Add-to-cart feedback (js/cbp-cart-feedback.js): spinner / "Added" state on
   the pressed Add to Cart button, and page messages shown as toasts. Site-wide. */

/* ---------- Button state ---------- */
.cbp-btn-busy {
    position: relative !important;
    overflow: hidden;
    opacity: 1 !important; /* the button is disabled meanwhile; Luma fades disabled buttons */
}
.cbp-btn-state {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: inherit;
    border-radius: inherit;
    color: #fff;
    pointer-events: none;
}
.cbp-btn-added .cbp-btn-state { background: #17a35a; }
.cbp-btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: cbp-spin .7s linear infinite;
}
.cbp-btn-check {
    width: 14px;
    height: 14px;
    background: #fff;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2 8.5l4 4 8-9' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2 8.5l4 4 8-9' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
}
@keyframes cbp-spin { to { transform: rotate(360deg); } }

/* ---------- Toasts ---------- */
.page.messages.cbp-toasts {
    position: fixed;
    top: calc(12px + env(safe-area-inset-top, 0px));
    left: 12px;
    right: 12px;
    z-index: 10010; /* over the header, under the mobile menu drawer */
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
    pointer-events: none;
}
.page.messages.cbp-toasts .messages {
    margin: 0;
    padding: 0;
}
.page.messages.cbp-toasts .message {
    pointer-events: auto;
    position: relative;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    column-gap: 12px;
    align-items: start;
    margin: 0 0 8px;
    padding: 14px 44px 14px 14px;
    background: #fff;
    color: #1a1c1c;
    border: 0;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.05);
    font-size: 14px;
    line-height: 1.45;
    animation: cbp-toast-in .22s ease-out;
    transition: opacity .2s ease, transform .2s ease;
}
.page.messages.cbp-toasts .message.cbp-toast-out {
    opacity: 0;
    transform: translateY(-8px);
}
.page.messages.cbp-toasts .message.cbp-toast-hidden { display: none; }
@keyframes cbp-toast-in {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: none; }
}

/* Type icon in a coloured circle; Luma draws its own on the inner div */
.page.messages.cbp-toasts .message::before {
    content: '';
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #1a1c1c url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='3.5' r='1.5' fill='%23fff'/%3E%3Crect x='6.75' y='6.5' width='2.5' height='7' rx='1.25' fill='%23fff'/%3E%3C/svg%3E") no-repeat center / 14px;
}
.page.messages.cbp-toasts .message-success::before {
    background: #17a35a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2 8.5l4 4 8-9' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / 14px;
}
.page.messages.cbp-toasts .message-error::before,
.page.messages.cbp-toasts .message-warning::before {
    background: #e31e24 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect x='6.75' y='2.5' width='2.5' height='7' rx='1.25' fill='%23fff'/%3E%3Ccircle cx='8' cy='12.5' r='1.5' fill='%23fff'/%3E%3C/svg%3E") no-repeat center / 14px;
}
.page.messages.cbp-toasts .message-warning::before { background-color: #f0a500; }
.page.messages.cbp-toasts .message > div:first-child {
    grid-column: 2;
    padding-top: 3px;
}
.page.messages.cbp-toasts .message > div:first-child::before { display: none; }
.page.messages.cbp-toasts .message a {
    color: #e31e24;
    font-weight: 700;
    text-decoration: none;
}

/* yttheme.css / config_en.css style every button (padding, size, red fill)
   with !important, hence the !important here. */
.page.messages.cbp-toasts .cbp-toast-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50%;
    background: transparent !important;
    cursor: pointer;
}
.page.messages.cbp-toasts .cbp-toast-close::before {
    content: '';
    position: absolute;
    top: 9px;
    left: 9px;
    width: 14px;
    height: 14px;
    background: #888;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M2 2l10 10M12 2L2 12' stroke='%23000' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / contain;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M2 2l10 10M12 2L2 12' stroke='%23000' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / contain;
}
.page.messages.cbp-toasts .cbp-toast-close:hover::before { background: #1a1c1c; }

.page.messages.cbp-toasts .cbp-toast-actions {
    grid-column: 2;
    display: flex;
    gap: 8px;
    margin-top: 12px;
}
.page.messages.cbp-toasts .cbp-toast-btn {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    border-radius: 6px;
    background: #e31e24;
    color: #fff !important;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    text-decoration: none !important;
}
.page.messages.cbp-toasts .cbp-toast-btn:hover { background: #c81b20; }
.page.messages.cbp-toasts .cbp-toast-btn--ghost {
    background: #fff;
    border: 1px solid #d9d9d9;
    color: #1a1c1c !important;
}
.page.messages.cbp-toasts .cbp-toast-btn--ghost:hover { background: #f6f6f7; }

@media (min-width: 768px) {
    .page.messages.cbp-toasts {
        top: 24px;
        right: 24px;
        left: auto;
        width: 380px;
    }
}
