/* ── Endorah Marketplace ───────────────────────────────────────────── */

.endorah-marketplace {
    /* Break out of the theme's narrow col-md-8 container */
    width: 100vw;
    margin-left: calc(50% - 50vw);
    max-width: none;
    box-sizing: border-box;
    padding: 24px 40px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: transparent;
}

/* Grid — 4 colonnes fixes */
.em-product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Card */
.em-product {
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.em-product:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.em-product-link {
    display: flex;
    flex-direction: column;
    text-decoration: none !important;
    color: inherit;
    height: 100%;
}

/* Image */
.em-product-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

/* Text body */
.em-product-body {
    padding: 10px 4px 8px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Name — override theme h2 (Hestia sets html=10px so use px not rem) */
.endorah-marketplace .em-product-grid .em-product .em-product-name {
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    margin: 0 0 4px !important;
    padding: 0 !important;
    color: #111 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-transform: none !important;
    letter-spacing: normal !important;
    border: none !important;
    background: none !important;
}
@media (max-width: 900px) {
    .endorah-marketplace .em-product-grid .em-product .em-product-name {
        font-size: 13px !important;
    }
}

/* Type */
.em-product-type {
    font-size: 0.8rem;
    color: #555;
    margin: 0 0 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.em-type-icon {
    width: 14px;
    height: 14px;
    opacity: 0.6;
}

/* Price / Rating row */
.em-product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 6px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #222;
    border-top: 1px solid #eee;
}

.em-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #444;
}

.em-price {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #222;
}

.em-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

/* Star SVG inline */
.em-star {
    color: #f5a623;
    font-size: 0.85rem;
    line-height: 1;
}

/* Loading spinner */
.em-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 0;
    color: #888;
    font-size: 0.9rem;
}

.em-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e0e0e0;
    border-top-color: #555;
    border-radius: 50%;
    animation: em-spin 0.7s linear infinite;
    margin-bottom: 10px;
}

@keyframes em-spin {
    to { transform: rotate(360deg); }
}

/* End / empty */
.em-end-message,
.em-no-products {
    text-align: center;
    color: #999;
    padding: 32px 0;
    font-size: 0.9rem;
    grid-column: 1 / -1;
}

/* ── Responsive ─────────────────────────────────────────────────────── */

@media (max-width: 900px) {
    .em-product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px 14px;
    }
}

@media (max-width: 600px) {
    .endorah-marketplace {
        padding: 16px 12px;
    }
    .em-product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px 10px;
    }
}
