/* ==========================================================================
   iamstilhed Product Feed — CSS strutturale
   I colori/spaziature specifiche di ogni istanza vengono impostati via
   variabili CSS inline nel markup del widget (vedi widget PHP).
   ========================================================================== */

.iams-feed-wrap,
.iams-feed-wrap *,
.iams-feed-wrap *::before,
.iams-feed-wrap *::after {
    box-sizing: border-box;
}

.iams-feed-wrap {
    --fd: 'Barlow Condensed', sans-serif;
    --fb: 'Barlow', sans-serif;
    font-family: var(--fb);
    -webkit-font-smoothing: antialiased;
    width: 100%;
}

/* ── Tema DARK (default) ───────────────────────────────────────────────── */
.iams-feed-wrap.iams-feed-theme-dark {
    --f-bg:      transparent;
    --f-card:    #151515;
    --f-border:  #222222;
    --f-text:    #F5F5F5;
    --f-muted:   #777777;
    --f-imgbg:   #1a1a1a;
    --f-overlay: linear-gradient(to top, rgba(0,0,0,.88) 0%, transparent 100%);
    --f-badgebg: rgba(0,0,0,.8);
}

/* ── Tema LIGHT ─────────────────────────────────────────────────────────── */
.iams-feed-wrap.iams-feed-theme-light {
    --f-bg:      transparent;
    --f-card:    #FFFFFF;
    --f-border:  #E7E7E7;
    --f-text:    #121212;
    --f-muted:   #8A8A8A;
    --f-imgbg:   #F1F1F1;
    --f-overlay: linear-gradient(to top, rgba(255,255,255,.92) 0%, transparent 100%);
    --f-badgebg: rgba(255,255,255,.9);
}

/* ── GRIGLIA ────────────────────────────────────────────────────────────── */
.iams-feed-grid {
    display: grid;
    grid-template-columns: repeat(var(--f-cols-desktop, 4), 1fr);
    gap: var(--f-gap, 2px);
    background: var(--f-bg);
}

@media (max-width: 1024px) {
    .iams-feed-grid { grid-template-columns: repeat(var(--f-cols-tablet, 2), 1fr); }
}
@media (max-width: 600px) {
    .iams-feed-grid { grid-template-columns: repeat(var(--f-cols-mobile, 2), 1fr); }
}

/* ── CARD ───────────────────────────────────────────────────────────────── */
.iams-feed-card {
    background: var(--f-card);
    border-radius: var(--f-radius, 0px);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: transform .25s ease;
}
.iams-feed-card:hover { transform: translateY(-3px); z-index: 2; }
.iams-feed-card::after {
    content: '';
    position: absolute; inset: 0;
    border: 2px solid transparent;
    border-radius: inherit;
    pointer-events: none;
    transition: border-color .25s ease;
}
.iams-feed-card:hover::after { border-color: var(--f-accent, #FF2D78); }

.iams-feed-card-num {
    position: absolute; top: 12px; left: 12px; z-index: 3;
    font-family: var(--fd); font-weight: 900; font-size: 11px;
    letter-spacing: .12em;
    color: var(--f-yellow, #FFE600);
    background: var(--f-badgebg);
    padding: 3px 7px;
}
.iams-feed-card-cat {
    position: absolute; top: 12px; right: 12px; z-index: 3;
    font-family: var(--fd); font-size: 10px; font-weight: 700;
    letter-spacing: .12em; text-transform: uppercase;
    color: var(--f-text);
    background: var(--f-badgebg);
    padding: 3px 7px;
}

/* Immagine */
.iams-feed-card-img {
    width: 100%;
    aspect-ratio: var(--f-img-ratio, 1 / 1);
    overflow: hidden;
    background: var(--f-imgbg);
    position: relative;
    display: block;
}
.iams-feed-card-img img {
    width: 100%; height: 100%; object-fit: cover;
    display: block; transition: transform .4s ease;
}
.iams-feed-card:hover .iams-feed-card-img img { transform: scale(1.06); }

/* Overlay CTA su hover */
.iams-feed-card-overlay {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: var(--f-overlay);
    height: 55%;
    opacity: 0; transition: opacity .3s ease;
    display: flex; align-items: flex-end; padding: 14px;
}
.iams-feed-card:hover .iams-feed-card-overlay { opacity: 1; }

.iams-feed-btn-cart {
    width: 100%;
    background: var(--f-accent, #FF2D78);
    color: #fff; border: none;
    padding: 10px;
    font-family: var(--fd); font-weight: 700; font-size: 13px;
    letter-spacing: .1em; text-transform: uppercase;
    cursor: pointer; text-align: center;
    text-decoration: none; display: block;
    transition: filter .2s ease;
}
.iams-feed-btn-cart:hover { filter: brightness(1.1); }

/* Wishlist */
.iams-feed-wishlist-btn {
    position: absolute; top: 12px; right: 12px; z-index: 4;
    background: transparent; border: none; padding: 0;
    cursor: pointer; color: var(--f-muted);
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    transition: color .2s ease;
}
.iams-feed-card-cat ~ .iams-feed-wishlist-btn,
.iams-feed-wishlist-btn.has-cat { top: 40px; }
.iams-feed-wishlist-btn:hover,
.iams-feed-wishlist-btn.active { color: var(--f-accent, #FF2D78); }

/* Body card */
.iams-feed-card-body {
    padding: 14px 16px 16px;
    display: flex; flex-direction: column; gap: 6px; flex: 1;
}
.iams-feed-card-title {
    font-family: var(--fd); font-weight: 700; font-size: 17px;
    letter-spacing: .02em; text-transform: uppercase; line-height: 1.15;
    color: var(--f-text);
    text-decoration: none;
}
.iams-feed-card-footer {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; margin-top: 4px;
}
.iams-feed-card-price,
.iams-feed-card-price .amount,
.iams-feed-card-price bdi,
.iams-feed-card-price ins {
    font-family: var(--fd); font-weight: 900; font-size: 20px;
    color: var(--f-accent, #FF2D78) !important;
    letter-spacing: .02em; text-decoration: none;
}
.iams-feed-card-price del,
.iams-feed-card-price del .amount,
.iams-feed-card-price del bdi {
    color: var(--f-muted) !important; font-size: 14px; margin-right: 6px;
    font-weight: 700; text-decoration: line-through;
}

.iams-feed-empty {
    color: var(--f-muted); font-family: var(--fb); font-size: 15px;
    padding: 40px 4px;
}

/* ── TOAST ──────────────────────────────────────────────────────────────── */
#iams-feed-toast {
    position: fixed; bottom: 24px; right: 24px; z-index: 9999;
    background: #FF2D78; color: #fff;
    font-family: 'Barlow Condensed', sans-serif; font-weight: 700;
    font-size: 14px; letter-spacing: .08em; text-transform: uppercase;
    padding: 12px 20px;
    transform: translateY(80px); opacity: 0;
    transition: all .3s ease; pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    .iams-feed-wrap * { transition: none !important; animation: none !important; }
}
