/* Favorite control and dedicated /account/favorites route. */
.favorite-button { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; color: #fff; background: none; border: 0; border-radius: 50%; font-size: 1.2rem; cursor: pointer; }
.favorite-button:hover { background: transparent; }
.favorite-button.active i { color: #f5365c; }
.favorite-button.active .fa-heart { font-weight: 900; }
.account-dashboard-shell.route-hidden { display: none !important; }
#account-section:has(#favorites-section:not(.hidden)) .account-desktop-back-btn { display: none; }

.favorites-section { width: 100%; min-height: calc(100dvh - 90px); margin: 0; padding: 0 0 48px !important; background: transparent !important; border: 0 !important; border-radius: 0; box-shadow: none !important; }
.favorites-glass-header { min-height: 62px; direction: rtl; top: 0 !important; margin: 0 5px 10px !important; }
.favorites-glass-header .fullscreen-modal-title { margin: 0; }
.favorites-route-back { width: 44px; height: 44px; display: grid; place-items: center; flex: 0 0 44px; }
.favorites-route-back svg { width: 23px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.favorites-header-spacer { width: 44px; height: 44px; flex: 0 0 44px; }

/* Deliberately mirrors #shop-products-grid and its real product cards. */
.favorites-list { width: 100%; max-width: 100%; margin-inline: auto; padding: 15px; box-sizing: border-box; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; justify-items: stretch; align-items: start; }
.favorites-list > :is(.bazaar-skeleton,.favorites-loading,.favorites-empty-state,.empty-message) { grid-column: 1/-1; }
.favorites-list .bazaar-skeleton--products .bazaar-skeleton-items { padding: 0; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
.favorites-loading { min-height: min(480px,60dvh); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--dark-gray); }
.favorites-loading-spinner { width: 46px; height: 46px; display: block; box-sizing: border-box; border: 4px solid rgba(225,29,72,.16); border-top-color: #e11d48; border-radius: 50%; animation: favorites-spinner-rotate .8s linear infinite; }
.favorites-loading-text { font-size: .86rem; font-weight: 500; }
@keyframes favorites-spinner-rotate { to { transform: rotate(360deg); } }
.favorites-list .favorite-product-card { width: 100%; max-width: 100%; min-width: 0; height: auto; min-height: 0; display: flex; flex-direction: column; gap: 8px; overflow: visible; background: transparent !important; border: 0 !important; box-shadow: none !important; cursor: pointer; box-sizing: border-box; transition: transform .2s ease; }
.favorites-list .favorite-product-card:hover { transform: translateY(-3px); box-shadow: none !important; }
.favorites-list .favorite-product-image { width: 100%; height: auto; aspect-ratio: 1/1; margin: 0; position: relative; overflow: hidden; background: #f4f6f8 !important; border: 1px solid rgba(15,23,42,.06) !important; border-radius: 18px !important; box-shadow: none !important; }
.favorites-list .favorite-product-image img { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover; border-radius: inherit; }
.favorites-list .favorite-product-image .no-image { width: 100%; height: 100%; border-radius: inherit; }
.favorites-list .favorite-product-info { height: auto; min-height: 0; padding: 0 4px; display: flex; flex-direction: column; gap: 3px; align-items: stretch; text-align: right; background: transparent; }
.favorites-list .favorite-product-info h3 { width: 100%; margin: 0; color: var(--text-color); font-size: .9rem; font-weight: 500; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.favorites-list .favorite-product-price { max-width: 100%; min-height: 0; height: auto; margin: 0; color: var(--secondary-color); font-size: .82rem; font-weight: 600; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; }
.favorites-list .favorite-product-store { max-width: 100%; margin: 0; color: var(--dark-gray); font-size: .78rem; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.favorites-list .favorite-product-price :is(.price-stack,.price-normal,.price-unavailable,.price-original,.price-discounted) { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Neutralize legacy fixed card/image heights exactly as /retail does. */
#favorites-list .product-card { height: auto !important; min-height: 0 !important; margin-bottom: 0 !important; }
#favorites-list .product-image-container { width: 100% !important; height: auto !important; aspect-ratio: 1/1 !important; margin: 0 !important; overflow: hidden !important; position: relative !important; }
#favorites-list .product-image-container > img.product-image { width: 100% !important; height: 100% !important; max-width: none !important; max-height: none !important; object-fit: cover !important; border-radius: inherit !important; flex-shrink: 0 !important; }
#favorites-list .product-info { height: auto !important; min-height: 0 !important; padding: 0 4px !important; gap: 3px !important; justify-content: flex-start !important; }
#favorites-list .product-info h3 { height: auto !important; margin: 0 !important; display: block !important; font-size: .9rem !important; font-weight: 500 !important; line-height: 1.35 !important; white-space: nowrap !important; }
#favorites-list .shop-product-price { height: auto !important; min-height: 0 !important; margin: 0 !important; display: block !important; font-size: .82rem !important; line-height: 1.35 !important; }
#favorites-list .shop-product-store { margin: 0 !important; font-size: .78rem !important; line-height: 1.35 !important; }
.favorite-product-image .remove-favorite { position: absolute; inset: 9px 9px auto auto; z-index: 3; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; color: #e11d48; background: rgba(255,255,255,.94); border: 1px solid rgba(225,29,72,.14); border-radius: 50%; box-shadow: 0 5px 16px rgba(15,23,42,.13); cursor: pointer; }
.favorite-product-image .remove-favorite:disabled { opacity: .55; cursor: wait; }

.favorites-empty-state { min-height: min(480px,60dvh); margin: 8px 0; padding: 36px 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: rgba(255,255,255,.72); border: 1px solid rgba(15,23,42,.07); border-radius: 20px; }
.favorites-empty-icon { width: 76px; height: 76px; display: grid; place-items: center; margin-bottom: 18px; color: #e11d48; background: #fff1f2; border-radius: 50%; font-size: 1.8rem; }
.favorites-empty-state h2 { margin: 0; color: var(--text-color); font-size: clamp(1rem,2vw,1.25rem); }
.favorites-empty-state p { max-width: 500px; margin: 10px 0 22px; color: var(--dark-gray); font-size: .9rem; line-height: 1.9; }
.favorites-browse-btn,.favorites-login-btn { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 21px; color: #fff; background: var(--secondary-color); border: 0; border-radius: 13px; font-weight: 700; text-decoration: none; cursor: pointer; }
.favorites-browse-btn:hover,.favorites-login-btn:hover { color: #fff; filter: brightness(.92); text-decoration: none; }
.favorites-route-back:focus-visible,.remove-favorite:focus-visible,.favorites-browse-btn:focus-visible,.favorites-login-btn:focus-visible,.favorite-product-card:focus-visible { outline: 3px solid rgba(244,63,94,.38); outline-offset: 3px; }

body.theme-dark .favorites-empty-state { background: rgba(17,24,39,.76); border-color: rgba(148,163,184,.18); }
body.theme-dark .favorites-loading-spinner { border-color: rgba(251,113,133,.2); border-top-color: #fb7185; }
body.theme-dark .favorites-loading { color: #cbd5e1; }
body.theme-dark .favorites-list .favorite-product-image { background: #0f172a !important; border-color: rgba(148,163,184,.18) !important; }
body.theme-dark .favorites-list .favorite-product-card { background: transparent !important; }

@media (max-width:480px) {
    .favorites-glass-header { margin: 0 5px 8px !important; top: 0 !important; }
    .favorites-list,.favorites-list .bazaar-skeleton--products .bazaar-skeleton-items { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; padding: 10px; }
    .favorites-list .bazaar-skeleton--products .bazaar-skeleton-items { padding: 0; }
    .favorites-list .favorite-product-card { gap: 6px; }
    .favorites-list .favorite-product-image { border-radius: 14px !important; }
    .favorites-list .favorite-product-info { padding: 0 2px; gap: 2px; }
    .favorites-list .favorite-product-info h3 { font-size: .78rem; line-height: 1.3; }
    .favorites-list .favorite-product-price { font-size: .72rem; line-height: 1.3; }
    .favorites-list .favorite-product-store { font-size: .68rem; line-height: 1.3; }
    #favorites-list .product-info { padding: 0 2px !important; gap: 2px !important; }
    #favorites-list .product-info h3 { height: auto !important; font-size: .78rem !important; line-height: 1.3 !important; }
    #favorites-list .shop-product-price { height: auto !important; min-height: 0 !important; font-size: .72rem !important; line-height: 1.3 !important; }
    #favorites-list .shop-product-store { font-size: .68rem !important; line-height: 1.3 !important; }
    .favorite-product-image .remove-favorite { inset: 7px 7px auto auto; width: 40px; height: 40px; }
    .favorites-empty-state { min-height: 55dvh; padding-inline: 18px; }
}
@media (min-width:768px) and (max-width:1199px) {
    .favorites-list,.favorites-list .bazaar-skeleton--products .bazaar-skeleton-items { gap: 20px; }
}
@media (min-width:1200px) {
    .favorites-list,.favorites-list .bazaar-skeleton--products .bazaar-skeleton-items { grid-template-columns: repeat(5,minmax(0,1fr)); gap: 18px; }
}
@media (prefers-reduced-motion:reduce) { .favorite-product-card { transition: none; } .favorites-loading-spinner { animation-duration: 1.8s; } }
