﻿/* Web-category tiles, the inline product-types panel, and the compact two-line strips
   (web.ws.ProductTypesNavigationMode == WebCategoriesThenProductTypes).

   NOT a Blazor .razor.css: this project sets <StaticWebAssetsEnabled>false</StaticWebAssetsEnabled>,
   so the ReBOOQ.Web.styles.css scoped bundle is never generated and every .razor.css here is dead.
   Served as a plain stylesheet instead, linked from __CarouselWebCategoriesThenTypes.razor —
   same approach as /css/isolated/BottomPanel.css. The wcm-* prefix keeps it out of the way of
   the site's global tile classes. */


/* ── LEVEL COLOUR RULE ───────────────────────────────────────────────────────────────────
   Nesting depth is expressed through the corporate palette rather than through size alone:

       level 1 — web categories .................. var(--corp-color-normal)
       level 2 — that category's product types ... var(--corp-color-dark)

   Everything below reads --wcm-level-color and never names a corporate colour directly, so
   a third level only needs one more declaration in this block. Both variables are emitted
   per site in App.razor from CorporateColorNormal / CorporateColorDark. */

.wcm-strip,
.wcm-strip-cats {
    --wcm-level-color: var(--corp-color-normal, #444);
}

/* Must stay AFTER the default above — .wcm-strip-types also carries .wcm-strip, and these
   have equal specificity, so source order is what makes the deeper level win. */
.wcm-strip-types,
.wcm-panel {
    --wcm-level-color: var(--corp-color-dark, #222);
}


/* ── Inline panel: expands in normal flow directly under the category strip ────────────── */

.wcm-panel {
    margin: 4px 0 10px 0;
    background: #fff;
    border: 1px solid #eaeaea;
    border-radius: 10px;
    box-shadow: 0 10px 30px -22px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

.wcm-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid #eee;
    background: #fbfbfb;
}

.wcm-head-icon {
    height: 32px;
    width: 32px;
    object-fit: contain;
    flex: 0 0 auto;
}

.wcm-head-title {
    font-size: 20px;
    font-weight: 600;
    color: #222;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wcm-close {
    border: 0;
    background: transparent;
    font-size: 30px;
    line-height: 1;
    color: #888;
    cursor: pointer;
    padding: 0 6px;
    flex: 0 0 auto;
}

    .wcm-close:hover {
        color: #222;
    }

.wcm-body {
    padding: 6px 18px 18px 18px;
    /* Tall categories stay usable without pushing the rest of the page down a screen. */
    max-height: 60vh;
    overflow-y: auto;
}

.wcm-group-title {
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--wcm-level-color);
    margin: 16px 0 8px 0;
}

.wcm-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 8px;
}

.wcm-tile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid #eee;
    border-radius: 8px;
    background: #fafafa;
    cursor: pointer;
    min-height: 48px;
}

    .wcm-tile:hover {
        background: #fff;
        border-color: var(--wcm-level-color);
    }

.wcm-tile-icon {
    height: 26px;
    width: 26px;
    object-fit: contain;
    flex: 0 0 auto;
}

.wcm-tile-text {
    flex: 1 1 auto;
    font-size: 14px;
    color: #222;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wcm-tile-badge {
    flex: 0 0 auto;
    font-size: 11px;
    color: #888;
    background: #fff;
    border-radius: 10rem;
    padding: 2px 8px;
}


/* ── Full-shape category tile ────────────────────────────────────────────────────────────
   Its own look, deliberately not built on .webProdTile (RebooqStyle): no icon, black title
   pinned top-left, and a large illustrative image bottom-right that is CROPPED by the tile's
   own bounds (overflow:hidden) rather than left free-floating. Selection is shown with a ring
   + small dot instead of RebooqStyle's invert-to-corp-colour treatment, so the illustration
   never has to survive being recoloured. */

.wcm-cat-tile {
    position: relative;
    height: 150px;
    min-width:160px;
    background: #fff;
    border-radius: var(--box-radius, 10px);
    overflow: hidden;
    padding: 12px 14px;
    box-sizing: border-box;
    transition: box-shadow .15s ease, transform .1s ease;
}

    .wcm-cat-tile:hover {
        box-shadow: 0 8px 20px -12px rgba(0, 0, 0, 0.35);
    }

.wcm-cat-title {
    position: relative;
    z-index: 2;
    font-size: 12px !important;
    font-weight: 600;
    line-height: 1.2em;
    color: #000 !important;
    text-align: left;
    text-transform: none;
    text-decoration: none !important;
    overflow: hidden;
    text-overflow: ellipsis;
    /*word-break: unset;*/
    /*overflow-wrap: break-word;*/
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}

