/* Trade-In Mini Cart Toast
   Namespaced as .mm-ti-* so it never collides with the WooCommerce mini cart. */

.mm-ti-cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}
.mm-ti-cart-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

html.mm-ti-cart-locked,
html.mm-ti-cart-locked body {
    overflow: hidden !important;
}

.mm-ti-cart-toast {
    position: fixed;
    top: 100px;
    right: 30px;
    width: 450px;
    max-width: calc(100vw - 40px);
    max-height: min(380px, calc(100vh - 90px));
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transform: translateX(calc(100% + 40px));
    opacity: 0;
    visibility: hidden;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease,
                visibility 0.25s ease;
    overflow: hidden;
}
.mm-ti-cart-toast.is-open {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
}

.mm-ti-cart-toast__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}
.mm-ti-cart-toast .mm-ti-cart-toast__title {
    margin: 0 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #000 !important;
    line-height: 1.3 !important;
}
.mm-ti-cart-close {
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
    padding: 4px !important;
    cursor: pointer;
    color: #000 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 0.15s ease;
}
.mm-ti-cart-close svg {
    display: block;
    stroke: #000 !important;
}
.mm-ti-cart-close:hover {
    background: none !important;
    background-color: transparent !important;
    color: #000 !important;
}

.mm-ti-cart-toast__body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 20px;
}
.mm-ti-cart-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 0;
}
.mm-ti-cart-empty__img {
    display: block;
    max-width: 100%;
    height: auto;
}

.mm-ti-cart-items {
    list-style: none;
    margin: 0;
    padding: 0;
}
.mm-ti-cart-toast .mm-ti-cart-item {
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: flex-start !important;
    gap: 12px !important;
    width: 100% !important;
    padding: 14px 0 !important;
    border-bottom: 1px solid #f0f0f0;
}
.mm-ti-cart-toast .mm-ti-cart-item:last-child {
    border-bottom: none;
}
.mm-ti-cart-toast .mm-ti-cart-item__image {
    flex: 0 0 60px !important;
    width: 60px !important;
    max-width: 60px !important;
    display: block;
}
.mm-ti-cart-item__image img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}
.mm-ti-cart-toast .mm-ti-cart-item__main {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    width: auto !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: stretch !important;
    gap: 8px;
    padding: 2px 0 2px 4px;
    min-height: 60px;
}
.mm-ti-cart-toast .mm-ti-cart-item__row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    box-sizing: border-box !important;
    gap: 16px;
}
.mm-ti-cart-toast .mm-ti-cart-item__row--bottom {
    align-items: flex-end !important;
}
.mm-ti-cart-toast .mm-ti-cart-item__titles {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px;
    padding-right: 4px;
}
.mm-ti-cart-toast .mm-ti-cart-item__pricewrap {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px;
    padding-right: 4px;
}
.mm-ti-cart-toast .mm-ti-cart-item__qty,
.mm-ti-cart-toast .mm-ti-cart-item__remove {
    flex: 0 0 auto !important;
    margin-left: auto !important;
}
.mm-ti-cart-toast .mm-ti-cart-item__name {
    display: block !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    color: #000 !important;
    line-height: 1.3 !important;
    margin: 0 !important;
}
.mm-ti-cart-toast .mm-ti-cart-item__variation {
    font-size: 9px !important;
    color: #999 !important;
    line-height: 1.3 !important;
    margin: 0 !important;
    font-weight: 500 !important;
}
.mm-ti-cart-toast .mm-ti-cart-item__price,
.mm-ti-cart-toast .mm-ti-cart-item__price * {
    font-size: 12px;
    font-weight: 600;
    color: #000;
    line-height: 16px !important;
}
.mm-ti-cart-toast .mm-ti-cart-item__price-original {
    font-size: 11px;
    font-weight: 500;
    color: #999;
    text-decoration: line-through;
    line-height: 16px !important;
}

