/* Mobile / iPad header menu + fixed cart (max-width: 1024px) */

.cmh-mobile-only,
.cmh-mobile-menu__head,
.cmh-mobile-accordion__btn,
.cmh-mobile-accordion__panel {
  display: none !important;
}

.cmh-mobile-overlay {
  display: none;
}

/* Desktop: keep #mobile-cart hidden (default theme shows it under 767) */
#mobile-cart {
  display: none !important;
}

@media (max-width: 1024px) {
  .cmh-nav-col {
    position: static;
    flex: 0 0 0;
    max-width: 0;
    width: 0;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible;
  }

  .cmh-header-row > .col-sm-3.col-6 {
    flex: 0 0 50%;
    max-width: 50%;
    width: 50%;
  }

  .cmh-mobile-only {
    display: list-item !important;
  }

  .cmh-hide-on-mobile {
    display: none !important;
  }

  .cmh-desktop-cat-link,
  .cmh-mega-menu {
    display: none !important;
  }

  .cmh-mobile-menu__head {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #efe8f6;
    background: linear-gradient(180deg, #faf7fd 0%, #fff 100%);
  }

  .cmh-mobile-menu__head span {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary_color);
    letter-spacing: 0.02em;
  }

  .cmh-mobile-menu__close {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 6px;
    background: #f3ebf9;
    color: var(--primary_color);
    font-size: 14px;
    cursor: pointer;
  }

  .cmh-mobile-accordion__btn {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px 16px;
    border: 0;
    background: transparent;
    color: #333 !important;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
  }

  .cmh-mobile-accordion--nested > .cmh-mobile-accordion__btn {
    padding: 10px 16px 10px 24px;
    font-size: 14px;
    font-weight: 600;
    color: #444 !important;
    width: 100%;
  }

  .cmh-mobile-accordion__btn i {
    font-size: 10px;
    color: var(--primary_color);
    transition: transform 0.25s ease;
    float: right !important;
  }

  .cmh-mobile-accordion.is-open > .cmh-mobile-accordion__btn i {
    transform: rotate(180deg);
  }

  .cmh-mobile-accordion.is-open > .cmh-mobile-accordion__panel {
    display: block !important;
  }

  .cmh-mobile-cat-scroll {
    max-height: 44vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-top: 1px solid #efe8f6;
    border-bottom: 1px solid #efe8f6;
  }

  .cmh-mobile-sub {
    list-style: none;
    margin: 0;
    padding: 0 0 4px !important;
    background: #fbf9fd;
  }

  .cmh-mobile-sub--child > li {
    display:block !important;
  }

  .cmh-mobile-sub--child > li > a {
    display: block;
    padding: 8px 16px 8px 36px;
    font-size: 15px !important;
    font-weight: 500;
    line-height: 1.35;
    color: #666 !important;
  }

  .cmh-mobile-cat-scroll .cmh-mobile-sub--child > li > a {
    padding-left: 24px;
    font-size: 14px;
    font-weight: 400;
    color: #555 !important;
  }

  .cmh-mobile-sub--child > li > a:hover {
    color: var(--primary_color) !important;
    background: #f3ebf9;
  }

  .cmh-mobile-viewall {
    display: block !important;
    margin: 30px 16px 14px;
    padding: 10px 14px !important;
    text-align: center;
    border-radius: 6px;
    background: var(--primary_color);
    color: #fff !important;
    font-size: 13px !important;
    font-weight: 600 !important;
  }

  header {
    padding: 14px 0;
    margin-bottom: 16px;
    position: relative;
    z-index: 1000;
  }

  .custom-pad {
    padding: 0 16px !important;
  }

  .logo__sec img {
    width: 85%;
    max-width: 160px;
  }

  .head__icon__tp {
    text-align: right;
  }

  .head__icon__tp ul {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin: 0;
    padding: 0 !important;
  }

  .head__icon__tp ul li {
    padding: 0;
  }

  .cmh-hamburger {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 5px;
    background: #f8f8f8;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    padding: 0;
    z-index: 10;
    -webkit-tap-highlight-color: transparent;
  }

  .cmh-hamburger span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--primary_color);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
    pointer-events: none;
  }

  .cmh-hamburger.is-active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .cmh-hamburger.is-active span:nth-child(2) {
    opacity: 0;
  }

  .cmh-hamburger.is-active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* Same header menu becomes mobile drawer */
  .menu__sec {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    width: min(340px, 88vw);
    height: 100%;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff;
    z-index: 10060;
    transform: translateX(-105%);
    transition: transform 0.3s ease;
    box-shadow: 8px 0 30px rgba(88, 22, 152, 0.12);
    overflow: hidden;
    text-align: left !important;
  }

  .menu__sec.is-open {
    transform: translateX(0);
  }

  .menu__sec > ul {
    list-style: none;
    margin: 0;
    padding: 8px 0 24px !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    display: block !important;
  }

  .menu__sec > ul > li {
    display: block !important;
    float: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .menu__sec > ul > li > a {
    display: block !important;
    padding: 15px 16px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    color: #333 !important;
    background: transparent !important;
    border-bottom: 1px solid #c1c1c1;
  }

  .menu__sec > ul > li > a.cmh-desktop-cat-link,
  .menu__sec .cmh-mega-menu {
    display: none !important;
  }

  .menu__sec > ul > li > a:hover {
    color: var(--primary_color) !important;
    background: #faf7fd !important;
  }

  .cmh-mobile-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(30, 20, 45, 0.45);
    z-index: 10050;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
  }

  .cmh-mobile-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  /* Fixed cart - override default yellow styles */
  #mobile-cart {
    display: block !important;
    position: fixed !important;
    right: 14px !important;
    bottom: 22px !important;
    top: auto !important;
    left: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    z-index: 9990 !important;
  }

  #mobile-cart .single-icon {
    position: relative;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--primary_color) !important;
    color: #fff !important;
    font-size: 20px;
    box-shadow: 0 8px 20px rgba(88, 22, 152, 0.28);
    text-decoration: none !important;
  }

  #mobile-cart .total-count {
    position: absolute !important;
    top: -4px !important;
    right: -4px !important;
    min-width: 20px;
    height: 20px;
    line-height: 20px;
    padding: 0 5px;
    border-radius: 100%;
    background: #3aafde !important;
    color: #fff !important;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
  }

  body.cmh-mobile-open {
    overflow: hidden;
  }

  li.cmh-mobile-accordion.cmh-mobile-accordion--nested {
    display: block;
}
}
