.browse-page {
  --br-bg: #f6f8fb;
  --br-surface: #ffffff;
  --br-surface-2: #f9fbff;
  --br-border: #dbe3ee;
  --br-border-strong: #c8d3e1;
  --br-text: #1f2937;
  --br-text-muted: #667085;
  --br-primary: #2563eb;
  --br-primary-dark: #1d4ed8;
  --br-success: #15803d;
  --br-danger: #b42318;
  --br-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --br-radius: 16px;
  --br-radius-sm: 12px;
  color: var(--br-text);
  background: var(--br-bg);
  min-height: 100vh;
}

.browse-page main {
  margin: 24px 10%;
  padding: 0;
  background: transparent;
}

.browse-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.browse-card {
  background: var(--br-surface);
  border: 1px solid var(--br-border);
  border-radius: var(--br-radius);
  box-shadow: var(--br-shadow);
}

.browse-sidebar {
  position: sticky;
  top: 92px;
  padding: 18px;
}

.browse-sidebar h2 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
}

.browse-sidebar p {
  margin: 0 0 16px;
  color: var(--br-text-muted);
  font-size: 14px;
}

.browse-filter-group {
  margin-bottom: 14px;
}

.browse-filter-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #344054;
  margin-bottom: 6px;
}

.browse-filter-group input[type="text"] {
  width: 100%;
  height: 40px;
  border: 1px solid var(--br-border-strong);
  border-radius: 10px;
  padding: 0 12px;
  font-size: 14px;
  box-sizing: border-box;
  background: white;
}

.browse-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #344054;
  font-weight: 600;
}

.browse-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.browse-btn {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.browse-btn:hover {
  transform: translateY(-1px);
}

.browse-btn-primary {
  background: linear-gradient(135deg, var(--br-primary), var(--br-primary-dark));
  color: white;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.22);
}

.browse-btn-secondary {
  background: #eef2f7;
  color: #334155;
  border: 1px solid var(--br-border);
}

.browse-main {
  min-width: 0;
}

.browse-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  margin-bottom: 18px;
}

.browse-toolbar-left h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}

.browse-toolbar-left p {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--br-text-muted);
}

.browse-toolbar-right {
  min-width: 220px;
}

.browse-toolbar-right label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #344054;
}

.browse-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 0 4px 14px;
  color: var(--br-text-muted);
  font-size: 14px;
}

