/* =====================================================
   PIXELMARKET — FEATURED PRODUCTS SECTION CSS
   Design: Modern digital marketplace aesthetic
   Grid: 4 cols on desktop, 2 cols on mobile
   ===================================================== */

:root {
    --pm-fp-bg:             #FFFFFF;
    --pm-fp-card-bg:        #FFFFFF;
    --pm-fp-border:         #EBE9E4;
    --pm-fp-border-hover:   rgba(108, 76, 241, 0.4);
    --pm-fp-text:           #1E293B;
    --pm-fp-subtext:        #64748B;
    --pm-fp-purple:         #6C4CF1;
    --pm-fp-purple-light:   #EDE8FE;
    --pm-fp-purple-glow:    rgba(108, 76, 241, 0.12);
    --pm-fp-sale:           #EF4444;
    --pm-fp-price-sale:     #059669;
    --pm-fp-star:           #F59E0B;
}

/* ════════ MAIN SECTION CONTAINER ════════ */
.pm-featured-products-section {
    background-color: var(--pm-fp-bg);
    padding: 88px 24px 104px;
    position: relative;
    font-family: var(--pm-font, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
    color: var(--pm-fp-text);
    box-sizing: border-box;
}

.pm-featured-products__inner {
    max-width: 1320px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    box-sizing: border-box;
}

/* ════════ SECTION HEADER WITH VIEW ALL LINK ════════ */
.pm-featured-products__header-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 48px;
}

.pm-featured-products__header-left {
    max-width: 720px;
}

/* Eyebrow badge */
.pm-featured-products__eyebrow {
    margin-bottom: 14px;
}

.pm-featured-products__eyebrow-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(108, 76, 241, 0.08);
    border: 1px solid rgba(108, 76, 241, 0.22);
    border-radius: 9999px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--pm-fp-purple);
}

.pm-featured-products__eyebrow-dot {
    width: 7px;
    height: 7px;
    background-color: var(--pm-fp-purple);
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(108, 76, 241, 0.2);
    animation: pmPulse 2s infinite ease-in-out;
}

/* Section Heading */
.pm-featured-products__heading {
    font-family: var(--pm-font-display, 'Plus Jakarta Sans', sans-serif);
    font-size: clamp(28px, 3.2vw, 42px);
    font-weight: 800;
    line-height: 1.18;
    letter-spacing: -0.03em;
    color: var(--pm-fp-text);
    margin: 0 0 12px;
}

.pm-featured-products__highlight-purple {
    color: #6C4CF1;
    display: inline;
}

@supports (-webkit-background-clip: text) or (background-clip: text) {
    .pm-featured-products__highlight-purple {
        background: linear-gradient(135deg, #6C4CF1 0%, #8D71FB 100%);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }
}

/* Section Subheading */
.pm-featured-products__subheading {
    font-size: 16px;
    line-height: 1.6;
    color: var(--pm-fp-subtext);
    margin: 0;
}

/* "View All Products" Button Beside Heading */
.pm-featured-products__header-right {
    flex-shrink: 0;
}

.pm-featured-products__view-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: #FFFFFF;
    border: 1.5px solid var(--pm-fp-border);
    border-radius: 9999px;
    font-family: var(--pm-font, 'Inter', sans-serif);
    font-size: 14.5px;
    font-weight: 700;
    color: var(--pm-fp-text);
    text-decoration: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

.pm-featured-products__view-all-btn svg {
    transition: transform 0.25s ease;
}

.pm-featured-products__view-all-btn:hover {
    background: var(--pm-fp-purple);
    color: #FFFFFF;
    text-decoration: none !important;
    border-color: var(--pm-fp-purple);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px var(--pm-fp-purple-glow);
}

.pm-featured-products__view-all-btn:hover svg {
    transform: translateX(4px);
}

/* ════════ PRODUCT GRID (4 COLS DESKTOP, 2 COLS MOBILE) ════════ */
.pm-featured-products__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 28px;
}

.pm-featured-products__grid--cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.pm-featured-products__grid--cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* ════════ WHITE PRODUCT CARD ════════ */
.pm-product-card {
    background-color: var(--pm-fp-card-bg);
    border: 1px solid var(--pm-fp-border);
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.03);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.35s ease,
                border-color 0.25s ease;
}

