/* =========================================================
   v2.3.0 — Mobile Perfect Polish
   Extra mobile UX layer: compact sticky header, calmer hero,
   searchable bottom-sheet menu, modern category dropdowns and safer
   phone layouts without horizontal overflow.
   ========================================================= */

@media (max-width: 782px) {
  :root {
    --vlg-mobile-page-x: 14px;
    --vlg-mobile-header-height: 112px;
  }

  html,
  body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: clip !important;
    background: #f5f7fb !important;
  }

  body.vlg-theme * {
    -webkit-tap-highlight-color: rgba(242, 138, 0, .14);
  }

  body.vlg-theme .vlg-site-header {
    position: sticky !important;
    top: var(--wp-admin--admin-bar--height, 0px) !important;
    z-index: 6400 !important;
    background: rgba(255,255,255,.985) !important;
    border-bottom: 1px solid rgba(219,229,241,.96) !important;
    box-shadow: 0 8px 22px rgba(15,23,42,.055) !important;
    backdrop-filter: blur(14px) saturate(160%);
  }

  body.admin-bar.vlg-theme .vlg-site-header {
    top: var(--wp-admin--admin-bar--height, 46px) !important;
  }

  body.vlg-theme .vlg-topbar {
    display: none !important;
  }

  body.vlg-theme .vlg-main-header {
    border: 0 !important;
    background: transparent !important;
  }

  body.vlg-theme .vlg-main-header-inner {
    width: calc(100% - (var(--vlg-mobile-page-x) * 2)) !important;
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto !important;
    grid-template-areas:
      "brand brand cart"
      "search search search" !important;
    gap: 8px 9px !important;
    min-height: 0 !important;
    padding: 8px 0 10px !important;
    margin: 0 auto !important;
  }

  body.vlg-theme .vlg-header-brand-row {
    grid-area: brand !important;
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 9px !important;
  }

  body.vlg-theme .vlg-header-actions {
    grid-area: cart !important;
    justify-self: end !important;
    align-self: center !important;
    min-width: 0 !important;
  }

  body.vlg-theme .vlg-header-search {
    grid-area: search !important;
    width: 100% !important;
    margin: 0 !important;
  }

  body.vlg-theme .vlg-mobile-toggle {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    border: 1px solid #dbe5f1 !important;
    border-radius: 16px !important;
    background: linear-gradient(180deg,#fff 0%,#f8fafc 100%) !important;
    box-shadow: 0 8px 20px rgba(15,23,42,.07) !important;
  }

  body.vlg-theme .vlg-mobile-toggle-icon span {
    height: 3px !important;
    border-radius: 999px !important;
    background: #071224 !important;
  }

  body.vlg-theme .vlg-mobile-toggle.is-open {
    border-color: rgba(242,138,0,.36) !important;
    background: #fff7ed !important;
  }

  body.vlg-theme .vlg-brand,
  body.vlg-theme .vlg-brand a {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  body.vlg-theme .vlg-brand .custom-logo,
  body.vlg-theme .custom-logo {
    width: auto !important;
    max-width: min(196px, 52vw) !important;
    max-height: 42px !important;
    object-fit: contain !important;
  }

  body.vlg-theme .vlg-cart-link {
    position: relative !important;
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    padding: 0 !important;
    display: inline-grid !important;
    place-items: center !important;
    border-radius: 17px !important;
    border: 1px solid rgba(242,138,0,.24) !important;
    background: #fff7ed !important;
    box-shadow: 0 8px 22px rgba(242,138,0,.11) !important;
  }

  body.vlg-theme .vlg-cart-link > span:not(.vlg-icon):not(.vlg-cart-count):not(.vlg-badge),
  body.vlg-theme .vlg-cart-link small,
  body.vlg-theme .vlg-cart-total {
    display: none !important;
  }

  body.vlg-theme .vlg-cart-link .vlg-icon {
    margin: 0 !important;
    font-size: 23px !important;
  }

  body.vlg-theme .vlg-cart-count,
  body.vlg-theme .vlg-cart-link .vlg-badge {
    position: absolute !important;
    top: -7px !important;
    right: -7px !important;
    min-width: 23px !important;
    height: 23px !important;
    padding: 0 6px !important;
    display: inline-grid !important;
    place-items: center !important;
    border-radius: 999px !important;
    border: 2px solid #fff !important;
    background: var(--vlg-primary, #f28a00) !important;
    color: #fff !important;
    font-size: 12px !important;
    font-weight: 950 !important;
    line-height: 1 !important;
  }

  body.vlg-theme .vlg-search {
    display: grid !important;
    grid-template-columns: 28px minmax(0,1fr) auto !important;
    align-items: center !important;
    gap: 7px !important;
    min-height: 50px !important;
    height: auto !important;
    padding: 5px 5px 5px 11px !important;
    border: 1px solid #dfe7f1 !important;
    border-radius: 20px !important;
    background: #fff !important;
    box-shadow: 0 10px 26px rgba(15,23,42,.055) !important;
  }

  body.vlg-theme .vlg-search::before {
    content: "⌕";
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    color: #64748b;
    font-size: 24px;
    line-height: 1;
  }

  body.vlg-theme .vlg-search input[type="search"] {
    min-width: 0 !important;
    width: 100% !important;
    height: 38px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: #0f172a !important;
    font-size: 15px !important;
    font-weight: 650 !important;
    text-overflow: ellipsis !important;
  }

  body.vlg-theme .vlg-search input[type="search"]::placeholder {
    color: #94a3b8 !important;
    opacity: 1 !important;
  }

  body.vlg-theme .vlg-search button,
  body.vlg-theme .vlg-search-submit {
    min-width: 64px !important;
    min-height: 40px !important;
    height: 40px !important;
    padding: 0 15px !important;
    border-radius: 15px !important;
    font-size: 14px !important;
    font-weight: 950 !important;
    box-shadow: 0 8px 18px rgba(242,138,0,.24) !important;
  }

  body.vlg-theme .vlg-search-suggestions,
  body.vlg-theme .vlg-search-results {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-height: min(62dvh, 420px) !important;
    overflow: auto !important;
    border-radius: 18px !important;
    z-index: 6600 !important;
  }

  /* Bottom sheet menu: full app-like sheet with search/filter. */
  body.vlg-theme .vlg-mobile-backdrop:not([hidden]) {
    background: rgba(7,18,36,.50) !important;
    backdrop-filter: blur(8px) saturate(125%) !important;
    z-index: 7990 !important;
  }

  body.vlg-theme .vlg-nav.is-open {
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    inset: auto 0 0 0 !important;
    width: 100% !important;
    max-height: min(88dvh, 760px) !important;
    border-left: 0 !important;
    border-right: 0 !important;
    border-bottom: 0 !important;
    border-radius: 30px 30px 0 0 !important;
    background: rgba(255,255,255,.985) !important;
    box-shadow: 0 -24px 80px rgba(7,18,36,.34) !important;
    overflow: hidden !important;
    z-index: 8000 !important;
  }

  body.admin-bar.vlg-theme .vlg-nav.is-open {
    max-height: calc(100dvh - var(--wp-admin--admin-bar--height, 46px) - 6px) !important;
  }

  body.vlg-theme .vlg-nav.is-open::before {
    width: 52px !important;
    height: 5px !important;
    margin: 11px auto 7px !important;
    background: #cbd5e1 !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-nav-inner {
    max-height: calc(min(88dvh, 760px) - 24px) !important;
    padding: 0 var(--vlg-mobile-page-x) calc(16px + env(safe-area-inset-bottom)) !important;
    gap: 11px !important;
    scrollbar-width: thin;
  }

  body.vlg-theme .vlg-mobile-nav-head {
    padding: 8px 0 11px !important;
    margin: 0 !important;
    border-bottom: 1px solid rgba(226,232,240,.78) !important;
  }

  body.vlg-theme .vlg-mobile-nav-head strong {
    font-size: 22px !important;
    letter-spacing: -.04em !important;
  }

  body.vlg-theme .vlg-mobile-nav-head span {
    font-size: 12px !important;
  }

  body.vlg-theme .vlg-mobile-menu-search {
    position: sticky;
    top: 60px;
    z-index: 2;
    padding: 0 0 2px;
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(10px);
  }

  body.vlg-theme .vlg-mobile-menu-search input {
    width: 100%;
    min-height: 46px;
    padding: 0 14px 0 42px;
    border: 1px solid #dbe5f1;
    border-radius: 16px;
    background: #f8fafc;
    color: #0f172a;
    font-size: 15px;
    font-weight: 760;
    outline: 0;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
  }

  body.vlg-theme .vlg-mobile-menu-search::before {
    content: "⌕";
    position: absolute;
    left: 14px;
    top: 12px;
    color: #64748b;
    font-size: 24px;
    line-height: 1;
    pointer-events: none;
  }

  body.vlg-theme .vlg-mobile-menu-search input:focus {
    border-color: rgba(242,138,0,.48);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(242,138,0,.12);
  }

  body.vlg-theme .vlg-mobile-quick-links {
    grid-template-columns: repeat(3,minmax(0,1fr)) !important;
    gap: 8px !important;
  }

  body.vlg-theme .vlg-mobile-quick-links a {
    min-height: 44px !important;
    border-radius: 16px !important;
    font-size: 12px !important;
    box-shadow: 0 6px 14px rgba(15,23,42,.035);
  }

  body.vlg-theme .vlg-nav.is-open .vlg-category-button {
    min-height: 56px !important;
    padding-left: 16px !important;
    border-radius: 20px !important;
    background:
      radial-gradient(circle at 100% 0, rgba(242,138,0,.22), transparent 34%),
      linear-gradient(135deg, #071224 0%, #10213b 100%) !important;
    font-size: 15px !important;
    font-weight: 950 !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(46dvh, 390px) !important;
    padding: 9px !important;
    border-radius: 20px !important;
    background: #f5f7fb !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;
    padding: 11px 12px 11px 15px !important;
    font-size: 14.5px !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-primary-menu > li {
    border-radius: 18px !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-primary-menu > li > a {
    min-height: 52px !important;
    padding-left: 15px !important;
    font-size: 14.5px !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-submenu-toggle {
    top: 8px !important;
    right: 8px !important;
    width: 36px !important;
    height: 36px !important;
  }

  body.vlg-theme .vlg-mobile-filter-hidden {
    display: none !important;
  }

  body.vlg-theme .vlg-mobile-filter-empty {
    display: none;
    padding: 13px 14px;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    background: #f8fafc;
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
    text-align: center;
  }

  body.vlg-theme .vlg-mobile-filter-empty.is-visible {
    display: block;
  }

  /* Home first screen: less noise, better hierarchy and clearer CTA. */
  body.vlg-theme .vlg-home > .vlg-container,
  body.vlg-theme .site-main.vlg-home > .vlg-container {
    width: calc(100% - (var(--vlg-mobile-page-x) * 2)) !important;
    padding-top: 12px !important;
  }

  body.vlg-theme .vlg-home .vlg-hero,
  body.vlg-theme .site-main.vlg-home .vlg-hero,
  body.vlg-theme .vlg-hero {
    margin: 0 0 12px !important;
    padding: 18px 16px 16px !important;
    border-radius: 24px !important;
    background-color: #071224 !important;
    background-image:
      radial-gradient(circle at 94% 104%, rgba(242,138,0,.36), transparent 34%),
      linear-gradient(145deg, #071224 0%, #0b1830 62%, #14233d 100%) !important;
    box-shadow: 0 16px 34px rgba(7,18,36,.17) !important;
  }

  body.vlg-theme .vlg-hero .vlg-kicker {
    max-width: 100% !important;
    padding: 6px 10px !important;
    margin-bottom: 10px !important;
    white-space: normal !important;
    word-break: normal !important;
  }

  body.vlg-theme .vlg-hero h1 {
    font-size: clamp(27px, 7.15vw, 34px) !important;
    line-height: 1.04 !important;
    letter-spacing: -.052em !important;
    max-width: 100% !important;
    margin-bottom: 10px !important;
  }

  body.vlg-theme .vlg-hero p {
    font-size: 15px !important;
    line-height: 1.44 !important;
    margin-bottom: 0 !important;
    color: rgba(241,245,249,.91) !important;
    -webkit-line-clamp: 2 !important;
  }

  body.vlg-theme .vlg-hero-actions {
    margin-top: 14px !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
  }

  body.vlg-theme .vlg-hero-actions .vlg-btn-primary,
  body.vlg-theme .vlg-hero-actions .vlg-btn,
  body.vlg-theme .vlg-hero .vlg-btn {
    min-height: 46px !important;
    border-radius: 17px !important;
    font-size: 14px !important;
    letter-spacing: -.01em !important;
  }

  body.vlg-theme .vlg-trust-grid {
    grid-template-columns: repeat(2,minmax(0,1fr)) !important;
    gap: 10px !important;
    margin-bottom: 22px !important;
  }

  body.vlg-theme .vlg-trust-item {
    min-width: 0 !important;
    min-height: 78px !important;
    border-radius: 18px !important;
    padding: 12px !important;
    overflow: hidden !important;
  }

  body.vlg-theme .vlg-trust-item span:first-child {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
  }

  body.vlg-theme .vlg-trust-item strong {
    font-size: 14px !important;
    line-height: 1.12 !important;
    word-break: normal !important;
    overflow-wrap: anywhere !important;
  }

  body.vlg-theme .vlg-section {
    margin-top: 22px !important;
  }

  body.vlg-theme .vlg-section-head {
    margin-bottom: 12px !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }

  body.vlg-theme .vlg-section-head h2,
  body.vlg-theme .vlg-home h2,
  body.vlg-theme .vlg-section-title {
    font-size: clamp(25px, 7.2vw, 32px) !important;
    line-height: 1.06 !important;
    letter-spacing: -.045em !important;
  }

  body.vlg-theme .vlg-section-head > a {
    min-height: 36px !important;
    padding: 0 12px !important;
    border-radius: 999px !important;
    font-size: 12px !important;
    white-space: nowrap !important;
  }

  body.vlg-theme .vlg-category-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  body.vlg-theme .vlg-category-card {
    display: grid !important;
    grid-template-columns: 74px minmax(0,1fr) !important;
    align-items: center !important;
    min-height: 92px !important;
    padding: 10px !important;
    border-radius: 20px !important;
    overflow: hidden !important;
  }

  body.vlg-theme .vlg-category-card img {
    width: 72px !important;
    height: 72px !important;
    border-radius: 17px !important;
    object-fit: contain !important;
  }

  body.vlg-theme .vlg-category-card div {
    min-width: 0 !important;
  }

  body.vlg-theme .vlg-category-card strong {
    display: block !important;
    font-size: 16px !important;
    line-height: 1.16 !important;
    overflow-wrap: anywhere !important;
  }

  body.vlg-theme .vlg-category-card small {
    font-size: 12px !important;
  }

  body.vlg-theme .products,
  body.vlg-theme .vlg-products-grid {
    grid-template-columns: repeat(2,minmax(0,1fr)) !important;
    gap: 12px !important;
  }

  body.vlg-theme ul.products li.product,
  body.vlg-theme .vlg-product-card {
    min-width: 0 !important;
    border-radius: 20px !important;
    overflow: hidden !important;
  }

  body.vlg-theme ul.products li.product .woocommerce-loop-product__title,
  body.vlg-theme .vlg-product-title {
    font-size: 13.5px !important;
    line-height: 1.25 !important;
    min-height: 0 !important;
    overflow-wrap: anywhere !important;
  }

  body.vlg-theme ul.products li.product .button,
  body.vlg-theme .vlg-product-card .button,
  body.vlg-theme .vlg-product-card .add_to_cart_button {
    width: 100% !important;
    min-height: 42px !important;
    border-radius: 14px !important;
    font-size: 13px !important;
    padding-inline: 8px !important;
  }

  body.vlg-theme .vlg-cookie-notice {
    left: var(--vlg-mobile-page-x) !important;
    right: var(--vlg-mobile-page-x) !important;
    bottom: max(14px, env(safe-area-inset-bottom)) !important;
    max-height: min(30dvh, 230px) !important;
    border-radius: 22px !important;
    z-index: 8100 !important;
  }

  body.vlg-theme .vlg-cookie-notice[hidden],
  body.vlg-theme .vlg-cookie-notice[data-vlg-cookie-dismissed="1"],
  body.vlg-theme .vlg-cookie-notice.is-hidden {
    display: none !important;
  }
}

@media (max-width: 430px) {
  :root { --vlg-mobile-page-x: 10px; }

  body.vlg-theme .vlg-mobile-quick-links {
    grid-template-columns: repeat(3,minmax(0,1fr)) !important;
  }

  body.vlg-theme .vlg-mobile-quick-links a {
    min-height: 42px !important;
    padding: 0 8px !important;
    font-size: 11.5px !important;
  }

  body.vlg-theme .vlg-home .vlg-hero,
  body.vlg-theme .site-main.vlg-home .vlg-hero,
  body.vlg-theme .vlg-hero {
    padding: 17px 15px 15px !important;
    border-radius: 22px !important;
  }

  body.vlg-theme .vlg-hero h1 {
    font-size: clamp(25px, 7vw, 31px) !important;
  }

  body.vlg-theme .vlg-hero p {
    font-size: 14px !important;
  }
}

@media (max-width: 360px) {
  body.vlg-theme .vlg-brand .custom-logo,
  body.vlg-theme .custom-logo {
    max-width: 148px !important;
  }

  body.vlg-theme .vlg-mobile-quick-links {
    grid-template-columns: 1fr 1fr !important;
  }

  body.vlg-theme .vlg-mobile-quick-links a:first-child {
    grid-column: 1 / -1 !important;
  }

  body.vlg-theme .products,
  body.vlg-theme .vlg-products-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.vlg-theme .vlg-nav.is-open,
  body.vlg-theme .vlg-mobile-backdrop:not([hidden]) {
    animation: none !important;
  }

  body.vlg-theme * {
    scroll-behavior: auto !important;
  }
}
