﻿/*
 MyOnke Compact Marketplace Shopping Layout V1
 ------------------------------------------------------------
 Principles:
 1. Products should appear quickly without a large wall of controls.
 2. Product names use normal reading weight.
 3. Price is the strongest text on the product card.
 4. Page-level search/filter controls live in a compact left rail on desktop.
 5. Existing mobile behaviour remains stacked and touch friendly.
*/

/* ==========================================================
   SHARED CUSTOMER MARKETPLACE TYPOGRAPHY
   ========================================================== */

/* Product names: readable, not headline-sized and not heavy bold. */
.ac-card-name,
.mb-card-name,
.mu-product-name,
.mx-title,
.rc-product-name,
.myo-category-product-title {
    font-size: 14px !important;
    line-height: 1.38 !important;
    font-weight: 400 !important;
    letter-spacing: 0 !important;
    color: #10284c !important;
}

/* Keep long product names controlled rather than growing the card. */
.ac-card-name,
.mb-card-name,
.mu-product-name,
.mx-title,
.rc-product-name,
.myo-category-product-title {
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 3 !important;
    overflow: hidden !important;
}

/* Supporting words should remain visually secondary. */
.ac-card-category,
.ac-stock,
.mb-card-store,
.mb-card-meta,
.mu-seller,
.mu-stock,
.mx-stock,
.myo-category-product-meta,
.myo-category-product-store {
    font-size: 12px !important;
    font-weight: 400 !important;
    line-height: 1.35 !important;
}

/* Price is the only strong card text. */
.ac-card-price strong,
.mb-card-price strong,
.mu-price,
.mx-products article strong,
.rc-product-grid article > strong,
.myo-category-product-price {
    font-size: 18px !important;
    line-height: 1.15 !important;
    font-weight: 800 !important;
    letter-spacing: 0 !important;
    color: #10284c !important;
}

.ac-card-price del,
.mb-card-price del,
.mu-compare,
.mx-old {
    font-size: 12px !important;
    font-weight: 400 !important;
    color: #8a97aa !important;
}

/* Tighter card copy means more product is visible above the fold. */
.ac-card-body,
.mb-card-body,
.mu-product-body {
    padding: 12px 14px 14px !important;
    gap: 6px !important;
}

.myo-category-product-body {
    padding: 11px 12px 13px !important;
}

/* ==========================================================
   GENERAL MARKETPLACE PAGE COMPACTION
   ========================================================== */

.mu-page,
.mu-section {
    padding-top: 28px !important;
    padding-bottom: 44px !important;
}

.mu-page h1,
.mu-section h1 {
    font-size: 32px !important;
    line-height: 1.08 !important;
    margin: 6px 0 14px !important;
    letter-spacing: -.02em !important;
}

.mu-page h2,
.mu-section h2 {
    font-size: 22px !important;
}

.mu-page > p,
.mu-section > p {
    margin-top: 0 !important;
    margin-bottom: 18px !important;
    font-size: 14px !important;
}

/* Store pages should not make shoppers scroll through a huge store header. */
.mu-store-head,
.rc-supplier-page-head {
    margin-bottom: 18px !important;
    gap: 14px !important;
}

.mu-store-head h1,
.rc-supplier-page-head h1 {
    font-size: 30px !important;
    margin: 4px 0 6px !important;
}

/* ==========================================================
   ALL PRODUCTS: SEARCH + SORT MOVED INTO LEFT RAIL
   ========================================================== */

