/* Noor Naksha v1.8.1 - Shop/Product Archive live-UAT hotfix layer.
 * Additive overrides only: preserves the v1.8.0 Shop architecture and homepage behavior.
 */

/* 1) Shop hero stays full-bleed, but its content must use the exact global site container. */
.nn-shop-header-v18 .nn-shop-header-inner-v18{
  width:min(calc(100% - (var(--nn-pad-desktop,32px) * 2)),var(--nn-shell,1320px))!important;
  max-width:100%!important;
  margin-inline:auto!important;
  padding-inline:0!important;
}
.nn-shop-header-align-left .nn-shop-header-copy-v18{margin-left:0!important;margin-right:auto!important;text-align:left!important}
.nn-shop-header-align-left .nn-shop-header-copy-v18 p{margin-left:0!important;margin-right:0!important}
.nn-shop-header-align-center .nn-shop-header-inner-v18{display:flex!important;justify-content:center!important}
.nn-shop-header-align-center .nn-shop-header-copy-v18{margin-inline:auto!important;text-align:center!important}
.nn-shop-header-align-center .nn-shop-header-copy-v18 p{margin-inline:auto!important}
.nn-shop-header-align-right .nn-shop-header-inner-v18{display:flex!important;justify-content:flex-end!important}
.nn-shop-header-align-right .nn-shop-header-copy-v18{margin-left:auto!important;margin-right:0!important;text-align:right!important}
.nn-shop-header-align-right .nn-shop-header-copy-v18 p{margin-left:auto!important;margin-right:0!important}

/* 2) When Noor Naksha toolbar is active, hide WooCommerce's native duplicate count/sort only at body level. */
.nn-shop-toolbar-enabled-v181 .nn-shop-page-v18 .nn-shop-body-v18 > .woocommerce-result-count,
.nn-shop-toolbar-enabled-v181 .nn-shop-page-v18 .nn-shop-body-v18 > .woocommerce-ordering{
  display:none!important;
}

/* 3) Compact desktop toolbar - same visual scale language as the homepage controls. */
.nn-shop-toolbar-v18{
  grid-template-columns:minmax(260px,1fr) auto!important;
  gap:10px!important;
  padding:9px 10px!important;
}
.nn-shop-toolbar-actions-v18{gap:7px!important}
.nn-shop-search-form-v18{min-height:40px!important;width:100%!important}
.nn-shop-search-form-v18 input[type=search]{height:40px!important;min-height:40px!important;padding-top:7px!important;padding-bottom:7px!important;font-size:13px!important}
.nn-shop-search-submit-v18{height:40px!important;min-height:40px!important;min-width:76px!important;padding:0 14px!important;font-size:12px!important}
.nn-shop-filter-button-v18{height:40px!important;min-height:40px!important;padding:0 12px!important;gap:6px!important;font-size:12px!important;line-height:1!important}
.nn-shop-filter-button-v18 .nn-icon{width:14px!important;height:14px!important}
.nn-shop-sort-v18 select{height:40px!important;min-height:40px!important;min-width:136px!important;padding:0 30px 0 10px!important;font-size:12px!important}
.nn-shop-view-toggle-v18{padding:2px!important;gap:2px!important}
.nn-shop-view-toggle-v18 button{width:34px!important;height:34px!important;font-size:17px!important;line-height:1!important}
.nn-shop-count-v18{font-size:11px!important}

/* 4) Drawer safety / no overlap. */
body.nn-no-scroll{overflow:hidden!important}
.nn-shop-filter-backdrop-v18[hidden]{display:none!important}
.nn-shop-filter-backdrop-v18:not([hidden]){display:block!important}
.nn-shop-layout-sidebar-off .nn-shop-filters-v18{max-width:92vw!important}

@media (min-width:1025px){
  .nn-shop-layout-sidebar-left .nn-shop-filters-v18,
  .nn-shop-layout-sidebar-right .nn-shop-filters-v18{
    position:sticky!important;
    right:auto!important;
    left:auto!important;
    top:104px!important;
    bottom:auto!important;
    width:auto!important;
    max-width:none!important;
    border-radius:12px!important;
    overflow:visible!important;
    box-shadow:none!important;
    transform:none!important;
  }
}

