/*
 * Responsive guardrail overrides.
 * Purpose: stabilize mobile layout (320px+) without changing business logic.
 */

:root {
  --nmk-mobile-gutter: 8px;
  --nmk-drawer-width: min(92vw, 360px);
}

/* Keep trusted badge dimensions stable across cards */
img.trusted-img,
.products_view_body img.trusted-img {
  width: 64px !important;
  max-width: 64px !important;
  height: auto !important;
  object-fit: contain;
}

@media (max-width: 991.98px) {
  .nmk-quick-deals ul:first-child {
    margin-left: 0 !important;
  }

  .mobile-list-short {
    padding-right: 0;
  }

  .nmk-categories-cus,
  .nmk-side-nav-mob-footer {
    left: 0;
    width: var(--nmk-drawer-width);
    max-width: calc(100vw - (var(--nmk-mobile-gutter) * 2));
    box-sizing: border-box;
  }

  .nmk-categories-cus {
    padding-bottom: calc(130px + env(safe-area-inset-bottom));
  }

  .nmk-categories-cus.nmk-cat-drop-show,
  .nmk-side-nav-mob-footer.show {
    transform: translateX(0);
  }

  .cus-search-form-wrp-mobile {
    width: min(92vw, 360px) !important;
    max-width: calc(100vw - 16px) !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%);
    box-sizing: border-box;
    padding: 16px;
  }

  .cus-search-form-wrp-mobile.nmk-mob-search-show {
    transform: translateX(-50%);
  }

  .product_thumbnail {
    height: auto;
    min-height: 180px;
  }

  .product_card {
    height: auto;
    min-height: 430px;
  }

  .product_card .product_content {
    height: auto;
    min-height: 200px;
  }

  .popular-products-wrap .popular-products-box {
    height: auto;
    min-height: 420px;
  }

  .popular-products-wrap .popular-products-box img,
  .explore-product .item img,
  .home-products .popular-products-wrap img,
  .recently-viewed.home-products .popular-products-wrap img,
  .trending-products.home-products .popular-products-wrap img,
  .product_thumbnail img,
  .product-inner-img img,
  .product-inner-img-carousel img,
  .similar-product .popular-products-wrap .popular-products-box img,
  .may-like .popular-products-wrap .popular-products-box img,
  .product-inner-recent-view .popular-products-wrap .popular-products-box img,
  .previous-order .popular-products-wrap .popular-products-box img {
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    max-height: 220px;
    object-fit: contain;
  }

  .category_card img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
  }
}

@media (max-width: 575.98px) {
  .nmk-categories-cus,
  .nmk-side-nav-mob-footer {
    max-width: calc(100vw - 8px);
  }

  .cat-parent-wrap li ul {
    padding: 16px 10px 10px;
  }

  .popular-products-wrap .popular-products-box {
    margin-right: 0;
    min-height: 380px;
  }

  .product_card {
    min-height: 390px;
  }

  .product-inner-img,
  .product-inner-img-carousel {
    padding: 20px 12px;
  }

  .product-inner-img img,
  .product-inner-img-carousel img {
    max-height: 240px;
  }
}

@media (max-width: 390px) {
  .cus-search-form-wrp-mobile {
    width: calc(100vw - 12px) !important;
    max-width: calc(100vw - 12px) !important;
    padding: 12px;
  }

  .nmk-categories-cus,
  .nmk-side-nav-mob-footer {
    width: calc(100vw - 6px);
    max-width: calc(100vw - 6px);
  }
}

@media (max-width: 320px) {
  .custom-header .header-top .header-top-left ul li {
    padding-right: 8px;
  }

  .custom-header .header-top .header-top-right ul li {
    padding-left: 10px;
  }

  .cat-parent-wrap li ul li a {
    font-size: 12px;
  }

  .nmk-categories-cus {
    padding-bottom: calc(145px + env(safe-area-inset-bottom));
  }
}
