/* ─── Single product gallery ─── */
.product-gallery-meta {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.product-gallery-album {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1.125rem;
    background-color: var(--white);
    color: var(--color2);
    font-size: 1.125rem;
    line-height: 1.9;
}

.product-gallery .wishlist-link {
    position: relative;
    width: 50px;
    height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background-color: var(--white);
    color: var(--color2);
    cursor: pointer;
    transition: color 0.3s ease, transform 0.3s ease;
    font-size: 1.75rem;
}

.product-gallery .wishlist-link:hover {
    transform: scale(1.06);
}

.product-gallery .wishlist-link.wished {
    color: var(--color1);
}

.product-gallery .wishlist-link .loding-wishlist {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 20px;
    height: 20px;
    opacity: 0;
    pointer-events: none;
    stroke: currentColor;
    transition: opacity 0.15s ease;
}

.product-gallery .wishlist-link .loding-wishlist circle {
    stroke-dasharray: 90;
    stroke-dashoffset: 60;
}

.product-gallery .wishlist-link .wishlist-link__icon {
    font-size: 1.375rem;
    line-height: 1;
    transition: opacity 0.15s ease;
}

.product-gallery .wishlist-link.loading {
    pointer-events: none;
    cursor: wait;
}

.product-gallery .wishlist-link.loading .wishlist-link__icon {
    opacity: 0;
}

.product-gallery .wishlist-link.loading .loding-wishlist {
    opacity: 1;
    animation: wishlist-spin 0.8s linear infinite;
}

@keyframes wishlist-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ─── Header link (desktop) ─── */
.header-wishlist-link {
    display: none;
    align-items: center;
    gap: 0.625rem;
    padding: 0.375rem 0.625rem 0.375rem 0.5rem;
    border-radius: 999px;
    color: var(--white);
    transition: color 0.3s ease, background 0.3s ease;
}

body:not(.home) .header-wishlist-link {
    color: var(--color2);
}

.header-wishlist-link:hover {
    color: var(--color1);
}

.header-wishlist-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.header-wishlist-icon {
    font-size: 1.375rem;
    line-height: 1;
}

.header-wishlist-text {
    font-size: 0.875rem;
    line-height: 1;
    white-space: nowrap;
}

.header-wishlist-count {
    position: absolute;
    top: -7px;
    left: -7px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--color1) 0%, #e8942e 100%);
    color: var(--white);
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(242, 160, 65, 0.45);
}

.header-wishlist-count.is-empty {
    display: none;
}

.header-top-divider {
    display: none;
    width: 1px;
    height: 2rem;
    background: rgba(255, 255, 255, 0.35);
    flex: 0 0 auto;
}

body:not(.home) .header-top-divider {
    background: #C5CAD9;
}

/* ─── Empty state ─── */
.wishlist-empty-state {
    max-width: 480px;
    margin: 2rem auto 4rem;
    padding: clamp(2rem, 5vw, 3rem) clamp(1.5rem, 4vw, 2.5rem);
    text-align: center;
    background: linear-gradient(180deg, #FFFFFF 0%, #FAFBFD 100%);
    border: 1px solid #E8EBF2;
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(197, 202, 217, 0.28);
}

.wishlist-empty-state__icon {
    width: 88px;
    height: 88px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(242, 160, 65, 0.18) 0%, rgba(242, 160, 65, 0.06) 100%);
    color: var(--color1);
    position: relative;
}

.wishlist-empty-state__icon::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 1px dashed rgba(242, 160, 65, 0.35);
}

.wishlist-empty-state__icon .icon-favorite {
    font-size: 2.25rem;
    line-height: 1;
}

.wishlist-empty-state__title {
    margin: 0 0 0.75rem;
    color: var(--color2);
    font-size: clamp(1.125rem, 2.5vw, 1.375rem);
    line-height: 1.5;
    font-weight: 600;
}

.wishlist-empty-state__desc {
    margin: 0 0 1.75rem;
    color: #8A8D90;
    font-size: 0.9375rem;
    line-height: 1.8;
}

.wishlist-empty-state__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    min-height: 48px;
    padding: 0 1.75rem;
    border-radius: 999px;
    background: var(--color2);
    color: var(--white);
    font-family: var(--main_font);
    font-size: 0.9375rem;
    line-height: 1;
    transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 6px 20px rgba(52, 52, 52, 0.18);
}

