@media screen and (max-width: 768px) {

    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    .boxes {
        width: 94%;
        margin: 10px auto;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .box-s {
        min-width: 0;
        width: 100%;
        overflow: hidden;
    }

    .box-s h3 {
        font-size: 13px;
        line-height: 1.8;
    }

    .box-s h4 {
        font-size: 11px;
    }

.box-s h5 {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    margin: 4px 0;
}

    .brand-box {
        width: 94%;
        margin: 10px auto;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .brand-box img {
        width: 100%;
        height: 65px;
        object-fit: contain;
    }

}

/* Navbar responsive fix */
@media screen and (max-width: 768px) {
    nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 10000;
    }

    nav .clear {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: nowrap;
        width: 100%;
        min-height: 65px;
        padding: 8px 12px;
        box-sizing: border-box;
    }

    nav .hamburger {
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        position: static !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        width: 32px !important;
        min-width: 32px;
        margin: 0;
        cursor: pointer;
        z-index: 10002;
    }

    nav .hamburger .bar {
        display: block;
        width: 28px;
        height: 3px;
        background-color: var(--color2, #333);
        border-radius: 3px;
    }

    nav .menu-bar-right {
        display: flex;
        align-items: center;
        float: none;
        position: static;
        margin: 0;
        min-width: 0;
    }

    nav .menu-bar-right img {
        position: static !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        width: 75px;
        max-width: 25vw;
        height: auto;
    }

    nav .menu-bar-left {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 75vh;
        overflow-y: auto;
        box-sizing: border-box;
        padding: 12px;
        margin: 0;
        background-color: var(--bgcolor1, #fff);
        flex-direction: column;
        align-items: stretch;
        z-index: 10001;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
    }

    nav .menu-bar-left ul {
        display: flex;
        flex-direction: column;
        width: 100%;
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }

    nav .menu-bar-left li {
        width: 100%;
        box-sizing: border-box;
    }

    nav .menu-bar-left a {
        display: block;
        padding: 10px;
    }

    nav .menu-bar-left .menu {
        width: 100%;
        box-sizing: border-box;
    }
}

@media screen and (max-width: 500px) {
    nav .navbar-search {
        display: none !important;
    }
}


/* Mobile: improve special products and slideshow */
@media screen and (max-width: 768px) {
    .slider-container {
        width: 100%;
        height: 190px;
        overflow: hidden;
        box-sizing: border-box;
    }

    .slider-container .slide {
        width: 100%;
        height: 100%;
    }

    .slider-container .slide img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .body-header {
        margin: 18px 10px 12px;
        text-align: center;
    }

    .body-header .titr {
        margin: 0 0 10px;
        line-height: 1.8;
        overflow-wrap: anywhere;
    }

    .boxes {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        width: 100%;
        padding: 0 10px;
        margin: 12px auto 20px;
        box-sizing: border-box;
    }

    .boxes .box-s {
        width: 100%;
        min-width: 0;
        min-height: 155px;
        margin: 0;
        padding: 16px 8px;
        box-sizing: border-box;
        overflow-wrap: anywhere;
    }

    .boxes .box-s h3 {
        font-size: 16px;
        line-height: 1.7;
    }

    .boxes .box-s h4 {
        font-size: 14px;
        line-height: 1.6;
    }

    .boxes .box-s h5 {
        font-size: 15px;
        line-height: 1.7;
    }
}

/* Mobile header fixes */
@media screen and (max-width: 500px) {
    nav .clear {
        min-height: 0 !important;
        height: auto !important;
        padding: 3px 8px !important;
        gap: 8px;
    }

    nav .menu-bar-right img {
        width: 62px !important;
        max-width: 22vw !important;
        height: auto !important;
    }

    nav .navbar-search {
        display: flex !important;
        flex: 1 1 auto;
        min-width: 0;
        margin: 0 5px !important;
    }

    nav .navbar-search form {
        display: flex;
        width: 70% !important;
        min-width: 0;
        height: 20px !important;
    }

    nav .navbar-search input {
        width: 100%;
        min-width: 0;
        font-size: 12px !important;
        padding: 0 8px !important;
    }

    nav .navbar-search button {
        width: 32px !important;
        flex-shrink: 0;
    }

    nav .mobile-search-toggle {
        display: none !important;
    }

    .body-header {
        margin-top: 12px !important;
        margin-bottom: 8px !important;
        padding: 0 6px;
    }

    .body-header .titr,
    .body-header .titr span {
        margin: 0 !important;
        font-size: 16px !important;
        line-height: 1.5 !important;
        white-space: nowrap !important;
    }

    .body-header > a {
        white-space: nowrap;
        font-size: 12px;
    }
}

/* Search beside logo on mobile only */
@media screen and (max-width: 500px) {
    .search .search- {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
        width: 100% !important;
        margin: 0px 0 !important;
        padding: 0 10px !important;
        box-sizing: border-box !important;
    }

    .search .search- .mobile-home-search {
        display: flex !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        max-width: 300px !important;
        height: 36px !important;
        margin: 0 !important;
    }

    .search .search- img {
        display: block !important;
        flex: 0 0 68px !important;
        width: 68px !important;
        max-width: 68px !important;
        height: auto !important;
    }

    .mobile-home-search input {
        flex: 1 1 auto !important;
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        font-size: 12px !important;
    }

    .mobile-home-search button {
        flex: 0 0 34px !important;
        width: 34px !important;
    }

    nav .navbar-search {
        display: none !important;
    }

    nav .mobile-search-toggle {
        display: none !important;
    }
}


@media screen and (max-width: 500px) {
  nav .navbar-search {
    display: none !important;
  }

  .search .search- {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: 100% !important;
    padding: 0 10px !important;
    box-sizing: border-box !important;
  }

  .search .search- img {
    flex: 0 0 70px !important;
    width: 70px !important;
    max-width: 70px !important;
    height: auto !important;
  }

  .search .search- .mobile-home-search {
    display: flex !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 38px !important;
    margin: 0 !important;
  }

  .mobile-home-search input {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .mobile-home-search button {
    flex: 0 0 34px !important;
    width: 34px !important;
  }
}

/* Final mobile-only logo and search layout */
@media screen and (max-width: 500px) {

    /* Hide the upper navbar search */
    nav .navbar-search,
    nav .mobile-search-toggle {
        display: none !important;
    }

    /* Logo and homepage search in one row */
    main .search > .search- {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 3px !important;
        width: 100% !important;
        margin: 0px 0 !important;
        padding: 0 10px !important;
        box-sizing: border-box !important;
    }

    main .search > .search- > img {
        display: block !important;
        flex: 0 0 65px !important;
        width: 65px !important;
        max-width: 65px !important;
        height: auto !important;
        margin: 0 !important;
        object-fit: contain !important;
    }

    main .search > .search- > .mobile-home-search {
        display: flex !important;
        flex: 1 1 0 !important;
        min-width: 0 !important;
        max-width: none !important;
        height: 38px !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    main .mobile-home-search input {
        flex: 1 1 auto !important;
        width: 0 !important;
        min-width: 0 !important;
        height: 100% !important;
        box-sizing: border-box !important;
        font-size: 12px !important;
    }

    main .mobile-home-search button {
        flex: 0 0 34px !important;
        width: 34px !important;
        height: 100% !important;
    }
}

/* Reduce vertical whitespace around homepage search on mobile */
@media screen and (max-width: 500px) {
    main > .search {
        margin-top: 0px !important;
        margin-bottom: 0px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        height: auto !important;
        min-height: 0 !important;
    }

    main > .search > .search- {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }
}

/* Tighten homepage search spacing on mobile only */
@media screen and (max-width: 500px) {
    main > .search {
        margin: 0 !important;
        padding: 0 !important;
    }

    main > .search > .search- {
        margin:  0 !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    main > .search + .slider-container {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
}

/* Desktop only: hide both search bars added for mobile */
@media screen and (min-width: 501px) {
    nav .navbar-search {
        display: none !important;
    }

    main .search > .search- > .mobile-home-search {
        display: none !important;
    }
}


/* Desktop only: hide homepage search under logo */
@media screen and (min-width: 769px) {
    main .search > .search- > .mobile-home-search {
        display: none !important;
    }
}

   .new-search{
    display : flex ;
    flex-direction : row ;
}


/* ===== Final mobile navbar search ===== */

@media screen and (min-width: 501px) {
    nav .navbar-search {
        display: flex !important;
        align-items: center !important;
    }

    nav .navbar-search form {
        display: flex !important;
    }

    nav .mobile-search-toggle {
        display: none !important;
    }
}

@media screen and (max-width: 500px) {
    nav .navbar-search {
        display: flex !important;
        align-items: center !important;
        position: static !important;
        margin: 0 8px !important;
    }

    nav .mobile-search-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border: 0;
        background: transparent;
        color: #333;
        font-size: 22px;
        cursor: pointer;
    }

    nav .navbar-search form {
        display: none !important;
        position: absolute !important;
        top: 100% !important;
        right: 8px !important;
        left: 8px !important;
        width: auto !important;
        height: 48px !important;
        margin: 5px 0 0 !important;
        padding: 5px !important;
        background: white !important;
        box-shadow: 0 3px 10px rgba(0,0,0,.18);
        z-index: 10005 !important;
        box-sizing: border-box !important;
    }

    nav .navbar-search.is-open form {
        display: flex !important;
    }

    nav .navbar-search form input {
        min-width: 0 !important;
        flex: 1 !important;
        width: 100% !important;
    }

    main .search > .search- > .mobile-home-search {
        display: none !important;
    }
}
