/* ===========================
   BB Wishlist — Archivio Personale
   =========================== */

/* --- Section label (injected via ::before) --- */
#commercekit-wishlist-shortcode::before {
    content: 'La tua Selezione';
    display: block;
    font-size: 10px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #aaa;
    font-weight: 400;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e8e8e8;
}

/* --- Grid --- */
#commercekit-wishlist-shortcode ul.products,
#commercekit-wishlist-shortcode .commercekit-wishlist-list {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 60px 24px !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    width: 100% !important;
    float: none !important;
    counter-reset: wl-counter;
}

/* --- Li reset (override WC float layout) --- */
#commercekit-wishlist-shortcode ul.products > li,
#commercekit-wishlist-shortcode .commercekit-wishlist-list > li {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    float: none !important;
    clear: none !important;
    padding: 0 !important;
}

/* --- Card --- */
.bb-wl-item {
    position: relative;
    list-style: none;
    counter-increment: wl-counter;
}

li.wsl-no-products {
    counter-increment: none;
}

.bb-wl-item__inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* --- Catalog number --- */
.bb-wl-item__num {
    display: block;
    margin-bottom: 10px;
    font-size: 10px;
    letter-spacing: 0.04em;
    color: #c0c0c0;
    font-weight: 400;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.bb-wl-item__num::before {
    content: counter(wl-counter, decimal-leading-zero);
}

/* --- Media container (image + overlays) --- */
.bb-wl-item__media {
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
    aspect-ratio: 3 / 4;
}

/* --- Remove (×) --- */
.bb-wl-item__remove {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 4;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.15s ease;
}

.bb-wl-item:hover .bb-wl-item__remove,
.bb-wl-item:focus-within .bb-wl-item__remove {
    opacity: 1;
}

.bb-wl-item__remove:hover {
    background: #fff;
}

/* Always visible on touch */
@media (hover: none) {
    .bb-wl-item__remove { opacity: 1 !important; }
}

/* --- Image --- */
.bb-wl-item__img-link {
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
}

.bb-wl-item__img {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover;
    display: block;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@media (hover: hover) {
    .bb-wl-item__media:hover .bb-wl-item__img {
        transform: scale(1.05);
    }
}

/* --- ATC overlay: slides up from bottom on hover --- */
.bb-wl-item__overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 3;
    transform: translateY(100%);
    transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(0, 0, 0, 0.86);
}

@media (hover: hover) {
    .bb-wl-item__media:hover .bb-wl-item__overlay,
    .bb-wl-item__media:focus-within .bb-wl-item__overlay {
        transform: translateY(0);
    }
}

/* Touch: overlay always visible at bottom */
@media (hover: none) {
    .bb-wl-item__overlay {
        transform: none;
        transition: none;
    }
}

/* --- ATC button inside overlay --- */
.bb-wl-item__atc-btn {
    display: block !important;
    width: 100% !important;
    padding: 15px 16px !important;
    text-align: center !important;
    font-size: 9px !important;
    letter-spacing: 0.16em !important;
    text-transform: uppercase !important;
    color: #fff !important;
    text-decoration: none !important;
    font-weight: 400 !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    line-height: 1 !important;
    transition: background 0.2s !important;
    box-shadow: none !important;
}

.bb-wl-item__atc-btn:hover {
    background: rgba(255, 255, 255, 0.07) !important;
    color: #fff !important;
}

/* Loading */
.bb-wl-item__atc-btn.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Added to cart flash */
.bb-wl-item__atc-btn.added {
    background: rgba(255, 255, 255, 0.12) !important;
}

/* Out of stock: darker overlay, different label */
.bb-wl-item__atc-btn:not(.alt) {
    background: rgba(0, 0, 0, 0.5) !important;
    color: rgba(255, 255, 255, 0.5) !important;
    cursor: default !important;
}

/* --- Info body --- */
.bb-wl-item__body {
    padding: 12px 0 0;
    display: flex;
    flex-direction: column;
}

.bb-wl-item__name-link {
    text-decoration: none;
    color: inherit;
    display: block;
    margin-bottom: 5px;
}

.bb-wl-item__name {
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 400;
    color: #000;
    line-height: 1.5;
}

.bb-wl-item__name-link:hover .bb-wl-item__name {
    opacity: 0.6;
    transition: opacity 0.2s;
}

.bb-wl-item__price {
    font-size: 12px;
    font-weight: 300;
    color: #555;
    letter-spacing: 0.02em;
}

.bb-wl-item__price .price {
    color: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
}

.bb-wl-item__price ins,
.bb-wl-item__price ins .woocommerce-Price-amount {
    text-decoration: none;
}

/* --- Remove animation (JS adds .is-removing) --- */
.bb-wl-item.is-removing {
    opacity: 0;
    transform: scale(0.96) translateY(-6px);
    transition: opacity 0.35s ease, transform 0.35s ease !important;
    pointer-events: none;
}

/* --- Empty state --- */
li.wsl-no-products {
    grid-column: 1 / -1;
    list-style: none;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 96px 24px;
    text-align: center;
}

/* Plugin renders: .wsl-no-icon (svg), .wsl-no-title (h2), .wsl-no-desc (p), .wsl-no-shop (a.button) */
li.wsl-no-products .wsl-no-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 28px;
}

