/**
 * MiniZShop Wishlist — Frontend Styles
 *
 * Uses CSS custom properties set by the plugin:
 *   --mwl-color:        default heart color
 *   --mwl-color-active: filled heart color
 *   --mwl-color-hover:  hover heart color
 */

/* Elessi header: the wishlist icon links to the page; no badge is shown. */
.ns-mini-yith-wcwl .nasa-wishlist-count {
    display: none !important;
}

/* ═══════════════════════════════════════════════════════════════════
   HEART BUTTON (product cards + single product)
   ═══════════════════════════════════════════════════════════════════ */

.mwl-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--mwl-color, #9CA3AF);
    transition: color 0.2s ease, transform 0.2s ease;
    position: relative;
    z-index: 5;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
}

.mwl-btn:hover {
    color: var(--mwl-color-hover, #F87171);
}

.mwl-btn:active {
    transform: scale(0.9);
}

/* Active state (product is in wishlist) */
.mwl-btn--active {
    color: var(--mwl-color-active, #EF4444);
}

.mwl-btn--active:hover {
    color: var(--mwl-color-hover, #F87171);
}

/* Heart icon states */
.mwl-heart--outline {
    display: block;
}

.mwl-heart--filled {
    display: none;
}

.mwl-btn--active .mwl-heart--outline {
    display: none;
}

.mwl-btn--active .mwl-heart--filled {
    display: block;
}

/* Pop animation on toggle */
@keyframes mwl-pop {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.mwl-btn--animating .mwl-heart--filled,
.mwl-btn--animating .mwl-heart--outline {
    animation: mwl-pop 0.3s ease-in-out;
}

/* Text label */
.mwl-btn__text {
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
}

/* ─── Single product context ────────────────────────────────────── */

.mwl-btn--single {
    padding: 10px 4px;
    margin-left: 8px;
}

.mwl-btn--single .mwl-heart--outline,
.mwl-btn--single .mwl-heart--filled {
    width: 22px;
    height: 22px;
}

/* ─── Loop / product card context ───────────────────────────────── */

.product-item .btn-wishlist:not(.mwl-btn) {
    display: none !important;
}

.mwl-btn--loop {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    padding: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.mwl-btn--loop:hover {
    background: rgba(255, 255, 255, 0.96);
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transform: scale(1.1);
}

.mwl-btn--loop:active {
    transform: scale(0.95);
}

/* Ensure product card has relative positioning for loop button */
.product-card,
.products .product,
li.product {
    position: relative;
}

/* Loading spinner */
.mwl-btn--loading {
    pointer-events: none;
    opacity: 0.6;
}

.mwl-btn--loading .mwl-heart--outline,
.mwl-btn--loading .mwl-heart--filled {
    animation: mwl-spin 0.6s linear infinite;
}

@keyframes mwl-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}


/* ═══════════════════════════════════════════════════════════════════
   TOAST NOTIFICATION
   ═══════════════════════════════════════════════════════════════════ */

.mwl-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1F2937;
    color: #fff;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 99999;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
    max-width: 90vw;
}

.mwl-toast--visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.mwl-toast svg {
    flex-shrink: 0;
}

.mwl-toast a {
    color: #F87171;
    text-decoration: underline;
    margin-left: 4px;
}


/* ═══════════════════════════════════════════════════════════════════
   WISHLIST PAGE
   ═══════════════════════════════════════════════════════════════════ */

.mwl-page {
    max-width: 900px;
    margin: 0 auto;
}

.mwl-page--shared {
    padding-top: 8px;
}

.mwl-shared-header {
    margin-bottom: 20px;
}

.mwl-shared-header__label {
    display: block;
    margin-bottom: 6px;
    color: #6B7280;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.mwl-shared-header h1 {
    margin: 0;
    color: #111827;
    font-size: 1.75rem;
    line-height: 1.2;
}

/* Tabs */
.mwl-page__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.mwl-page__tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.mwl-page__tab {
    padding: 8px 16px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    background: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s ease;
}

.mwl-page__tab:hover {
    background: #F3F4F6;
}

.mwl-page__tab--active {
    background: #FEF2F2;
    color: #DC2626;
    border-color: #FECACA;
}

.mwl-page__create-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border: 1px dashed #D1D5DB;
    border-radius: 8px;
    background: none;
    font-size: 0.8125rem;
    color: #6B7280;
    cursor: pointer;
    transition: all 0.15s ease;
}

.mwl-page__create-btn:hover {
    border-color: #9CA3AF;
    color: #374151;
    background: #F9FAFB;
}

/* List container */
.mwl-page__list {
    display: none;
}

.mwl-page__list--active {
    display: block;
}

.mwl-list-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.mwl-list-toolbar button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
    background: #fff;
    color: #374151;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.mwl-list-toolbar button:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
}

.mwl-list-toolbar__add-all {
    background: #111827 !important;
    border-color: #111827 !important;
    color: #fff !important;
}

.mwl-list-toolbar__add-all:hover {
    background: #374151 !important;
    border-color: #374151 !important;
}

.mwl-list-toolbar__clear:hover {
    background: #FEF2F2 !important;
    border-color: #FECACA !important;
    color: #DC2626 !important;
}

.mwl-list-toolbar__share:hover {
    background: #EFF6FF !important;
    border-color: #BFDBFE !important;
    color: #1D4ED8 !important;
}

.mwl-list-actions__rename:hover {
    background: #F9FAFB !important;
    border-color: #D1D5DB !important;
    color: #111827 !important;
}

.mwl-list-actions__delete:hover {
    background: #FEF2F2 !important;
    border-color: #FECACA !important;
    color: #DC2626 !important;
}

.mwl-is-loading {
    opacity: 0.65;
    cursor: wait !important;
}

/* Items grid */
.mwl-items {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: #E5E7EB;
    border-radius: 12px;
    overflow: hidden;
}

.mwl-item {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 16px;
    padding: 16px;
    background: #fff;
    align-items: center;
    transition: background 0.15s ease;
}

.mwl-item:hover {
    background: #F9FAFB;
}

.mwl-item__image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
}