.pm-product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 42px var(--pm-fp-purple-glow), 0 4px 12px rgba(0, 0, 0, 0.04);
    border-color: var(--pm-fp-border-hover);
}

/* ── Card Preview Image Media ── */
.pm-product-card__media {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    min-height: 190px;
    background: #F4F3EE;
    overflow: hidden;
}

.pm-product-card__media-link {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    text-decoration: none !important;
}

.pm-product-card__media-link:hover {
    text-decoration: none !important;
}

.pm-product-card__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.pm-product-card:hover .pm-product-card__media img {
    transform: scale(1.05);
}

.pm-product-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9CA3AF;
    background: #F3F1EC;
}

/* ── Badges: Featured & Sale ── */
.pm-product-card__badges {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    z-index: 3;
    pointer-events: none;
}

.pm-product-card__badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.pm-product-card__badge--featured {
    background: linear-gradient(135deg, #6C4CF1 0%, #8D71FB 100%);
    color: #FFFFFF;
    box-shadow: 0 4px 14px rgba(108, 76, 241, 0.4);
}

.pm-product-card__badge--sale {
    background: #EF4444;
    color: #FFFFFF;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

/* ── Real Wishlist Control (Only if active) ── */
.pm-product-card__wishlist {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
}

/* ── Card Body ── */
.pm-product-card__body {
    padding: 20px 20px 22px;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
    gap: 16px;
    background: #FFFFFF;
}

.pm-product-card__info {
    flex: 1;
}

/* Seller / Store Name */
.pm-product-card__seller-wrap {
    margin-bottom: 7px;
}

.pm-product-card__seller {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--pm-fp-subtext);
    text-decoration: none !important;
    transition: color 0.2s ease;
}

.pm-product-card__seller svg {
    color: #94A3B8;
}

.pm-product-card__seller:hover {
    color: var(--pm-fp-purple);
    text-decoration: none !important;
}

.pm-product-card__seller:hover svg {
    color: var(--pm-fp-purple);
}

/* Product Title */
.pm-product-card__title {
    font-family: var(--pm-font-display, 'Plus Jakarta Sans', sans-serif);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.38;
    color: var(--pm-fp-text);
    margin: 0 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 44px;
}

.pm-product-card__title a {
    color: inherit;
    text-decoration: none !important;
    transition: color 0.2s ease;
}

.pm-product-card__title a:hover {
    color: var(--pm-fp-purple);
    text-decoration: none !important;
}

/* Rating and Reviews (ONLY when actual data exists) */
.pm-product-card__rating {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    font-weight: 600;
    color: #374151;
    margin-top: 2px;
}

.pm-product-card__rating-stars {
    display: inline-flex;
    align-items: center;
}

.pm-product-card__rating-score {
    font-weight: 700;
    color: #1F2937;
}

.pm-product-card__rating-count {
    color: var(--pm-fp-subtext);
    font-weight: 500;
}

/* ── Card Footer: Price & Detail Action ── */
.pm-product-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid #F1EFEA;
    margin-top: auto;
}

