/* ===== 1. SCOPE & RESET ===== */
body:is(.products_grid, .products_search_grid),
body:is(.products_list, .products_search_list) {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #1c1c1e;
}
body:is(.products_grid, .products_search_grid) *,
body:is(.products_list, .products_search_list) * { box-sizing: border-box; }

body:is(.products_grid, .products_search_grid) .products-grid .card {
  background: none;
  border-radius: 0;
  padding: 0;
  margin-bottom: 0;
  box-shadow: none;
}

body:is(.products_grid, .products_search_grid) .breadcrumb,
body:is(.products_grid, .products_search_grid) .well,
body:is(.products_grid, .products_search_grid) h1.top,
body:is(.products_grid, .products_search_grid) .form-products-per-page,
body:is(.products_grid, .products_search_grid) .product-filters-select-view-type,
body:is(.products_grid, .products_search_grid) .pagination-left,
body:is(.products_list, .products_search_list) .breadcrumb,
body:is(.products_list, .products_search_list) .well,
body:is(.products_list, .products_search_list) h1.top,
body:is(.products_list, .products_search_list) .form-products-per-page,
body:is(.products_list, .products_search_list) .product-filters-select-view-type,
body:is(.products_list, .products_search_list) .pagination-left,
body:is(.products_list, .products_search_list) label[for="addressbook_id"],
body:is(.products_list, .products_search_list) .plp-orig-hidden {
  display: none !important;
}

