/* Shop layout (category + search pages) — ShopFilterSidebar.tsx and the
   pages themselves. Sidebar + results 2-column layout. A small text
   breadcrumb (.sw-shop-breadcrumb) is used here instead of the sitewide
   hero-image breadcrumb strip (display:none'd in sw-product-detail.css per
   an earlier "no breadcrumbs" request) — Shop/Search/Category specifically
   still want a plain "Home / Shop" trail. */
.sw-shop-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  font-size: 12px;
  color: #aaa;
}
.sw-shop-breadcrumb a {
  color: #777;
}
.sw-shop-breadcrumb a:hover {
  color: var(--sw-primary);
}
.sw-shop-breadcrumb .current {
  color: #333;
  font-weight: 600;
}

.sw-shop-intro {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 32px;
}
.sw-shop-intro h1 {
  margin: 0 0 10px;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #1a1a1a;
}
.sw-shop-intro p {
  margin: 0;
  color: #888;
  font-size: 15px;
  line-height: 1.6;
}
.sw-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 720px;
  margin: 0 auto 28px;
  padding: 6px 6px 6px 20px;
  border: 1px solid #e2e2e2;
  border-radius: 999px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.sw-search-bar:focus-within {
  border-color: var(--sw-primary);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.08);
}
.sw-search-bar-icon {
  color: #aaa;
  font-size: 15px;
  flex: 0 0 auto;
}
.sw-search-bar input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  height: 40px;
  font-size: 14px;
  background: transparent;
}
.sw-search-bar-clear {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: #f2f2f2;
  color: #888;
  cursor: pointer;
  font-size: 11px;
}
.sw-search-bar-clear:hover {
  background: #e6e6e6;
}
.sw-search-bar-submit {
  flex: 0 0 auto;
  height: 40px;
  padding: 0 22px;
  border: none;
  border-radius: 999px;
  background: var(--sw-primary);
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}
.sw-search-bar-submit:hover {
  background: var(--sw-primary-hover);
}
.sw-search-bar-submit-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
@media (max-width: 480px) {
  .sw-search-bar {
    padding-left: 14px;
  }
  .sw-search-bar-submit {
    padding: 0 16px;
  }
}

.sw-search-popular-categories {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}
.sw-search-popular-categories a {
  padding: 8px 18px;
  border: 1px solid #e2e2e2;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: #555;
}
.sw-search-popular-categories a:hover {
  border-color: var(--sw-primary);
  color: var(--sw-primary);
}

.sw-shop-intro-tagline {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sw-h2-green, var(--sw-primary));
}

.sw-shop-layout {
  display: flex;
  gap: 28px;
  align-items: flex-start;
}
.sw-shop-sidebar {
  flex: 0 0 260px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: calc(var(--sw-header-height, 140px) + 20px);
  background: #fff;
  border: 1px solid #eee;
  border-radius: 14px;
  box-shadow: 0 4px 18px rgba(20, 30, 50, 0.05);
  padding: 20px;
}
.sw-shop-sidebar-heading {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #999;
}
.sw-shop-sidebar-close {
  display: none;
}
.sw-shop-toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sw-shop-view-toggle {
  display: inline-flex;
  align-items: center;
  border: 1px solid #e2e2e2;
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.sw-shop-view-toggle button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #999;
  font-size: 14px;
  cursor: pointer;
}
.sw-shop-view-toggle button:hover {
  color: var(--sw-primary);
}
.sw-shop-view-toggle button.active {
  background: var(--sw-primary);
  color: #fff;
}
.sw-shop-filter-btn-mobile {
  display: none;
}
/*
 * Permanent sidebar -> compact "Filter" drawer button.
 *
 * This used to switch at max-width:900px, so the 901-1279px tablet-landscape
 * band (iPad landscape, 1024/1180 etc.) kept the full 260px sidebar + 28px
 * gap, leaving a cramped ~600-700px for a 3-column product grid — cards
 * squeezed narrow with a big dead gap next to the sidebar. Extending this
 * breakpoint to 1279px gives that whole tablet range (portrait AND
 * landscape) the full-width grid with a compact horizontal Filter/Sort
 * toolbar instead (ShopToolbar + the .sw-shop-filter-btn-mobile button
 * below), matching a standard modern catalog layout. The permanent sidebar
 * comes back at 1280px+ ("small desktop" and up), where there's enough
 * room for it alongside a comfortable 3-4 column grid.
 */