.mwl-item__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mwl-item__info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mwl-item__name {
    font-weight: 600;
    color: #111827;
    text-decoration: none;
    font-size: 0.9375rem;
}

.mwl-item__name:hover {
    color: #DC2626;
}

.mwl-item__price {
    font-size: 0.875rem;
    color: #374151;
}

.mwl-item__price del {
    color: #9CA3AF;
}

.mwl-item__price ins {
    color: #DC2626;
    text-decoration: none;
    font-weight: 600;
}

.mwl-item__stock {
    font-size: 0.75rem;
    font-weight: 500;
}

.mwl-item__stock--in {
    color: #059669;
}

.mwl-item__stock--out {
    color: #DC2626;
}

.mwl-item__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
    min-width: 220px;
    flex-wrap: wrap;
}

.mwl-page .mwl-item__cart-btn,
.mwl-page .mwl-item__remove-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    border-radius: 8px;
    border: 1px solid transparent !important;
    box-shadow: none !important;
    text-decoration: none;
    line-height: 1 !important;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.mwl-page .mwl-item__cart-btn {
    gap: 6px;
    height: 36px;
    min-width: 36px;
    padding: 0 12px !important;
    background: #F9FAFB !important;
    color: #374151 !important;
    font-size: 0.8125rem;
    font-weight: 700;
}

.mwl-page .mwl-item__cart-btn:hover {
    background: #111827 !important;
    border-color: #111827 !important;
    color: #fff !important;
    transform: translateY(-1px);
}

.mwl-page .mwl-item__cart-btn:disabled {
    transform: none;
}

.mwl-item__cart-label {
    line-height: 1;
    white-space: nowrap;
}

.mwl-page .mwl-item__remove-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    padding: 0 !important;
    background: #fff !important;
    color: #9CA3AF !important;
}

.mwl-page .mwl-item__remove-btn:hover {
    background: #FEF2F2 !important;
    border-color: #FECACA !important;
    color: #DC2626 !important;
}

.mwl-page .mwl-item__cart-btn svg,
.mwl-page .mwl-item__remove-btn svg {
    display: block;
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    margin: 0;
    pointer-events: none;
}

.mwl-item__move-select {
    width: 132px;
    height: 36px;
    min-height: 36px;
    padding: 0 30px 0 10px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    background-color: #fff;
    color: #374151;
    font-size: 0.8125rem;
    line-height: 36px;
    cursor: pointer;
}

.mwl-item__move-select:hover,
.mwl-item__move-select:focus {
    border-color: #D1D5DB;
    outline: none;
}

/* List actions (rename/delete) */
.mwl-list-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #E5E7EB;
}

.mwl-list-actions button {
    padding: 6px 12px;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    background: #fff;
    font-size: 0.8125rem;
    color: #6B7280;
    cursor: pointer;
    transition: all 0.15s ease;
}

.mwl-list-actions button:hover {
    background: #F3F4F6;
}

.mwl-list-actions__delete:hover {
    background: #FEF2F2 !important;
    color: #DC2626 !important;
    border-color: #FECACA !important;
}