@media (min-width: 701px) {
    .ac-page {
        max-width: 1440px !important;
        display: grid !important;
        grid-template-columns: 245px minmax(0,1fr) !important;
        gap: 18px 22px !important;
        align-items: start !important;
        padding-top: 28px !important;
    }

    .ac-heading {
        grid-column: 1 / -1 !important;
        margin: 0 0 2px !important;
        align-items: end !important;
    }

    .ac-heading h1 {
        font-size: 34px !important;
        margin: 5px 0 5px !important;
    }

    .ac-heading p {
        font-size: 13px !important;
        line-height: 1.45 !important;
    }

    .ac-count strong {
        font-size: 23px !important;
    }

    /* Search and sort now behave as the first part of the left rail. */
    .ac-toolbar {
        grid-column: 1 !important;
        grid-row: 2 !important;
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 9px !important;
        margin: 0 !important;
        padding: 12px !important;
        border-radius: 14px !important;
        align-items: stretch !important;
    }

    .ac-search {
        min-width: 0 !important;
        border-radius: 10px !important;
    }

    .ac-search input {
        min-width: 0 !important;
        padding: 10px 9px !important;
        font-size: 13px !important;
    }

    .ac-search > span {
        padding-left: 9px !important;
        font-size: 16px !important;
    }

    .ac-sort > span {
        font-size: 10px !important;
    }

    .ac-sort select,
    .ac-search-button {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 38px !important;
        height: 38px !important;
        border-radius: 9px !important;
        font-size: 12px !important;
    }

    .ac-search-button {
        padding: 0 12px !important;
    }

    /*
       The existing ac-layout wrapper becomes transparent to the grid.
       Filters stay in the left column while products begin at the top-right.
    */
    .ac-layout {
        display: contents !important;
    }

    .ac-filters {
        grid-column: 1 !important;
        grid-row: 3 !important;
        position: static !important;
        top: auto !important;
        border-radius: 14px !important;
    }

    .ac-filter-heading {
        padding: 12px 14px !important;
    }

    .ac-filter-form fieldset {
        padding: 12px 14px !important;
    }

    .ac-filter-form legend {
        font-size: 12px !important;
        margin-bottom: 7px !important;
    }

    .ac-radio,
    .ac-check {
        margin: 6px 0 !important;
        font-size: 12px !important;
    }

    .ac-filter-button {
        width: calc(100% - 28px) !important;
        margin: 12px 14px !important;
        padding: 10px !important;
        font-size: 12px !important;
    }

    .ac-results {
        grid-column: 2 !important;
        grid-row: 2 / span 2 !important;
        min-width: 0 !important;
    }

    .ac-product-grid {
        gap: 14px !important;
    }
}

/* ==========================================================
   BRANDS: LEFT-SIDE SEARCH / BRAND CHOICE + PRODUCTS AT TOP
   ========================================================== */