.wcm-cat-image {
    position: absolute;
    right: -24px;
    bottom: -24px;
    height: 120px;
    width: 120px;
    object-fit: contain;
    object-position: bottom right;
    pointer-events: none;
    z-index: 1;
}

.wcm-cat-count {
    position: absolute;
    bottom: 6px;
    left: 6px;
    font-size: 11px !important;
    white-space: nowrap;
    z-index: 2;
}

/* Selection indicator: a ring around the tile + a small ellipse dot, no colour inversion. */
.wcm-cat-tile-active {
    box-shadow: inset 0 0 0 2px var(--corp-color-normal, #444);
}

.wcm-cat-active-dot {
    position: absolute;
    z-index: 3;
    top: 8px;
    left: 8px;
    height: 10px;
    width: 14px;
    border-radius: 50%;
    background: var(--corp-color-normal, #444);
}

@media (max-width: 576px) {
    .wcm-cat-tile {
        height: 120px;
        padding: 10px 12px;
    }

    .wcm-cat-title {
        font-size: 10.5px !important;
    }

    .wcm-cat-image {
        height: 68px;
        width: 68px;
        right: -6px;
        bottom: -6px;
    }
}


/* ── Compact shape: two scrollable lines above a product listing ───────────────────────────
   Native horizontal scroll rather than owl — line 2 is rebuilt whenever a category is picked,
   and owl's cloned/wrapped DOM does not survive Blazor re-rendering the children underneath it. */

.wcm-strip {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 3px 0;
    margin: 0 0 4px 0;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

    .wcm-strip::-webkit-scrollbar {
        height: 6px;
    }

    .wcm-strip::-webkit-scrollbar-thumb {
        background: #d8d8d8;
        border-radius: 10rem;
    }

    .wcm-strip::-webkit-scrollbar-track {
        background: transparent;
    }

.wcm-strip-item {
    flex: 0 0 auto;
    width: 190px;
    cursor: pointer;
    scroll-snap-align: start;
}

/* Line 1 — WEB CATEGORIES as small content-width pills. Intentionally a different, lighter
   object than the product-type tiles on line 2: same-looking rows at the same size would read
   as one flat list instead of "category → its types". */
.wcm-strip-cats {
    gap: 5px;
    margin-bottom: 8px;
}

.wcm-chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    max-width: 240px;
    padding: 0 12px;
    border: 1px solid #e4e4e4;
    border-radius: 10rem;
    background: #fff;
    color: #444;
    font-size: 13px;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    scroll-snap-align: start;
    transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}

    .wcm-chip:hover {
        border-color: var(--wcm-level-color);
        color: #111;
    }

    .wcm-chip:focus {
        outline: none;
        border-color: var(--wcm-level-color);
    }

.wcm-chip-icon {
    height: 18px;
    width: 18px;
    object-fit: contain;
    flex: 0 0 auto;
}

.wcm-chip-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

.wcm-chip-active {
    background: var(--wcm-level-color);
    border-color: var(--wcm-level-color);
    color: #fff;
    font-weight: 600;
}

    /* Category icons are dark-on-transparent PNGs — knock them to white on the filled pill,
       the same trick RebooqStyle uses for .webProdTile.active .webCategoryIcon. */
    .wcm-chip-active .wcm-chip-icon {
        filter: grayscale(1) brightness(0) invert(1);
    }

/* Line 2 reads as subordinate to the category line above it. */
.wcm-strip-types {
    padding-left: 14px;
    border-left: 3px solid var(--wcm-level-color);
}

    /* CategoryTile is a shared control whose active/hover state is painted with
       --corp-color-normal by RebooqStyle (.webProdTile:hover/.active, itself !important).
       Repaint it with the level colour HERE ONLY, so level 2 obeys the rule without touching
       the global stylesheet. Higher specificity + !important + later in document order. */
    .wcm-strip-types .webProdTile:hover,
    .wcm-strip-types .webProdTile.active {
        background-color: var(--wcm-level-color) !important;
    }

@media (max-width: 576px) {
    .wcm-tiles {
        grid-template-columns: 1fr;
    }

    .wcm-strip-item {
        width: 155px;
    }

    .wcm-chip {
        height: 29px;
        max-width: 190px;
        padding: 0 10px;
        font-size: 12px;
    }

    .wcm-chip-icon {
        height: 16px;
        width: 16px;
    }

    .wcm-body {
        padding: 6px 12px 14px 12px;
        max-height: 65vh;
    }

    .wcm-head {
        padding: 10px 12px;
    }

    .wcm-head-title {
        font-size: 17px;
    }
}