/* Empty state */
.mwl-empty {
    text-align: center;
    padding: 48px 24px;
    color: #9CA3AF;
}

.mwl-empty p {
    margin: 12px 0 24px;
    font-size: 1rem;
}

.mwl-empty .btn-primary {
    display: inline-flex;
}


/* ═══════════════════════════════════════════════════════════════════
   WISHLIST PICKER MODAL
   ═══════════════════════════════════════════════════════════════════ */

.mwl-modal {
    position: fixed;
    inset: 0;
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mwl-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
}

.mwl-modal__content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    width: 380px;
    max-width: 90vw;
    max-height: 80vh;
    overflow: hidden;
    animation: mwl-modal-in 0.2s ease;
}

@keyframes mwl-modal-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.mwl-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #E5E7EB;
}

.mwl-modal__header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
}

.mwl-modal__close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #9CA3AF;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

.mwl-modal__close:hover {
    color: #374151;
}

.mwl-modal__body {
    padding: 16px 20px;
    overflow-y: auto;
    max-height: 60vh;
}

.mwl-modal__lists {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.mwl-modal__list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.mwl-modal__list-item:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
}

.mwl-modal__list-item--active {
    background: #FEF2F2;
    border-color: #FECACA;
}

.mwl-modal__list-item--active .mwl-modal__list-name {
    color: #DC2626;
}

.mwl-modal__list-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.mwl-modal__list-count {
    font-size: 0.75rem;
    color: #9CA3AF;
}

.mwl-modal__list-check {
    color: #DC2626;
    font-size: 1.25rem;
}

/* Create new list form in modal */
.mwl-modal__create {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid #E5E7EB;
}

.mwl-modal__create-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.15s ease;
}

.mwl-modal__create-input:focus {
    border-color: #DC2626;
}

.mwl-modal__create-btn {
    padding: 8px 14px !important;
    font-size: 1rem !important;
}


/* ═══════════════════════════════════════════════════════════════════
   CART TO WISHLIST
   ═══════════════════════════════════════════════════════════════════ */

.mwl-cart-to-wishlist-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    padding: 0 16px !important;
    border: 1px solid #E5E7EB !important;
    border-radius: 8px !important;
    background: #fff !important;
    color: #374151 !important;
    font-size: 0.875rem !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    cursor: pointer;
    text-decoration: none !important;
    box-shadow: none !important;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.mwl-cart-to-wishlist-btn:hover {
    background: #FEF2F2 !important;
    border-color: #FECACA !important;
    color: #DC2626 !important;
}

.mwl-cart-to-wishlist-btn svg {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    margin: 0;
}

.woocommerce-cart-form .mwl-cart-to-wishlist-btn {
    margin-top: 14px;
}

.btn-mini-cart .mwl-cart-to-wishlist-btn {
    width: 100%;
    margin: 0 0 8px;
}


/* ═══════════════════════════════════════════════════════════════════
   SIDEBAR (mini wishlist drawer)
   ═══════════════════════════════════════════════════════════════════ */

.mwl-sidebar__list {
    margin-bottom: 16px;
}

.mwl-sidebar__list-name {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6B7280;
    margin-bottom: 8px;
}

.mwl-sidebar__empty {
    font-size: 0.8125rem;
    color: #9CA3AF;
    text-align: center;
    padding: 16px 0;
}

.mwl-sidebar__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #F3F4F6;
}

.mwl-sidebar__item:last-child {
    border-bottom: none;
}

.mwl-sidebar__item-img {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.mwl-sidebar__item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mwl-sidebar__item-info {
    flex: 1;
    min-width: 0;
}

.mwl-sidebar__item-info a {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #111827;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mwl-sidebar__item-info a:hover {
    color: #DC2626;
}

.mwl-sidebar__item-price {
    font-size: 0.75rem;
    color: #6B7280;
}

.mwl-sidebar__item-remove {
    background: none;
    border: none;
    color: #9CA3AF;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    padding: 4px;
    flex-shrink: 0;
}

.mwl-sidebar__item-remove:hover {
    color: #DC2626;
}

/* Count badge */
.mwl-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--mwl-color-active, #EF4444);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}


/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
    .mwl-item {
        grid-template-columns: 60px 1fr;
        gap: 12px;
    }

    .mwl-item__image {
        width: 60px;
        height: 60px;
    }

    .mwl-item__actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
        min-width: 0;
    }

    .mwl-item__move-select {
        width: min(100%, 180px);
    }

    .mwl-page__header {
        flex-direction: column;
        align-items: flex-start;
    }

    .mwl-page__tabs {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .mwl-page__tab {
        white-space: nowrap;
    }
}
