/* v4.4.0 — Mobile App Experience
   App-like mobile navigation, full screen search, premium product cards,
   category drawer polish, checkout/cart readability and sticky single-product buy bar. */

@media (max-width: 782px) {
  :root { --vlg-mobile-appbar-h: 76px; }

  body.vlg-theme {
    padding-bottom: calc(var(--vlg-mobile-appbar-h) + env(safe-area-inset-bottom)) !important;
    background: #f4f7fb !important;
  }

  /* Bottom app navigation */
  body.vlg-theme .vlg-mobile-appbar {
    position: fixed !important;
    left: max(8px, env(safe-area-inset-left)) !important;
    right: max(8px, env(safe-area-inset-right)) !important;
    bottom: max(8px, env(safe-area-inset-bottom)) !important;
    z-index: 9200 !important;
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 6px !important;
    min-height: 66px !important;
    padding: 7px !important;
    border: 1px solid rgba(15, 23, 42, .08) !important;
    border-radius: 24px !important;
    background: rgba(255, 255, 255, .94) !important;
    backdrop-filter: blur(18px) saturate(155%) !important;
    box-shadow: 0 18px 60px rgba(2, 8, 23, .20) !important;
  }

  body.vlg-theme .vlg-mobile-appbar__item {
    position: relative !important;
    display: grid !important;
    place-items: center !important;
    gap: 3px !important;
    min-width: 0 !important;
    min-height: 52px !important;
    border: 0 !important;
    border-radius: 18px !important;
    background: transparent !important;
    color: #334155 !important;
    text-decoration: none !important;
    font: inherit !important;
    cursor: pointer !important;
  }

  body.vlg-theme .vlg-mobile-appbar__item span {
    display: grid !important;
    place-items: center !important;
    width: 24px !important;
    height: 24px !important;
    font-size: 20px !important;
    line-height: 1 !important;
  }

  body.vlg-theme .vlg-mobile-appbar__item b {
    display: block !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 10.5px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
  }

  body.vlg-theme .vlg-mobile-appbar__item--primary {
    background: linear-gradient(135deg, #071224, #14294b) !important;
    color: #fff !important;
    box-shadow: 0 10px 24px rgba(7, 18, 36, .22) !important;
  }

  body.vlg-theme .vlg-mobile-appbar__item em {
    position: absolute !important;
    top: 4px !important;
    right: 9px !important;
    display: grid !important;
    place-items: center !important;
    min-width: 18px !important;
    height: 18px !important;
    padding: 0 5px !important;
    border-radius: 999px !important;
    background: #ffb000 !important;
    color: #071224 !important;
    font-size: 10px !important;
    font-style: normal !important;
    font-weight: 950 !important;
  }

  body.vlg-theme .vlg-back-to-top {
    bottom: calc(var(--vlg-mobile-appbar-h) + 18px + env(safe-area-inset-bottom)) !important;
  }

  /* Full screen mobile search */
  body.vlg-mobile-search-open { overflow: hidden !important; }
  body.vlg-theme .vlg-mobile-search-panel[hidden] { display: none !important; }
  body.vlg-theme .vlg-mobile-search-panel {
    position: fixed !important;
    inset: 0 !important;
    z-index: 9400 !important;
    display: grid !important;
    align-items: start !important;
    padding: calc(18px + env(safe-area-inset-top)) 14px 14px !important;
    background: rgba(7, 18, 36, .62) !important;
    backdrop-filter: blur(14px) saturate(135%) !important;
  }

  body.vlg-theme .vlg-mobile-search-panel__card {
    width: 100% !important;
    max-width: 620px !important;
    margin: 0 auto !important;
    padding: 18px !important;
    border-radius: 28px !important;
    background: #fff !important;
    box-shadow: 0 24px 80px rgba(2, 8, 23, .32) !important;
  }

  body.vlg-theme .vlg-mobile-search-panel__head {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 52px !important;
    gap: 12px !important;
    align-items: center !important;
    margin-bottom: 14px !important;
  }

  body.vlg-theme .vlg-mobile-search-panel__head strong {
    display: block !important;
    color: #071224 !important;
    font-size: 24px !important;
    font-weight: 950 !important;
    letter-spacing: -.045em !important;
  }

  body.vlg-theme .vlg-mobile-search-panel__head span {
    display: block !important;
    margin-top: 3px !important;
    color: #64748b !important;
    font-size: 13px !important;
    line-height: 1.35 !important;
  }

  body.vlg-theme .vlg-mobile-search-panel__head button {
    width: 52px !important;
    height: 52px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 18px !important;
    background: #f8fafc !important;
    color: #071224 !important;
    font-size: 30px !important;
    font-weight: 900 !important;
  }

  body.vlg-theme .vlg-mobile-search-panel__form {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 10px !important;
    padding: 8px !important;
    border: 1px solid #dbe5f1 !important;
    border-radius: 22px !important;
    background: #f8fafc !important;
  }

  body.vlg-theme .vlg-mobile-search-panel__form input[type='search'] {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 48px !important;
    border: 0 !important;
    background: transparent !important;
    color: #071224 !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    outline: 0 !important;
  }

  body.vlg-theme .vlg-mobile-search-panel__form button {
    min-height: 48px !important;
    padding: 0 18px !important;
    border: 0 !important;
    border-radius: 17px !important;
    background: linear-gradient(135deg, #ff9900, #f28a00) !important;
    color: #fff !important;
    font-weight: 950 !important;
  }

  body.vlg-theme .vlg-mobile-search-panel__chips {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin-top: 14px !important;
  }

  body.vlg-theme .vlg-mobile-search-panel__chips a,
  body.vlg-theme .vlg-mobile-search-panel__shop {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 40px !important;
    padding: 0 13px !important;
    border-radius: 999px !important;
    background: #eef4fb !important;
    color: #1e355d !important;
    text-decoration: none !important;
    font-size: 13px !important;
    font-weight: 850 !important;
  }

  body.vlg-theme .vlg-mobile-search-panel__shop {
    width: 100% !important;
    margin-top: 14px !important;
    min-height: 46px !important;
    background: #071224 !important;
    color: #fff !important;
  }

  /* Drawer / categories: app quality, less cramped */
  body.vlg-theme .vlg-nav.is-open,
  body.vlg-theme.vlg-menu-open .vlg-nav.is-open {
    max-height: min(92dvh, 820px) !important;
    border-radius: 30px 30px 0 0 !important;
    background:
      radial-gradient(circle at 90% 0, rgba(242, 138, 0, .12), transparent 30%),
      linear-gradient(180deg, #0a1220 0%, #0b1424 100%) !important;
    color: #f8fafc !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-mobile-nav-head,
  body.vlg-theme.vlg-menu-open .vlg-nav.is-open .vlg-mobile-nav-head {
    position: sticky !important;
    top: 0 !important;
    z-index: 5 !important;
    grid-template-columns: minmax(0, 1fr) 56px !important;
    background: linear-gradient(180deg, rgba(10,18,32,.98), rgba(10,18,32,.92) 82%, rgba(10,18,32,0)) !important;
    border-bottom: 1px solid rgba(148,163,184,.16) !important;
  }

  body.vlg-theme .vlg-mobile-nav-head strong { color: #fff !important; font-size: 20px !important; }
  body.vlg-theme .vlg-mobile-nav-head span { color: rgba(226,232,240,.70) !important; }

  body.vlg-theme .vlg-mobile-nav-close {
    width: 56px !important;
    height: 56px !important;
    border-radius: 18px !important;
    border: 1px solid rgba(148,163,184,.18) !important;
    background: rgba(255,255,255,.09) !important;
    color: #fff !important;
    font-size: 30px !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-category-button {
    min-height: 60px !important;
    border-radius: 20px !important;
    background: linear-gradient(135deg, #06101f, #10213b) !important;
    border: 1px solid rgba(255,255,255,.07) !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-category-dropdown > ul,
  body.vlg-theme .vlg-nav.is-open .vlg-category-dropdown > .vlg-cat-dropdown-list {
    max-height: min(45dvh, 400px) !important;
    padding: 10px !important;
    border-radius: 22px !important;
    background: rgba(255,255,255,.055) !important;
    border: 1px solid rgba(255,255,255,.08) !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-cat-dropdown-list a,
  body.vlg-theme .vlg-nav.is-open .vlg-category-dropdown a {
    min-height: 52px !important;
    border-radius: 17px !important;
    background: rgba(255,255,255,.05) !important;
    color: #f8fafc !important;
    gap: 10px !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }

  /* Cart / checkout shipping: no narrow vertical text */
  body.vlg-theme.woocommerce-cart .cart_totals .woocommerce-shipping-methods,
  body.vlg-theme.woocommerce-cart .cart_totals #shipping_method,
  body.vlg-theme.woocommerce-checkout ul#shipping_method,
  body.vlg-theme.woocommerce-checkout .fs-shipping-methods-wrap ul#shipping_method {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  body.vlg-theme.woocommerce-cart .cart_totals .woocommerce-shipping-methods li,
  body.vlg-theme.woocommerce-cart .cart_totals #shipping_method li,
  body.vlg-theme.woocommerce-checkout ul#shipping_method li,
  body.vlg-theme.woocommerce-checkout .fs-shipping-methods-wrap ul#shipping_method li {
    display: grid !important;
    grid-template-columns: 28px minmax(0, 1fr) !important;
    align-items: start !important;
    gap: 12px !important;
    width: 100% !important;
    min-width: 0 !important;
    padding: 14px !important;
    border-radius: 20px !important;
    box-sizing: border-box !important;
  }

  body.vlg-theme.woocommerce-cart .cart_totals tr.shipping,
  body.vlg-theme.woocommerce-cart .cart_totals tr.shipping th,
  body.vlg-theme.woocommerce-cart .cart_totals tr.shipping td,
  body.vlg-theme.woocommerce-cart .cart_totals .woocommerce-shipping-totals,
  body.vlg-theme.woocommerce-cart .cart_totals .woocommerce-shipping-totals th,
  body.vlg-theme.woocommerce-cart .cart_totals .woocommerce-shipping-totals td {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    text-align: left !important;
  }

  body.vlg-theme.woocommerce-cart .cart_totals .woocommerce-shipping-methods label,
  body.vlg-theme.woocommerce-cart .cart_totals #shipping_method label,
  body.vlg-theme.woocommerce-checkout ul#shipping_method label,
  body.vlg-theme.woocommerce-checkout .fs-shipping-methods-wrap ul#shipping_method label {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: baseline !important;
    justify-content: flex-start !important;
    gap: 6px 8px !important;
    width: 100% !important;
    min-width: 0 !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: anywhere !important;
    writing-mode: horizontal-tb !important;
    text-align: left !important;
    font-size: 17px !important;
    line-height: 1.32 !important;
  }

  body.vlg-theme.woocommerce-cart .cart_totals #shipping_method label .amount,
  body.vlg-theme.woocommerce-cart .cart_totals #shipping_method label small,
  body.vlg-theme.woocommerce-cart .cart_totals #shipping_method label .includes_tax,
  body.vlg-theme.woocommerce-checkout ul#shipping_method label .amount,
  body.vlg-theme.woocommerce-checkout ul#shipping_method label small,
  body.vlg-theme.woocommerce-checkout ul#shipping_method label .includes_tax {
    white-space: nowrap !important;
    word-break: keep-all !important;
  }

  /* Product cards mobile premium */
  body.vlg-theme ul.products,
  body.vlg-theme .vlg-products-grid,
  body.vlg-theme .vlg-shop-products ul.products {
    gap: 14px !important;
  }

  body.vlg-theme ul.products li.product.vlg-product-card,
  body.vlg-theme .vlg-product-card {
    border-radius: 22px !important;
    box-shadow: 0 14px 32px rgba(15,23,42,.075) !important;
  }

  /* Single product sticky mobile buy bar */
  body.vlg-theme.single-product form.cart {
    position: sticky !important;
    bottom: calc(var(--vlg-mobile-appbar-h) + 14px + env(safe-area-inset-bottom)) !important;
    z-index: 4000 !important;
    display: grid !important;
    grid-template-columns: 96px minmax(0, 1fr) !important;
    gap: 10px !important;
    align-items: center !important;
    margin: 14px 0 !important;
    padding: 10px !important;
    border-radius: 22px !important;
    background: rgba(255,255,255,.96) !important;
    border: 1px solid rgba(226,232,240,.9) !important;
    backdrop-filter: blur(16px) saturate(150%) !important;
    box-shadow: 0 18px 50px rgba(15,23,42,.16) !important;
  }

  body.vlg-theme.single-product form.cart .quantity,
  body.vlg-theme.single-product form.cart .qty {
    width: 100% !important;
  }

  body.vlg-theme.single-product form.cart .single_add_to_cart_button {
    min-height: 52px !important;
    border-radius: 17px !important;
    font-size: 15px !important;
    font-weight: 950 !important;
  }
}

@media (min-width: 783px) {
  .vlg-mobile-appbar,
  .vlg-mobile-search-panel { display: none !important; }
}
