/* ============================================================
   博上智造 (Biosun) 移动端优先产品样本与资料中心 - 样式表
   Design: Modern Biotech & Intelligent Manufacturing Aesthetic
   ============================================================ */

:root {
  --primary: #0284c7;
  --primary-dark: #0369a1;
  --primary-light: #e0f2fe;
  --primary-gradient: linear-gradient(135deg, #0284c7 0%, #0ea5e9 50%, #38bdf8 100%);
  --tech-dark: #0f172a;
  --tech-slate: #1e293b;
  --card-border: #e2e8f0;
  --bg-page: #f1f5f9;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --reagent-accent: #059669;
  --reagent-bg: #ecfdf5;
  --reagent-border: #a7f3d0;
  
  --equipment-accent: #2563eb;
  --equipment-bg: #eff6ff;
  --equipment-border: #bfdbfe;
  
  --temp-freezer: #0284c7;
  --temp-fridge: #059669;
  --temp-room: #d97706;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-float: 0 20px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.06);

  --font-sans: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ================= PC Container & Shell ================= */
.app-viewport-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding-bottom: 24px;
}

.pc-utility-bar {
  width: 100%;
  max-width: 540px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  font-size: 12px;
  color: var(--text-muted);
  transition: max-width 0.3s ease;
}

.pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
  margin-right: 6px;
  vertical-align: middle;
}

.utility-actions {
  display: flex;
  gap: 8px;
}

.utility-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: var(--text-main);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.utility-btn:hover {
  background: #f8fafc;
  border-color: var(--primary);
  color: var(--primary);
}

