/**
 * Block: White Goods Cards — opt produse in promotie dintr-o categorie Bit2Win.
 *
 * Cardul e generat de acelasi renderer PHP ca listarea (vp-render.php), dar CSS-ul
 * se incarca per bloc (`wp_enqueue_block_style` pe acf/<nume>), deci regulile de
 * card trebuie sa existe si aici. Sunt copiate 1:1 din vp-products.css ca sa nu
 * divergeze vizual — daca se schimba cardul, se schimba in ambele locuri.
 *
 * Diferenta fata de listare: butonul isi afiseaza eticheta, deci `.vp-card__cta`
 * are text centrat in loc de un bloc gol.
 */

.block-wg-product-list-reshape {
    --vp-gap: 16px;
    --vp-radius: 8px;
    --vp-border: #e5e5e5;
    --vp-bg: #ffffff;
    --vp-bg-muted: #f5f5f5;
    --vp-text: #0d0d0d;
    --vp-text-muted: #6b6b6b;
    --vp-accent: #F96246;
    --vp-yellow: #ffe14d;
    --vp-blue: #cfe3ff;

    padding: 0px 0px;
}

/* ── Cap: titlu + "Vezi toate produsele" ─────────────────────────────────── */

.wgc__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.wgc__footer {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.wgc__title {
    margin: 0;
    font-size: 24px;
    line-height: 32px;
    font-weight:400;
    color: var(--vp-text);
    font-family: 'PingLCG';
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    /* ia doar spațiul rămas lângă buton (nu-l mai împinge pe rândul următor) */
    flex: 1 1 0;
    min-width: 0;
}

/* Link setat manual din bloc; duce la pagina de categorie. */
.wgc__all {
    display: block;
    align-items: center;
    padding: 12px 20px;
    border: 1px solid var(--vp-border);
    border-radius: 12px;
    background: var(--vp-bg);
    color: var(--vp-text);
    font-size: 16px;
    font-weight:400;
    font-family: 'PingLCG';
    line-height:24px;
    text-decoration: none;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width:500px;
    flex: 0 0 auto;
    margin-left: auto;
}

.global-button.wgc__all {
    display:block;
}
.wgc__all:hover {
    border-color: var(--vp-text);
}

/* ── Grila: 2 rânduri x 4 ─────────────────────────────────────────────────── */

.wgc__grid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* ── Card (identic cu listarea) ───────────────────────────────────────────── */

.block-wg-product-list-reshape .vp-card {
    display: flex;
    flex-direction: column;
    /* justify-content: space-between; */
    min-height: 380px;
    border: 0px solid var(--vp-border);
    border-radius: var(--vp-radius);
    background: var(--vp-bg);
    overflow: hidden;
    transition: box-shadow .2s ease;
}

.block-wg-product-list-reshape .vp-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, .08);
}

.block-wg-product-list-reshape .vp-card__media {
    position: relative;
    display: flex;
    flex: 0 1 auto;
    min-height: 0;
    background: var(--vp-bg);
    padding: 0px;
}

.block-wg-product-list-reshape .vp-card__image {
    display: block;
    flex: 1;
    min-height: 0;
    max-height: calc(178px + 8px) ;
    padding:16px 16px 8px 16px;
    box-sizing:border-box;
    /* background:red; */
}

.block-wg-product-list-reshape .vp-card__image img {
    width: 100%;
    height: 100%;
    max-height: 160px;
    object-fit: contain;
    mix-blend-mode: multiply;
    /* background:green; */
}

.block-wg-product-list-reshape .vp-card__image-placeholder {
    display: block;
    width: 100%;
    height: 160px;
    max-height:calc(156px + 8px);
    transition: all 0.5s ease;
    -webkit-transition: all 0.5s ease;
    -moz-transition: all 0.5s ease;
    -o-transition: all 0.5s ease;
    background:
        linear-gradient(135deg, transparent 47%, var(--vp-border) 47%, var(--vp-border) 53%, transparent 53%),
        var(--vp-bg-muted);
}