.wishlist-empty-state__btn:hover {
    background: var(--color1);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(242, 160, 65, 0.35);
}

.wishlist-empty-state__btn i {
    font-size: 1.125rem;
    color: inherit;
    transition: transform 0.3s ease;
}

.wishlist-empty-state__btn:hover i {
    transform: translateX(-4px);
}

/* ─── Mobile FAB ─── */
.wishlist-mobile-fab {
    display: none;
    position: fixed;
    left: 0;
    bottom: calc(1.75rem + env(safe-area-inset-bottom, 0px));
    z-index: 9990;
    color: var(--white);
}

.wishlist-mobile-fab__body {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 58px;
    padding: 0.625rem 1.125rem 0.625rem 0.875rem;
    border-radius: 0 999px 999px 0;
    background: linear-gradient(135deg, var(--color2) 0%, #4f4f4f 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-left: 0;
    box-shadow:
        0 12px 36px rgba(52, 52, 52, 0.28),
        0 4px 12px rgba(52, 52, 52, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);
    transition: box-shadow 0.3s ease, background 0.3s ease;
}

.wishlist-mobile-fab.has-items .wishlist-mobile-fab__body {
    background: linear-gradient(135deg, var(--color1) 0%, #e08030 55%, #f2a041 100%);
    box-shadow:
        0 14px 40px rgba(242, 160, 65, 0.45),
        0 6px 16px rgba(242, 160, 65, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.wishlist-mobile-fab:active .wishlist-mobile-fab__body {
    opacity: 0.92;
}

.wishlist-mobile-fab__icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    flex: 0 0 auto;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.wishlist-mobile-fab__icon .icon-favorite {
    font-size: 1.375rem;
    line-height: 1;
}

.wishlist-mobile-fab__label {
    font-size: 0.875rem;
    line-height: 1.2;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: -0.01em;
}

.wishlist-mobile-fab__count {
    min-width: 26px;
    height: 26px;
    padding: 0 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--white);
    color: #d53343;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    flex: 0 0 auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-right: 0.125rem;
}

.wishlist-mobile-fab__count.is-empty {
    display: none;
}

/* ─── Wishlist page cards ─── */
.product-item--wishlist {
    height: auto;
}

.product-item--wishlist .wishlist-card-info {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
}

.product-item--wishlist .wishlist-card-sku {
    display: inline-flex;
    align-items: center;
    align-self: center;
    margin-top: 0.5rem;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    background: #F1F3F9;
    color: #8A8D90;
    font-size: 0.6875rem;
    line-height: 1.4;
}

.product-item--wishlist .wishlist-card-album {
    display: inline-flex;
    align-items: center;
    align-self: center;
    margin-top: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    background: var(--white);
    color: var(--color2);
    font-size: 0.6875rem;
    line-height: 1.4;
    box-shadow: 0 2px 8px rgba(52, 52, 52, 0.06);
}

.wishlist-card-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.wishlist-card-view,
.wishlist-page-remove {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0 1rem;
    border-radius: 999px;
    font-family: var(--main_font);
    font-size: 0.8125rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, opacity 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.wishlist-card-view {
    flex: 1 1 auto;
    border: 1px solid #C5CAD9;
    background: var(--white);
    color: var(--color2);
}

.wishlist-card-view:hover {
    border-color: var(--color1);
    color: var(--color1);
    background: rgba(242, 160, 65, 0.06);
    transform: translateY(-1px);
}

.wishlist-page-remove {
    flex: 0 0 auto;
    border: 1px solid rgba(213, 51, 67, 0.2);
    background: rgba(213, 51, 67, 0.08);
    color: #d53343;
}

.wishlist-page-remove:hover {
    background: #d53343;
    border-color: #d53343;
    color: var(--white);
    box-shadow: 0 4px 14px rgba(213, 51, 67, 0.3);
    transform: translateY(-1px);
}

.wishlist-page-remove.loading {
    opacity: 0.65;
    pointer-events: none;
}

.wishlist-page-remove .icon-favorite {
    font-size: 1rem;
    line-height: 1;
}

/* ─── Toast ─── */
.wbs-wishlist-alert {
    position: fixed;
    bottom: calc(5.75rem + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    padding: 0.875rem 1.5rem;
    border-radius: 999px;
    color: var(--white);
    font-size: 0.875rem;
    z-index: 10002;
    max-width: calc(100vw - 2rem);
    text-align: center;
    box-shadow: 0 8px 24px rgba(52, 52, 52, 0.2);
    animation: wishlistToastIn 0.35s ease;
}

@keyframes wishlistToastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.wbs-wishlist-alert.success {
    background: linear-gradient(135deg, var(--color2) 0%, #4a4a4a 100%);
}

.wbs-wishlist-alert.danger {
    background: linear-gradient(135deg, #d53343 0%, #b82838 100%);
}

/* ─── Desktop ─── */
@media screen and (min-width: 992px) {
    .header-wishlist-link,
    .header-top-divider {
        display: inline-flex;
    }

    .product-item--wishlist {
        border: 1px solid #E8EBF2;
        overflow: hidden;
        background: var(--white);
        transition: box-shadow 0.35s ease, transform 0.35s ease, border-color 0.35s ease;
    }

    .product-item--wishlist:hover {
        border-color: rgba(242, 160, 65, 0.35);
        box-shadow: 0 16px 40px rgba(197, 202, 217, 0.4);
        transform: translateY(-4px);
    }

    .product-item--wishlist .product-image {
        overflow: hidden;
    }

    .product-item--wishlist .product-image img {
        transition: transform 0.5s ease;
    }

    .product-item--wishlist:hover .product-image img {
        transform: scale(1.05);
    }

    .product-item--wishlist .wishlist-card-info {
        padding: 0 1.125rem 1.125rem;
    }

    .product-item--wishlist .product-title {
        margin-top: 1rem;
    }

    .wishlist-card-actions {
        margin-top: auto;
        padding-top: 1rem;
    }
}

/* ─── Mobile ─── */
@media screen and (max-width: 991.98px) {
    .wishlist-mobile-fab {
        display: block;
    }

    .product-gallery-meta {
        top: 0.75rem;
        left: 0.75rem;
        gap: 0.5rem;
    }

    .product-gallery-album {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }

    .product-gallery .wishlist-link {
        width: 44px;
        height: 44px;
    }

    .product-item-arch:has(.product-item--wishlist) {
        margin-bottom: 0.875rem;
    }

    .product-item--wishlist {
        flex-direction: row;
        align-items: stretch;
        gap: 1rem;
        padding: 0.875rem;
        border: 1px solid #E8EBF2;
        border-radius: 16px;
        background: linear-gradient(180deg, #FFFFFF 0%, #FAFBFD 100%);
        box-shadow: 0 8px 24px rgba(197, 202, 217, 0.25);
        transition: box-shadow 0.3s ease, transform 0.3s ease;
    }

    .product-item--wishlist:active {
        transform: scale(0.99);
    }

    .product-item--wishlist .product-image {
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 4px 12px rgba(52, 52, 52, 0.08);
    }

    .product-item--wishlist .product-image img {
        aspect-ratio: 1 / 1;
        height: 100%;
    }

    .product-item--wishlist .product-title {
        margin: 0;
        font-size: 0.9375rem;
        line-height: 1.65;
    }

    .product-item--wishlist .wishlist-card-actions {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: stretch;
        margin-top: 0.875rem;
        gap: 0.5rem;
    }

    .wishlist-card-view {
        flex: 1 1 calc(100% - 88px);
        min-width: 0;
    }

    .wishlist-page-remove {
        flex: 0 0 80px;
        padding: 0 0.75rem;
    }

    .wishlist-page-remove span {
        display: none;
    }

    .wishlist-empty-state {
        margin-top: 1rem;
        margin-bottom: 3rem;
    }
}

@media screen and (max-width: 575.98px) {
    .wishlist-mobile-fab__body {
        min-height: 54px;
        padding: 0.5rem 0.875rem 0.5rem 0.75rem;
        gap: 0.625rem;
    }

    .wishlist-mobile-fab__icon {
        width: 38px;
        height: 38px;
    }

    .wishlist-mobile-fab__label {
        font-size: 0.8125rem;
    }

    .wishlist-card-view {
        flex: 1 1 100%;
    }

    .wishlist-page-remove {
        flex: 1 1 100%;
    }

    .wishlist-page-remove span {
        display: inline;
    }
}