@media (max-width:1024px){
  .nn-shop-header-v18 .nn-shop-header-inner-v18{
    width:min(calc(100% - (var(--nn-pad-tablet,22px) * 2)),var(--nn-shell,1320px))!important;
  }
  .nn-shop-toolbar-v18{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:8px!important;padding:8px 9px!important}
  .nn-shop-toolbar-search-v18,.nn-shop-live-search-v18,.nn-shop-search-form-v18{width:100%!important;max-width:none!important}
  .nn-shop-toolbar-actions-v18{width:100%!important;justify-content:flex-start!important;flex-wrap:nowrap!important;gap:7px!important}
  .nn-shop-filter-button-v18,.nn-shop-sort-v18 select{height:39px!important;min-height:39px!important}
  .nn-shop-view-toggle-v18 button{width:33px!important;height:33px!important}
}

@media (max-width:720px){
  /* Match homepage mobile rhythm: full-width search first, compact action row second. */
  .nn-shop-header-v18 .nn-shop-header-inner-v18{
    width:min(calc(100% - (var(--nn-pad-mobile,14px) * 2)),var(--nn-shell,1320px))!important;
  }
  .nn-shop-header-copy-v18{max-width:min(86%,560px)!important;padding:20px 0!important}
  .nn-shop-header-v18 h1{font-size:34px!important;line-height:1!important}
  .nn-shop-header-v18 p{font-size:12px!important;line-height:1.5!important}

  .nn-shop-toolbar-v18{display:flex!important;flex-direction:column!important;width:100%!important;gap:7px!important;padding:8px!important;margin-bottom:12px!important;border-radius:10px!important}
  .nn-shop-toolbar-search-v18,.nn-shop-live-search-v18,.nn-shop-search-form-v18{display:flex!important;width:100%!important;min-width:0!important;max-width:none!important}
  .nn-shop-search-form-v18{min-height:40px!important}
  .nn-shop-search-icon-v18{left:12px!important}
  .nn-shop-search-icon-v18 .nn-icon{width:16px!important;height:16px!important}
  .nn-shop-search-form-v18 input[type=search]{display:block!important;flex:1 1 auto!important;width:100%!important;min-width:0!important;height:40px!important;min-height:40px!important;border-radius:8px!important;padding:8px 10px 8px 36px!important;font-size:14px!important;line-height:1.2!important}
  .nn-shop-search-submit-v18{display:none!important}

  .nn-shop-toolbar-actions-v18{display:grid!important;grid-template-columns:auto minmax(0,1fr) auto!important;align-items:center!important;width:100%!important;gap:6px!important}
  .nn-shop-filter-button-v18{height:36px!important;min-height:36px!important;padding:0 10px!important;border-radius:7px!important;font-size:11px!important}
  .nn-shop-sort-v18{min-width:0!important;width:100%!important}
  .nn-shop-sort-v18 .woocommerce-ordering{width:100%!important}
  .nn-shop-sort-v18 select{display:block!important;width:100%!important;max-width:100%!important;min-width:0!important;height:36px!important;min-height:36px!important;padding:0 26px 0 9px!important;border-radius:7px!important;font-size:11px!important}
  .nn-shop-view-toggle-v18{height:36px!important;padding:2px!important;border-radius:7px!important}
  .nn-shop-view-toggle-v18 button{width:30px!important;height:30px!important;border-radius:5px!important;font-size:15px!important;padding:0!important}
  .nn-shop-count-v18{display:none!important}

  .nn-shop-search-results-v18{left:0!important;right:0!important;top:calc(100% + 6px)!important;width:100%!important;max-height:min(62vh,520px)!important;border-radius:10px!important}

  /* Drawer always overlays on tablet/mobile regardless of desktop sidebar setting. */
  .nn-shop-filters-v18{
    position:fixed!important;
    right:-380px!important;
    left:auto!important;
    top:0!important;
    bottom:0!important;
    width:min(350px,92vw)!important;
    max-width:92vw!important;
    border-radius:0!important;
    z-index:1002!important;
    overflow-y:auto!important;
    transition:right .25s ease!important;
    box-shadow:-18px 0 42px rgba(14,44,35,.15)!important;
  }
  .nn-shop-filters-v18.is-open-v18{right:0!important}
}

@media (max-width:430px){
  .nn-shop-header-v18 .nn-shop-header-inner-v18{width:min(calc(100% - (var(--nn-pad-mobile,14px) * 2)),var(--nn-shell,1320px))!important}
  .nn-shop-toolbar-actions-v18{grid-template-columns:auto minmax(0,1fr) auto!important}
  .nn-shop-filter-button-v18 span{display:inline!important}
  .nn-shop-category-card-v18{min-width:86px!important}
}