.block-wg-product-list-reshape .vp-card__badges {
    position: absolute;
    z-index: 2;
    top: 16px;
    left: 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.block-wg-product-list-reshape .vp-badge {
    display: inline-block;
    padding: 8px 8px;
    border-radius: 8px;
    background: var(--vp-badge-bg, #FFDA00);
    color: var(--vp-badge-fg, #0d0d0d);
    font-size: 12px;
    font-weight: 700;
    line-height: 14px;
    gap:8px;
}
.block-wg-product-list-reshape .vp-badge img {
    height:auto;
    height:auto;
    max-width:16px;
    max-height:16px;
}

.block-wg-product-list-reshape .vp-card__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 6px;
    padding: 8px 16px 16px 16px;
    /* background:purple; */
}

/* Logo-ul de brand nu se afiseaza pe card (design). */
.block-wg-product-list-reshape .vp-card__body .vp-brand--logo {
    display: none;
}

.block-wg-product-list-reshape .vp-card__title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 24px;
    font-family: 'PingLCG';
    
}

.block-wg-product-list-reshape .vp-card__title a {
    color: var(--vp-text);
    text-decoration: none;
    /* Doua rânduri, ca inaltimea cardurilor sa rămână uniforma. */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top:4px;
}

.block-wg-product-list-reshape .vp-card__title a:hover {
    text-decoration: underline;
}

/* ── Clasa energetica ─────────────────────────────────────────────────────── */

.block-wg-product-list-reshape .vp-energy {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 16px;
    line-height:24px;
    font-weight:400;
    color: #0D0D0D;
    font-family: 'PingLCG';
}
.block-wg-product-list-reshape .vp-energy strong {
    font-weight:400;
}
.block-wg-product-list-reshape .vp-energy__icon {
    

    /* -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Crect x='3' y='5' width='8' height='3.4' rx='1'/%3E%3Crect x='3' y='10.3' width='13' height='3.4' rx='1'/%3E%3Crect x='3' y='15.6' width='18' height='3.4' rx='1'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Crect x='3' y='5' width='8' height='3.4' rx='1'/%3E%3Crect x='3' y='10.3' width='13' height='3.4' rx='1'/%3E%3Crect x='3' y='15.6' width='18' height='3.4' rx='1'/%3E%3C/svg%3E") center/contain no-repeat; */

    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: middle;
    background-color: currentColor;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
    flex-shrink: 0;
    font-size:24px;
    transition: all 0.3s ease-in-out;
	-webkit-transition: all 0.3s ease-in-out;
	-moz-transition: all 0.3s ease-in-out;
	-o-transition: all 0.3s ease-in-out;
    -webkit-mask-image: url("../../assets/icons/blocks/vp-clasa-energetica.svg");
    mask-image: url("../../assets/icons/blocks/vp-clasa-energetica.svg");
    color: #1d2327;
}

.block-wg-product-list-reshape .vp-energy__value {
    color: var(--vp-text);
}

/* ── Pret ─────────────────────────────────────────────────────────────────── */

.block-wg-product-list-reshape .vp-price {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top:auto;
}

/*
 * Randul de pret: doua grupuri lipite la marginile cardului.
 *
 *   de la 79,99 lei/luna                    79,99 lei/luna (i)
 *
 * Identic cu listarea (vp-products.css) — daca se schimba acolo, se schimba
 * si aici.
 */
.block-wg-product-list-reshape .vp-price__main {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 6px;
    width: 100%;
    min-width:0;
}
.block-wg-product-list-reshape .vp-price__left,
.block-wg-product-list-reshape .vp-price__right {
    display: flex;
    align-items: center;
    min-width: 0;
}
.block-wg-product-list-reshape .vp-price__left {
    gap: 6px;
}

.block-wg-product-list-reshape .vp-price__right {
    gap: 6px;
    flex: 0 0 auto;
}
/* "de la" e text normal, nu gri estompat. */
.block-wg-product-list-reshape .vp-price__from {
    font-size: 14px;
    line-height:18px;
    color: #000;
    font-weight:400;
    font-family: 'PingLCG';
}

.block-wg-product-list-reshape .vp-price__old {
    font-size: 14px;
    color: #4e4e4e;
    font-weight:400;
    line-height:20px;
    text-decoration-line:line-through;
    white-space: nowrap;
}

.block-wg-product-list-reshape .vp-price__sub {
    font-size: 12px;
    color: var(--vp-text-muted);
}

.block-wg-product-list-reshape .vp-price__new {
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
    font-size: 20px;
    font-weight: 700;
    line-height:24px;
    color: var(--vp-accent);
    flex: 0 0 auto;
    min-width:0; 
    margin-left:auto;
    white-space: nowrap;
}

/* Zecimalele la aceeasi dimensiune ca partea intreaga ("79,99 lei/luna"). */
.block-wg-product-list-reshape .vp-price__new sup {
    font-size: 1em;
    top: 0;
    vertical-align: baseline;
}

.block-wg-product-list-reshape .vp-price__new sup::before {
    content: ",";
}

/* Unitatea are aceeasi dimensiune si greutate ca numarul ("79,99 lei/luna"). */
.block-wg-product-list-reshape .vp-price__unit {
    /* margin-left: 4px; */
    font-size: 20px;
    font-weight: inherit;
}
.block-wg-product-list-reshape .vp-price__main.vp-price--large .vp-price__old {
    font-size: 13px;
    line-height: 19px;
}

.block-wg-product-list-reshape .vp-price__main.vp-price--large .vp-price__new ,
.block-wg-product-list-reshape .vp-price__main.vp-price--large .vp-price__unit {
    font-size: 18px;
}

/* Cerc cu "i" drept, nu italic. Culoarea e textul, nu gri estompat. */
/* Tooltip-ul e componenta din forms-reshape.css; identic cu vp-products. */
.block-wg-product-list-reshape .vp-price__info {
    --vp-info-size: 16px;

    position: relative;
    z-index: 3;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    width: var(--vp-info-size);
    height: var(--vp-info-size);
}

/* Ancora e absoluta in forms-reshape; aici iconita e inline dupa pret. */
.block-wg-product-list-reshape .vp-price__info.info.tooltip .tooltip-anchor {
    position: relative;
    inset: auto;
    display: inline-flex;
    align-items: center;
    padding: 0;
}

.block-wg-product-list-reshape .vp-price__info.info.tooltip .tooltip-container,
.block-wg-product-list-reshape .vp-price__info.info.tooltip button.tooltip-container,
.block-wg-product-list-reshape .vp-price__info.info.tooltip .tooltip-container::before {
    width: var(--vp-info-size);
    height: var(--vp-info-size);
}

.block-wg-product-list-reshape .vp-price__info .tooltip-message p {
    display: inline;
    margin: 0;
}

.block-wg-product-list-reshape .vp-price__info .tooltip-message p + p::before {
    content: " ";
}
.block-wg-product-list-reshape .vp-price__info.info.tooltip .tooltip-text {
    right:-8px;
}
.block-wg-product-list-reshape .vp-price__info.info.tooltip .tooltip-text:before {
    right:10px;
}



/* Tooltip-ul nu trebuie decupat de card. */
.block-wg-product-list-reshape .vp-card__body,
.block-wg-product-list-reshape .vp-price,
.block-wg-product-list-reshape .vp-price__main {
    overflow: visible;
}

.block-wg-product-list-reshape .vp-card:has(.tooltip-open) {
    position: relative;
    z-index: 2;
    /* overflow: visible; */
}

/* ── CTA: aici butonul afiseaza textul ───────────────────────────────────── */

.block-wg-product-list-reshape .vp-card__cta {
    display: block;
    margin-top: auto;
    padding: 12px 16px;
    border-radius: var(--vp-radius);
    text-align: center;
    font-size: 16px;
    text-decoration: none;
    
}
/* Pretul are deja margin-top:auto; CTA-ul il urmeaza. Fara pret, CTA-ul coboara singur. */
.block-wg-product-list-reshape .vp-price + .vp-card__cta {
    margin-top: 8px;
}

/* ── Rating (randat doar cand API-ul livreaza date) ──────────────────────── */

.block-wg-product-list-reshape .vp-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--vp-text-muted);
}