/* ===== 2. HEADER CARD ===== */
.plp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #ffffff;
  border: 1px solid #e6e6e9;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(16,16,20,.04);
  padding: 18px 22px;
  margin-bottom: 14px;
}
.plp-head-left { display: flex; align-items: center; gap: 16px; min-width: 0; }
.plp-head-tools { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.plp-head-thumb {
  width: 74px; height: 50px; flex: 0 0 auto;
  border-radius: 8px; object-fit: contain; background: #faf7ef;
}
.plp-head-text { min-width: 0; }
.plp-head-title {
  font-size: 22px; font-weight: 700; line-height: 1.1; margin: 0 0 4px;
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.plp-head-count { font-size: 14px; font-weight: 400; color: #8a8a8f; }
.plp-head-sub { font-size: 14px; color: #8a8a8f; margin: 0; }

/* ===== 2a. SORT DROPDOWN ===== */
.plp-sort {
  position: relative; flex: 0 0 auto;
}
.plp-sort-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: #ffffff; border: 1px solid #e6e6e9;
  border-radius: 10px; padding: 10px 14px; cursor: pointer;
  font-size: 14px; color: #1c1c1e; white-space: nowrap;
  transition: border-color .15s;
}

.plp-sort-btn:focus,
.plp-sort-btn:active,
.plp-sort.open .plp-sort-btn { border-color: #93117E; outline: none; }
.plp-sort-btn .plp-sort-ico { font-size: 15px; color: #8a8a8f; }
.plp-sort-btn .plp-caret { margin-left: 2px; color: #8a8a8f; transition: transform .15s; }
.plp-sort.open .plp-caret { transform: rotate(180deg); }
/* Lives in <body>; the JS sets top/left/width from the button's position */
.plp-sort-menu {
  position: fixed;
  background: #fff; border: 1px solid #e6e6e9;
  border-radius: 10px; box-shadow: 0 8px 28px rgba(16,16,20,.12);
  padding: 6px; min-width: 220px; z-index: 1050; display: none;
  max-height: 320px; overflow-y: auto;
}
.plp-sort-menu.open { display: block; }
.plp-sort-menu button {
  display: block; width: 100%; text-align: left; border: 0; background: none;
  padding: 9px 12px; border-radius: 7px; font-size: 14px; cursor: pointer; color: #1c1c1e;
  font-family: inherit; white-space: nowrap;
}
.plp-sort-menu button { transition: background-color .12s, color .12s; }
.plp-sort-menu button:hover { background: #F4E7F2; color: #860F73; }
.plp-sort-menu button:focus,
.plp-sort-menu button:active { background: #EFDBEC; color: #5B0B4F; outline: none; }
.plp-sort-menu button.active { background: #faeef5; color: #93117E; font-weight: 600; }

/* ===== 2b. VIEW TOGGLE (Photos / List) ===== */
.plp-view-toggle {
  display: inline-flex; align-items: center;
  border: 1px solid #e6e6e9; border-radius: 10px;
  background: #fff; padding: 3px; gap: 2px; flex: 0 0 auto;
}
.plp-view-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 34px; border-radius: 8px;
  color: #8a8a8f; text-decoration: none; cursor: pointer;
  transition: background .15s, color .15s;
}
.plp-view-btn:hover { background: #F4E7F2; color: #860F73; }
.plp-view-btn.active { background: #faeef5; color: #93117E; }
.plp-view-btn .plp-view-ico { display: block; }

/* ===== 3. CATEGORY BAR ===== */
.plp-catbar {
  position: relative;
  background: #ffffff;
  border: 1px solid #e6e6e9;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(16,16,20,.04);
  padding: 10px 12px 16px;   /* +4px on .plp-catbar-scroll = same visual spacing as before */
  margin-bottom: 18px;
}
.plp-catbar-scroll {
  display: flex; align-items: center; gap: 10px;
  overflow-x: auto;   /* no scroll-behavior:smooth -- it made the thumb lag behind drags */
  padding: 4px 4px 8px;   /* room for the focus ring; the scroller clips anything outside */
  -ms-overflow-style: none; scrollbar-width: none;
}
.plp-catbar-scroll::-webkit-scrollbar { display: none; }
.plp-pill {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px;
  border: 2px solid var(--Colors-Borders-borderOpaque, #E3E3E3); background: #fff;
  border-radius: 999px; padding: 8px 16px; font-size: 14px;   /* 2px border: 1px off vertical padding keeps the 41px height */
  color: #6A6A6A; cursor: pointer; text-decoration: none; white-space: nowrap;
  text-underline-offset: 3px;
  transition: border-color .15s, background .15s, color .15s, box-shadow .15s;
}
button.plp-pill { font-family: inherit; line-height: inherit; -webkit-appearance: none; appearance: none; }

/* Variants (rested) */
.plp-pill.active { border-color: #93117E; color: #93117E; font-weight: 600; }
.plp-pill.plp-pill-all { border-color: #EFDBEC; color: #93117E; font-weight: 600; }
.plp-pill-all .plp-pill-ico { width: 18px; height: 18px; display: block; flex: 0 0 auto; }

/* States -- declared after the variants so they win for every chip */
/* Hover & pressed: brand border, 2px white gap (inset shadow), tinted fill */
.plp-pill:hover {
  background: #F4E7F2; color: #93117E;
  border-color: var(--Colors-Borders-borderBrand, #93117E);
  box-shadow: inset 0 0 0 2px #fff;
  text-decoration: underline;
}
.plp-pill:active {
  background: #EFDBEC; color: #5B0B4F;
  border-color: var(--Colors-Borders-borderBrandDark, #5B0B4F);
  box-shadow: inset 0 0 0 2px #fff;
  text-decoration: underline;
}
/* Keyboard focus only: a ring, not the pressed look */
.plp-pill:focus { outline: none; }
.plp-pill:focus-visible { outline: 2px solid #93117E; outline-offset: 2px; }

/* Scrollbar: grey track, black thumb that follows the pills (positioned by JS) */
.plp-catbar-track {
  position: absolute; left: 16px; right: 16px; bottom: 8px;
  height: 3px; border-radius: 3px;
  background: #ececef;
  cursor: pointer;
  touch-action: none;
}
/* Larger invisible hit area so the 3px bar is easy to grab */
.plp-catbar-track::before {
  content: ""; position: absolute; left: 0; right: 0; top: -6px; bottom: -6px;
}
.plp-catbar-thumb {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 46px;
  background: #1c1c1e; border-radius: 3px;
  cursor: grab;
  transition: height .12s, top .12s;
  will-change: transform;
}
.plp-catbar-track:hover .plp-catbar-thumb,
.plp-catbar--dragging .plp-catbar-thumb { top: -1px; bottom: -1px; }
.plp-catbar--dragging,
.plp-catbar--dragging .plp-catbar-thumb { cursor: grabbing; user-select: none; }
/* Everything fits: no scrollbar, no arrow */
.plp-catbar--static .plp-catbar-track { display: none; }
.plp-catbar-next.is-hidden { display: none; }
.plp-catbar-next {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 999px;
  border: 1px solid #e6e6e9; background: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(16,16,20,.08); z-index: 5;
}
.plp-catbar-next:hover { background: #faf3f8; border-color: #93117E; }
.plp-catbar-next-ico { width: 16px; height: 16px; display: block; }

/* ===== 3b. ALL-CATEGORIES DRAWER ===== */
.plp-cat-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(16,16,20,.35);
  opacity: 0; visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}
.plp-cat-overlay.open { opacity: 1; visibility: visible; }

/* Fixed to the viewport height: header stays put, the list scrolls */
.plp-cat-drawer {
  position: fixed; top: 0; left: 0; z-index: 2001;
  height: 100vh; height: 100dvh;
  width: 380px; max-width: 90vw;
  background: #fff;
  display: flex; flex-direction: column;
  box-shadow: 4px 0 28px rgba(16,16,20,.16);
  transform: translateX(-100%); visibility: hidden;
  transition: transform .25s ease, visibility .25s ease;
}
.plp-cat-drawer.open { transform: none; visibility: visible; }

.plp-cat-drawer-head {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid #e6e6e9;
}
.plp-cat-drawer-title { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.2; color: #1c1c1e; }
.plp-cat-close {
  background: none; border: 0; padding: 0 4px; cursor: pointer;
  font-size: 30px; line-height: 1; color: #1c1c1e;
}
.plp-cat-close:focus-visible { outline: 2px solid #93117E; outline-offset: 2px; border-radius: 4px; }

.plp-cat-list {
  position: relative; flex: 1 1 auto; min-height: 0;
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: 10px 0 16px;
}
.plp-cat-item {
  display: block; padding: 12px 20px;
  border-left: 4px solid transparent;
  font-size: 16px; line-height: 1.35; color: #1c1c1e; text-decoration: none;
  transition: background .12s;
}
.plp-cat-item:hover,
.plp-cat-item:focus-visible { background: #F4E7F2; color: #860F73; text-decoration: none; outline: none; }
.plp-cat-item.active { background: #faeef5; border-left-color: #93117E; color: #93117E; font-weight: 600; }
.plp-cat-depth-1 { padding-left: 36px; font-size: 15px; }
.plp-cat-depth-2 { padding-left: 52px; font-size: 15px; }
.plp-cat-depth-3 { padding-left: 68px; font-size: 14px; }
.plp-cat-empty { margin: 0; padding: 12px 20px; color: #8a8a8f; }

body.plp-cat-lock { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .plp-cat-drawer, .plp-cat-overlay { transition: none; }
}

body:is(.products_grid, .products_search_grid) .products-grid { margin: 0; display: block; }

/* ===== 4. PRODUCT GRID + CARDS ===== */
body:is(.products_grid, .products_search_grid) .products-grid > form,
body:is(.products_grid, .products_search_grid) form#add-products-multiple-form {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin: 0;
}

body:is(.products_grid, .products_search_grid) .products-grid > form > input[type="hidden"],
body:is(.products_grid, .products_search_grid) form#add-products-multiple-form > input[type="hidden"] {
  display: none !important;
}

@media (max-width: 1400px){ body:is(.products_grid, .products_search_grid) .products-grid > form, body:is(.products_grid, .products_search_grid) form#add-products-multiple-form { grid-template-columns: repeat(4,1fr);} }
@media (max-width: 992px){  body:is(.products_grid, .products_search_grid) .products-grid > form, body:is(.products_grid, .products_search_grid) form#add-products-multiple-form { grid-template-columns: repeat(3,1fr);} }
@media (max-width: 680px){  body:is(.products_grid, .products_search_grid) .products-grid > form, body:is(.products_grid, .products_search_grid) form#add-products-multiple-form { grid-template-columns: repeat(2,1fr);} }

/* Same structure detection in pure CSS, so the grid is right from the first
   paint, before dropxl-plp.js has run (it only runs after window load).
   ITEMS = the element whose children are the column wrappers holding cards. */
body:is(.products_grid, .products_search_grid) :is(form, div):has(> [class*="col-"] > .card-product) {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: 12px;
  width: 100% !important; max-width: 100% !important;
  margin: 0 !important; padding: 0 !important;
  float: none !important;
}
body:is(.products_grid, .products_search_grid) :is(form, div):has(> [class*="col-"] > .card-product)::before,
body:is(.products_grid, .products_search_grid) :is(form, div):has(> [class*="col-"] > .card-product)::after { display: none !important; }
body:is(.products_grid, .products_search_grid) :is(form, div):has(> [class*="col-"] > .card-product) > :is(input[type="hidden"], br, .clearfix) { display: none !important; }
/* Wrappers between the page and that element: plain full-width blocks. */
body:is(.products_grid, .products_search_grid) :is(.products-grid, #add-products-multiple-form, .products-grid div, #add-products-multiple-form div):has(.card-product):not(:has(> .card-product)):not(:has(> [class*="col-"] > .card-product)) {
  display: block !important;
  width: 100% !important; max-width: 100% !important;
  float: none !important;
  margin-left: 0 !important; margin-right: 0 !important;
  padding-left: 0 !important; padding-right: 0 !important;
  grid-template-columns: none !important;
}
/* The cells themselves, whatever col-* classes they carry. */
body:is(.products_grid, .products_search_grid) [class*="col-"]:has(> .card-product) {
  width: 100% !important; max-width: 100% !important; min-width: 0 !important;
  float: none !important; padding: 0 !important; margin: 0 !important;
  display: flex !important; flex: 0 0 auto !important;
  align-items: stretch !important;
}
@media (max-width: 1400px){ body:is(.products_grid, .products_search_grid) :is(form, div):has(> [class*="col-"] > .card-product) { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; } }
@media (max-width: 992px){  body:is(.products_grid, .products_search_grid) :is(form, div):has(> [class*="col-"] > .card-product) { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; } }
@media (max-width: 680px){  body:is(.products_grid, .products_search_grid) :is(form, div):has(> [class*="col-"] > .card-product) { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 0; } }

/* Structure tagged by the JS (works whatever wrappers the page has).
   Wrappers around the cells: plain full-width blocks. */
body:is(.products_grid, .products_search_grid) .plp-grid-shell:not(.plp-grid-items) {
  display: block !important;
  width: 100% !important; max-width: 100% !important;
  float: none !important;
  margin-left: 0 !important; margin-right: 0 !important;
  padding-left: 0 !important; padding-right: 0 !important;
  grid-template-columns: none !important;
}
/* The element that directly holds the cells is the grid. */
body:is(.products_grid, .products_search_grid) .plp-grid-items {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: 12px;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
}
body:is(.products_grid, .products_search_grid) .plp-grid-items::before,
body:is(.products_grid, .products_search_grid) .plp-grid-items::after { display: none !important; } /* bootstrap .row clearfix would take a grid cell */
body:is(.products_grid, .products_search_grid) .plp-grid-items > :is(input[type="hidden"], br, .clearfix, [class*="visible-"], :empty):not(.plp-grid-cell) { display: none !important; }
body:is(.products_grid, .products_search_grid) .plp-grid-cell {
  width: 100% !important; max-width: 100% !important; min-width: 0 !important;
  float: none !important; padding: 0 !important; margin: 0 !important;
  display: flex !important; flex: 0 0 auto !important;
  align-items: stretch !important;
}
body:is(.products_grid, .products_search_grid) .plp-grid-cell > .card-product { width: 100%; }

@media (max-width: 1400px){ body:is(.products_grid, .products_search_grid) .plp-grid-items { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; } }
@media (max-width: 992px){  body:is(.products_grid, .products_search_grid) .plp-grid-items { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; } }
@media (max-width: 680px){  body:is(.products_grid, .products_search_grid) .plp-grid-items { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 0; } }

body:is(.products_grid, .products_search_grid) .products-grid .col-xs-6,
body:is(.products_grid, .products_search_grid) .products-grid .col-sm-4,
body:is(.products_grid, .products_search_grid) .products-grid .col-md-3 {
  width: 100% !important; max-width: 100% !important; min-width: 0 !important;
  float: none !important; padding: 0 !important;
  display: flex !important; flex: 0 0 auto !important;
  align-items: stretch !important;
}
body:is(.products_grid, .products_search_grid) .products-grid .col-xs-6 > .card-product { width: 100%; }

body:is(.products_grid, .products_search_grid) .products-grid .card-product {
  background: #ffffff;
  border: 1px solid #e6e6e9;
  border-radius: 14px;
  overflow: hidden;
  margin: 0;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: 100%;

  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  flex: 1 1 auto !important;
  transition: border-color .15s;
}

body:is(.products_grid, .products_search_grid) .products-grid .card-product:hover {
  border-color: #828282 !important;
}
body:is(.products_grid, .products_search_grid) .products-grid .card-product:focus,
body:is(.products_grid, .products_search_grid) .products-grid .card-product:focus-within,
body:is(.products_grid, .products_search_grid) .products-grid .card-product:active {
  border-color: #454545 !important;
}

/* The theme gives the image wrappers a fixed height. Our image scales with
   the card width, so on wide screens it outgrew that box and spilled over
   the title. Wrappers now size to their content, and the 4:3 frame lives on
   .thumb so the image can never be taller than the space it reserves. */
body:is(.products_grid, .products_search_grid) .card-image {
  display: block !important;
  position: relative !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  flex: 0 0 auto !important;
  align-self: stretch !important;
  margin: 0 !important;
  padding: 14px 14px 0 !important;
  overflow: visible !important;
}
body:is(.products_grid, .products_search_grid) .card-image > div {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
}
body:is(.products_grid, .products_search_grid) .card-image .thumb {
  display: block !important;
  position: relative !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden !important;
}

body:is(.products_grid, .products_search_grid) .card-image .thumb,
body:is(.products_grid, .products_search_grid) .card-image .thumb:hover,
body:is(.products_grid, .products_search_grid) .card-image .thumb:focus,
body:is(.products_grid, .products_search_grid) .card-image .thumb:active {
  outline: none !important;
  box-shadow: none !important;
  cursor: default !important;
  text-decoration: none !important;
}
body:is(.products_grid, .products_search_grid) .card-image img {
  position: static !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: none !important;
  margin: 0 !important;
  object-fit: contain;
  background: #fff;
  display: block !important;
  outline: none !important;
}
body:is(.products_grid, .products_search_grid) .card-image img:hover,
body:is(.products_grid, .products_search_grid) .card-image img:focus {
  outline: none !important;
  box-shadow: none !important;
  transform: none !important;
}

body:is(.products_grid, .products_search_grid) .card-content {
  position: relative !important;
  margin: 0 !important;
  height: auto !important;
  width: 100% !important;
  align-self: stretch !important;
  flex: 1 1 auto !important;
  border-radius: 8px;
  padding: 16px !important;
  display: flex !important; flex-direction: column !important;
  align-items: flex-start !important; gap: 12px;
  transition: background-color .15s;
}

body:is(.products_grid, .products_search_grid) .products-grid .card-product:hover .card-content {
  background: #F5F5F5;
}
body:is(.products_grid, .products_search_grid) .products-grid .card-product:focus .card-content,
body:is(.products_grid, .products_search_grid) .products-grid .card-product:focus-within .card-content,
body:is(.products_grid, .products_search_grid) .products-grid .card-product:active .card-content {
  background: #E3E3E3;
}

body:is(.products_grid, .products_search_grid) .plp-brand,
body:is(.products_grid, .products_search_grid) .card-title {
  width: 100%;
  align-self: stretch;
  margin: 0 !important;
  padding: 0 !important;
  text-align: left !important;
}

body:is(.products_grid, .products_search_grid) .plp-brand {
  font-size: 12px; color: #9a9aa0; line-height: 1; letter-spacing: .2px;
}
body:is(.products_grid, .products_search_grid) .card-title a {
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px; font-weight: 600; font-style: normal;
  color: #000; line-height: 150%;
  text-decoration: none;

  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; text-overflow: ellipsis; min-height: 48px;
}
body:is(.products_grid, .products_search_grid) .card-title a:hover { color: #93117E; }

body:is(.products_grid, .products_search_grid) .footer { margin-top: auto !important; }

body:is(.products_grid, .products_search_grid) .price,
body:is(.products_grid, .products_search_grid) .qty-discount-prices .dropdown-toggle {
  color: #048259 !important;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px; font-weight: 700; font-style: normal;
  line-height: 150%;
  letter-spacing: 0.019px;
}

/* ===== 4c. PRODUCT LIST VIEW ===== */
.plp-list {
  background: #ffffff;
  border: 1px solid #e6e6e9;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(16,16,20,.04);
  overflow: hidden;
}
/* Header must mirror the row's own gap + thumbnail width, otherwise every
   column label sits ~60px (3 gaps) to the left of the data underneath it. */
.plp-list-head {
  display: flex; align-items: center; gap: 20px;
  padding: 18px 24px;
  border-bottom: 1px solid #ececef;
  font-size: 14px; color: #8a8a8f;
}
.plp-list-head-thumb { flex: 0 0 auto; width: 88px; }
.plp-list-head-product { flex: 1 1 auto; min-width: 0; }
.plp-list-head-code { flex: 0 0 auto; width: 180px; }
.plp-list-head-status { flex: 0 0 auto; width: 150px; }
.plp-list-head-price { flex: 0 0 auto; width: 220px; }

.plp-list-body { display: block; }

.plp-list-row {
  display: flex; align-items: center; gap: 20px;
  padding: 16px 24px;
  border-bottom: 1px solid #ececef;
  text-decoration: none; color: inherit;
  transition: background .15s;
}
.plp-list-body .plp-list-row:last-child { border-bottom: 0; }
.plp-list-row:hover { background: #F5F5F5; }
.plp-list-row:focus,
.plp-list-row:active { background: #E3E3E3; outline: none; }

.plp-list-thumb {
  flex: 0 0 auto;
  width: 88px; height: 66px;
  border: 1px solid #ececef; border-radius: 10px;
  background: #fff; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.plp-list-thumb img {
  max-width: 100%; max-height: 100%;
  object-fit: contain; display: block;
}

.plp-list-info { flex: 1 1 auto; min-width: 0; }
.plp-list-brand {
  font-size: 12px; color: #9a9aa0; line-height: 1;
  letter-spacing: .2px; margin-bottom: 4px;
}
.plp-list-name {
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px; font-weight: 600; color: #000; line-height: 1.4;
}
.plp-list-row:hover .plp-list-name { color: #93117E; }
.plp-list-name-brand { display: none; }   /* shown inline on mobile */

/* Availability column -- no header label, mirrors the default storefront column */
.plp-list-status {
  flex: 0 0 auto; width: 150px;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px; color: #1c1c1e; line-height: 150%;
}
.plp-list-status.out { color: #c0392b; }

.plp-list-code {
  flex: 0 0 auto; width: 180px;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px; font-weight: 600; color: #1c1c1e;
  line-height: 150%;
}
.plp-list-code-num { display: block; }
.plp-list-ean { display: block; font-size: 12px; font-weight: 400; color: #8a8a8f; }

.plp-list-price {
  flex: 0 0 auto; width: 220px;
  color: #048259;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px; font-weight: 700; line-height: 150%;
  letter-spacing: 0.019px;
}

/* ===== 5. PAGINATION BAR ===== */
.plp-pager {
  margin: 24px 0 8px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  align-self: stretch;
}
.plp-pager-row {
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  gap: 8px;
  padding: 16px;
  border-radius: 8px;
  background: #FFF;
  align-self: stretch;
}

.plp-pager-controls {
  display: flex; justify-content: center; align-items: center;
  gap: 16px;
}
.plp-pg-btn {
  width: 40px; height: 40px; border-radius: 8px;
  border: 1px solid #e6e6e9; background: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: #1c1c1e;
  text-decoration: none; font-size: 14px;
  transition: background .15s, border-color .15s;
}
.plp-pg-btn:hover { background: #F5F5F5; border-color: #E3E3E3; }
.plp-pg-btn:focus,
.plp-pg-btn:active { background: #E3E3E3; border-color: #E3E3E3; outline: none; }
.plp-pg-btn.disabled { opacity: .4; pointer-events: none; }

.plp-pg-btn .plp-pg-ico { width: 18px; height: 18px; display: block; }
.plp-pg-label { font-size: 14px; color: #1c1c1e; padding: 0 2px; }
.plp-pg-input {
  width: 120px; height: 40px; text-align: center; border: 1px solid #e6e6e9;
  border-radius: 8px; font-size: 14px; color: #1c1c1e;
}
.plp-pg-input:focus { outline: none; border-color: #93117E; }
.plp-pg-of { font-size: 14px; color: #1c1c1e; padding: 0 2px; }

.plp-pg-showing {
  font-size: 13px; color: #8a8a8f; white-space: nowrap; text-align: center;
}
.plp-pg-showing b { color: #1c1c1e; }

/* ===== 6. RESPONSIVE / MOBILE ===== */
@media (max-width: 768px) {
  .plp-head {
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px;
  }
  .plp-head-title { font-size: 20px; }
  .plp-head-tools { width: 100%; }
  .plp-sort { flex: 1 1 auto; }
  .plp-sort-btn { width: 100%; justify-content: space-between; }

  .plp-list-head-price,
  .plp-list-price { width: 120px; }
  .plp-list-head-code,
  .plp-list-code { width: 90px; }
  .plp-list-head-status,
  .plp-list-status { width: 110px; font-size: 13px; }
}

@media (max-width: 680px) {

  body:is(.products_grid, .products_search_grid) .products-grid > form,
  body:is(.products_grid, .products_search_grid) form#add-products-multiple-form {
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
  }

  body:is(.products_grid, .products_search_grid) .products-grid .card-product {
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border-right: 1px solid #ececef !important;
    border-bottom: 1px solid #ececef !important;
  }

  body:is(.products_grid, .products_search_grid) .products-grid .col-xs-6:nth-child(2n) .card-product,
  body:is(.products_grid, .products_search_grid) .plp-grid-cell:nth-child(2n of .plp-grid-cell) .card-product {
    border-right: 0 !important;
  }

  body:is(.products_grid, .products_search_grid) .products-grid .card-product:hover,
  body:is(.products_grid, .products_search_grid) .products-grid .card-product:focus,
  body:is(.products_grid, .products_search_grid) .products-grid .card-product:focus-within,
  body:is(.products_grid, .products_search_grid) .products-grid .card-product:active {
    border-color: transparent #ececef #ececef transparent !important;
  }
  body:is(.products_grid, .products_search_grid) .products-grid .col-xs-6:nth-child(2n) .card-product:hover,
  body:is(.products_grid, .products_search_grid) .products-grid .col-xs-6:nth-child(2n) .card-product:focus-within {
    border-right-color: transparent !important;
  }

  body:is(.products_grid, .products_search_grid) .card-image { padding: 12px 12px 0 !important; }
  body:is(.products_grid, .products_search_grid) .card-content { padding: 12px !important; gap: 8px; }

  .plp-catbar { padding: 12px 12px 14px; }
  .plp-catbar-track { left: 12px; right: 12px; }
  .plp-pager-controls { flex-wrap: wrap; gap: 10px; }
  .plp-pg-input { width: 90px; }
  .plp-head-thumb { width: 56px; height: 40px; }

  /* Drawer goes full width on phones */
  .plp-cat-drawer { width: 100%; max-width: 100%; }

  /* List view: image on the left, details stacked on the right */
  .plp-list-head { display: none; }
  .plp-list-row {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    column-gap: 16px; row-gap: 4px;
    align-items: start;
    padding: 16px;
  }
  .plp-list-thumb {
    grid-column: 1; grid-row: 1 / span 4;
    align-self: center;
    width: 104px; height: 104px;
    padding: 6px;
  }
  .plp-list-info,
  .plp-list-code,
  .plp-list-status,
  .plp-list-price { grid-column: 2; width: auto; min-width: 0; }

  .plp-list-brand { display: none; }
  .plp-list-name-brand { display: inline; }
  .plp-list-name {
    font-size: 16px; font-weight: 600; color: #333; line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; text-overflow: ellipsis;
  }
  .plp-list-code { font-size: 14px; font-weight: 700; color: #000; line-height: 1.5; }
  .plp-list-ean { font-size: 13px; line-height: 1.5; margin-top: 2px; }
  .plp-list-status { font-size: 14px; line-height: 1.5; }
  .plp-list-price { font-size: 17px; line-height: 1.5; margin-top: 2px; }
}

body:is(.products_list, .products_search_list) .col-xl-6.col-md-8.addressbook {
	display:none;
}

/* ===== 7. SEARCH RESULTS (body.plp-search, added by the JS) ===== */
.plp-head-count:empty { display: none; }

.plp-head-title--search { font-weight: 400; }
.plp-head-title--search strong { font-weight: 700; }

/* Three equal columns: Product (thumb + name + stock) | Code | Price */
body.plp-search .plp-list-head,
body.plp-search .plp-list-row { gap: 16px; }

body.plp-search .plp-list-head-product,
body.plp-search .plp-list-product,
body.plp-search .plp-list-head-code,
body.plp-search .plp-list-code,
body.plp-search .plp-list-head-price,
body.plp-search .plp-list-price {
  flex: 1 1 0; width: auto; min-width: 0;
}

body.plp-search .plp-list-product { display: flex; align-items: center; gap: 12px; }
body.plp-search .plp-list-thumb { width: 88px; height: 88px; padding: 4px; }

body.plp-search .plp-list-brand { display: none; }
body.plp-search .plp-list-name-brand { display: inline; }
body.plp-search .plp-list-name {
  font-size: 14px; font-weight: 600; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

body.plp-search .plp-list-code { align-self: flex-start; padding-top: 4px; }

body.plp-search .plp-list-price { font-size: 14px; font-weight: 600; }

.plp-list-stock {
  display: flex; align-items: center; gap: 6px;
  margin-top: 6px;
  font-size: 13px; line-height: 1.4; color: #1c1c1e;
}
.plp-list-stock::before {
  content: ""; flex: 0 0 auto;
  width: 8px; height: 8px; border-radius: 50%;
  background: #048259;
}
.plp-list-stock.out { color: #c0392b; }
.plp-list-stock.out::before { background: #c0392b; }

/* Empty search */
.plp-empty {
  background: #fff;
  border: 1px solid #e6e6e9;
  border-radius: 14px;
  padding: 40px 24px;
  text-align: center;
  font-size: 15px; color: #1c1c1e;
}
.plp-empty p { margin: 6px 0 0; color: #8a8a8f; font-size: 14px; }
.plp-list .plp-empty { border: 0; border-radius: 0; }

/* Table never found (unexpected markup): give the native heading back */
body.plp-no-results h1.top { display: block !important; }

@media (max-width: 680px) {
  /* Let thumb + info join the row grid so the mobile layout above applies */
  body.plp-search .plp-list-product { display: contents; }
  body.plp-search .plp-list-thumb { width: 104px; height: 104px; padding: 6px; }
  body.plp-search .plp-list-code { padding-top: 0; }
}