.browse-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.browse-product {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.browse-product-image-wrap {
  position: relative;
  padding: 16px 16px 0;
}

.browse-product-image-link {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 12px;
  min-height: 210px;
  text-decoration: none;
}

.browse-product-image {
  width: 100%;
  max-width: 220px;
  height: 200px;
  object-fit: contain;
}

.browse-stock-badge {
  position: absolute;
  top: 24px;
  right: 24px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
}

.browse-stock-badge small {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 700;
}

.browse-stock-badge.in {
  background: #ecfdf3;
  color: #027a48;
}

.browse-stock-badge.low {
  background: #fffaeb;
  color: #b54708;
}

.browse-stock-badge.out {
  background: #fef3f2;
  color: #b42318;
}

.browse-product-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.browse-brand {
  font-size: 12px;
  font-weight: 700;
  color: var(--br-primary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.browse-title {
  font-size: 15px;
  line-height: 1.35;
  font-weight: 700;
  color: #111827;
  min-height: 3.75em;
}

.browse-title a {
  color: inherit;
  text-decoration: none;
}

.browse-title a:hover {
  text-decoration: underline;
}

.browse-desc-sub {
  font-size: 12px;
  line-height: 1.35;
  color: #667085;
  min-height: 32px;
  margin-top: -2px;
}

.browse-desc-meta {
  font-size: 11px;
  line-height: 1.2;
  color: #98a2b3;
  min-height: 30px;
  margin-top: -2px;
}
.browse-desc-meta strong {
  color: #667085;
  font-weight: 600;
}

.browse-item-code {
  font-size: 12px;
  color: var(--br-text-muted);
  font-weight: 600;
}

.browse-price-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px 0 2px;
  border-top: 1px solid #edf2f7;
  border-bottom: 1px solid #edf2f7;
}

.browse-price-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.browse-price-label {
  font-size: 11px;
  color: var(--br-text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.browse-price-value {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
}

.browse-price-value.final {
  color: var(--br-danger);
  font-weight: 800;
}

.browse-card-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}

.browse-qty-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.browse-qty-input {
  width: 86px;
  height: 38px;
  border: 1px solid var(--br-border-strong);
  border-radius: 10px;
  padding: 0 10px;
  font-size: 14px;
  box-sizing: border-box;
  background: white;
}

.browse-add-btn,
.browse-update-btn {
  height: 38px;
  border: none;
  border-radius: 10px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  flex: 1;
}

.browse-add-btn {
  background: linear-gradient(135deg, #0a84ff, #2563eb);
  color: #fff;
}

.browse-update-btn {
  background: linear-gradient(135deg, #1f7a3f, #2f9e44);
  color: #fff;
  border: 0;
}

.browse-add-btn:disabled,
.browse-update-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.browse-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--br-text-muted);
  font-size: 15px;
}

.browse-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 20px 0 8px;
}

.browse-page-indicator {
  min-width: 120px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: #475467;
}

.browse-loading {
  opacity: 0.7;
  pointer-events: none;
}

.ts-wrapper {
  width: 100%;
  min-width: 0;
}

.ts-wrapper.single .ts-control {
  min-height: 40px !important;
  height: 40px !important;
  border-radius: 10px !important;
  border: 1px solid var(--br-border-strong) !important;
  padding: 8px 12px !important;
  box-shadow: none !important;
}

.ts-dropdown {
  border-radius: 12px !important;
  border: 1px solid var(--br-border) !important;
  box-shadow: var(--br-shadow) !important;
}

@media (max-width: 1600px) {
  .browse-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .browse-page main {
    margin: 20px 4%;
  }

  .browse-shell {
    grid-template-columns: 1fr;
  }

  .browse-sidebar {
    position: static;
  }

  .browse-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .browse-grid {
    grid-template-columns: 1fr;
  }

  .browse-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .browse-toolbar-right {
    width: 100%;
  }
}

/* Mobile browse quick actions */
.browse-mobile-fab,
.browse-mobile-filter-backdrop,
.browse-mobile-filter-sheet {
  display: none;
}

@media (max-width: 700px) {
  body.browse-page {
    padding-bottom: 0;
  }

  .browse-page main {
    margin-bottom: 150px;
  }

  .browse-shell {
    display: block;
  }

  .browse-mobile-fab {
    position: fixed;
    right: 14px;
    bottom: calc(16px + 52px + 10px);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    pointer-events: none;
  }

  .browse-fab-btn {
    pointer-events: auto;
    border: 0;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.26);
    font-weight: 800;
    cursor: pointer;
  }

  .browse-fab-filter {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #059669);
  }

  .browse-fab-icon {
    width: 22px;
    height: 22px;
    display: block;
    flex-shrink: 0;
  }

  .browse-toolbar-right {
    display: block;
  }

  .browse-mobile-filter-backdrop:not([hidden]) {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1190;
    background: rgba(15, 23, 42, 0.45);
  }

  .browse-mobile-filter-sheet:not([hidden]) {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1200;
    max-height: 86vh;
    overflow-y: auto;
    padding: 14px;
    border-radius: 24px 24px 0 0;
    background: #f8fafc;
    box-shadow: 0 -18px 44px rgba(15, 23, 42, 0.28);
  }

  .browse-mobile-filter-header {
    position: sticky;
    top: -14px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 2px 14px;
    background: #f8fafc;
  }

  .browse-mobile-filter-header strong {
    display: block;
    font-size: 20px;
    color: #111827;
  }

  .browse-mobile-filter-header span {
    display: block;
    margin-top: 2px;
    font-size: 13px;
    color: #667085;
  }

  #browseMobileFilterClose {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid #dbe3ef;
    background: #fff;
    color: #111827;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
  }

  .browse-mobile-sort-mount .browse-toolbar-right,
  .browse-mobile-filter-mount .browse-sidebar {
    width: 100%;
  }

  .browse-mobile-sort-mount .browse-toolbar-right {
    margin-bottom: 12px;
    padding: 16px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid #dbe3ef;
  }

  .browse-mobile-filter-mount .browse-sidebar {
    position: static;
    box-shadow: none;
  }

  .browse-filter-open {
    overflow: hidden;
  }
}