li.wsl-no-products .wsl-no-icon svg {
    width: 40px;
    height: 40px;
    opacity: 0.18;
}

li.wsl-no-products .wsl-no-icon svg path {
    stroke: #000 !important;
}

li.wsl-no-products .wsl-no-title {
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #aaa;
    font-weight: 400;
    margin: 0 0 12px;
    line-height: 1;
}

li.wsl-no-products .wsl-no-desc {
    font-size: 12px;
    letter-spacing: 0.02em;
    color: #bbb;
    margin: 0 0 32px;
    max-width: 280px;
    line-height: 1.8;
    font-weight: 300;
}

li.wsl-no-products .wsl-no-shop.button {
    display: inline-block !important;
    font-size: 9px !important;
    letter-spacing: 0.18em !important;
    text-transform: uppercase !important;
    text-decoration: none !important;
    color: #000 !important;
    padding: 13px 40px !important;
    border: 1px solid #000 !important;
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transition: background 0.25s, color 0.25s !important;
    font-weight: 400 !important;
}

li.wsl-no-products .wsl-no-shop.button:hover {
    background: #000 !important;
    color: #fff !important;
}

/* --- Pagination --- */
.tablenav-pages.commercekit-wishlist-pages {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 64px;
    padding-top: 32px;
    border-top: 1px solid #e8e8e8;
}

.tablenav-pages.commercekit-wishlist-pages a,
.tablenav-pages.commercekit-wishlist-pages span.current,
.tablenav-pages.commercekit-wishlist-pages span.dots {
    min-width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    letter-spacing: 0.06em;
    text-decoration: none;
    color: #000;
    border: 1px solid transparent;
    transition: border-color 0.2s;
    padding: 0 6px;
}

.tablenav-pages.commercekit-wishlist-pages a:hover {
    border-color: #000;
}

.tablenav-pages.commercekit-wishlist-pages span.current {
    border-color: #000;
    font-weight: 500;
}

.tablenav-pages.commercekit-wishlist-pages span.dots {
    color: #ccc;
    border: none;
}

/* === RESPONSIVE === */

@media (max-width: 1280px) {
    #commercekit-wishlist-shortcode ul.products,
    #commercekit-wishlist-shortcode .commercekit-wishlist-list {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 52px 20px !important;
    }
}

@media (max-width: 900px) {
    #commercekit-wishlist-shortcode ul.products,
    #commercekit-wishlist-shortcode .commercekit-wishlist-list {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 40px 16px !important;
    }
}

@media (max-width: 767px) {
    #commercekit-wishlist-shortcode::before {
        margin-bottom: 24px;
        padding-bottom: 16px;
    }

    #commercekit-wishlist-shortcode ul.products,
    #commercekit-wishlist-shortcode .commercekit-wishlist-list {
        gap: 32px 12px !important;
    }

    .bb-wl-item__num { font-size: 9px; margin-bottom: 8px; }
    .bb-wl-item__name { font-size: 10px; }
    .bb-wl-item__price { font-size: 11px; }

    .bb-wl-item__atc-btn {
        padding: 13px 12px !important;
        font-size: 8px !important;
        letter-spacing: 0.12em !important;
    }

    li.wsl-no-products { padding: 56px 24px; }
}
