/**
 * Rosa Medical - Amazon-Style Catalogue & Shop Layout Styles
 */

/* ==========================================================================
   Compact Product Cards & Quoting Bar
   ========================================================================== */

.rosa-preview-product {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--rosa-product-line, rgb(25 25 23 / 0.11));
  border-radius: 10px;
  background: #fff;
  padding: 0.85rem;
  box-shadow: 0 2px 8px rgb(17 24 39 / 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

/* Quote-selection styling sets generic cards to `align-self: start`. The
 * catalogue grid must retain its track width, especially in RTL two-column
 * mobile layouts. */
.rosa-shop-products-grid .rosa-preview-product {
  align-self: stretch;
  width: 100%;
  min-width: 0;
}

.rosa-preview-product:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgb(17 24 39 / 0.08);
  border-color: rgba(183, 25, 32, 0.3);
}

.rosa-preview-product__media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 180px;
  max-height: 180px;
  background: #fbfbfb;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 0.75rem;
  text-decoration: none;
}

.rosa-preview-product__media img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  transition: transform 0.3s cubic-bezier(0.2, 0.6, 0.35, 1);
}

.rosa-preview-product:hover .rosa-preview-product__media img {
  transform: scale(1.05);
}

.rosa-preview-product__body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

.rosa-preview-product__meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.rosa-preview-product__family {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--preview-red, #b71920);
  margin: 0;
}

.rosa-preview-product__sku {
  font-size: 0.68rem;
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #64748b;
  background: #f1f5f9;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.rosa-preview-product__title {
  margin: 0 0 0.5rem 0;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}

