/* ========================================
   CyberCash Public Online Store Page
   ======================================== */

/* ---- STORE HERO ---- */
.store-hero {
    background: linear-gradient(135deg, var(--topnav-primary) 0%, var(--topnav-primary-dark) 100%);
    color: #fff;
    text-align: center;
    padding: 3.5rem 1.5rem;
}

.store-hero-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    letter-spacing: -0.3px;
}

.store-hero-subtitle {
    font-size: 1rem;
    opacity: 0.85;
    margin: 0;
    font-weight: 400;
}

/* ---- STORE SECTION ---- */
.store-section {
    padding: 4rem 1.5rem;
}

/* ---- PLACEHOLDER (coming soon) ---- */
.store-placeholder {
    text-align: center;
    padding: 3rem 1.5rem;
    max-width: 500px;
    margin: 0 auto;
}

.store-placeholder-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.store-placeholder h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #323130;
    margin: 0 0 0.75rem;
}

.store-placeholder p {
    font-size: 1rem;
    color: #605e5c;
    line-height: 1.6;
    margin: 0;
}

/* ---- BREADCRUMB / BACK LINK ---- */
.store-back-link {
    display: inline-block;
    color: #fff;
    font-size: 0.85rem;
    opacity: 0.85;
    text-decoration: none;
    margin-bottom: 0.75rem;
}
.store-back-link:hover { opacity: 1; text-decoration: underline; }

