:root {
    --itbs-fav-red: #ff385c;
    --itbs-fav-bg: #fff;
    --itbs-fav-shadow: 0 18px 30px -18px rgba(15, 23, 42, 0.36);
}

.itbs-fav-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid #ffe2e6;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 12px 20px -14px rgba(255, 56, 92, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
    z-index: 6;
}

.itbs-fav-btn svg {
    width: 22px;
    height: 22px;
    stroke: var(--itbs-fav-red);
    fill: rgba(255, 56, 92, 0.04);
    transition: transform 0.15s ease, fill 0.15s ease, stroke 0.15s ease;
}

.itbs-fav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 26px -16px rgba(255, 56, 92, 0.6);
}

.itbs-fav-btn.active svg,
.itbs-fav-btn[aria-pressed="true"] svg {
    fill: var(--itbs-fav-red);
    stroke: var(--itbs-fav-red);
}

.itbs-fav-btn-inline {
    position: static;
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 12px;
    border: 1px solid #ffd0dc;
    background: #fff;
    box-shadow: 0 8px 16px -12px rgba(255, 56, 92, 0.4);
}
.itbs-fav-btn-inline svg {
    width: 20px;
    height: 20px;
}

.itbs-fav-btn:focus-visible {
    outline: 2px solid var(--itbs-fav-red);
    outline-offset: 2px;
}

.itbs-fav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid #ffe2e6;
    background: #ffffff;
    color: var(--itbs-fav-red);
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: 0 10px 22px -18px rgba(255, 56, 92, 0.55);
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.itbs-fav-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 28px -20px rgba(255, 56, 92, 0.65);
}

.itbs-fav-toggle:focus-visible {
    outline: 2px solid var(--itbs-fav-red);
    outline-offset: 2px;
}

.itbs-fav-icon svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.itbs-fav-pill {
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--itbs-fav-red);
    color: #fff;
    font-size: 12px;
    line-height: 24px;
    text-align: center;
    box-shadow: 0 8px 16px -12px rgba(248, 113, 113, 1);
}

.itbs-fav-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 360px;
    max-width: calc(100vw - 24px);
    z-index: 60;
    display: none;
    pointer-events: none;
}

.itbs-fav-panel.is-open {
    display: block;
    pointer-events: auto;
    animation: itbsFavFade 0.2s ease;
}

.itbs-fav-panel__inner {
    background: var(--itbs-fav-bg);
    border: 1px solid #f3f4f6;
    border-radius: 18px;
    box-shadow: var(--itbs-fav-shadow);
    overflow: hidden;
}

.itbs-fav-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    background: linear-gradient(145deg, #fff7fa, #ffffff);
}

.itbs-fav-panel__title {
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
}

.itbs-fav-panel__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 10px;
    background: #ffe4eb;
    color: #c81d45;
    border-radius: 999px;
    font-size: 13px;
}

.itbs-fav-panel__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.itbs-fav-clear,
.itbs-fav-close {
    border: none;
    background: #f8fafc;
    color: #0f172a;
    padding: 8px 12px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.itbs-fav-clear:hover {
    background: #fff0f4;
    color: #c81d45;
    box-shadow: 0 10px 20px -18px rgba(200, 29, 69, 0.5);
}

.itbs-fav-close {
    padding: 8px 10px;
}

.itbs-fav-close:hover {
    background: #e2e8f0;
}

.itbs-fav-list {
    max-height: 60vh;
    overflow-y: auto;
    padding: 12px;
    display: grid;
    gap: 10px;
}

.itbs-fav-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    padding: 10px;
    border: 1px solid #f1f5f9;
    border-radius: 14px;
    background: #ffffff;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.itbs-fav-item:hover {
    transform: translateY(-1px);
    border-color: #e2e8f0;
    box-shadow: 0 12px 24px -18px rgba(15, 23, 42, 0.22);
}

.itbs-fav-thumb {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    object-fit: cover;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
}

.itbs-fav-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.itbs-fav-title {
    font-weight: 700;
    color: #0f172a;
    font-size: 15px;
    line-height: 1.3;
    word-break: break-word;
}

.itbs-fav-sub {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #475569;
    flex-wrap: wrap;
}

.itbs-fav-price-inline {
    font-weight: 800;
    color: #0f172a;
    font-size: 13px;
}

.itbs-fav-more {
    font-weight: 700;
    font-size: 12px;
    color: #2563eb;
}

.itbs-fav-chip {
    padding: 4px 8px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    font-weight: 700;
}

.itbs-fav-price {
    color: #0ea5e9;
}

.itbs-fav-empty {
    padding: 24px 18px;
    text-align: center;
    color: #94a3b8;
    font-weight: 600;
}

.itbs-fav-panel a {
    text-decoration: none;
}

.itbs-fav-fab {
    position: fixed;
    right: 16px;
    bottom: calc(18px + env(safe-area-inset-bottom));
    min-width: 68px;
    height: 38px;
    padding: 0 12px;
    border-radius: 12px;
    clip-path: polygon(8% 0, 92% 0, 100% 22%, 100% 78%, 92% 100%, 8% 100%, 0 78%, 0 22%);
    border: none;
    background: linear-gradient(180deg, #ff5a7b, #ff385c);
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 22px 32px -18px rgba(248, 113, 113, 0.9);
    z-index: 58;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.itbs-fav-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 24px 36px -18px rgba(248, 113, 113, 1);
}

.itbs-fav-fab:active {
    transform: translateY(0);
}

.itbs-fav-fab__icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.itbs-fav-fab__count {
    min-width: 28px;
    height: 22px;
    padding: 0 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.34);
    font-weight: 800;
    font-size: 12px;
}

.itbs-fav-panel.is-mobile {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(96px + env(safe-area-inset-bottom));
    width: auto;
    max-width: none;
    transform-origin: bottom center;
}

@media (max-width: 1023px) {
    .itbs-fav-fab {
        display: inline-flex;
    }
    .itbs-fav-panel {
        max-height: 80vh;
    }
    .itbs-fav-list {
        max-height: 50vh;
    }
    .itbs-fav-toggle--desktop {
        display: none;
    }
}

@media (max-width: 640px) {
    .itbs-fav-panel.is-mobile {
        left: 8px;
        right: 8px;
        bottom: calc(88px + env(safe-area-inset-bottom));
    }
    .itbs-fav-item {
        grid-template-columns: 60px 1fr;
    }
    .itbs-fav-thumb {
        width: 60px;
        height: 60px;
    }
}

@keyframes itbsFavFade {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
