/* MPR Showcase Revolution — Core Front Styles */

/* ============================================
   CSS Variables (overridable via admin config)
   ============================================ */
:root {
    --mpr-sc-primary: #2fb5d2;
    --mpr-sc-accent: #ff6b35;
    --mpr-sc-radius: 8px;
    --mpr-sc-shadow: 0 2px 8px rgba(0,0,0,0.08);
    --mpr-sc-shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
    --mpr-sc-transition: 0.25s ease;
    --mpr-sc-gap: 16px;
}

/* ============================================
   Theme Miniature Bridge
   Ensure native .product-miniature fills
   the widget grid/slider containers properly
   ============================================ */
.mpr-showcase-grid__item .product-miniature,
.mpr-showcase-slider__slide .product-miniature {
    height: 100%;
}

/* ============================================
   Grid Layout
   ============================================ */
.mpr-showcase-grid {
    display: grid;
    grid-template-columns: repeat(var(--mpr-sc-cols, 4), 1fr);
    gap: var(--mpr-sc-gap);
}

@media (max-width: 992px) {
    .mpr-showcase-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .mpr-showcase-grid {
        grid-template-columns: repeat(var(--mpr-sc-cols-mobile, 2), 1fr);
        gap: 10px;
    }
}

/* ============================================
   List Layout
   ============================================ */
.mpr-list-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.mpr-list-item:last-child {
    border-bottom: none;
}

.mpr-list-item__image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: var(--mpr-sc-radius);
    overflow: hidden;
}

.mpr-list-item__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mpr-list-item__info {
    flex: 1;
    min-width: 0;
}

.mpr-list-item__name {
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 4px;
}

.mpr-list-item__name a {
    color: #333;
    text-decoration: none;
}

.mpr-list-item__desc {
    font-size: 13px;
    color: #666;
    margin: 0;
}

.mpr-list-item__price-current {
    font-size: 16px;
    font-weight: 700;
    color: #222;
    white-space: nowrap;
}

/* ============================================
   Compact Layout (Sidebar)
   ============================================ */
.mpr-compact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: inherit;
    transition: background var(--mpr-sc-transition);
}

.mpr-compact-item:hover {
    background: #f8f9fa;
}

.mpr-compact-item__image {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 6px;
    overflow: hidden;
}

.mpr-compact-item__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mpr-compact-item__name {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #333;
}

.mpr-compact-item__price {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--mpr-sc-primary);
    margin-top: 2px;
}

/* ============================================
   Empty State
   ============================================ */
.mpr-showcase-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    grid-column: 1 / -1;
}

.mpr-showcase-empty .material-icons {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.mpr-showcase-empty p {
    font-size: 15px;
    margin: 0;
}

/* ============================================
   Product Card (theme-agnostic miniature)
   ============================================ */
.mpr-sc-card {
    height: 100%;
}

.mpr-sc-card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
    border: 1px solid #e5e5e5;
    border-radius: var(--mpr-sc-radius);
    overflow: hidden;
    transition: box-shadow var(--mpr-sc-transition), border-color var(--mpr-sc-transition);
}

.mpr-sc-card__link:hover {
    border-color: #ddd;
    box-shadow: var(--mpr-sc-shadow-hover);
}

.mpr-sc-card__img {
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mpr-sc-card__img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.mpr-sc-card__link:hover .mpr-sc-card__img img {
    transform: scale(1.05);
}

.mpr-sc-card__info {
    padding: 12px 14px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.mpr-sc-card__name {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    margin: 0;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mpr-sc-card__price {
    margin-top: auto;
    padding-top: 6px;
}

.mpr-sc-card__price--current {
    font-size: 16px;
    font-weight: 700;
    color: var(--mpr-sc-accent, #e8650a);
}

.mpr-sc-card__price--old {
    font-size: 13px;
    color: #999;
    text-decoration: line-through;
    margin-right: 6px;
}
