/* ==========================================================================
   EV Nexo Mart – Product Showcase  |  Public Styles  v1.0.1
   Card design updated to match EV Nexo Mart store style.
   All classes prefixed .evnm- to avoid theme conflicts.
   ========================================================================== */

/* ─── CSS Custom Properties ─────────────────────────────────────────────────── */
.evnm-showcase {
    --evnm-cols-desktop: 4;
    --evnm-cols-tablet: 3;
    --evnm-cols-mobile: 2;
    --evnm-gap: 20px;

    /* Card */
    --evnm-card-radius: 16px;
    --evnm-card-shadow: 0 2px 16px rgba(0,0,0,.07);
    --evnm-card-hover-shadow: 0 10px 32px rgba(0,0,0,.13);

    /* Colors */
    --evnm-primary: #1a56db;          /* rich blue — matches store */
    --evnm-primary-hover: #1245b8;
    --evnm-accent: #ff6b35;           /* sale / badge orange */
    --evnm-green: #16a34a;            /* in stock */
    --evnm-new-badge: #16a34a;        /* NEW badge green */
    --evnm-featured-badge: #f59e0b;   /* FEATURED badge amber */
    --evnm-sale-badge: #ef4444;       /* SALE badge red */
    --evnm-text: #111827;
    --evnm-muted: #6b7280;
    --evnm-border: #e5e7eb;
    --evnm-bg: #f9fafb;

    font-family: inherit;
}

/* ─── Section wrapper ─────────────────────────────────────────────────────── */
.evnm-showcase-category {
    margin-bottom: 52px;
}
.evnm-showcase-category + .evnm-showcase-category {
    padding-top: 8px;
    border-top: 1px solid var(--evnm-border);
}

/* ─── Section header ──────────────────────────────────────────────────────── */
.evnm-showcase-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 22px;
}
.evnm-showcase-category-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--evnm-text);
    margin: 0;
    position: relative;
    padding-left: 16px;
    letter-spacing: -.3px;
}
.evnm-showcase-category-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 72%;
    background: var(--evnm-primary);
    border-radius: 3px;
}
.evnm-showcase-view-all {
    font-size: 13px;
    font-weight: 600;
    color: var(--evnm-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: gap .15s, color .15s;
    white-space: nowrap;
}
.evnm-showcase-view-all:hover {
    color: var(--evnm-primary-hover);
    gap: 8px;
}

/* ─── Featured section override ───────────────────────────────────────────── */
.evnm-showcase-featured .evnm-showcase-category-title::before {
    background: var(--evnm-featured-badge);
}
.evnm-featured-icon { margin-right: 4px; }

/* ─── Grid ────────────────────────────────────────────────────────────────── */
.evnm-showcase-grid {
    display: grid;
    grid-template-columns: repeat(var(--evnm-cols-desktop), 1fr);
    gap: var(--evnm-gap);
}

/* ==========================================================================
   PRODUCT CARD  — styled to match Image 2
   ========================================================================== */
.evnm-showcase-card {
    background: #fff;
    border: 1px solid var(--evnm-border);
    border-radius: var(--evnm-card-radius);
    box-shadow: var(--evnm-card-shadow);
    display: flex;
    flex-direction: column;
    transition: box-shadow .22s ease, transform .22s ease;
    overflow: hidden;
    position: relative;
}
.evnm-showcase-card:hover {
    box-shadow: var(--evnm-card-hover-shadow);
    transform: translateY(-3px);
}

/* ── Image area ─────────────────────────────────────────────────────────── */
.evnm-card-image-link {
    display: block;
    text-decoration: none;
}
.evnm-card-image-wrap {
    position: relative;
    overflow: hidden;
    background: var(--evnm-bg);
    aspect-ratio: 1 / 1;
    border-radius: var(--evnm-card-radius) var(--evnm-card-radius) 0 0;
}
.evnm-card-image {
    width: 100%;
    height: 100%;
    object-fit: contain;          /* "contain" keeps full product visible */
    padding: 10px;
    box-sizing: border-box;
    transition: transform .32s ease;
}
.evnm-showcase-card:hover .evnm-card-image {
    transform: scale(1.05);
}

/* ── Badge — top-left corner ribbon ───────────────────────────────────── */
.evnm-card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--evnm-new-badge);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: .8px;
    text-transform: uppercase;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
/* Sale badge gets red */
.evnm-on-sale .evnm-card-badge {
    background: var(--evnm-sale-badge);
}
/* Featured badge gets amber */
.evnm-showcase-featured .evnm-card-badge {
    background: var(--evnm-featured-badge);
}

/* Out of stock overlay */
.evnm-card-stock-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.72);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: var(--evnm-muted);
    letter-spacing: .3px;
    z-index: 1;
}