/* ---- BRANCH STRIP (unified mode) / BRANCH PICKER ---- */
.store-branch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin: 0 0 2.5rem;
}
.store-branch-card {
    display: block;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 1.25rem;
    text-decoration: none;
    color: inherit;
    text-align: center;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.store-branch-card:hover {
    border-color: var(--topnav-primary, #0078d4);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.store-branch-card .store-branch-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    margin-bottom: 0.6rem;
}
.store-branch-card .store-branch-logo-placeholder { font-size: 2.25rem; margin-bottom: 0.4rem; }
.store-branch-card h3 { font-size: 1rem; font-weight: 600; color: #323130; margin: 0 0 0.25rem; }
.store-branch-card p { font-size: 0.8rem; color: #605e5c; margin: 0; }
.store-section-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #323130;
    margin: 0 0 1.25rem;
}

/* ---- CATEGORY NAVIGATION + SEARCH ---- */
.store-browser {
    display: grid;
    grid-template-columns: minmax(190px, 240px) minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
}
.store-category-panel {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 1rem;
}
.store-category-title {
    font-size: 1rem;
    font-weight: 700;
    color: #323130;
    margin: 0 0 0.75rem;
}
.store-category-branch {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #605e5c;
    margin: 1rem 0 0.35rem;
}
.store-category-branch:first-of-type { margin-top: 0; }
.store-category-all,
.store-category-link {
    display: block;
    border-radius: 4px;
    padding: 0.38rem 0.45rem;
    color: #605e5c;
    font-size: 0.85rem;
    line-height: 1.35;
    text-decoration: none;
}
.store-category-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.store-category-count {
    flex: 0 0 auto;
    min-width: 1.45rem;
    padding: 0.05rem 0.35rem;
    border-radius: 999px;
    background: #f3f2f1;
    color: #605e5c;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.35;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.store-category-link.active .store-category-count {
    background: #deecf9;
    color: #005a9e;
}
.store-category-link:hover .store-category-count {
    background: #e1dfdd;
}
.store-category-all { color: #323130; font-weight: 600; }
.store-category-all:hover,
.store-category-link:hover { background: #f3f2f1; color: #0078d4; }
.store-category-all.active,
.store-category-link.active { background: #eff6fc; color: #0078d4; font-weight: 600; }
.store-results { min-width: 0; }
.store-search-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.store-search-form input[type="search"] {
    flex: 1;
    min-width: 0;
    padding: 0.65rem 0.75rem;
    border: 1px solid #c8c6c4;
    border-radius: 4px;
    font: inherit;
    color: #323130;
    background: #fff;
}
.store-search-form input[type="search"]:focus {
    outline: 2px solid var(--topnav-primary, #0078d4);
    outline-offset: 1px;
}
.store-search-form button {
    border: 0;
    border-radius: 4px;
    padding: 0.65rem 1rem;
    background: var(--topnav-primary, #0078d4);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.store-search-form button:hover { filter: brightness(0.93); }
.store-filterbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.9rem;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    color: #605e5c;
}
.store-filter-label strong { color: #323130; }
.store-filter-branch {
    margin-left: 0.35rem;
    color: #0078d4;
}
.store-filterbar a { color: #0078d4; }
.store-filter-all { margin-left: auto; }
.store-result-count {
    margin-left: 0.5rem;
    font-size: 0.8rem;
    font-weight: 400;
    color: #605e5c;
}
.store-no-results { padding-top: 1rem; }
.store-no-results a { color: #0078d4; }

/* ---- PRODUCT GRID ---- */
.store-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}
.store-product-card {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
/* A FIXED tile: legacy product images were stored at the source's own pixel size, and a
   grid tile must never be sized by the file. Show the WHOLE product image, as the Product
   Catalogue Report does, rather than cropping a portrait pack into a wide tile. */
.store-product-img {
    width: 100%;
    height: 200px;
    max-height: 200px;
    object-fit: contain;
    object-position: center;
    background: #f3f2f1;
    padding: 10px;
    box-sizing: border-box;
    display: block;
}
.store-product-img-placeholder {
    height: 200px;
    background: #f3f2f1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}
.store-product-body { padding: 0.9rem 1rem 1rem; display: flex; flex-direction: column; flex: 1; }
.store-product-body h3 { font-size: 0.95rem; font-weight: 600; color: #323130; margin: 0 0 0.35rem; }
.store-product-body p { font-size: 0.8rem; color: #605e5c; line-height: 1.45; margin: 0 0 0.75rem; flex: 1; }
.store-product-body .store-product-category {
    flex: 0 0 auto;
    margin: 0 0 0.3rem;
    color: #605e5c;
    font-size: 0.7rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.store-product-price { font-size: 1rem; font-weight: 700; color: #323130; }
.store-product-price .store-product-taxnote { font-size: 0.7rem; font-weight: 400; color: #605e5c; margin-left: 0.35rem; }
.store-product-branch {
    display: inline-block;
    font-size: 0.7rem;
    color: #0078d4;
    background: #eff6fc;
    border-radius: 3px;
    padding: 0.1rem 0.45rem;
    margin-bottom: 0.5rem;
    width: fit-content;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .store-hero {
        padding: 2.5rem 1rem;
    }
    .store-hero-title {
        font-size: 1.5rem;
    }
    .store-placeholder {
        padding: 2rem 1rem;
    }
    .store-browser {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    .store-category-panel {
        padding: 0.85rem;
    }
    .store-search-form {
        flex-direction: column;
    }
    .store-filter-all {
        margin-left: 0;
    }
}

@media (max-width: 520px) {
    .store-product-body .store-product-category { display: none; }
}

/* ========================================
   Marketplace shell, themed by Homepage Customisations
   ======================================== */
.store-body {
    margin: 0;
    background: #f3f4f6;
    color: #1b1b1b;
    font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
}
.store-body.store-large { font-size: 18px; }
.store-body.store-rm *, .store-body.store-rm *::before, .store-body.store-rm *::after {
    transition: none !important;
    animation: none !important;
}

.store-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--store-nav-bg, #fff);
    color: var(--store-nav-text, #323130);
    border-bottom: 1px solid rgba(0,0,0,.12);
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.store-header-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: .55rem 1.1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.store-brand {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    font-size: calc(var(--store-nav-size, 15px) + 3px);
    font-weight: 700;
    color: var(--store-nav-text, #323130);
    text-decoration: none;
}
.store-brand-logo { display: block; height: 36px; width: auto; max-width: 190px; object-fit: contain; }
.topnav-logo-img { display: block; height: 32px; width: auto; max-width: 180px; object-fit: contain; }
.store-brand-mark {
    width: 34px; height: 34px; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 700;
    background: var(--store-nav-text, #323130);
    color: var(--store-nav-bg, #fff);
}
.store-nav { display: flex; align-items: center; gap: .25rem; flex: 1 1 auto; flex-wrap: wrap; }
.store-nav a {
    font-family: var(--store-nav-font, "Segoe UI", sans-serif);
    font-size: var(--store-nav-size, 15px);
    color: var(--store-nav-text, #323130);
    text-decoration: none;
    padding: .4rem .7rem;
    border-radius: 6px;
    white-space: nowrap;
}
.store-nav a:hover { background: rgba(0,0,0,.07); }
.store-nav a.active { font-weight: 700; background: rgba(0,0,0,.09); }
.store-backoffice {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 6px;
    color: var(--store-nav-text, #323130); border: 1px solid currentColor;
    text-decoration: none; margin-left: auto; flex: 0 0 auto;
}
.store-backoffice:hover { background: var(--store-nav-text, #323130); color: var(--store-nav-bg, #fff); }

.store-hero {
    position: relative;
    text-align: left;
    padding: 3.2rem 1.5rem 3rem;
    color: #fff;
    background-size: cover;
    background-position: center;
    overflow: hidden;
}
.store-hero-overlay { position: absolute; inset: 0; background: #000; opacity: var(--store-overlay, .45); }
.store-hero-inner { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; }
.store-hero-title { font-size: clamp(1.8rem, 4vw, 2.7rem); margin: 0 0 .45rem; }
.store-hero-subtitle { margin: 0; font-size: 1rem; opacity: .9; }
.store-back-link { color: #fff; opacity: .9; }

.store-main { padding: 2rem 1.5rem 4rem; }
.store-container { max-width: 1180px; margin: 0 auto; }

/* Sample Site Warning: the same red notice and SAMPLE ONLY band used by the Customisable
   Homepage, carried onto the full store so a demonstration catalogue cannot be mistaken
   for live stock. The band never takes a click. */
.store-sample-warning {
    background: #b3131b; color: #fff; text-align: center;
    padding: 0.7rem 1.1rem; font-size: 0.92rem; line-height: 1.5;
    border-bottom: 2px solid #7d0d13;
}
.store-sample-warning strong { font-weight: 700; }
.store-marketplace.store-sample-flag { position: relative; }
.store-sample-flag::after {
    content: 'SAMPLE ONLY';
    position: absolute; left: 0; right: 0; top: 50%; z-index: 3;
    transform: translateY(-50%) rotate(-4deg);
    padding: 0.4rem 0; text-align: center; pointer-events: none;
    font-weight: 800; letter-spacing: 0.28em; font-size: clamp(0.95rem, 2.6vw, 1.5rem);
    color: #8e0f16; background: rgba(196, 18, 26, 0.14);
    border-top: 2px solid rgba(196, 18, 26, 0.4);
    border-bottom: 2px solid rgba(196, 18, 26, 0.4);
}
.store-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.store-text-link, .store-back-link-dark { color: var(--store-nav-text, #0b3d5c); font-size: .84rem; }
.store-branch-picker { margin: 0 0 2rem; }
.store-marketplace { display: grid; grid-template-columns: minmax(190px, 235px) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.store-category-panel { position: sticky; top: 86px; background: #fff; border: 1px solid #e1e1e1; border-radius: 10px; padding: 1rem; }
.store-category-all.active, .store-category-link.active { background: #eff6fc; color: var(--store-nav-text, #0078d4); }
.store-search-row { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.store-search-row .store-search-form { flex: 1 1 360px; margin: 0; }
.store-listing-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin: 1rem 0; }
.store-listing-summary { display: flex; align-items: baseline; gap: .55rem; flex-wrap: wrap; font-size: .9rem; }
.store-listing-summary strong { font-size: 1.2rem; }
.store-active-filter { background: #fff; border: 1px solid #e1e1e1; border-radius: 999px; padding: .18rem .55rem; font-size: .78rem; color: #605e5c; }
.store-active-filter a { color: #a4262c; margin-left: .25rem; }
.store-sort-form { display: flex; align-items: center; gap: .45rem; font-size: .84rem; color: #605e5c; }
.store-sort-form select { padding: .42rem .55rem; border: 1px solid #c8c6c4; border-radius: 5px; background: #fff; font: inherit; }
.store-filter-panel { background: #fff; border: 1px solid #e1e1e1; border-radius: 8px; padding: .65rem .85rem; margin-bottom: 1.1rem; }
.store-filter-panel summary { cursor: pointer; font-size: .86rem; font-weight: 600; }
.store-filter-form { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem; padding-top: .75rem; font-size: .82rem; color: #605e5c; }
.store-filter-form label { display: flex; flex-direction: column; gap: .25rem; }
.store-filter-form input[type="number"] { width: 120px; padding: .4rem .5rem; border: 1px solid #c8c6c4; border-radius: 4px; font: inherit; }
.store-filter-form .store-check { flex-direction: row; align-items: center; gap: .3rem; }
.store-filter-apply { border: 0; background: var(--store-nav-text, #0078d4); color: var(--store-nav-bg, #fff); border-radius: 5px; padding: .48rem .8rem; font: inherit; font-weight: 600; cursor: pointer; }
.store-filter-form a { color: #605e5c; }

.store-products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 1rem; }
.store-product-card { color: inherit; text-decoration: none; background: #fff; border: 1px solid #e1e1e1; border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; transition: transform .12s ease, box-shadow .12s ease; }
.store-product-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.1); }
.store-product-media { position: relative; background: #f6f8fa; }
.store-product-img { width: 100%; height: 220px; object-fit: contain; padding: 12px; box-sizing: border-box; display: block; }
.store-product-img-placeholder { height: 220px; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; background: #f6f8fa; }
.store-stock-badge { position: absolute; left: .6rem; top: .6rem; background: #dff6dd; color: #107c10; border-radius: 999px; padding: .16rem .5rem; font-size: .68rem; font-weight: 700; }
.store-stock-badge.out { background: #fde7e9; color: #a4262c; }
.store-product-body { padding: .85rem .9rem 1rem; display: flex; flex-direction: column; flex: 1; }
.store-product-body h3 { font-size: .98rem; margin: 0 0 .35rem; line-height: 1.3; }
.store-product-body p { font-size: .8rem; color: #605e5c; line-height: 1.45; margin: 0 0 .75rem; flex: 1; }
.store-product-footer { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: auto; }
.store-product-price { font-weight: 700; }
.store-view-product { color: var(--store-nav-text, #0078d4); font-size: .78rem; font-weight: 600; }
.store-pagination { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin-top: 1.6rem; font-size: .84rem; }
.store-pagination a, .store-page-gap { min-width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; padding: 0 .45rem; border: 1px solid #d0d0d0; border-radius: 5px; text-decoration: none; color: #323130; background: #fff; }
.store-pagination a.active { background: var(--store-nav-text, #0b3d5c); border-color: var(--store-nav-text, #0b3d5c); color: var(--store-nav-bg, #fff); font-weight: 700; }
.store-page-gap { border: 0; background: transparent; }

/* Product detail page */
.store-pdp-main { padding-top: 1.5rem; }
.store-breadcrumb { display: flex; gap: .4rem; font-size: .8rem; color: #605e5c; margin-bottom: 1rem; }
.store-breadcrumb a { color: var(--store-nav-text, #0b3d5c); }
.store-pdp { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr); gap: 2rem; align-items: start; }
.store-pdp-gallery, .store-pdp-info { background: #fff; border: 1px solid #e1e1e1; border-radius: 12px; padding: 1rem; }
.store-pdp-mainimage { height: min(520px, 58vw); display: flex; align-items: center; justify-content: center; background: #f6f8fa; border-radius: 8px; overflow: hidden; }
.store-pdp-mainimage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.store-pdp-thumbs { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .75rem; }
.store-pdp-thumb { width: 66px; height: 66px; border: 2px solid transparent; border-radius: 6px; background: #f6f8fa; padding: 3px; cursor: pointer; }
.store-pdp-thumb.active { border-color: var(--store-nav-text, #0b3d5c); }
.store-pdp-thumb img { width: 100%; height: 100%; object-fit: contain; }
.store-pdp-info h1 { font-size: clamp(1.5rem, 3vw, 2.2rem); margin: .35rem 0 .7rem; line-height: 1.2; }
.store-pdp-branch { margin: 0; font-size: .8rem; color: #605e5c; }
.store-pdp-branch a { color: var(--store-nav-text, #0b3d5c); }
.store-pdp-price { font-size: 1.5rem; font-weight: 700; margin-bottom: .5rem; }
.store-pdp-price span { font-size: .74rem; font-weight: 400; color: #605e5c; }
.store-pdp-stock { margin-bottom: 1rem; }
.store-pdp-stock .store-stock-badge { position: static; display: inline-block; }
.store-pdp-summary { font-size: 1rem; line-height: 1.6; color: #444; }
.store-pdp-long { font-size: .92rem; line-height: 1.75; color: #323130; white-space: pre-line; border-top: 1px solid #edebe9; padding-top: 1rem; }
.store-pdp-purchase { margin-top: 1.4rem; border-top: 1px solid #edebe9; padding-top: 1rem; }
.store-pdp-purchase h2 { font-size: 1.05rem; margin: 0 0 .55rem; }
.store-pdp-purchase h3 { font-size: .92rem; margin: 1rem 0 .5rem; }
.store-pdp-warning { background: #fff4ce; border-left: 4px solid #f2c811; padding: .65rem .8rem; font-size: .84rem; line-height: 1.5; }
.store-pdp-instructions { font-size: .85rem; line-height: 1.6; color: #444; white-space: pre-line; }
.store-pdp-small { font-size: .75rem; color: #605e5c; }
.store-bank-list { display: grid; gap: .65rem; }
.store-bank-card { border: 1px solid #e1e1e1; border-radius: 8px; padding: .7rem .8rem; background: #fafafa; }
.store-bank-card strong { font-size: .85rem; }
.store-bank-card dl { display: grid; grid-template-columns: minmax(100px, auto) 1fr; gap: .2rem .7rem; margin: .45rem 0 0; font-size: .8rem; }
.store-bank-card dt { color: #605e5c; }
.store-bank-card dd { margin: 0; font-weight: 600; word-break: break-word; }

/* High contrast follows the homepage's accessibility setting. */
.store-body.store-hc { background: #000; color: #fff; }
.store-body.store-hc .store-header { background: #000; color: #fff; border-bottom: 2px solid #fff; }
.store-body.store-hc .store-brand, .store-body.store-hc .store-nav a, .store-body.store-hc .store-backoffice { color: #fff; }
.store-body.store-hc .store-category-panel, .store-body.store-hc .store-product-card,
.store-body.store-hc .store-filter-panel, .store-body.store-hc .store-pdp-gallery,
.store-body.store-hc .store-pdp-info, .store-body.store-hc .store-bank-card,
.store-body.store-hc .store-branch-card { background: #111; color: #fff; border: 2px solid #fff; }
.store-body.store-hc .store-product-body p, .store-body.store-hc .store-result-count,
.store-body.store-hc .store-pdp-branch, .store-body.store-hc .store-pdp-warning { color: #e6e6e6; }
.store-body.store-hc .store-pdp-warning { background: #333; border-color: #ffe680; }
.store-body.store-hc .store-text-link, .store-body.store-hc .store-view-product { color: #ffe680; }
.store-body.store-hc .store-filter-apply, .store-body.store-hc .store-pagination a.active { background: #fff; color: #000; }
.store-body.store-hc .store-sample-flag::after { color: #fff; background: rgba(255,255,255,0.22); border-color: #fff; }

@media (max-width: 900px) {
    .store-marketplace { grid-template-columns: 1fr; }
    .store-category-panel { position: static; }
    .store-pdp { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .store-header-inner { padding: .5rem .8rem; }
    .store-nav { order: 3; width: 100%; }
    .store-hero { padding: 2.2rem 1rem; }
    .store-main { padding: 1.3rem .8rem 3rem; }
    .store-products-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .store-product-img, .store-product-img-placeholder { height: 170px; }
    .store-search-row { align-items: stretch; }
}