.pm-product-card__price-box {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.pm-product-card__price-box .woocommerce-Price-amount,
.pm-product-card__price-box .price {
    font-family: var(--pm-font-display, 'Plus Jakarta Sans', sans-serif);
    font-size: 18px;
    font-weight: 800;
    color: var(--pm-fp-text);
    letter-spacing: -0.02em;
    margin: 0;
}

.pm-product-card__price-box ins {
    text-decoration: none;
}

.pm-product-card__price-box ins .woocommerce-Price-amount {
    color: var(--pm-fp-price-sale);
    font-weight: 800;
}

.pm-product-card__price-box del {
    color: #94A3B8;
    font-size: 13.5px;
    font-weight: 500;
}

.pm-product-card__price-box del .woocommerce-Price-amount {
    color: #94A3B8;
    font-size: 13.5px;
    font-weight: 500;
}

/* Arrow detail link button */
.pm-product-card__action {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #F4F3F0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4B5563;
    text-decoration: none !important;
    flex-shrink: 0;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.pm-product-card__action:hover {
    text-decoration: none !important;
}

.pm-product-card:hover .pm-product-card__action {
    background: var(--pm-fp-purple);
    color: #FFFFFF;
    text-decoration: none !important;
    transform: translate(2px, -2px);
    box-shadow: 0 4px 12px rgba(108, 76, 241, 0.35);
}

/* ════════ EMPTY & ONBOARDING STATE ════════ */
.pm-products-empty {
    background: #FFFFFF;
    border: 1.5px dashed var(--pm-fp-border);
    border-radius: 20px;
    padding: 56px 36px;
    text-align: center;
    max-width: 680px;
    margin: 0 auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.pm-products-empty__icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--pm-fp-purple-light);
    color: var(--pm-fp-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.pm-products-empty__title {
    font-family: var(--pm-font-display, 'Plus Jakarta Sans', sans-serif);
    font-size: 20px;
    font-weight: 800;
    color: var(--pm-fp-text);
    margin: 0 0 10px;
}

.pm-products-empty__desc {
    font-size: 15px;
    line-height: 1.6;
    color: var(--pm-fp-subtext);
    margin: 0 0 24px;
}

.pm-products-empty__meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.pm-products-empty__badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: #F4F3EE;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    color: #4B5563;
}

.pm-products-empty__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--pm-fp-purple);
    color: #FFFFFF;
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 6px 18px var(--pm-fp-purple-glow);
    transition: all 0.25s ease;
}

.pm-products-empty__btn:hover {
    background: #5B3AE0;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px var(--pm-fp-purple-glow);
    color: #FFFFFF;
}

/* ════════ RESPONSIVE ADAPTATIONS ════════ */
@media (max-width: 1140px) {
    .pm-featured-products__grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 22px;
    }
}

@media (max-width: 860px) {
    .pm-featured-products-section {
        padding: 64px 20px 80px;
    }

    .pm-featured-products__header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        margin-bottom: 36px;
    }

    .pm-featured-products__header-right {
        width: 100%;
    }

    .pm-featured-products__view-all-btn {
        width: auto;
    }

    .pm-featured-products__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }
}

/* MOBILE ADAPTATION: EXACTLY TWO PRODUCT CARDS PER ROW */
@media (max-width: 640px) {
    .pm-featured-products-section {
        padding: 48px 16px 64px;
    }

    .pm-featured-products__header-row {
        margin-bottom: 28px;
    }

    .pm-featured-products__heading {
        font-size: 26px;
    }

    .pm-featured-products__subheading {
        font-size: 14.5px;
    }

    .pm-featured-products__view-all-btn {
        font-size: 13.5px;
        padding: 10px 18px;
    }

    /* Strict 2 cards per row on mobile */
    .pm-featured-products__grid,
    .pm-featured-products__grid--cols-3,
    .pm-featured-products__grid--cols-4 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    .pm-product-card {
        border-radius: 14px;
    }

    .pm-product-card__badges {
        top: 8px;
        left: 8px;
        gap: 4px;
    }

    .pm-product-card__badge {
        font-size: 9.5px;
        padding: 3px 7px;
    }

    .pm-product-card__body {
        padding: 14px 12px 14px;
        gap: 10px;
    }

    .pm-product-card__seller {
        font-size: 11.5px;
    }

    .pm-product-card__title {
        font-size: 14px;
        line-height: 1.3;
        min-height: 36px;
        margin-bottom: 4px;
    }

    .pm-product-card__rating {
        font-size: 11px;
    }

    .pm-product-card__footer {
        padding-top: 10px;
    }

    .pm-product-card__price-box .woocommerce-Price-amount,
    .pm-product-card__price-box .price {
        font-size: 15px;
    }

    .pm-product-card__price-box del .woocommerce-Price-amount {
        font-size: 11.5px;
    }

    .pm-product-card__action {
        width: 30px;
        height: 30px;
    }

    .pm-product-card__action svg {
        width: 14px;
        height: 14px;
    }
}