@media (min-width: 701px) {
    .mb-page {
        max-width: 1440px !important;
        display: grid !important;
        grid-template-columns: 245px minmax(0,1fr) !important;
        gap: 18px 22px !important;
        align-items: start !important;
        padding-top: 28px !important;
    }

    /*
       The original Brands hero becomes a compact marketplace rail.
       This makes the brand/product content visible immediately beside it.
    */
    .mb-hero {
        grid-column: 1 !important;
        grid-row: 1 / span 100 !important;
        align-self: start !important;
        position: sticky !important;
        top: 104px !important;
        padding: 16px !important;
        border: 1px solid #d7e0ef !important;
        border-radius: 16px !important;
        background: #fff !important;
    }

    .mb-eyebrow {
        font-size: 10px !important;
        margin-bottom: 6px !important;
    }

    .mb-hero h1 {
        font-size: 27px !important;
        line-height: 1.05 !important;
        margin: 0 0 7px !important;
    }

    .mb-hero p {
        font-size: 12px !important;
        line-height: 1.45 !important;
        margin: 0 !important;
    }

    .mb-filter-bar {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        margin: 14px 0 0 !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
    }

    .mb-filter-search input,
    .mb-filter-select-wrap select {
        height: 39px !important;
        border-radius: 9px !important;
        padding: 0 10px !important;
        font-size: 12px !important;
    }

    .mb-apply,
    .mb-clear {
        width: 100% !important;
        height: 39px !important;
        border-radius: 9px !important;
        padding: 0 11px !important;
        font-size: 12px !important;
        box-sizing: border-box !important;
    }

    .mb-summary {
        margin-top: 10px !important;
        font-size: 11px !important;
        line-height: 1.4 !important;
    }

    .mb-brand-strip-shell,
    .mb-brand-section,
    .mb-empty {
        grid-column: 2 !important;
        margin: 0 0 18px !important;
        padding: 18px !important;
        border-radius: 20px !important;
        min-width: 0 !important;
    }

    .mb-section-topline,
    .mb-brand-section-head {
        margin-bottom: 13px !important;
    }

    .mb-section-topline h2,
    .mb-brand-section-head h2 {
        font-size: 21px !important;
    }

    .mb-section-topline p,
    .mb-brand-section-head p {
        margin-top: 3px !important;
        font-size: 12px !important;
    }

    .mb-brand-strip,
    .mb-product-rail {
        gap: 12px !important;
    }

    .mb-brand-tile {
        min-width: 170px !important;
        max-width: 170px !important;
        padding: 12px !important;
        gap: 7px !important;
        border-radius: 16px !important;
    }

    .mb-brand-avatar {
        width: 66px !important;
        height: 66px !important;
        border-radius: 15px !important;
    }

    .mb-brand-avatar-large {
        width: 58px !important;
        height: 58px !important;
    }

    .mb-brand-tile strong {
        font-size: 13px !important;
        font-weight: 500 !important;
    }

    .mb-brand-tile span {
        font-size: 11px !important;
    }

    .mb-card {
        min-width: 230px !important;
        max-width: 230px !important;
        border-radius: 17px !important;
    }

    .mb-card-image-wrap {
        padding: 10px 10px 0 !important;
    }

    .mb-card-image {
        height: 205px !important;
        border-radius: 13px !important;
    }

    .mb-card-name {
        min-height: 58px !important;
        margin-bottom: 9px !important;
    }

    .mb-card-price {
        margin-bottom: 8px !important;
    }

    .mb-card-meta {
        font-size: 11px !important;
    }

    .mb-scroll-btn {
        width: 36px !important;
        height: 36px !important;
        font-size: 18px !important;
    }

    .mb-brand-actions a {
        height: 36px !important;
        padding: 0 12px !important;
        font-size: 11px !important;
        border-radius: 9px !important;
    }
}

/* ==========================================================
   HOME / SEARCH / DEALS / NEW / STORE: PRODUCT-FIRST DENSITY
   ========================================================== */

.mu-product-grid {
    gap: 14px !important;
}

.mu-product-card {
    border-radius: 15px !important;
}

.mu-image {
    height: 215px !important;
    min-height: 215px !important;
}

.mx-products {
    gap: 13px !important;
}

/* Homepage product cards: normal product name, strong price only. */
.mx-products article > div {
    gap: 5px !important;
}

.myo-category-product-title {
    min-height: 0 !important;
}

/* Keep customer-page controls compact wherever these common controls appear. */
.mu-page select,
.mu-page input[type="search"],
.mu-page input[type="text"] {
    font-size: 13px;
}

/* ==========================================================
   MOBILE: retain natural stacked flow
   ========================================================== */

@media (max-width: 700px) {
    .ac-page,
    .mb-page {
        display: block !important;
    }

    .mb-hero {
        position: static !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
    }

    .mb-filter-bar {
        margin-top: 14px !important;
    }

    .mb-brand-strip-shell,
    .mb-brand-section,
    .mb-empty {
        margin-top: 16px !important;
    }

    .ac-heading h1,
    .mb-hero h1,
    .mu-page h1 {
        font-size: 30px !important;
    }

    .ac-card-name,
    .mb-card-name,
    .mu-product-name,
    .mx-title,
    .rc-product-name,
    .myo-category-product-title {
        font-size: 13px !important;
        -webkit-line-clamp: 2 !important;
    }

    .ac-card-price strong,
    .mb-card-price strong,
    .mu-price,
    .mx-products article strong,
    .myo-category-product-price {
        font-size: 16px !important;
    }
}