/* ── Card body ──────────────────────────────────────────────────────────── */
.evnm-card-body {
    padding: 14px 16px 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Category label — grey caps, like Image 2 */
.evnm-card-category {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--evnm-muted);
}

/* Product title — bold, larger, matches Image 2 */
.evnm-card-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    color: var(--evnm-text);
}
.evnm-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color .15s;
}
.evnm-card-title a:hover { color: var(--evnm-primary); }

/* Vendor */
.evnm-card-vendor {
    font-size: 11px;
    color: var(--evnm-primary);
    font-weight: 600;
}

/* Short description — 3 lines max, matches Image 2 */
.evnm-card-desc {
    font-size: 12.5px;
    color: var(--evnm-muted);
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Rating */
.evnm-card-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
}
.evnm-card-rating .star-rating {
    float: none;
    font-size: 12px;
}
.evnm-card-rating-count {
    font-size: 11px;
    color: var(--evnm-muted);
}

/* ── Price block — large & bold, exactly like Image 2 ─────────────────── */
.evnm-card-price {
    margin-top: auto;       /* pushes price toward the bottom of body */
    padding-top: 10px;
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}
/* Regular / only price — large */
.evnm-price-only {
    font-size: 20px;
    font-weight: 800;
    color: var(--evnm-text);
    letter-spacing: -.5px;
}
/* Strike-through old price (on sale) */
.evnm-card-price .evnm-price-regular {
    font-size: 13px;
    color: var(--evnm-muted);
    text-decoration: line-through;
    font-weight: 400;
}
/* Sale price — large */
.evnm-card-price .evnm-price-sale {
    font-size: 20px;
    font-weight: 800;
    color: var(--evnm-text);
    letter-spacing: -.5px;
}

/* Stock status text — small, under price */
.evnm-card-stock-label {
    font-size: 11px;
    font-weight: 600;
    padding-top: 2px;
}
.evnm-stock-instock     { color: var(--evnm-green); }
.evnm-stock-outofstock  { color: #dc2626; }
.evnm-stock-onbackorder { color: #ea580c; }

/* ── Card footer — full-width Add to Cart like Image 2 ────────────────── */
.evnm-card-footer {
    padding: 10px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Shared button base */
.evnm-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    padding: 11px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background .16s, box-shadow .16s, transform .1s;
    text-align: center;
    box-sizing: border-box;
    letter-spacing: .2px;
}
.evnm-btn:active { transform: scale(.98); }

/* Add to Cart — solid primary blue, full width, icon */
.evnm-btn-cart {
    background: var(--evnm-primary);
    color: #fff;
    box-shadow: 0 3px 10px rgba(26,86,219,.25);
}
.evnm-btn-cart::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='21' r='1'/%3E%3Ccircle cx='20' cy='21' r='1'/%3E%3Cpath d='M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6'/%3E%3C/svg%3E") no-repeat center/contain;
    flex-shrink: 0;
}
.evnm-btn-cart:hover {
    background: var(--evnm-primary-hover);
    color: #fff;
    box-shadow: 0 5px 16px rgba(26,86,219,.35);
}

/* View Product — ghost / outline */
.evnm-btn-view {
    background: transparent;
    color: var(--evnm-primary);
    border: 1.5px solid var(--evnm-primary);
    box-shadow: none;
}
.evnm-btn-view:hover {
    background: var(--evnm-primary);
    color: #fff;
}

/* Variable / disabled */
.evnm-btn-disabled {
    background: var(--evnm-bg);
    color: var(--evnm-muted);
    border: 1.5px solid var(--evnm-border);
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
}

/* AJAX cart feedback states */
.evnm-btn-cart.evnm-btn-loading {
    opacity: .75;
    pointer-events: none;
}
.evnm-btn-cart.evnm-btn-added {
    background: var(--evnm-green);
    box-shadow: 0 3px 10px rgba(22,163,74,.3);
}

/* ── Out of stock card ──────────────────────────────────────────────────── */
.evnm-out-of-stock { opacity: .82; }
.evnm-out-of-stock .evnm-card-image-wrap { opacity: .7; }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .evnm-showcase-grid {
        grid-template-columns: repeat(var(--evnm-cols-tablet), 1fr);
    }
}
@media (max-width: 640px) {
    .evnm-showcase-grid {
        grid-template-columns: repeat(var(--evnm-cols-mobile), 1fr);
        gap: 12px;
    }
    .evnm-showcase-category-title { font-size: 18px; }
    .evnm-card-body  { padding: 12px 12px 6px; }
    .evnm-card-footer { padding: 8px 12px 12px; }
    .evnm-price-only,
    .evnm-card-price .evnm-price-sale { font-size: 17px; }
    .evnm-btn { padding: 10px 12px; font-size: 12px; }
}

/* ─── WooCommerce star-rating color override ─────────────────────────────── */
.evnm-showcase .star-rating::before,
.evnm-showcase .star-rating span::before { color: #f59e0b; }
