/* Cascina Bonfiglio — Wishlist (preferiti).
 * Override del cuore "outline" (default sulle card) con uno stato pieno
 * verde brand quando il prodotto è in wishlist. Niente nuove immagini:
 * usiamo SVG inline + currentColor per evitare flash bianco/cream. */

/* -------------------------------------------------------------------------
 *  Cards listing / related / search (.cb-card__like)
 * ------------------------------------------------------------------------- */
.cb-card__like {
    cursor: pointer;
    transition: transform .15s ease, filter .2s ease;
    position: relative;
}
.cb-card__like:hover { transform: scale(1.06); }
.cb-card__like.is-loading { opacity: .55; pointer-events: none; }

/* Quando attivo: nasconde l'<img> outline e disegna un cuore pieno con SVG generato in CSS. */
.cb-card__like.is-active {
    color: #A8C780; /* verde brand */
}
.cb-card__like.is-active img { display: none; }
.cb-card__like.is-active::after {
    content: "";
    display: block;
    width: 27px;
    height: 26px;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 27 26'><path d='M13.5 22.5S2 14.8 2 8a5.5 5.5 0 0 1 11.5-3A5.5 5.5 0 0 1 25 8c0 6.8-11.5 14.5-11.5 14.5z'/></svg>") center/contain no-repeat;
            mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 27 26'><path d='M13.5 22.5S2 14.8 2 8a5.5 5.5 0 0 1 11.5-3A5.5 5.5 0 0 1 25 8c0 6.8-11.5 14.5-11.5 14.5z'/></svg>") center/contain no-repeat;
}

/* -------------------------------------------------------------------------
 *  Bestsellers (.cb-bs-card__fav) — il cuore SVG è inline nella button.
 *  Quando attivo riempiamo il path interno e schiariamo la pillola sfondo.
 * ------------------------------------------------------------------------- */
.cb-bs-card__fav { cursor: pointer; transition: transform .15s ease; }
.cb-bs-card__fav:hover { transform: scale(1.06); }
.cb-bs-card__fav.is-loading { opacity: .55; pointer-events: none; }
.cb-bs-card__fav.is-active rect { fill: #A8C780; fill-opacity: 1; }
.cb-bs-card__fav.is-active path { fill: #ffffff; }

/* -------------------------------------------------------------------------
 *  Combo (.cb-combo__fav) — stessa logica di bestsellers.
 * ------------------------------------------------------------------------- */
.cb-combo__fav { cursor: pointer; transition: transform .15s ease; }
.cb-combo__fav:hover { transform: scale(1.06); }
.cb-combo__fav.is-loading { opacity: .55; pointer-events: none; }
.cb-combo__fav.is-active rect { fill: #A8C780; fill-opacity: 1; }
.cb-combo__fav.is-active path { fill: #ffffff; }

/* -------------------------------------------------------------------------
 *  Detail page (.cb-scheda__wish) — bottone outline grande accanto al CTA.
 * ------------------------------------------------------------------------- */
.cb-scheda__wish { transition: transform .15s ease, color .2s ease, background .2s ease, border-color .2s ease; }
.cb-scheda__wish:hover { transform: scale(1.04); }
.cb-scheda__wish.is-loading { opacity: .55; pointer-events: none; }
.cb-scheda__wish.is-active {
    color: #ffffff;
    background: #A8C780;
    border-color: #A8C780;
}
.cb-scheda__wish.is-active svg path { fill: #ffffff; stroke: #ffffff; }

/* -------------------------------------------------------------------------
 *  Toast feedback (mini bubble sopra al bottone)
 * ------------------------------------------------------------------------- */
.cb-wishlist-toast {
    z-index: 9999;
    background: #2C1A0E;
    color: #fff;
    font-family: 'Nunito Sans', Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
    box-shadow: 0 6px 20px rgba(44,26,14,.18);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .2s ease, transform .2s ease;
    pointer-events: none;
    white-space: nowrap;
}
.cb-wishlist-toast.is-visible { opacity: 1; transform: translateY(0); }
.cb-wishlist-toast.is-error { background: #C44747; }

/* -------------------------------------------------------------------------
 *  Tab "Preferiti" nella dashboard
 * ------------------------------------------------------------------------- */
.cb-account-card--wishlist .cb-wishlist-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    padding: 40px 16px 16px;
}
.cb-account-card--wishlist .cb-wishlist-empty__text {
    max-width: 460px;
    color: #5b4839;
    line-height: 1.5;
    font-size: 15px;
    margin: 0;
}
.cb-wishlist-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px 16px;
    margin-top: 12px;
}
@media (max-width: 1100px) {
    .cb-wishlist-grid { grid-template-columns: repeat(2, 1fr); gap: 18px 14px; }
}
/* Mobile: 2 colonne come il listing (la card .cb-card e' la stessa con aspect 175/350).
   Singola colonna creava card enormi (~800px alte) su viewport stretto. */
@media (max-width: 560px) {
    .cb-wishlist-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}
/* Sotto 400px: 1 colonna verticale, foto sopra + body sotto, card compatte. */
@media (max-width: 400px) {
    .cb-wishlist-grid { grid-template-columns: 1fr; gap: 10px; }
    .cb-wishlist-grid > .cb-card {
        aspect-ratio: auto !important;
        height: auto !important;
        min-height: 0 !important;
    }
    .cb-wishlist-grid > .cb-card .cb-card__media {
        position: relative !important;
        inset: auto !important;
        width: 100%;
        height: 220px;
        border-radius: 14.65px 14.65px 0 0;
    }
    .cb-wishlist-grid > .cb-card .cb-card__media img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center center !important;   /* foto centrata orizz + vert */
    }
    .cb-wishlist-grid > .cb-card .cb-card__body {
        position: relative !important;
        inset: auto !important;
        height: auto !important;
        min-height: 0 !important;
        padding: 12px 14px !important;
        gap: 6px !important;
        border-radius: 0 0 14.65px 14.65px !important;
    }
    .cb-wishlist-grid > .cb-card .cb-card__top {
        position: absolute;
        left: 10px;
        top: 10px;
        display: grid;
        padding: 0px !important;
    }
}
@media (max-width: 640px) {
    .cb-card__like.is-active::after { width: 20px; height: 20px; }
}