.block-wg-product-list-reshape .vp-rating__stars {
    display: inline-flex;
    gap: 1px;
}

.block-wg-product-list-reshape .vp-star {
    width: 12px;
    height: 12px;
    background: #d5d5d5;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l3.1 6.3 6.9 1-5 4.9 1.2 6.8L12 17.8 5.8 21l1.2-6.8-5-4.9 6.9-1z'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l3.1 6.3 6.9 1-5 4.9 1.2 6.8L12 17.8 5.8 21l1.2-6.8-5-4.9 6.9-1z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.block-wg-product-list-reshape .vp-star--full { background: #ffb400; }
.block-wg-product-list-reshape .vp-rating__value { font-weight: 600; color: var(--vp-text); }

/* ── Notice in editor ─────────────────────────────────────────────────────── */

.block-wg-product-list-reshape .vp-products--notice,
.vp-products--notice {
    padding: 24px;
    border: 1px dashed var(--vp-border, #e5e5e5);
    border-radius: 8px;
    text-align: center;
    color: #6b6b6b;
    display:none;
}
.block-wg-product-list-reshape .vp-energy__text.vp-energy__text--desktop {}
.block-wg-product-list-reshape .vp-energy__text.vp-energy__text--mobile {
    display:none;
}

.block-wg-product-list-reshape .vp-card__cta-label {}
.block-wg-product-list-reshape .vp-card__cta-label.vp-card__cta-label--desktop  {}
.block-wg-product-list-reshape .vp-card__cta-label.vp-card__cta-label--mobile {
    display:none;
}
.block-wg-product-list-reshape .wgc__all.is-disabled {
    pointer-events: none;
}
/* ── Responsive (aceleasi breakpoint-uri ca listarea) ────────────────────── */
@media (max-width: 1500px) {
    .block-wg-product-list-reshape .vp-price__main.vp-price--large .vp-price__from,
    .block-wg-product-list-reshape .vp-price__main.vp-price--large .vp-price__old {
        font-size:12px;
        line-height:18px;
    }
    .block-wg-product-list-reshape .vp-price__main.vp-price--large .vp-price__new, 
    .block-wg-product-list-reshape .vp-price__main.vp-price--large .vp-price__unit {
        font-size:16px;
        line-height:22px;
    }
}
@media (max-width: 1440px) {
    .block-wg-product-list-reshape .vp-price__main {
        flex-wrap:wrap;
    }
    .block-wg-product-list-reshape .vp-price__new {
        flex: none;
        
        align-items: center;
        justify-content: flex-start;
        margin-left: 0;
    }
    .block-wg-product-list-reshape .vp-price__main.vp-price--large .vp-price__from,
    .block-wg-product-list-reshape .vp-price__main.vp-price--large .vp-price__old {
        font-size:14px;
        line-height:20px;
    }
    .block-wg-product-list-reshape .vp-price__main.vp-price--large .vp-price__new, 
    .block-wg-product-list-reshape .vp-price__main.vp-price--large .vp-price__unit {
        font-size:20px;
        line-height:24px;
    }

    .block-wg-product-list-reshape .vp-price {
        position:relative;
    }
    
    .block-wg-product-list-reshape .vp-price__info.info.tooltip .tooltip-anchor,
    .block-wg-product-list-reshape .vp-price__info {
        position:initial;
    }
    .block-wg-product-list-reshape .vp-price__info.info.tooltip .tooltip-text {
        left:0px;
        right:0px;
        bottom:0px;
        max-width:100%;
    }
    .block-wg-product-list-reshape .vp-price__info.info.tooltip .tooltip-text:before {
        display:none;
    }
    .block-wg-product-list-reshape .vp-card {
        height:auto;
        min-height: 0;
    }
    .block-wg-product-list-reshape .vp-price__main {
        gap:0px;
    }
    
}
@media (max-width: 1200px) {
    .block-wg-product-list-reshape .vp-price__main.vp-price--large .vp-price__new, .block-wg-product-list-reshape .vp-price__main.vp-price--large .vp-price__unit {
        font-size:18px;
        line-height:24px;
    }
    .wgc__grid {
        gap:16px;
    }
    .block-wg-product-list-reshape .vp-price__unit,
    .block-wg-product-list-reshape .vp-price__new {
        font-size:18px;
    }
   .block-wg-product-list-reshape .vp-price__main {
        justify-content: flex-start;
   }
}
@media (max-width: 1100px) {
    .wgc__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    

    
}

@media (max-width: 860px) {
    .block-wg-product-list-reshape .vp-price__main {
        align-items: flex-start;
        justify-content: flex-start;
        flex-direction: column;
        gap: 0;
    }
    .wgc__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .block-wg-product-list-reshape .vp-price__main .vp-price__new, 
    .block-wg-product-list-reshape .vp-price__main .vp-price__unit,
    .block-wg-product-list-reshape .vp-price__main.vp-price--large .vp-price__new, 
    .block-wg-product-list-reshape .vp-price__main.vp-price--large .vp-price__unit {
        font-size:18px;
        line-height:24px;
    }
    .wgc__title {
        font-size: 20px;
    }
    .wgc__grid {
        gap:8px;
    }
    .wgc__head {
        margin-bottom:8px;
    }
    .wgc__head .wgc__all {
        display:none;
    }
    .wgc__footer {
        display:flex;
        margin-top:16px;
    }
    .wgc__footer .wgc__all {
        max-width:100%;
        width:100%;
    }
    .block-wg-product-list-reshape .vp-card__image {
        padding:12px 8px;
    }
    .block-wg-product-list-reshape .vp-card__badges {
        top:12px;
        left:8px;
        gap:12px;
    }
    .block-wg-product-list-reshape .vp-badge {
        padding:4px;
    }
  
    .block-wg-product-list-reshape .vp-card__body {
        padding:0px 8px 12px 8px;
        gap:4px;
    }
    .block-wg-product-list-reshape .vp-card__title {
        font-size:14px;
        line-height:20px;
    }
    .block-wg-product-list-reshape .vp-energy {
        gap:4px;
        font-size:14px;
        line-height:20px;
    }
    .block-wg-product-list-reshape .vp-energy__icon {
        font-size:16px;
    }
    .block-wg-product-list-reshape .vp-price__right {
        gap:4px;
    }
    .block-wg-product-list-reshape .vp-price__main.vp-price--large .vp-price__new, 
    .block-wg-product-list-reshape .vp-price__main.vp-price--large .vp-price__unit {
        font-size:16px;
        line-height:24px;
    }
    .block-wg-product-list-reshape .vp-price__info.info.tooltip .tooltip-message *{
        font-size:14px;
        line-height:20px;
    } 
    .block-wg-product-list-reshape .vp-price__info.info.tooltip .tooltip-text {
        margin-left:auto;
    }
    .block-wg-product-list-reshape .vp-card {
        min-height:300px;
    }
}

 @media (max-width: 520px) {
    .block-wg-product-list-reshape .vp-card__cta {
        min-width:auto;
    }
    .block-wg-product-list-reshape .vp-energy__text.vp-energy__text--desktop {
        display:none;
    }
    .block-wg-product-list-reshape .vp-energy__text.vp-energy__text--mobile {
        display:block;
    }
    .block-wg-product-list-reshape .vp-card__cta-label.vp-card__cta-label--desktop  {
        display:none;
    }
    .block-wg-product-list-reshape .vp-card__cta-label.vp-card__cta-label--mobile {
        display:block;
    }
    .block-wg-product-list-reshape .vp-card__image {
        max-height:calc(100px + 8px);
    }
    .block-wg-product-list-reshape .vp-card__image-placeholder {
        max-height:calc(77px + 8px);
    }
    .block-wg-product-list-reshape .vp-price__main .vp-price__new, 
    .block-wg-product-list-reshape .vp-price__main .vp-price__unit, 
    .block-wg-product-list-reshape .vp-price__main.vp-price--large .vp-price__new, 
    .block-wg-product-list-reshape .vp-price__main.vp-price--large .vp-price__unit {
        font-size:16px;
        line-height:24px;
    }
    .wgc__grid {
        /* grid-template-columns: 1fr; */
    }

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

   
    .wgc__title {
        flex: none;
        width: 100%;
    }

    .wgc__all {
        width: 100%;
        justify-content: center;
        margin-left: 0;
    }
} 
@media (max-width: 420px) {
    .block-wg-product-list-reshape .vp-price__main .vp-price__new, 
    .block-wg-product-list-reshape .vp-price__main .vp-price__unit {
        font-size:15px;
    }
    .block-wg-product-list-reshape .vp-price__main.vp-price--large .vp-price__from, 
    .block-wg-product-list-reshape .vp-price__main.vp-price--large .vp-price__old,
    .block-wg-product-list-reshape .vp-price__main.vp-price--large .vp-price__new, 
    .block-wg-product-list-reshape .vp-price__main.vp-price--large .vp-price__unit {
        font-size:14px;
    }
}
@media (max-width: 360px) {
    .block-wg-product-list-reshape .vp-price__main .vp-price__new, 
    .block-wg-product-list-reshape .vp-price__main .vp-price__unit {
        font-size:14px;
    }
    .block-wg-product-list-reshape .vp-price__main.vp-price--large .vp-price__from, 
    .block-wg-product-list-reshape .vp-price__main.vp-price--large .vp-price__old,
    .block-wg-product-list-reshape .vp-price__main.vp-price--large .vp-price__new, 
    .block-wg-product-list-reshape .vp-price__main.vp-price--large .vp-price__unit {
        font-size:13px;
    }
}