/* JO-Dealz - Favorite (follow) buttons for categories, subcategories and stores.
   Shared by desktop and mobile; state is driven by [aria-pressed] set in favorites.js.
   Box sizing uses !important because the mobile CSS forces every <button> to
   padding:10px 16px / font-size:16px (!important) and a 44px minimum. */

.fav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-width: 0 !important;
    min-height: 38px !important;
    padding: 0.45rem 0.95rem !important;
    border-radius: 9999px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #334155;
    font-size: 0.75rem !important;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}
.fav-btn[hidden] { display: none; }
.fav-btn:hover { border-color: var(--color-primary, #F52A3B); color: var(--color-primary, #F52A3B); }
.fav-btn:active { transform: scale(0.96); }
.fav-btn:focus-visible { outline: 2px solid var(--color-primary, #F52A3B); outline-offset: 2px; }
.fav-btn i { font-size: 0.85rem; }

.fav-btn[aria-pressed="true"] {
    background: var(--color-primary, #F52A3B);
    border-color: var(--color-primary, #F52A3B);
    color: #fff;
}
.fav-btn[aria-pressed="true"]:hover { background: var(--color-primary-hover, #B50045); border-color: var(--color-primary-hover, #B50045); color: #fff; }

.fav-btn[aria-busy="true"] { opacity: 0.65; pointer-events: none; }

/* Icon-only round variant (subcategory cards, compact headers) */
.fav-btn--icon {
    width: 38px;
    height: 38px;
    min-height: 38px !important;
    padding: 0 !important;
    gap: 0;
}
.fav-btn--icon .fav-btn__label { display: none; }

/* Sits on top of photos / gradients */
.fav-btn--overlay {
    background: rgba(255, 255, 255, 0.92);
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
}

.dark .fav-btn:not([aria-pressed="true"]) { background: #0f172a; border-color: #334155; color: #e2e8f0; }
.dark .fav-btn--overlay:not([aria-pressed="true"]) { background: rgba(15, 23, 42, 0.9); border-color: transparent; }

/* Mobile categories: toggles pinned over the category banner and subcategory cards
   (siblings of the links, never nested inside them) */
.panel-banner-wrap,
.subcat-card-wrap { position: relative; display: flex; flex-direction: column; }
.panel-banner-wrap > .panel-banner { padding-inline-end: 52px; }
.panel-banner-wrap > .fav-btn,
.subcat-card-wrap > .fav-btn {
    position: absolute;
    top: 8px;
    inset-inline-end: 8px;
    z-index: 2;
}
.subcat-card-wrap > .fav-btn--icon {
    top: 6px;
    inset-inline-end: 6px;
    width: 32px;
    height: 32px;
    min-height: 32px !important;
}
.subcat-card-wrap > .fav-btn--icon i { font-size: 0.75rem; }

/* Search results filtered by a category: "favorite this category" bar */
.fav-category-bar {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.85rem 1.1rem;
    border-radius: 1.25rem;
    border: 1px solid #f1f5f9;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.dark .fav-category-bar { background: #0f172a; border-color: #1e293b; }

/* Profile favorites list */
.fav-list-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.9rem;
    border-radius: 1rem;
    border: 1px solid #f1f5f9;
    background: #fff;
}
.dark .fav-list-item { background: #0f172a; border-color: #1e293b; }
.fav-list-item__thumb {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 0.75rem;
    background: #fff1f2;
    color: var(--color-primary, #F52A3B);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.fav-list-item__thumb img { width: 100%; height: 100%; object-fit: cover; }
.fav-list-item__body { flex: 1; min-width: 0; }
.fav-list-item__title { display: block; font-size: 0.85rem; font-weight: 800; color: #1e293b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dark .fav-list-item__title { color: #f1f5f9; }
.fav-list-item__meta { display: block; font-size: 0.7rem; font-weight: 600; color: #94a3b8; margin-top: 2px; }
.fav-section-title { font-size: 0.7rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.06em; color: #64748b; margin: 1.25rem 0 0.6rem; }
.fav-section-title:first-child { margin-top: 0; }

/* Alerts on/off switch */
.fav-switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.fav-switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.fav-switch span { position: absolute; inset: 0; border-radius: 9999px; background: #cbd5e1; transition: background-color 0.2s ease; }
.fav-switch span::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.2s ease; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); }
.fav-switch input:checked + span { background: var(--color-primary, #F52A3B); }
.fav-switch input:checked + span::after { transform: translateX(20px); }
[dir="rtl"] .fav-switch input:checked + span::after { transform: translateX(-20px); }
.fav-switch input:focus-visible + span { outline: 2px solid var(--color-primary, #F52A3B); outline-offset: 2px; }
