/* mv-rec.css
 *
 * Minimal stylesheet — only skeleton loader + section heading.
 * ALL product card styling comes from the theme (WooCommerce loop templates).
 * This means mobile responsiveness, hover states, sale badges etc.
 * are automatically inherited and never need updating here.
 */

/* ── Section wrapper ── */
.mv-rec-section {
    margin: 40px 0;
}
.mv-rec-heading {
    font-size: 1.4em;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: -.02em;
}

/* ── Skeleton loader
 * Sized to match heim theme's product card proportions.
 * Disappears the moment real cards are injected.
 * ── */
.mv-rec-skeleton {
    pointer-events: none;
}
.mv-rec-skeleton .mv-skeleton-img {
    aspect-ratio: 1 / 1;
    border-radius: 4px;
    margin-bottom: 12px;
}
.mv-rec-skeleton .mv-skeleton-text {
    height: 16px;
    border-radius: 4px;
    width: 85%;
    margin-bottom: 8px;
}
.mv-rec-skeleton .mv-skeleton-price {
    height: 16px;
    border-radius: 4px;
    width: 45%;
}

/* Shimmer animation — applied only while loading */
.mv-rec-loading .mv-rec-skeleton .mv-skeleton-img,
.mv-rec-loading .mv-rec-skeleton .mv-skeleton-text,
.mv-rec-loading .mv-rec-skeleton .mv-skeleton-price {
    background: linear-gradient(
        90deg,
        #e8e7e4 25%,
        #f2f1ee 50%,
        #e8e7e4 75%
    );
    background-size: 200% 100%;
    animation: mv-shimmer 1.4s ease-in-out infinite;
}
@keyframes mv-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
/* Remove shimmer from skeleton headings/price wrappers that WC reuses */
.mv-rec-loading .mv-rec-skeleton .woocommerce-loop-product__title,
.mv-rec-loading .mv-rec-skeleton .price {
    color: transparent;
}

/* ── Live søkeresultater (inne i temaets .site-search-suggestions) ──
 * Bruker temaets CSS-variabler for automatisk lys/mørk-modus.
 */

/* ── Mobile override — temaet skjuler .site-search-suggestions på <640px
 *    Vi overstyrer dette når live-resultater er aktive, uansett skjermstørrelse.
 *    Høy spesifisitet slår temaets media query.
 * ── */
@media (max-width: 1025px) {
    .site-search-suggestions.mv-suggestions-active strong {
        display: none !important; /* tema viser "Prøv:"-label — skjul under live-søk */
    }
}
@media (max-width: 640px) {
    /* Temaet setter display:none her — vi overstyrer med !important når resultater vises */
    .site-search-suggestions.mv-suggestions-active {
        display: block !important;
    }
    /* Litt ekstra padding på mobil for touch-vennlig tap-area */
    .mv-result-item a {
        padding: 12px 8px;
    }
    .mv-res-img {
        width: 48px;
        height: 48px;
    }
    .mv-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
        scrollbar-width: none;
    }
    .mv-filters::-webkit-scrollbar { display: none; }
}

/* Loading state */
.mv-loading {
    font-size: var(--global--font-size-body-sm, 14px);
    color: var(--global--color-foreground-low-contrast, #5F7281);
    text-align: left;
    padding: 8px 12px;
    max-width: 680px;
    margin: 0 auto;
}

/* ── Filter chips ── */
.mv-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    max-width: 680px;
    margin: 0 auto 14px;
    padding: 0 4px;
}

.mv-filter-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--global--color-foreground-low-contrast, #5F7281);
    margin-right: 2px;
}

.mv-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 30px;
    padding: 0 12px;
    border-radius: 100px;
    border: 1.5px solid rgba(0,0,0,0.15);
    background: transparent;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    color: var(--global--color-foreground, #22272D);
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
    white-space: nowrap;
}
.mv-chip:hover  { background: rgba(0,0,0,0.05); border-color: rgba(0,0,0,0.25); }
.mv-chip-active { background: var(--global--color-foreground, #22272D) !important; color: var(--global--color-body, #fff) !important; border-color: transparent !important; }
.mv-chip-active .mv-chip-count { opacity: 0.6; }

.mv-chip-model { border-color: rgba(87,159,215,0.4); color: #3a7ab3; }
.mv-chip-model:hover { background: rgba(87,159,215,0.08); }
.mv-chip-model.mv-chip-active { background: #579FD7 !important; color: #fff !important; }

.mv-chip-count {
    font-size: 10px;
    opacity: 0.5;
    font-weight: 700;
}

/* ── Result list ── */
.mv-results-list {
    list-style: none;
    margin: 0 auto;
    padding: 0;
    max-width: 680px;
    text-align: left;
}

.mv-result-item a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 8px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--global--color-foreground, #22272D);
    transition: background 0.12s;
}
.mv-result-item a:hover,
.mv-result-active a { background: rgba(0,0,0,0.05); }

/* Product image */
.mv-res-img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--global--color-background-secondary, #f2f1ee);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mv-res-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}
.mv-res-img-placeholder {
    width: 100%;
    height: 100%;
    background: var(--global--color-background-secondary, #e8e7e4);
}

/* Text body */
.mv-res-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mv-res-title {
    font-size: var(--global--font-size-body-sm, 14px);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--global--color-foreground, #22272D);
    line-height: 1.3;
}
.mv-res-title mark {
    background: transparent;
    color: inherit;
    font-weight: 800;
    border-bottom: 2px solid var(--global--color-primary, #579FD7);
}

/* Price row */
.mv-res-price {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.mv-price-current {
    font-size: 15px;
    font-weight: 700;
    color: var(--global--color-foreground, #22272D);
}

.mv-res-price-sale .mv-price-current {
    color: #D65956;
}

.mv-price-was {
    font-size: 12px;
    color: var(--global--color-foreground-low-contrast, #5F7281);
    text-decoration: line-through;
}

.mv-res-sale {
    font-size: 11px;
    font-weight: 700;
    background: #D65956;
    color: #fff;
    padding: 1px 6px;
    border-radius: 100px;
    letter-spacing: 0.3px;
}

/* "Se alle"-footer */
.mv-results-all {
    display: block;
    max-width: 680px;
    margin: 10px auto 0;
    padding: 11px 8px;
    font-size: var(--global--font-size-body-sm, 13px);
    font-weight: 600;
    color: var(--global--color-primary, #579FD7);
    text-decoration: none;
    border-top: 1px solid rgba(0,0,0,0.07);
    text-align: left;
}
.mv-results-all:hover { text-decoration: underline; }

.mv-no-results {
    max-width: 680px;
    margin: 0 auto 8px;
    font-size: var(--global--font-size-body-sm, 14px);
    color: var(--global--color-foreground-low-contrast, #5F7281);
    text-align: left;
    padding: 8px 8px 0;
}