.rosa-preview-product__title a {
  color: var(--preview-ink, #191917);
  text-decoration: none;
  transition: color 0.15s ease;
}

.rosa-preview-product__title a:hover {
  color: var(--preview-red, #b71920);
}

.rosa-preview-product__price {
  font-size: 0.78rem;
  font-weight: 500;
  color: #64748b;
  margin: 0 0 0.75rem 0;
}

/* ==========================================================================
   Card quotation action
   ========================================================================== */

.rosa-preview-product__quote-bar {
  margin-top: auto;
  display: flex;
  align-items: stretch;
  padding-top: 0.65rem;
  border-top: 1px solid #f1f5f9;
}

.rosa-card-quote-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex: 1 1 auto;
  min-height: 44px;
  padding: 0 0.65rem !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  border-radius: 6px !important;
  white-space: nowrap;
  background: var(--preview-red, #b71920) !important;
  color: #fff !important;
  border: 0 !important;
  cursor: pointer;
  box-shadow: 0 1px 3px rgb(183 25 32 / 0.2);
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.rosa-card-quote-btn:hover {
  background: #99141a !important;
  transform: translateY(-1px);
}

.rosa-card-quote-btn:active {
  transform: translateY(0);
}

.rosa-card-quote-btn__icon {
  font-size: 1rem;
  line-height: 1;
  font-weight: 700;
}

/* ==========================================================================
   RTL Adjustments for Card
   ========================================================================== */

[dir="rtl"] .rosa-preview-product {
  text-align: right;
}

[dir="rtl"] .rosa-preview-product__quote-bar {
  flex-direction: row-reverse;
}



/* ==========================================================================
   Live Search Autocomplete Dropdown
   ========================================================================== */

.rosa-search-autocomplete {
  display: flex !important;
  flex-direction: column !important;
  position: absolute !important;
  top: calc(100% + 6px) !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  grid-column: 1 / -1 !important;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  box-shadow: 0 12px 28px -4px rgb(0 0 0 / 0.15), 0 8px 12px -6px rgb(0 0 0 / 0.1);
  z-index: 9999;
  overflow: hidden;
}

.rosa-search-autocomplete[hidden] {
  display: none !important;
}

.rosa-search-autocomplete__header {
  padding: 0.55rem 1rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
}

.rosa-search-autocomplete__list {
  max-height: 380px;
  overflow-y: auto;
  padding: 0.3rem 0;
}

.rosa-search-autocomplete__item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.6rem 1rem;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.15s ease;
  border-bottom: 1px solid #f8fafc;
}

.rosa-search-autocomplete__item:last-child {
  border-bottom: 0;
}

.rosa-search-autocomplete__item:hover,
.rosa-search-autocomplete__item.is-highlighted {
  background: #f1f5f9;
}

.rosa-search-autocomplete__thumb {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.rosa-search-autocomplete__thumb img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.rosa-search-autocomplete__no-thumb {
  font-size: 1.25rem;
}

.rosa-search-autocomplete__info {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
}

.rosa-search-autocomplete__title {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rosa-search-autocomplete__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: #64748b;
}

.rosa-search-autocomplete__family {
  color: var(--preview-red, #b71920);
  font-weight: 600;
}

.rosa-search-autocomplete__sku {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.68rem;
  background: #e2e8f0;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  color: #475569;
}

.rosa-search-autocomplete__arrow {
  color: #94a3b8;
  font-size: 1.1rem;
  font-weight: bold;
}

.rosa-search-autocomplete__footer {
  padding: 0.6rem 1rem;
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
  text-align: center;
}

.rosa-search-autocomplete__all {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--preview-red, #b71920);
  text-decoration: none;
}

.rosa-search-autocomplete__all:hover {
  text-decoration: underline;
}

.rosa-search-autocomplete__empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: #64748b;
  font-size: 0.88rem;
}

[dir="rtl"] .rosa-search-autocomplete__info {
  text-align: right;
}

/* ==========================================================================
   Amazon-Style 2-Column Catalogue Layout & Faceted Sidebar
   ========================================================================== */

.rosa-shop-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  align-items: start;
  padding-top: 2rem;
  padding-bottom: 4rem;
}

[dir="rtl"] .rosa-shop-container {
  grid-template-columns: 280px 1fr;
}

/* Mobile Filter Toggle */
.rosa-shop-filter-toggle {
  display: none !important;
}

@media (max-width: 1024px) {
  .rosa-shop-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  [dir="rtl"] .rosa-shop-container {
    grid-template-columns: 1fr;
  }

  .rosa-shop-filter-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--preview-ink, #191917) !important;
    background: #fff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgb(0 0 0 / 0.05);
    margin-bottom: 1rem;
  }

  .rosa-shop-filter-toggle__icon {
    width: 1.1rem;
    height: 1.1rem;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
  }

  .rosa-shop-filter-toggle .rosa-filter-count-badge {
    background: var(--preview-red, #b71920);
    color: #fff;
    font-size: 0.75rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
  }

  .rosa-shop-sidebar {
    position: fixed !important;
    top: 0;
    left: 0;
    bottom: 0;
    width: 320px;
    max-width: 85vw;
    background: #fff;
    z-index: 99999;
    padding: 1.5rem;
    box-shadow: 4px 0 24px rgb(0 0 0 / 0.15);
    overflow-y: auto;
    transform: translateX(-100%);
    display: none;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  [dir="rtl"] .rosa-shop-sidebar {
    left: auto;
    right: 0;
    box-shadow: -4px 0 24px rgb(0 0 0 / 0.15);
    transform: translateX(100%);
  }

  .rosa-shop-sidebar.is-open {
    display: block;
    transform: translateX(0) !important;
  }
}

.rosa-shop-sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgb(0 0 0 / 0.5);
  z-index: 99998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.rosa-shop-sidebar-backdrop.is-active {
  opacity: 1;
  pointer-events: auto;
}

/* Sidebar Box & Headers */
.rosa-shop-sidebar {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.03);
}

.rosa-shop-sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 1rem;
}

.rosa-shop-sidebar__header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--preview-ink, #191917);
}

.rosa-shop-sidebar__close {
  display: none !important;
  background: none !important;
  border: none !important;
  font-size: 1.5rem;
  line-height: 1;
  color: #64748b !important;
  cursor: pointer;
  padding: 0.25rem;
}

