/* Storefront overrides layered on app.css (external stylesheet — no inline styles). */

/* Footer social icons — suited to the dark footer background. */
.vh-foot-social { display: flex; gap: 10px; margin-top: 14px; }
.vh-foot-social a { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .09); color: #fff; transition: background .15s ease; }
.vh-foot-social a:hover { background: var(--vh-primary); color: #fff; }

/* Footer payment badges */
.vh-footer .vh-foot-pay { display: flex; grid-template-columns: none; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .08); margin-top: 20px; }
.vh-foot-pay-label { font-size: 12px; color: rgba(255, 255, 255, .55); margin-right: 4px; }
.vh-pay-badge { font-size: 11px; font-weight: 700; letter-spacing: .3px; color: rgba(255, 255, 255, .85); background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); border-radius: 6px; padding: 4px 8px; }

/* Back-to-top button */
.vh-backtop { position: fixed; right: 22px; bottom: 22px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--vh-primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 8px 22px rgba(15, 23, 42, .25); opacity: 0; transform: translateY(8px); transition: opacity .18s ease, transform .18s ease; z-index: 60; }
.vh-backtop.is-visible { opacity: 1; transform: translateY(0); }
.vh-backtop:hover { filter: brightness(1.06); }

/* Top-bar phone link */
.vh-topbar-left a svg { vertical-align: -2px; margin-right: 4px; }

/* Footer brand: keep logo mark + name side by side. */
.vh-footer .vh-logo-light { display: inline-flex; align-items: center; gap: 10px; padding: 0; }

/* Textareas: resize vertically only, never wider than their card/container. */
textarea { resize: vertical; max-width: 100%; box-sizing: border-box; }

/* Account icon shown only in the trimmed mobile top bar (hidden on desktop). */
.vh-user-icon { display: none; }

@media (max-width: 820px) {
    /* Mobile nav: open as a dropdown overlay instead of pushing the page down. */
    #mobileNav.is-open { position: absolute; left: 0; right: 0; z-index: 90; background: #fff; box-shadow: 0 14px 32px rgba(15, 23, 42, .16); border-bottom: 1px solid var(--vh-line); max-height: calc(100vh - 120px); overflow-y: auto; }

    /* CodeCanyon-style mobile header: hamburger left + logo centred (both from
       the theme), and the theme's own top-bar cluster overlaid top-right —
       trimmed down to just the cart + one account icon. Hiding the wishlist,
       Login link and Sign-Up button leaves a single clean cluster, so a second
       cart can never appear. */
    .vh-topbar-right .vh-hide-mobile,
    .vh-topbar-right > a[aria-label="Wishlist"] { display: none; }
    .vh-user-icon { display: inline-flex; }
    .vh-logo-img { max-width: 150px; }
}

/* ============================================================
   Mobile app-style bottom tab bar (site-wide, ≤900px).
   ============================================================ */
.vh-tabbar { display: none; }
@media (max-width: 900px) {
    body { padding-bottom: 72px; }
    .vh-tabbar {
        display: flex;
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
        background: #fff; border-top: 1px solid var(--vh-line);
        padding: 9px 4px calc(9px + env(safe-area-inset-bottom, 0px));
        box-shadow: 0 -4px 18px rgba(15, 23, 42, .06);
    }
    .vh-tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--vh-muted); position: relative; }
    .vh-tabbar a.is-active { color: var(--vh-primary); }
    .vh-tab-badge { position: absolute; top: -5px; left: 50%; transform: translateX(6px); background: var(--vh-primary); color: #fff; font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; display: grid; place-items: center; }
}

/* ============================================================
   Single product page — mobile layout (match app demo).
   Reorder: gallery → title/rating → buy box → favourites → tabs.
   display:contents flattens the two desktop columns into one flex
   column, then flex `order` interleaves them. No markup change.
   ============================================================ */
