/*
 * LEO Commerce UI — Favoritos v0.1 SAFE
 * Drawer global, sem interferir no carrinho/checkout.
 */

.leo-favorites-trigger {
    position: relative;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin: 0 5px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #071f6b;
    cursor: pointer;
    vertical-align: middle;
    box-sizing: border-box;
}

.leo-favorites-trigger svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.leo-favorites-trigger:hover,
.leo-favorites-trigger:focus-visible {
    color: #000;
}

.leo-favorites-trigger:focus-visible {
    outline: 2px solid #071f6b;
    outline-offset: 2px;
    border-radius: 50%;
}

.leo-favorites-trigger__count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    background: #111;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 17px;
    text-align: center;
    box-sizing: border-box;
}


.leo-favorites-layer [hidden],
.leo-favorites-toast[hidden],
.leo-favorites-trigger__count[hidden] {
    display: none !important;
}

body.leo-favorites-open {
    overflow: hidden !important;
}

.leo-favorites-layer {
    position: fixed;
    inset: 0;
    z-index: 1000005;
    pointer-events: none;
    visibility: hidden;
}

.leo-favorites-layer.is-open {
    pointer-events: auto;
    visibility: visible;
}

.leo-favorites-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(0, 0, 0, .42);
    opacity: 0;
    transition: opacity .18s ease;
    cursor: default;
}

.leo-favorites-layer.is-open .leo-favorites-backdrop {
    opacity: 1;
}

.leo-favorites-drawer {
    position: absolute;
    top: 0;
    right: 0;
    width: min(420px, 92vw);
    height: 100%;
    background: #fff;
    box-shadow: -14px 0 36px rgba(0, 0, 0, .16);
    transform: translateX(104%);
    transition: transform .22s ease;
    display: flex;
    flex-direction: column;
    outline: 0;
}

.leo-favorites-layer.is-open .leo-favorites-drawer {
    transform: translateX(0);
}

.leo-favorites-drawer__header {
    min-height: 76px;
    padding: 17px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid #eceff2;
    box-sizing: border-box;
}

.leo-favorites-drawer__header > div {
    min-width: 0;
}

.leo-favorites-drawer__header strong {
    display: block;
    margin: 0 0 3px;
    color: #111;
    font-size: 19px;
    line-height: 1.2;
}

.leo-favorites-drawer__summary {
    display: block;
    color: #767b80;
    font-size: 12px;
    line-height: 1.3;
}

.leo-favorites-close {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #e2e5e8;
    border-radius: 50%;
    background: #fff;
    color: #111;
    cursor: pointer;
}

.leo-favorites-close svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
}

.leo-favorites-drawer__body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 14px 16px 22px;
    overflow-y: auto;
    overscroll-behavior: contain;
    box-sizing: border-box;
}

.leo-favorites-loading,
.leo-favorites-error {
    margin: 8px 0;
    padding: 13px 14px;
    border-radius: 9px;
    background: #f5f6f7;
    color: #555;
    font-size: 13px;
}

.leo-favorites-error {
    background: #fff4f2;
    color: #8d241b;
    border: 1px solid #f0d0cb;
}

.leo-favorites-empty {
    min-height: 300px;
    padding: 42px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #555;
    box-sizing: border-box;
}

.leo-favorites-empty svg {
    width: 46px;
    height: 46px;
    margin-bottom: 15px;
    fill: none;
    stroke: #c9cdd1;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.leo-favorites-empty strong {
    margin-bottom: 6px;
    color: #222;
    font-size: 15px;
}

.leo-favorites-empty p {
    max-width: 260px;
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
}

.leo-favorites-list {
    display: grid;
    gap: 10px;
}

.leo-favorites-card {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 13px;
    padding: 12px;
    border: 1px solid #e6e9ec;
    border-radius: 11px;
    background: #fff;
    box-sizing: border-box;
}

.leo-favorites-card__image {
    width: 86px;
    height: 86px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #fafafa;
    overflow: hidden;
}

.leo-favorites-card__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.leo-favorites-card__body {
    min-width: 0;
}

.leo-favorites-card__name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0 0 5px;
    color: #1b1b1b;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.35;
    text-decoration: none;
}

.leo-favorites-card__price {
    margin-bottom: 3px;
    color: #111;
    font-size: 13px;
    font-weight: 700;
}

.leo-favorites-card__price del {
    color: #888;
    font-weight: 400;
}

.leo-favorites-card__stock {
    display: block;
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 650;
}

.leo-favorites-card__stock.is-in-stock {
    color: #157347;
}

.leo-favorites-card__stock.is-out-of-stock {
    color: #a33a32;
}

.leo-favorites-card__actions {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
}

.leo-favorites-card__view,
.leo-favorites-card__remove {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 750;
    line-height: 1.2;
    text-decoration: none;
    box-sizing: border-box;
}

.leo-favorites-card__view {
    border: 0;
    background: #111;
    color: #fff;
}

.leo-favorites-card__remove {
    border: 1px solid #dedede;
    background: #fff;
    color: #555;
    cursor: pointer;
}

.leo-favorites-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 1000007;
    transform: translate(-50%, 14px);
    max-width: min(440px, calc(100vw - 28px));
    padding: 10px 10px 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 10px;
    background: #151515;
    color: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
    opacity: 0;
    transition: opacity .18s ease, transform .18s ease;
    box-sizing: border-box;
}

.leo-favorites-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.leo-favorites-toast__text {
    min-width: 0;
    font-size: 12px;
    line-height: 1.35;
}

.leo-favorites-toast__open {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 6px 10px;
    border: 0;
    border-radius: 7px;
    background: #ffd400;
    color: #111;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

@media (max-width: 767px) {
    .leo-favorites-trigger {
        width: 32px;
        height: 32px;
        margin: 0 3px;
    }

    .leo-favorites-trigger svg {
        width: 21px;
        height: 21px;
    }

    .leo-favorites-drawer {
        width: 100%;
        max-width: 100%;
    }

    .leo-favorites-drawer__header {
        min-height: 70px;
        padding: 14px 15px;
    }

    .leo-favorites-drawer__body {
        padding: 12px 12px 20px;
    }

    .leo-favorites-card {
        grid-template-columns: 76px minmax(0, 1fr);
        gap: 11px;
        padding: 10px;
    }

    .leo-favorites-card__image {
        width: 76px;
        height: 76px;
    }

    .leo-favorites-toast {
        bottom: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .leo-favorites-backdrop,
    .leo-favorites-drawer,
    .leo-favorites-toast {
        transition: none !important;
    }
}