@media (max-width: 1024px) {
  .rosa-shop-sidebar__close {
    display: block !important;
  }
}

/* Active Filters Chips */
.rosa-active-filters {
  background: #f8fafc;
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 1.25rem;
  border: 1px solid #e2e8f0;
}

.rosa-active-filters[hidden] {
  display: none !important;
}

.rosa-active-filters__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.rosa-clear-all-btn {
  background: none !important;
  border: none !important;
  padding: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--preview-red, #b71920) !important;
  cursor: pointer;
  text-decoration: underline;
}

.rosa-active-filters__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.rosa-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #334155;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
}

.rosa-filter-chip__remove {
  background: none !important;
  border: none !important;
  padding: 0;
  margin: 0;
  color: #94a3b8 !important;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.rosa-filter-chip__remove:hover {
  color: var(--preview-red, #b71920) !important;
}

/* Filter Groups */
.rosa-filter-group {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid #f1f5f9;
}

.rosa-filter-group:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.rosa-filter-group__title {
  margin: 0 0 0.65rem 0;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #334155;
}

.rosa-filter-group__options {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

[dir="rtl"] .rosa-filter-group__options {
  padding-right: 0;
  padding-left: 0.25rem;
}

.rosa-filter-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.84rem;
  color: #475569;
  cursor: pointer;
  user-select: none;
  padding: 0.2rem 0;
  transition: color 0.15s ease, opacity 0.15s ease;
}

.rosa-filter-option:hover {
  color: var(--preview-red, #b71920);
}

.rosa-filter-option input[type="radio"],
.rosa-filter-option input[type="checkbox"] {
  accent-color: var(--preview-red, #b71920);
  cursor: pointer;
  width: 16px;
  height: 16px;
  margin: 0;
  flex-shrink: 0;
}

.rosa-filter-option__name {
  flex: 1 1 auto;
}

.rosa-filter-option__count {
  font-size: 0.75rem;
  color: #94a3b8;
  font-family: ui-monospace, SFMono-Regular, monospace;
}

.rosa-filter-option.is-disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* ==========================================================================
   Main Area, Toolbar & 4-Column Product Grid
   ========================================================================== */

.rosa-shop-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.rosa-shop-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid #e2e8f0;
}

.rosa-shop-count-label {
  font-size: 0.92rem;
  font-weight: 600;
  color: #475569;
}

.rosa-shop-sort-select {
  padding: 0.45rem 2rem 0.45rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #334155;
  background-color: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
}

[dir="rtl"] .rosa-shop-sort-select {
  padding: 0.45rem 0.85rem 0.45rem 2rem;
}

.rosa-shop-products-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
}

@media (max-width: 1200px) {
  .rosa-shop-products-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  .rosa-shop-products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .rosa-preview-product__quote-bar,
  [dir="rtl"] .rosa-preview-product__quote-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .rosa-card-quote-btn {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    white-space: normal !important;
    line-height: 1.2;
    padding-inline: 0.4rem !important;
  }
}

.rosa-shop-grid-item {
  display: flex;
  flex-direction: column;
  transition: opacity 0.2s ease;
}

.rosa-shop-grid-item.is-hidden {
  display: none !important;
}

.rosa-shop-empty {
  padding: 3rem 1rem;
  text-align: center;
}

.rosa-shop-empty[hidden] {
  display: none !important;
}

.rosa-shop-empty__card {
  max-width: 480px;
  margin: 0 auto;
  padding: 2rem;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
}

.rosa-shop-empty__msg {
  font-size: 1.05rem;
  font-weight: 600;
  color: #475569;
  margin: 0 0 1rem 0;
}

/* Dense catalogue pass: keep the cards calm and scannable while reclaiming
 * the empty vertical space between the image, metadata and action. */
.rosa-shop-products-grid .rosa-preview-product {
  padding: .62rem;
}
.rosa-shop-products-grid .rosa-preview-product__media {
  height: 136px;
  max-height: 136px;
  margin-bottom: .42rem;
  border-radius: 5px;
}
.rosa-shop-products-grid .rosa-preview-product__media img {
  max-width: 87%;
  max-height: 87%;
}
.rosa-shop-products-grid .rosa-preview-product__meta-top {
  gap: .3rem;
  margin-bottom: .22rem;
}
.rosa-shop-products-grid .rosa-preview-product__family,
.rosa-shop-products-grid .rosa-preview-product__sku {
  font-size: .61rem;
  line-height: 1.2;
}
.rosa-shop-products-grid .rosa-preview-product__sku { padding: .11rem .28rem; }
.rosa-shop-products-grid .rosa-preview-product__title {
  min-height: 0;
  margin: 0 0 .28rem;
  font-size: var(--rosa-card-title-size, .86rem);
  line-height: 1.18;
  white-space: nowrap;
  text-overflow: ellipsis;
  display: block;
}
.rosa-shop-products-grid .rosa-preview-product__title a {
  display: block;
  overflow: hidden;
  white-space: inherit;
  text-overflow: inherit;
}
.rosa-shop-products-grid .rosa-preview-product__price {
  margin: 0 0 .35rem;
  font-size: .7rem;
  line-height: 1.25;
}
.rosa-shop-products-grid .rosa-preview-product__quote-bar {
  padding-top: .35rem;
}
.rosa-shop-products-grid .rosa-card-quote-btn {
  min-height: 44px;
  font-size: .75rem !important;
  line-height: 1.15;
}

.rosa-shop-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  margin: 1.4rem 0 .1rem;
}
.rosa-shop-pagination[hidden] { display: none !important; }
.rosa-shop-pagination__pages { display: flex; align-items: center; gap: .25rem; }
.rosa-shop-pagination__ellipsis { min-width: 1rem; color: var(--preview-muted, #667085); text-align: center; }
.rosa-shop-pagination__arrow,
.rosa-shop-pagination__page {
  display: inline-grid;
  min-width: 2.55rem;
  min-height: 2.55rem;
  place-items: center;
  border: 1px solid var(--preview-border, #d8dde3);
  border-radius: .35rem;
  background: #fff;
  color: var(--preview-ink, #191917);
  font: inherit;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.rosa-shop-pagination__arrow { font-size: 1.35rem; line-height: 1; }
.rosa-shop-pagination__arrow:hover:not(:disabled),
.rosa-shop-pagination__page:hover,
.rosa-shop-pagination__page[aria-current="page"] {
  border-color: var(--preview-accent, #b71920);
  background: var(--preview-accent, #b71920);
  color: #fff;
}
.rosa-shop-pagination__arrow:disabled { cursor: not-allowed; opacity: .38; }
.rosa-shop-pagination__page[aria-current="page"] { cursor: default; }

@media (max-width: 768px) {
  .rosa-shop-products-grid .rosa-preview-product { padding: .48rem; }
  .rosa-shop-products-grid .rosa-preview-product__media {
    height: 112px;
    max-height: 112px;
    margin-bottom: .3rem;
  }
  .rosa-shop-products-grid .rosa-preview-product__body { min-width: 0; }
  .rosa-shop-products-grid .rosa-preview-product__meta-top { gap: .18rem; }
  .rosa-shop-products-grid .rosa-preview-product__family,
  .rosa-shop-products-grid .rosa-preview-product__sku { font-size: .54rem; }
  .rosa-shop-products-grid .rosa-preview-product__sku { max-width: 58%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rosa-shop-products-grid .rosa-preview-product__price { font-size: .65rem; margin-bottom: .28rem; }
  .rosa-shop-products-grid .rosa-card-quote-btn { min-height: 44px; padding-inline: .3rem !important; }
  .rosa-shop-pagination { margin-top: 1rem; }
  .rosa-shop-pagination__arrow,
  .rosa-shop-pagination__page { min-width: 2.35rem; min-height: 2.35rem; }
}
