/* Electronix Hub mobile layout overrides (v1.4.1) */
html,
body.ehub-theme,
body.wp-theme-electronix-hub,
body.wp-theme-electronix-hub-5,
body.theme-electronix-hub-5 {
  overflow-x: clip;
}

@media (max-width: 1200px) {
  .eh-products__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .eh-products__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  body.ehub-theme,
  body.wp-theme-electronix-hub,
  body.wp-theme-electronix-hub-5 {
    background-attachment: scroll;
    --eh-runner-img-h: min(24rem, 58vh);
  }

  .eh-container {
    width: min(100% - 1.25rem, var(--eh-max));
  }

  .eh-header__inner {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "logo actions toggle"
      "nav nav nav";
    gap: 0.65rem 0.75rem;
    min-height: 4.25rem;
    padding-block: 0.35rem;
  }

  .eh-logo--header {
    height: 2.85rem;
    max-height: calc(4.25rem - 0.7rem);
  }

  .eh-logo--header img {
    max-width: min(8.5rem, 42vw);
  }

  .eh-header__actions {
    gap: 0.35rem;
    flex-shrink: 0;
    grid-area: actions;
  }

  .eh-header__actions .eh-btn--sm {
    display: none !important;
  }

  .eh-icon-btn {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
  }

  .eh-nav-toggle {
    display: flex !important;
    grid-area: toggle;
  }

  .eh-nav {
    position: absolute;
    top: 100%;
    left: 50%;
    right: auto;
    width: 100vw;
    margin-left: -50vw;
    display: none;
    padding: 0.85rem 1rem 1rem;
    background: rgba(5, 8, 15, 0.98);
    border-bottom: 1px solid rgba(43, 96, 220, 0.12);
    grid-area: nav;
    z-index: 2;
    max-height: calc(100vh - 4.5rem);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .eh-nav.is-open {
    display: block !important;
  }

  .eh-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
  }

  .eh-nav__list a {
    padding: 0.7rem 0.85rem;
    font-size: 0.92rem;
    white-space: normal;
  }

  .eh-nav__list .sub-menu {
    display: none;
    margin: 0.15rem 0 0.35rem;
    padding: 0.15rem 0 0.15rem 0.65rem;
    border-left: 2px solid rgba(43, 96, 220, 0.28);
    list-style: none;
  }

  .eh-nav__list .menu-item-has-children.is-open > .sub-menu {
    display: grid;
    gap: 0.1rem;
  }

  .eh-hero--showcase {
    overflow-x: clip;
    padding-bottom: 1.25rem;
  }

  .eh-hero__showcase-art {
    width: 100%;
    max-width: min(100%, 28rem);
  }

  .eh-hero__showcase-art img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
  }

  .eh-site-runner__track--art .eh-site-runner__unit img {
    max-width: 100vw;
    height: auto;
  }

  .eh-section {
    padding: 2.75rem 0;
  }

  .eh-section__head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
    margin-bottom: 1.35rem;
  }

  .eh-page-hero {
    padding: 2rem 0 1.5rem;
  }

  .eh-how__grid,
  .eh-testimonials__grid {
    grid-template-columns: 1fr;
  }

  .eh-stats__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .eh-products__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .eh-shop-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .eh-footer__grid {
    grid-template-columns: 1fr !important;
  }

  .eh-product-card {
    min-height: 14rem;
  }

  .eh-product-card h3 {
    padding-top: 6rem;
    font-size: 0.9rem;
  }

  .eh-price-list-contact {
    display: grid;
    gap: 0.35rem;
    font-size: 0.86rem;
    word-break: break-word;
  }

  .eh-pl-table-wrap {
    -webkit-overflow-scrolling: touch;
  }

  .eh-pl-table {
    font-size: 0.8rem;
  }

  .eh-pl-table th,
  .eh-pl-table td {
    padding: 0.5rem 0.6rem;
  }

  .eh-pl-acc__head {
    padding: 0.85rem 0.9rem;
    font-size: 0.92rem;
  }

  .woocommerce-cart .woocommerce,
  .woocommerce-checkout .woocommerce {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 640px) {
  .eh-products__grid,
  .eh-shop-grid,
  .woocommerce ul.products {
    grid-template-columns: 1fr !important;
  }

  .eh-stats__grid {
    grid-template-columns: 1fr;
  }

  .eh-section {
    padding: 2.25rem 0;
  }

  .eh-product-card {
    min-height: 12.5rem;
  }

  .eh-product-card h3 {
    padding-top: 5.25rem;
  }

  .eh-footer__bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .eh-payments {
    width: 100%;
  }

  .eh-mobile-bar {
    display: flex !important;
    padding-bottom: calc(0.65rem + env(safe-area-inset-bottom, 0px));
  }

  body.ehub-theme,
  body.wp-theme-electronix-hub,
  body.wp-theme-electronix-hub-5 {
    padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
  }
}

@media (min-width: 961px) {
  .eh-nav__list .menu-item-has-children {
    position: relative;
  }

  .eh-nav__list .sub-menu {
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    min-width: 11rem;
    padding: 0.4rem;
    border-radius: 0.65rem;
    border: 1px solid rgba(91, 126, 240, 0.22);
    background: rgba(8, 6, 12, 0.98);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transform: translateY(0.35rem);
    transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
    z-index: 20;
    list-style: none;
    margin: 0;
  }

  .eh-nav__list .menu-item-has-children:hover > .sub-menu,
  .eh-nav__list .menu-item-has-children:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}