@media (max-width: 1279px) {
  .sw-shop-layout {
    flex-direction: column;
  }
  .sw-shop-filter-btn-mobile {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 16px;
    border: 1px solid #e2e2e2;
    border-radius: 999px;
    background: #fff;
    color: #333;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
  }
  .sw-shop-filter-btn-mobile:hover {
    border-color: var(--sw-primary);
    color: var(--sw-primary);
  }
  .sw-shop-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(320px, 86vw);
    z-index: 1300;
    background: #fff;
    padding: 20px;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.12);
    border-radius: 0;
    border: none;
  }
  .sw-shop-sidebar.open {
    transform: translateX(0);
  }
  .sw-shop-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(20, 22, 28, 0.5);
    z-index: 1299;
  }
  .sw-shop-sidebar-backdrop.open {
    display: block;
  }
  .sw-shop-sidebar-close {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 700;
  }
  .sw-shop-sidebar-close button {
    border: none;
    background: #f3f3f3;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
  }
}
/* Tablet-landscape toolbar (900-1279px): keep the results title/count and
   the filter/view/sort controls from wrapping onto cramped stacked lines —
   give the control cluster room to sit on one row, wrapping only the two
   halves of the toolbar against each other, not every control within it. */
@media (min-width: 900px) and (max-width: 1279px) {
  .sw-shop-results-header {
    flex-wrap: nowrap;
  }
  .sw-shop-toolbar-right {
    flex-wrap: nowrap;
    gap: 16px;
  }
  .sw-shop-sort {
    white-space: nowrap;
  }
}
.sw-shop-clear-all {
  align-self: flex-start;
  background: none;
  border: none;
  padding: 0;
  color: var(--sw-error, #c0392b);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.sw-shop-clear-all:hover {
  text-decoration: underline;
}
.sw-shop-checkbox-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sw-shop-checkbox-list label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: #555;
  cursor: pointer;
}

.sw-shop-filter-group {
  padding: 16px 0;
  border-bottom: 1px solid #eee;
}
.sw-shop-filter-group:last-of-type {
  border-bottom: none;
}
.sw-shop-filter-group h3 {
  margin: 0 0 14px;
  font-size: 13.5px;
  font-weight: 700;
  color: #222;
}

.sw-shop-category-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sw-shop-category-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: #555;
}
.sw-shop-category-list a::before {
  content: '';
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1.5px solid #cfcfcf;
  background: #fff;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.sw-shop-category-list a:hover {
  color: var(--sw-primary);
}
.sw-shop-category-list a:hover::before {
  border-color: var(--sw-primary);
}
.sw-shop-category-list a.active {
  color: #222;
  font-weight: 600;
}
.sw-shop-category-list a.active::before {
  border-color: var(--sw-primary);
  background: var(--sw-primary);
  box-shadow: inset 0 0 0 3px #fff;
}
.sw-shop-empty {
  font-size: 13px;
  color: #999;
}

