/* v3.0.0 — Clean Core final layer
   Loads last and normalizes mobile header/menu, checkout, product pages and hero text.
*/

@media (max-width: 767.98px) {
  html body.vlg-theme {
    --vlg-mobile-radius: 18px;
    --vlg-mobile-gap: 12px;
    --vlg-mobile-shadow: 0 16px 34px rgba(7, 18, 36, .14);
  }

  html body.vlg-theme .vlg-main-header {
    position: relative !important;
    z-index: 30 !important;
    background: #fff !important;
    border-bottom: 1px solid rgba(7, 18, 36, .08) !important;
  }

  html body.vlg-theme .vlg-main-header-inner {
    display: grid !important;
    grid-template-columns: auto 1fr auto !important;
    gap: 10px !important;
    align-items: center !important;
    min-height: 64px !important;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
  }

  html body.vlg-theme .vlg-header-brand-row { display: contents !important; }

  html body.vlg-theme .vlg-mobile-toggle {
    grid-column: 1 !important;
    width: 44px !important;
    height: 44px !important;
    border-radius: 15px !important;
    background: #071224 !important;
    color: #fff !important;
    box-shadow: 0 10px 24px rgba(7, 18, 36, .16) !important;
  }

  html body.vlg-theme .vlg-brand {
    grid-column: 2 !important;
    justify-self: center !important;
    min-width: 0 !important;
  }

  html body.vlg-theme .vlg-brand img,
  html body.vlg-theme .custom-logo {
    max-height: 42px !important;
    width: auto !important;
  }

  html body.vlg-theme .vlg-header-actions {
    grid-column: 3 !important;
    display: flex !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    min-width: 44px !important;
  }

  html body.vlg-theme .vlg-header-actions .vlg-account-link,
  html body.vlg-theme .vlg-header-actions .vlg-wishlist-link,
  html body.vlg-theme .vlg-header-language-slot { display: none !important; }

  html body.vlg-theme .vlg-cart-link {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    padding: 0 !important;
    justify-content: center !important;
    border-radius: 15px !important;
  }

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

  html body.vlg-theme .vlg-header-search {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    width: 100% !important;
    margin: 0 !important;
  }

  html body.vlg-theme.vlg-mobile-hide-search .vlg-header-search { display: none !important; }

  html body.vlg-theme .vlg-nav.is-open {
    position: fixed !important;
    inset: 10px !important;
    z-index: 9999 !important;
    display: block !important;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    max-height: calc(100dvh - 20px) !important;
    overflow: hidden !important;
    border-radius: 24px !important;
    background: #fff !important;
    box-shadow: 0 24px 90px rgba(7, 18, 36, .30) !important;
  }

  html body.admin-bar.vlg-theme .vlg-nav.is-open {
    top: 56px !important;
    max-height: calc(100dvh - 66px) !important;
  }

  html body.vlg-theme .vlg-nav.is-open .vlg-nav-inner {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    height: 100% !important;
    max-height: inherit !important;
    padding: 14px !important;
    overflow: hidden !important;
  }

  html body.vlg-theme .vlg-nav.is-open .vlg-mobile-nav-head {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    flex: 0 0 auto !important;
    padding: 0 0 10px !important;
    border-bottom: 1px solid rgba(7, 18, 36, .08) !important;
  }

  html body.vlg-theme .vlg-nav.is-open .vlg-mobile-nav-head strong {
    font-size: 18px !important;
    line-height: 1.15 !important;
  }

  html body.vlg-theme .vlg-nav.is-open .vlg-mobile-nav-head span { display: none !important; }

  html body.vlg-theme .vlg-nav.is-open .vlg-mobile-quick-links {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
    flex: 0 0 auto !important;
  }

  html body.vlg-theme.vlg-mobile-hide-quick-links .vlg-nav.is-open .vlg-mobile-quick-links,
  html body.vlg-theme:not(.vlg-mobile-show-quick-links) .vlg-nav.is-open .vlg-mobile-quick-links {
    display: none !important;
  }

  html body.vlg-theme .vlg-nav.is-open .vlg-mobile-quick-links a {
    min-height: 42px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 15px !important;
    background: #f3f6fb !important;
    color: #071224 !important;
    font-weight: 900 !important;
    text-decoration: none !important;
  }

  html body.vlg-theme .vlg-nav.is-open .vlg-category-menu {
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
  }

  html body.vlg-theme .vlg-nav.is-open .vlg-category-button {
    flex: 0 0 auto !important;
    min-height: 56px !important;
    width: 100% !important;
    padding: 14px 16px !important;
    border-radius: 18px !important;
    background: linear-gradient(135deg, #071224, #132542) !important;
    color: #fff !important;
  }

  html body.vlg-theme .vlg-nav.is-open .vlg-category-button::before {
    display: none !important;
    content: none !important;
  }

  html body.vlg-theme .vlg-nav.is-open .vlg-category-dropdown {
    position: static !important;
    display: none !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    margin-top: 10px !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  html body.vlg-theme .vlg-nav.is-open .vlg-category-menu.is-open .vlg-category-dropdown,
  html body.vlg-theme .vlg-nav.is-open .vlg-category-button[aria-expanded="true"] + .vlg-category-dropdown,
  html body.vlg-theme.vlg-mobile-auto-open-categories .vlg-nav.is-open .vlg-category-dropdown {
    display: flex !important;
    flex-direction: column !important;
  }

  html body.vlg-theme .vlg-nav.is-open .vlg-cat-tree,
  html body.vlg-theme .vlg-nav.is-open .vlg-category-dropdown > ul {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    height: 100% !important;
    overflow: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 10px !important;
    border-radius: 18px !important;
    background: #f5f8fc !important;
  }

  html body.vlg-theme .vlg-nav.is-open .vlg-cat-row,
  html body.vlg-theme .vlg-nav.is-open .vlg-cat-tree a,
  html body.vlg-theme .vlg-nav.is-open .vlg-category-dropdown li > a {
    min-height: 46px !important;
    border-radius: 14px !important;
    background: #fff !important;
    color: #071224 !important;
    box-shadow: 0 1px 0 rgba(7, 18, 36, .06) !important;
  }

  html body.vlg-theme .vlg-nav.is-open .vlg-primary-menu { display: none !important; }

  html body.vlg-theme.vlg-mobile-show-primary-menu .vlg-nav.is-open .vlg-primary-menu,
  html body.vlg-theme.vlg-mobile-full-menu .vlg-nav.is-open .vlg-primary-menu {
    display: block !important;
    flex: 0 0 auto !important;
    max-height: 30dvh !important;
    overflow: auto !important;
    padding: 10px !important;
    border-radius: 18px !important;
    background: #f5f8fc !important;
  }
}

/* Desktop hero cleanup */
@media (min-width: 992px) {
  body.vlg-theme .vlg-hero-title,
  body.vlg-theme .vlg-hero h1,
  body.vlg-theme .vlg-hero-content h1 {
    max-width: 780px !important;
    font-size: clamp(40px, 4.2vw, 58px) !important;
    line-height: 1.04 !important;
    letter-spacing: -.045em !important;
  }
}

/* Mobile checkout: one column and easier to scan. */
@media (max-width: 767.98px) {
  body.woocommerce-checkout.vlg-theme form.checkout,
  body.woocommerce-checkout.vlg-theme .woocommerce-checkout { display: block !important; }

  body.woocommerce-checkout.vlg-theme .col2-set,
  body.woocommerce-checkout.vlg-theme #order_review,
  body.woocommerce-checkout.vlg-theme #order_review_heading {
    width: 100% !important;
    float: none !important;
    clear: both !important;
  }

  body.woocommerce-checkout.vlg-theme .woocommerce-billing-fields,
  body.woocommerce-checkout.vlg-theme .woocommerce-shipping-fields,
  body.woocommerce-checkout.vlg-theme #order_review {
    border-radius: 18px !important;
    background: #fff !important;
    box-shadow: 0 10px 24px rgba(7, 18, 36, .08) !important;
    padding: 16px !important;
    margin-bottom: 14px !important;
  }
}

/* Mobile product page: prioritize image, price and add-to-cart. */
@media (max-width: 767.98px) {
  body.single-product.vlg-theme div.product { display: block !important; }

  body.single-product.vlg-theme div.product .summary { padding-top: 12px !important; }

  body.single-product.vlg-theme div.product .price {
    font-size: 24px !important;
    line-height: 1.15 !important;
    font-weight: 950 !important;
  }

  body.single-product.vlg-theme div.product form.cart {
    position: sticky !important;
    bottom: max(10px, env(safe-area-inset-bottom)) !important;
    z-index: 40 !important;
    display: flex !important;
    gap: 10px !important;
    align-items: center !important;
    padding: 10px !important;
    border-radius: 20px !important;
    background: rgba(255,255,255,.96) !important;
    box-shadow: 0 14px 38px rgba(7, 18, 36, .18) !important;
    backdrop-filter: blur(10px) !important;
  }

  body.single-product.vlg-theme div.product form.cart .single_add_to_cart_button {
    flex: 1 1 auto !important;
    min-height: 48px !important;
    border-radius: 15px !important;
  }
}
