@media screen and (max-width: 768px) {
    /* Hide a custom element with a specific class */
   .emart/home-v3-category {
        display: none;
    }
}

.wc-block-components-product-sale-badge {
    z-index: 0; /* Adjust this value as needed */
    position: relative; /* Ensure z-index works by setting position */
}


.wp-block-group filter-content {
    z-index:9999; /* Adjust this value as needed */
    position: relative; /* Ensure z-index works by setting position */
}

.wc-block-components-product-sale-badge--align-right {
    z-index: 0; /* Adjust this value as needed */
    position: relative; /* Ensure z-index works by setting position */
}

.wc-block-grid__product-onsale {
    z-index: 0; /* Adjust this value as needed */
    position: relative; /* Ensure z-index works by setting position */
}


@media (max-width: 768px) {
  .header-wrap {
    display: grid !important;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    grid-template-areas: 
      "mega-icon logo actions"
      "search search search";
    gap: 8px;
    align-items: center;
    width: 100% !important;
    box-sizing: border-box;
  }

  /* Max Mega Menu as icon */
  .wp-block-maxmegamenu-location {
    grid-area: mega-icon;
    width: 40px !important;
    height: 40px !important;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .wp-block-maxmegamenu-location > .mega-menu-toggle {
    width: 100%;
    height: 100%;
    padding: 0;
  }
  .wp-block-maxmegamenu-location .mega-menu-toggle .mega-label {
    display: none !important;
  }
  .wp-block-maxmegamenu-location .mega-menu-toggle:before {
    content: "";
    display: block;
    width: 24px;
    height: 3px;
    background: #fff;
    box-shadow: 
      0 8px 0 #fff,
      0 -8px 0 #fff;
  }

  /* Logo alignment */
  .wp-block-image {
    grid-area: logo;
    justify-self: center;
    margin: 0 !important;
    text-align: center;
  }

  /* Cart/account icons */
  .header-action {
    grid-area: actions;
    justify-self: end;
    display: flex;
    gap: 12px;
    margin: 0 !important;
  }

  /* Search bar: relative width/height, centered in bottom row */
  .wp-block-search {
    grid-area: search;
    width: 87% !important;         /* Relative width */
    height: 54px !important;       /* Relative height, adjust as needed */
    min-height: 2.5em;
    max-width: 100%;
    margin: 10px auto 0 auto !important; /* Center horizontally */
    display: flex !important;
    align-items: center;
    justify-content: center;
  }
  .wp-block-search input[type="search"] {
    height: 100% !important;
		/* Make input fill container height */
    font-size: 1em;
  }

    font-size: 1em;
  }

  /* Force search bar visibility */
  .wp-block-search.d-none.d-xl-block {
    display: flex !important;
  }

  /* Height reduction adjustments */
  .relative {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
  }
  .alignwide {
    min-height: auto !important;
  }

  /* Optional: Reduce logo size on very small screens */
  @media (max-width: 480px) {
    .wp-block-image img {
      max-width: 180px;
    }
  }