@media (max-width: 900px) {
    .vh-pd { display: flex; flex-direction: column; gap: 0; margin-top: 8px; }
    .vh-pd-left, .vh-pd-buy { display: contents; }

    .vh-pd-left > *, .vh-pd-buy > * { order: 5; }
    .vh-pd-gallery { order: 1; margin-bottom: 4px; }
    .vh-pd-preview-btns { order: 1; }
    .vh-pd-thumbs { order: 1; }
    .vh-pd-headbox { order: 2; margin-top: 4px; }
    .vh-buybox { order: 2; margin-bottom: 14px; }
    .vh-pd-2btn { order: 2; grid-template-columns: 1fr 1fr; }
    .vh-pd-tabwrap { order: 3; margin-top: 18px; }

    /* tabs + thumbs scroll horizontally instead of clipping */
    .vh-pd-tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    .vh-pd-tabs::-webkit-scrollbar { display: none; }
    .vh-pd-tabs .vh-tab { white-space: nowrap; flex: none; }
    .vh-pd-thumbs { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    .vh-pd-thumbs::-webkit-scrollbar { display: none; }
    .vh-pd-thumbs img { flex: none; }

    .vh-pd-headbox h1 { font-size: 22px; line-height: 1.25; }
    .vh-pd-price { font-size: 30px; }
}
@media (max-width: 380px) {
    .vh-pd-2btn { grid-template-columns: 1fr; }
}

/* ---- Extend-support upsell (product buy box) ---- */
.vh-supext { display: flex; align-items: center; gap: 10px; padding: 12px 2px; border-top: 1px solid var(--vh-line); border-bottom: 1px solid var(--vh-line); margin: 2px 0 14px; font-size: 14px; color: var(--vh-body); cursor: pointer; }
.vh-supext input { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--vh-primary); cursor: pointer; }
.vh-supext-txt { flex: 1; }
.vh-supext-price { white-space: nowrap; font-size: 13px; }
.vh-supext-price s { color: var(--vh-faint); margin-right: 5px; }
.vh-supext-price b { color: var(--vh-ink); }
.vh-ci-support { font-size: 12px; color: var(--vh-muted); margin-top: 6px; display: flex; align-items: center; gap: 5px; }
.vh-ci-support svg { color: var(--vh-green); }

/* ---- Mobile header: search icon (≤820px only) ---- */
.vh-mhead-search { display: none; }
@media (max-width: 820px) {
    .vh-mhead-search { display: inline-flex; }
}

/* ============================================================
   Single category page — mobile layout (match app demo).
   hero → sub-category tiles → filter/sort bar (Filter drawer)
   → product LIST cards. Sidebar (categories + filters) is
   flattened: categories list hidden, filters behind a button.
   ============================================================ */
.vh-filter-btn { display: none; }
@media (max-width: 900px) {
    .vh-browse { display: flex; flex-direction: column; gap: 0; margin-bottom: 24px; }
    .vh-browse-side, .vh-browse-main { display: contents; }
    .vh-browse-side > *, .vh-browse-main > * { order: 5; }

    /* hide the desktop Categories sidebar box (nav is via tiles + breadcrumb) */
    .vh-browse-side > div.vh-side-box { display: none; }

    .vh-browse-hero { order: 1; }
    .vh-subcat-row { order: 2; }
    .vh-browse-bar { order: 3; }
    .vh-filter-drawer { order: 4; }
    .vh-pager { order: 6; }

    /* sub-category tiles: 3-up grid (matches demo) */
    .vh-subcat-row { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
    .vh-subcat-card { padding: 11px 9px; gap: 8px; }
    .vh-subcat-ico { width: 30px; height: 30px; }
    .vh-subcat-card b { font-size: 12px; }
    .vh-subcat-card > div > span { font-size: 10.5px; }

    /* category hero illustration (laptop) — shown on mobile too */
    .vh-browse-hero { gap: 12px; }
    .vh-browse-hero-art { display: block; width: 118px; height: 90px; }

    /* compact filter / sort bar: [Filter] [Sort] [grid|list]; count below */
    .vh-browse-bar { flex-direction: column-reverse; align-items: stretch; gap: 10px; margin-bottom: 14px; }
    .vh-browse-tools { justify-content: flex-start; gap: 10px; }
    .vh-browse-tools > form:first-of-type { flex: 1; }
    .vh-browse-tools .vh-select-sm { width: 100%; }
    .vh-perpage { display: none; }
    .vh-filter-btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border: 1px solid var(--vh-line); border-radius: var(--vh-radius-sm); background: #fff; font-size: 14px; font-weight: 600; color: var(--vh-body); flex-shrink: 0; }
    .vh-filter-btn:hover { border-color: var(--vh-primary); color: var(--vh-primary); }

    /* filter drawer: hidden until the Filter button toggles it open */
    .vh-filter-drawer { display: none; }
    .vh-filter-drawer.is-open { display: block; margin-bottom: 16px; }

    /* products as horizontal list cards (thumb left, info right) */
    #vh-grid.vh-prod-grid-cat { grid-template-columns: 1fr; gap: 12px; }
    #vh-grid .vh-prod { flex-direction: row; align-items: stretch; }
    #vh-grid .vh-prod-thumb { width: 128px; flex-shrink: 0; }
    #vh-grid .vh-prod-thumb img, #vh-grid .vh-prod-banner { height: 100%; }
    #vh-grid .vh-prod-body { flex: 1; min-width: 0; justify-content: center; }
}
@media (max-width: 400px) {
    #vh-grid .vh-prod-thumb { width: 104px; }
}

/* ---- Category hero laptop illustration (replaces the plain icon badge) ---- */
.vh-browse-hero-art { color: var(--vh-primary); }
.vh-hero-laptop { width: 100%; height: 100%; display: block; }