.mm-ti-cart-toast .mm-ti-qty {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    border: none !important;
    background-color: #f5f5f5 !important;
    border-radius: 4px;
}
.mm-ti-cart-toast .mm-ti-qty__btn {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    background: #F2F2F2 !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    line-height: 1 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    text-decoration: underline !important;
    text-underline-offset: 2px !important;
    transition: background 0.15s ease !important;
}
.mm-ti-cart-toast .mm-ti-qty__btn:hover:not(:disabled) {
    background: #e5e5e5 !important;
    color: #000 !important;
}
.mm-ti-cart-toast .mm-ti-qty__btn:disabled {
    opacity: 0.4;
    cursor: not-allowed !important;
    pointer-events: none;
}
.mm-ti-cart-toast .mm-ti-qty__value {
    min-width: 24px !important;
    text-align: center !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #000 !important;
    line-height: 1 !important;
}

.mm-ti-cart-toast .mm-ti-cart-item__remove {
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    padding: 0 0 0 4px !important;
    height: 16px !important;
    min-height: 16px !important;
    box-sizing: content-box !important;
    cursor: pointer !important;
    color: #999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: none !important;
    text-shadow: none !important;
    border-radius: 0 !important;
    transform: translateY(-3px) !important;
    transition: color 0.15s ease !important;
}
.mm-ti-cart-toast .mm-ti-cart-item__remove:hover {
    background: none !important;
    background-color: transparent !important;
    color: #666 !important;
}
.mm-ti-cart-toast .mm-ti-cart-item__remove svg {
    display: block !important;
}

.mm-ti-cart-toast__footer {
    border-top: 1px solid #eee;
    padding: 16px 20px;
    background: #fff;
}
.mm-ti-cart-toast__footer--hidden {
    display: none !important;
}
.mm-ti-cart-actions {
    display: flex;
    gap: 10px;
}
.mm-ti-cart-toast .mm-ti-btn {
    flex: 1 !important;
    display: inline-block !important;
    padding: 12px 16px !important;
    text-align: center !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    text-decoration: none !important;
    transition: background 0.2s ease, color 0.2s ease !important;
    box-sizing: border-box !important;
}
.mm-ti-cart-toast .mm-ti-btn--secondary,
.mm-ti-cart-toast .mm-ti-btn--secondary:visited,
.mm-ti-cart-toast .mm-ti-btn--secondary:link {
    background: #fff !important;
    color: #000 !important;
    border: 1px solid #000 !important;
}
.mm-ti-cart-toast .mm-ti-btn--secondary:hover {
    background: #f5f5f5 !important;
    color: #000 !important;
}
.mm-ti-cart-toast .mm-ti-btn--primary,
.mm-ti-cart-toast .mm-ti-btn--primary:visited,
.mm-ti-cart-toast .mm-ti-btn--primary:link {
    background: #000 !important;
    color: #fff !important;
    border: 1px solid #000 !important;
}
.mm-ti-cart-toast .mm-ti-btn--primary:hover {
    background: #222 !important;
    color: #fff !important;
}

.mm-ti-cart-toast a,
.mm-ti-cart-toast a:hover,
.mm-ti-cart-toast a:visited,
.mm-ti-cart-toast a:focus,
.mm-ti-cart-toast a:active,
.mm-ti-cart-toast button {
    text-decoration: none !important;
}
.mm-ti-cart-toast button.mm-ti-qty__btn {
    text-decoration: underline !important;
    text-underline-offset: 2px !important;
}

@media (max-width: 480px) {
    .mm-ti-cart-toast {
        top: var(--mm-ti-header-offset, 0px) !important;
        right: 0;
        left: 0;
        bottom: 0;
        width: 100vw;
        max-width: 100vw;
        height: auto;
        max-height: calc(100vh - var(--mm-ti-header-offset, 0px));
        border-radius: 0;
        transform: translateX(100%);
    }
    .mm-ti-cart-toast.is-open {
        transform: translateX(0);
    }
}