.utility-btn.admin-link {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.utility-btn.admin-link:hover {
  background: #1e293b;
  color: #38bdf8;
}

/* Mobile Application Viewport */
.mobile-container {
  width: 100%;
  max-width: 540px;
  min-height: 94vh;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: var(--shadow-float);
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Wide Mode on Desktop */
.app-viewport-wrapper.wide-mode .pc-utility-bar {
  max-width: 960px;
}
.app-viewport-wrapper.wide-mode .mobile-container {
  max-width: 960px;
  border-radius: 16px;
}
.app-viewport-wrapper.wide-mode .product-grid {
  grid-template-columns: repeat(2, 1fr);
  display: grid;
  gap: 16px;
}

/* Native Mobile overrides */
@media (max-width: 640px) {
  .app-viewport-wrapper {
    padding: 0;
  }
  .pc-utility-bar {
    display: none;
  }
  .mobile-container {
    max-width: 100% !important;
    min-height: 100vh;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }
}

/* ================= Header & Brand ================= */
.app-header {
  background: #ffffff;
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(10px);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-area {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.brand-logo-img {
  height: 34px;
  max-width: 110px;
  object-fit: contain;
  display: block;
}

.header-inner .search-section {
  flex: 1;
  min-width: 0;
}

/* Search Bar */
.search-box {
  display: flex;
  align-items: center;
  background: #f1f5f9;
  border-radius: 20px;
  padding: 8px 14px;
  gap: 8px;
  border: 1.5px solid transparent;
  transition: all 0.2s ease;
}

.search-box:focus-within {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.search-icon {
  color: var(--text-light);
  flex-shrink: 0;
}

.search-box input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  color: var(--text-main);
  font-family: inherit;
}

.search-box input::placeholder {
  color: #94a3b8;
}

.clear-search-btn {
  background: none;
  border: none;
  font-size: 16px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

/* ================= Banner Section ================= */
.banner-section {
  padding: 12px 16px 6px;
}

.banner-carousel {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  background: #0f172a;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}

.banner-carousel:active {
  cursor: grabbing;
}

.banner-slides {
  display: flex;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  width: 100%;
  will-change: transform;
}

.banner-slide {
  min-width: 100%;
  position: relative;
  aspect-ratio: 2.1 / 1;
  cursor: pointer;
  overflow: hidden;
}

.banner-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.85);
  transition: transform 0.5s ease;
}

.banner-slide:hover img {
  transform: scale(1.03);
}

.banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.1) 0%, rgba(15, 23, 42, 0.85) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
  color: #ffffff;
}

.banner-badge {
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #0284c7;
  color: #ffffff;
  margin-bottom: 6px;
}

.banner-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 3px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.banner-desc {
  font-size: 11px;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.banner-dots {
  position: absolute;
  bottom: 8px;
  right: 12px;
  display: flex;
  gap: 5px;
}

.banner-dot {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.4);
  transition: all 0.3s ease;
  cursor: pointer;
}

.banner-dot.active {
  width: 16px;
  background: #ffffff;
}

/* ================= Category Navigation ================= */
.category-nav-section {
  background: #ffffff;
  padding: 10px 16px 6px;
  border-bottom: 1px solid #f1f5f9;
  position: sticky;
  top: 55px;
  z-index: 30;
}

/* Category Wrappers with Edge Fade Indicators & Drag support */
.category-tabs-wrapper,
.category-tags-wrapper {
  position: relative;
  width: 100%;
}

.category-tabs-wrapper .scroll-edge-fade,
.category-tags-wrapper .scroll-edge-fade {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 36px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 5;
}

.category-tabs-wrapper .scroll-edge-fade.edge-left,
.category-tags-wrapper .scroll-edge-fade.edge-left {
  left: 0;
  background: linear-gradient(to right, #ffffff 20%, rgba(255, 255, 255, 0));
}

.category-tabs-wrapper .scroll-edge-fade.edge-right,
.category-tags-wrapper .scroll-edge-fade.edge-right {
  right: 0;
  background: linear-gradient(to left, #ffffff 20%, rgba(255, 255, 255, 0));
}

.category-tabs-wrapper.has-scroll-left .scroll-edge-fade.edge-left,
.category-tags-wrapper.has-scroll-left .scroll-edge-fade.edge-left {
  opacity: 1;
}

.category-tabs-wrapper.has-scroll-right .scroll-edge-fade.edge-right,
.category-tags-wrapper.has-scroll-right .scroll-edge-fade.edge-right {
  opacity: 1;
}

/* Level 1 Tabs (Main Categories) */
.category-tabs-level1 {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  padding-bottom: 6px;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.category-tabs-level1::-webkit-scrollbar {
  display: none;
}

.category-tabs-level1.is-dragging {
  cursor: grabbing !important;
}

.category-tabs-level1.is-dragging * {
  cursor: grabbing !important;
  pointer-events: none;
}

.level1-tab {
  flex-shrink: 0;
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  background: #f8fafc;
  color: var(--text-muted);
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}

.level1-tab:hover {
  background: #f1f5f9;
  color: var(--text-main);
}

.level1-tab.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

/* Level 2 Sub-categories (Pills) */
.category-tags-level2 {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  padding: 6px 2px 8px;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.category-tags-level2::-webkit-scrollbar {
  display: none;
}

.category-tags-level2.is-dragging {
  cursor: grabbing !important;
}

.category-tags-level2.is-dragging * {
  cursor: grabbing !important;
  pointer-events: none;
}

.level2-tag {
  flex-shrink: 0;
  padding: 5px 13px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 500;
  background: #f1f5f9;
  color: var(--text-muted);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}

.level2-tag:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

.level2-tag:active {
  transform: scale(0.96);
}

.level2-tag.active {
  background: #0f172a;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
}

/* Filter Quick Bar */
.filter-quick-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 4px 0 2px;
}

.filter-chips {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
}

.filter-chip-checkbox {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.filter-chip-checkbox input {
  display: none;
}

.filter-chip-checkbox .chip-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 500;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.filter-chip-checkbox input:checked + .chip-label {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #2563eb;
  font-weight: 600;
}

.filter-stat-text {
  font-size: 11px;
  color: var(--text-light);
}

.filter-stat-text span {
  color: var(--primary);
  font-weight: 600;
}

/* ================= Product Cards Feed ================= */
.product-feed-section {
  padding: 12px 16px 24px;
  flex: 1;
}

.product-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Product Card - Inspired by Reference Site */
.product-card {
  background: #ffffff;
  border: 1px solid #f1f5f9;
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  position: relative;
  cursor: pointer;
}

.product-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

/* Thumbnail Area */
.card-thumbnail-wrapper {
  position: relative;
  width: 90px;
  height: 90px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #f8fafc;
}

.card-thumbnail-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-type-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  color: #ffffff;
}

.badge-equipment {
  background: #2563eb;
}

.badge-reagent {
  background: #059669;
}

.card-manual-tag {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  gap: 2px;
}

/* Card Content Area */
.card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}

.card-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}

.meta-chip {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  background: #f1f5f9;
  color: var(--text-muted);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: middle;
}

.temp-chip {
  font-weight: 600;
}
.temp-chip.cold-20 {
  background: #e0f2fe;
  color: #0369a1;
}
.temp-chip.cold-4 {
  background: #ecfdf5;
  color: #047857;
}
.temp-chip.room-temp {
  background: #fef3c7;
  color: #b45309;
}

.card-foot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 4px;
  border-top: 1px dashed #f1f5f9;
}

.cat-no-text {
  font-size: 11px;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-actions {
  display: flex;
  gap: 6px;
}

.card-btn {
  padding: 4px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all 0.2s ease;
}

.card-btn-view {
  background: #f1f5f9;
  color: var(--text-main);
}
.card-btn-view:hover {
  background: #e2e8f0;
}

.card-btn-manual {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
}
.card-btn-manual:hover {
  background: #bae6fd;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-muted);
}
.empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
}
.empty-state h3 {
  font-size: 15px;
  color: var(--text-main);
  margin-bottom: 6px;
}
.empty-state p {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.reset-filter-btn {
  padding: 8px 16px;
  border-radius: 20px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  font-size: 12px;
  cursor: pointer;
}

/* ================= Infinite Scroll ================= */
.infinite-scroll-container {
  padding: 20px 16px 36px;
  text-align: center;
  width: 100%;
}

.infinite-loader {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 13px;
  color: #64748b;
  background: #f8fafc;
  padding: 8px 18px;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
}

.spinner-ring {
  width: 16px;
  height: 16px;
  border: 2px solid #cbd5e1;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spinRing 0.75s linear infinite;
}

@keyframes spinRing {
  to { transform: rotate(360deg); }
}

.infinite-nomore {
  font-size: 12px;
  color: #94a3b8;
  letter-spacing: 0.5px;
  padding: 10px 0;
}

/* ================= Legacy Pagination Fallback ================= */
.pagination-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 0 8px;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  border: 1px solid #e2e8f0;
  background: #ffffff;
  font-size: 12px;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  font-weight: 600;
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-summary-text {
  font-size: 12px;
  color: var(--text-light);
  margin-right: 8px;
}

/* ================= Footer ================= */
.app-footer {
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
  padding: 20px 16px;
  text-align: center;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.copyright {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.tech-note {
  font-size: 11px;
  color: var(--text-light);
}

.icp-info {
  margin-top: 2px;
  line-height: 1.5;
}

.icp-link {
  font-size: 11px;
  color: var(--text-light);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s ease;
}

.icp-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.footer-links {
  margin-top: 6px;
  font-size: 11px;
}

.footer-links a {
  color: var(--primary);
  text-decoration: none;
}

.footer-links .sep {
  margin: 0 6px;
  color: #cbd5e1;
}

/* ================= Modal: Detail Drawer ================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 100%;
  max-width: 540px;
  background: #ffffff;
  border-radius: 20px 20px 0 0;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.modal-overlay.open .modal-card {
  transform: translateY(0);
}

.modal-header {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-close-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-body {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: #f8fafc;
}

.detail-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 8px;
}

.detail-table tr {
  border-bottom: 1px solid #f1f5f9;
}

.detail-table td {
  padding: 8px 6px;
}

.detail-table td.label-col {
  color: var(--text-muted);
  width: 32%;
  font-weight: 500;
}

.detail-table td.val-col {
  color: var(--text-main);
  font-weight: 600;
}

.detail-features {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.feature-tag {
  padding: 3px 8px;
  border-radius: 4px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 500;
}

.detail-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  background: #f8fafc;
  padding: 12px;
  border-radius: var(--radius-sm);
}

.modal-footer {
  padding: 12px 16px;
  border-top: 1px solid #f1f5f9;
  background: #ffffff;
  display: flex;
  gap: 10px;
}

.btn-primary {
  flex: 1;
  padding: 10px 16px;
  border-radius: 20px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  transition: background 0.2s ease;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  padding: 10px 16px;
  border-radius: 20px;
  background: #f1f5f9;
  color: var(--text-main);
  border: 1px solid #cbd5e1;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

/* ================= Modal: PDF Online Viewer ================= */
.pdf-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(6px);
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  overscroll-behavior: contain;
}

.pdf-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.pdf-modal-container {
  width: 100%;
  max-width: 540px;
  height: 94vh;
  background: #ffffff;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-float);
  overscroll-behavior: contain;
}

.app-viewport-wrapper.wide-mode .pdf-modal-container {
  max-width: 900px;
}

@media (max-width: 640px) {
  .pdf-modal-container {
    max-width: 100%;
    height: 100vh;
    border-radius: 0;
  }
}

.pdf-modal-header {
  padding: 10px 12px;
  background: #0f172a;
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pdf-header-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 5px 9px 5px 6px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.pdf-header-back-btn:hover,
.pdf-header-back-btn:active {
  background: rgba(255, 255, 255, 0.24);
}

.pdf-title-box {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1;
  margin: 0 4px;
  overflow: hidden;
}

.pdf-title-text {
  font-size: 13px;
  font-weight: 600;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdf-header-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.pdf-action-btn {
  padding: 4px 8px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.pdf-action-btn.download-btn {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

.pdf-action-btn.new-tab-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.pdf-close-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.pdf-close-btn:hover {
  color: #ffffff;
}

.pdf-viewer-frame-wrapper {
  flex: 1;
  position: relative;
  background: #475569;
  display: flex;
  flex-direction: column;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.pdf-viewer-frame-wrapper iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #ffffff;
}

.pdf-fallback-hint {
  padding: 24px;
  text-align: center;
  color: #ffffff;
  background: #1e293b;
  margin: auto;
  border-radius: 8px;
}

.pdf-modal-footer {
  padding: 8px 14px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.pdf-footer-close {
  padding: 5px 14px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}

.pdf-footer-close:hover {
  background: #f1f5f9;
}

/* ================= Consult Phone Action Sheet Modal ================= */
.footer-consult-btn {
  color: var(--primary);
  text-decoration: none;
  background: none;
  border: none;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 20px;
  background: #f0f9ff;
  border: 1px solid #e0f2fe;
  transition: all 0.2s ease;
}
.footer-consult-btn:hover {
  background: #e0f2fe;
  color: var(--primary-dark);
}

.consult-sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
}

.consult-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  animation: fadeInBackdrop 0.25s ease-out;
}

.consult-sheet-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 500px;
  background: #ffffff;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  animation: slideUpSheet 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.consult-sheet-header {
  padding: 20px 20px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sheet-title {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.sheet-close-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f1f5f9;
  border: none;
  font-size: 18px;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.sheet-close-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.consult-list {
  padding: 4px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 60vh;
  overflow-y: auto;
}

.consult-item {
  background: #f8fafc;
  border: none;
  border-radius: 8px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  text-decoration: none;
}

.consult-item:hover, .consult-item:active {
  background: #f1f5f9;
  transform: scale(0.99);
}

.consult-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1e40af;
  flex-shrink: 0;
}

.consult-item-content {
  flex: 1;
  min-width: 0;
}

.consult-item-name {
  font-size: 15px;
  font-weight: 500;
  color: #0f172a;
  line-height: 1.3;
}

.consult-item-phone {
  font-size: 14px;
  font-weight: 400;
  color: #334155;
  line-height: 1.3;
  margin-top: 4px;
}

.sheet-cancel-wrapper {
  padding: 4px 18px 24px;
  background: #ffffff;
}

.sheet-cancel-btn {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  background: #f1f5f9;
  border: none;
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: background 0.2s ease;
}

.sheet-cancel-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

@keyframes slideUpSheet {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes fadeInBackdrop {
  from { opacity: 0; }
  to { opacity: 1; }
}