.sw-shop-price-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sw-shop-price-slider {
  position: relative;
  height: 18px;
}
.sw-shop-price-slider input[type='range'] {
  position: absolute;
  left: 0;
  top: 6px;
  width: 100%;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  pointer-events: none;
}
.sw-shop-price-slider input[type='range']::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 999px;
  background: #e2e2e2;
}
.sw-shop-price-slider input[type='range']::-moz-range-track {
  height: 5px;
  border-radius: 999px;
  background: #e2e2e2;
}
.sw-shop-price-slider input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  pointer-events: auto;
  width: 15px;
  height: 15px;
  margin-top: -5px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--sw-primary);
  cursor: pointer;
}
.sw-shop-price-slider input[type='range']::-moz-range-thumb {
  pointer-events: auto;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--sw-primary);
  cursor: pointer;
}
.sw-shop-price-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sw-shop-price-inputs input {
  width: 0;
  flex: 1 1 auto;
  height: 36px;
  border: 1px solid #e2e2e2;
  border-radius: 6px;
  padding: 0 10px;
  font-size: 13px;
}
.sw-shop-price-inputs span {
  color: #999;
}
.sw-shop-price-form button {
  height: 36px;
  border: none;
  border-radius: 6px;
  background: var(--sw-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.sw-shop-price-form button:hover {
  background: var(--sw-primary-hover);
}

.sw-shop-category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.sw-shop-category-tabs a {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 16px;
  border-radius: 999px;
  background: #f4f4f2;
  color: #555;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.sw-shop-category-tabs a:hover {
  color: var(--sw-primary);
}
.sw-shop-category-tabs a.active {
  background: var(--sw-primary);
  color: #fff;
}
/* Tablet portrait through tablet-landscape (601-1279px): a full row of
   category pills wraps into several awkward half-empty rows once the
   permanent sidebar is gone and there's no second column to absorb them —
   scroll horizontally in one row instead, same pattern as the mobile-cart
   drawer's chip rows elsewhere in the theme. Left alone below 601px so the
   existing portrait-mobile chip layout (flagged as "already looks good")
   is untouched. */
@media (min-width: 601px) and (max-width: 1279px) {
  .sw-shop-category-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .sw-shop-category-tabs::-webkit-scrollbar {
    display: none;
  }
  .sw-shop-category-tabs a {
    flex: 0 0 auto;
  }
}

.sw-shop-filter-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.sw-shop-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 6px 0 14px;
  border-radius: 999px;
  background: var(--sw-primary-soft, #eef3f9);
  color: var(--sw-primary);
  font-size: 12.5px;
  font-weight: 600;
}
.sw-shop-filter-chip button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  color: inherit;
  font-size: 11px;
  cursor: pointer;
}
.sw-shop-filter-chip button:hover {
  background: rgba(0, 0, 0, 0.12);
}

.sw-shop-results-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}
.sw-shop-results-count {
  display: block;
  margin-top: 6px;
  font-size: 13.5px;
  color: #777;
}
.sw-shop-sort {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sw-shop-sort label {
  font-size: 13.5px;
  color: #555;
}
.sw-shop-sort select {
  height: 38px;
  border: 1px solid #e2e2e2;
  border-radius: 6px;
  padding: 0 10px;
  font-size: 13.5px;
}

.sw-shop-main {
  flex: 1 1 auto;
  min-width: 0;
}

.sw-shop-pagination-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 32px;
}
.sw-shop-pagination-info {
  margin: 0;
  font-size: 13px;
  color: #888;
}
.sw-shop-pagination-info strong {
  color: #333;
  font-weight: 700;
}
.sw-shop-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 0;
}
.sw-shop-pagination button {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #e2e2e2;
  border-radius: 50%;
  background: #fff;
  color: #444;
  font-size: 13px;
  cursor: pointer;
}
.sw-shop-pagination button:hover:not(:disabled) {
  border-color: var(--sw-primary);
  color: var(--sw-primary);
}
.sw-shop-pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.sw-shop-pagination .current {
  border-color: var(--sw-primary);
  background: var(--sw-primary);
  color: #fff;
}

/*
 * Phone landscape (short viewport height, e.g. 926x428, 844x390): the fixed
 * header + full-size intro heading/tagline/paragraph + search bar + toolbar
 * + category chip row together were taller than the whole viewport, so not
 * a single product card was visible without scrolling first — the opposite
 * of what a landscape/tablet catalog layout should do. `max-height` (not
 * just `orientation: landscape`) keeps this scoped to short phone-landscape
 * viewports and leaves tall tablet-landscape screens (1024x768 and up, with
 * plenty of vertical room) untouched. Placed at the end of the file — same-
 * specificity rules are decided by source order, and this needs to win over
 * this file's own earlier unconditional `.sw-shop-intro-tagline` etc rules
 * whenever its media query matches.
 */
