/* NurLab — главная страница: удобство для пациентов на телефоне и ПК */

/* ---------- Шапка ---------- */
.header { padding: 12px max(16px, calc((100vw - 1400px) / 2)) !important; }
.header-contacts { display: none !important; }              /* контакты переехали в карточки hero */
#installAppBtn, #shortcutBtn { display: none !important; }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(900px 380px at 90% 0%, rgba(45, 212, 191, .22), transparent 65%),
    linear-gradient(180deg, #0F5E58 0%, #0F766E 55%, #F3F6F8 55.1%);
  padding: 8px 16px 0;
}
.hero-inner {
  max-width: 1400px; margin: 0 auto; display: grid; grid-template-columns: 1.25fr 1fr; gap: 20px;
  background: #fff; border-radius: 22px; padding: 28px; box-shadow: 0 20px 50px rgba(11, 59, 60, .14);
}
.hero-kicker { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); background: var(--primary-soft); padding: 5px 10px; border-radius: 999px; }
.hero h2 { margin: 12px 0 8px; font-size: clamp(24px, 3.2vw, 36px); line-height: 1.15; letter-spacing: -0.03em; color: var(--text-main); }
.hero p { margin: 0 0 18px; color: #475569; font-size: 15px; line-height: 1.6; max-width: 560px; }
.hero-search {
  display: flex; align-items: center; gap: 8px; background: #F8FAFC; border: 1.5px solid #D5DCE4;
  border-radius: 16px; padding: 6px 6px 6px 14px; max-width: 620px; transition: border-color .15s, box-shadow .15s;
}
.hero-search:focus-within { border-color: var(--accent); box-shadow: var(--ring); background: #fff; }
.hero-search input { flex: 1; min-width: 0; border: none; background: transparent; outline: none; font: inherit; font-size: 16px; padding: 10px 0; color: var(--text-main); }
.hero-search button { border: none; background: var(--primary); color: #fff; font: inherit; font-weight: 700; font-size: 15px; padding: 12px 20px; border-radius: 12px; cursor: pointer; }
.hero-search button:hover { background: #0D9488; }
.hero-quick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; font-size: 13px; color: #64748B; }
.hero-quick button { border: 1px solid var(--border-color); background: #fff; color: #334155; font: inherit; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.hero-quick button:hover { border-color: var(--accent); color: var(--primary); }

.hero-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: start; }
.info-card {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 16px;
  background: #F8FAFC; border: 1px solid var(--border-color); color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s, border-color .15s;
}
a.info-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: #99F6E4; }
.info-card .ic { width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 19px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.info-card small { display: block; font-size: 11px; color: #64748B; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.info-card b { display: block; font-size: 14px; margin: 2px 0; color: var(--text-main); }
.info-card em { font-style: normal; font-size: 12px; color: var(--primary); font-weight: 600; }
.info-card em.is-open { color: #15803D; }
.info-card em.is-closed { color: #B91C1C; }
.info-wa { background: #F0FDF4; border-color: #BBF7D0; }
.info-wa em { color: #15803D; }

/* ---------- Навигация и контент ---------- */
.nav-tabs { margin-top: 18px; justify-content: center; }
.content { max-width: 1400px !important; }
.view-section { padding: 22px 24px !important; }

/* Шаги заказа */
.how-to { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 14px; }
.how-to div { display: flex; gap: 10px; align-items: center; background: #F8FAFC; border: 1px solid var(--border-color); border-radius: 14px; padding: 10px 12px; font-size: 13px; color: #334155; }
.how-to b { width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; }

/* Каталог */
.catalog-sticky-header { top: 49px !important; border-bottom: 1px solid var(--border-color) !important; box-shadow: none !important; }
.chip-btn { font-size: 12px !important; padding: 7px 13px !important; border: 1px solid var(--border-color) !important; }
.chip-btn.active { background: var(--primary-dark) !important; border-color: var(--primary-dark) !important; }
.search-input-wrapper input { padding-top: 11px !important; padding-bottom: 11px !important; font-size: 14px !important; }
.table-container { max-height: none !important; overflow: visible !important; }
@media (min-width: 821px) and (min-height: 501px) {
  #mainServicesTable th { top: 0; }
  #mainServicesTable td { font-size: 13px; padding: 12px 14px !important; }
}
.price-tag { font-size: 15px; font-weight: 800; color: var(--primary-dark); white-space: nowrap; }
.btn-add, .btn-incart { width: 100%; justify-content: center; padding: 9px 12px !important; font-size: 13px !important; }
.btn-incart { background: #DCFCE7 !important; color: #166534 !important; border: 1px solid #86EFAC !important; }
.btn-incart:hover { background: #FEE2E2 !important; color: #991B1B !important; border-color: #FCA5A5 !important; }
.empty-state { text-align: center; padding: 30px 16px; color: #475569; }
.empty-state b { display: block; font-size: 16px; margin: 6px 0; color: var(--text-main); }
.empty-state p { margin: 0 auto 14px; max-width: 420px; font-size: 13px; }

/* Плавающая корзина на ПК */
.mobile-fab { background: var(--primary-dark) !important; border: none !important; box-shadow: 0 10px 30px rgba(11, 59, 60, .35) !important; padding: 14px 22px !important; font-size: 14px !important; }
.fab-count { background: #fff; color: var(--primary-dark); padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.fab-total { opacity: .85; font-weight: 600; }

/* Корзина */
.cart-header { background: var(--primary-dark) !important; }
.cart-item-card { border: 1px solid var(--border-color) !important; }
.btn-whatsapp-order { background: #16A34A !important; box-shadow: 0 6px 18px rgba(22, 163, 74, .3) !important; font-size: 15px !important; padding: 15px !important; }

/* Нижняя навигация (только телефоны) */
.bottom-nav { display: none; }

/* ---------- Планшеты ---------- */
@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-cards { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Телефоны ---------- */
@media (max-width: 820px), (max-height: 500px) and (orientation: landscape) {
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
  .header { flex-direction: row !important; align-items: center !important; padding: 10px 14px !important; }
  #authArea { position: static !important; }
  #authArea .btn { padding: 7px 10px !important; font-size: 12px !important; }
  .auth-user small { display: none; }
  .logo-badge { width: 40px !important; height: 40px !important; }
  .logo-title h1 { font-size: 15px !important; }

  .hero { padding: 0 10px; background: linear-gradient(180deg, #0F766E 0%, #0F766E 40%, #F3F6F8 40.1%); }
  .hero-inner { padding: 18px 16px; border-radius: 18px; gap: 14px; }
  .hero h2 { font-size: 23px; margin-top: 10px; }
  .hero p { font-size: 14px; margin-bottom: 14px; }
  .hero-search { padding-left: 12px; border-radius: 14px; }
  .hero-search button { padding: 11px 14px; }
  .hero-quick { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px; scrollbar-width: none; }
  .hero-quick::-webkit-scrollbar { display: none; }
  .hero-quick button, .hero-quick span { flex-shrink: 0; }
  .hero-cards { grid-template-columns: 1fr 1fr; gap: 8px; }
  .info-card { padding: 10px; gap: 8px; border-radius: 14px; }
  .info-card .ic { width: 32px; height: 32px; font-size: 16px; border-radius: 10px; }
  .info-card b { font-size: 13px; }

  .nav-tabs { display: none !important; }      /* на телефоне — нижнее меню */
  .content { padding: 12px 10px !important; }
  .view-section { padding: 14px 12px !important; border-radius: 16px !important; }
  .catalog-sticky-header { top: 0 !important; }
  .how-to { grid-template-columns: 1fr; gap: 6px; }
  .how-to div { padding: 8px 10px; font-size: 12.5px; }
  .sub-tabs-group { width: 100%; }
  .sub-tab { flex: 1; text-align: center; padding: 9px 10px !important; }

  /* Карточки услуг для пациента */
  body:not(.is-staff) #mainServicesTable tbody tr:not(.empty-row) {
    display: flex !important; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 14px !important;
    border: 1px solid var(--border-color) !important; border-radius: 16px !important; box-shadow: 0 1px 3px rgba(15,23,42,.04) !important;
  }
  body:not(.is-staff) #mainServicesTable tbody tr:not(.empty-row) td {
    display: inline-flex !important; width: auto !important; border: none !important; padding: 0 !important; margin: 0 !important; font-size: 12px !important;
  }
  body:not(.is-staff) #mainServicesTable td::before { display: none !important; }
  body:not(.is-staff) #mainServicesTable td[data-label="Наименование"] { display: block !important; flex-basis: 100%; font-size: 15px !important; color: var(--text-main) !important; margin-bottom: 2px !important; }
  body:not(.is-staff) #mainServicesTable td[data-label="Код"],
  body:not(.is-staff) #mainServicesTable td[data-label="Биоматериал"] { background: #F1F5F9; color: #475569; padding: 2px 8px !important; border-radius: 999px; font-weight: 600; }
  body:not(.is-staff) #mainServicesTable td[data-label="Готовность"] { background: #E0F2FE; color: #075985; padding: 2px 8px !important; border-radius: 999px; font-weight: 600; }
  body:not(.is-staff) #mainServicesTable td[data-label="Готовность"]::before { content: '⏱ ' !important; display: inline !important; font-size: 12px !important; text-transform: none !important; color: inherit !important; margin: 0 !important; }
  body:not(.is-staff) #mainServicesTable td[data-label="Цена (₸)"] { flex: 1 1 auto; margin-top: 8px !important; }
  body:not(.is-staff) #mainServicesTable td[data-label="Цена (₸)"] .price-tag { font-size: 18px !important; color: var(--primary-dark) !important; }
  body:not(.is-staff) #mainServicesTable td[data-label="Действие"] { margin-top: 8px !important; flex: 0 0 auto; }
  body:not(.is-staff) #mainServicesTable td[data-label="Действие"] .btn { width: auto !important; padding: 10px 16px !important; font-size: 14px !important; box-shadow: none !important; }
  .empty-row td { display: block !important; }
  .empty-row td::before { display: none !important; }

  .mobile-fab { display: none !important; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 1500;
    background: rgba(255,255,255,.96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-color); padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -6px 20px rgba(15, 23, 42, .06);
  }
  .bottom-nav button, .bottom-nav a {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; border: none; background: none;
    font: inherit; font-size: 10.5px; font-weight: 600; color: #64748B; text-decoration: none; padding: 4px 0; cursor: pointer; border-radius: 12px;
  }
  .bottom-nav span { font-size: 20px; line-height: 1.1; }
  .bottom-nav .active { color: var(--primary-dark); background: var(--primary-soft); }
  .bottom-nav b { position: absolute; top: 0; right: calc(50% - 22px); background: #EA580C; color: #fff; font-size: 10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; display: flex; align-items: center; justify-content: center; box-sizing: border-box; }
  #nlToastBox { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); left: 16px; right: 16px; align-items: center; }
  .footer-ad { padding-bottom: 20px; }
}

@media (max-width: 380px) {
  .hero-cards { grid-template-columns: 1fr; }
  .bottom-nav button, .bottom-nav a { font-size: 9.5px; }
}

/* ---------- Исправления по скриншотам ---------- */
.hero-text, .hero-cards { min-width: 0; }
@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px), (max-height: 500px) and (orientation: landscape) {
  .hero-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .info-card > span:last-child { min-width: 0; }
  .info-card b, .info-card em { overflow-wrap: anywhere; }
  .hero-search input { font-size: 15px; }
  .search-input-wrapper { flex: 1 1 100% !important; }
  .sort-select-wrapper { flex: 1 1 auto; }
  .sort-select { width: 100%; }
  #cartBtn { display: none !important; }
  .how-to { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .how-to div { flex-direction: column; align-items: flex-start; gap: 4px; padding: 8px; font-size: 11px; line-height: 1.35; }
  .how-to b { width: 22px; height: 22px; font-size: 11px; }
  body:not(.is-staff) #mainServicesTable td[data-label="Наименование"] { order: -1; }
  body:not(.is-staff) #mainServicesTable td.is-empty { display: none !important; }
}
@media (max-width: 380px) {
  .hero-cards { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px), (max-height: 500px) and (orientation: landscape) {
  body:not(.is-staff) #mainServicesTable tbody tr:not(.empty-row) td.is-empty { display: none !important; }
  body:not(.is-staff) #mainServicesTable tbody tr:not(.empty-row) td[data-label="Цена (₸)"] { flex: 1 1 calc(100% - 180px) !important; min-width: calc(100% - 180px); order: 10; }
  body:not(.is-staff) #mainServicesTable tbody tr:not(.empty-row) td[data-label="Действие"] { order: 11; margin-left: auto !important; }
}