@media (orientation: landscape) and (max-height: 500px) {
  .sw-shop-intro {
    margin: 0 auto 10px;
  }
  .sw-shop-intro-tagline {
    display: none;
  }
  .sw-shop-intro h1 {
    font-size: 19px;
    margin-bottom: 2px;
  }
  .sw-shop-intro p {
    display: none;
  }
  .sw-search-bar {
    margin: 0 auto 10px;
  }
  .sw-search-bar input {
    height: 32px;
  }
  .sw-search-bar-submit,
  .sw-search-bar-submit-icon {
    height: 32px;
  }
  .sw-shop-results-header {
    margin-bottom: 10px;
  }
  .sw-shop-category-tabs {
    margin-bottom: 10px;
  }
  .sw-product-grid {
    gap: 12px;
  }

  /*
   * Product cards: image-on-top/content-below (the portrait layout, sized
   * for a tall narrow column) put a full square image ahead of the title
   * and price in each card, and 3+ columns of those stacked vertically is
   * what pushed everything below the fold on a short landscape screen in
   * the first place. Switching each card to a horizontal strip — image on
   * the left, title/category/price/rating on the right — fixes that
   * properly: the image scales down with the row's own height instead of
   * being capped/cropped, and one full card (photo + all its info) reads
   * as a single compact row instead of a tall stack. Scoped to the shop
   * grid (`.sw-shop-main`), not `.sw-card` globally, so ProductCard stays
   * the normal vertical layout on pages not fighting this height budget
   * (wishlist, related products, home sliders).
   */
  .sw-shop-main .sw-card {
    flex-direction: row;
    align-items: stretch;
    padding: 0;
  }
  .sw-shop-main .sw-card-media {
    flex: 0 0 38%;
    width: 38%;
    aspect-ratio: auto;
    margin: 0;
  }
  .sw-shop-main .sw-card-image-link {
    border-radius: 10px 0 0 10px;
  }
  .sw-shop-main .sw-card-body {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: center;
    padding: 8px 12px;
  }
  /* The wishlist/quick-view stack and cart button were positioned to hang
     off a square image's own bottom/right edge (bottom: -22px etc) — with
     the image now exactly as tall as its row instead of a fixed square,
     those offsets would either clip against the card's overflow:visible
     row or spill into the next row. Pull them fully inside the image
     area instead. */
  .sw-shop-main .sw-card-actions {
    top: 8px;
    right: 8px;
    gap: 6px;
  }
  .sw-shop-main .sw-card-action-btn {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }
  .sw-shop-main .sw-card-badge {
    top: 8px;
    left: 8px;
    font-size: 10px;
    padding: 3px 8px;
  }
  .sw-shop-main .sw-card-cart-fab,
  .sw-shop-main .sw-notify-me-fab-wrap,
  .sw-shop-main .sw-card-qty-stepper {
    bottom: 8px;
    right: 8px;
  }
  .sw-shop-main .sw-card-cart-fab {
    width: 34px;
    height: 34px;
    font-size: 13px;
  }
}
/* Even shorter phone-landscape heights (e.g. 844x390, 740x360) — trim the
   remaining chrome around the (now horizontal) card rows further: drop the
   category-chip row (redundant with the Filters drawer's own category
   list) and tighten the row layout a touch more. */
@media (orientation: landscape) and (max-height: 420px) {
  .sw-shop-category-tabs {
    display: none;
  }
  .sw-shop-results-header {
    margin-bottom: 8px;
  }
  .sw-shop-main .sw-card-media {
    flex-basis: 34%;
    width: 34%;
  }
  .sw-shop-main .sw-card-body {
    padding: 6px 10px;
  }
}
