/* Argus Ads Tracker — адаптивные стили */

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  padding-bottom: env(safe-area-inset-bottom);
}

.btn-touch {
  min-height: 2.75rem;
  min-width: 2.75rem;
}

.table-scroll {
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.table-scroll::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 1.5rem;
  pointer-events: none;
  background: linear-gradient(to left, rgba(249, 250, 251, 0.95), transparent);
}

@media (min-width: 1024px) {
  .table-scroll::after {
    display: none;
  }
}

.table-scroll-hint {
  display: block;
  font-size: 0.75rem;
  color: #6b7280;
  text-align: center;
  padding: 0.5rem 0 0;
}

@media (min-width: 1024px) {
  .table-scroll-hint {
    display: none;
  }
}

.input-field {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  border-radius: 0.375rem;
  border: 1px solid #d1d5db;
  padding: 0.625rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
}

@media (min-width: 640px) {
  .input-field {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
  }
}

.input-field:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

#mobile-menu:not(.hidden) {
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-0.5rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mobile-bottom-nav {
  padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
}

@media (min-width: 1280px) {
  .mobile-bottom-nav {
    display: none;
  }

  .has-bottom-nav main {
    padding-bottom: 0;
  }
}

@media (max-width: 1279px) {
  .has-bottom-nav main {
    padding-bottom: 5rem;
  }
}

.metric-card {
  min-width: 0;
}

.metric-card p:last-child {
  word-break: break-word;
}

.break-url {
  word-break: break-all;
  overflow-wrap: anywhere;
}

.kaspi-product-list {
  max-height: 18rem;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  background: #fff;
}

.kaspi-product-list__empty {
  padding: 1.5rem 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: #6b7280;
}

.kaspi-product-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: none;
  border-bottom: 1px solid #f3f4f6;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
}

.kaspi-product-row:last-child {
  border-bottom: none;
}

.kaspi-product-row:hover {
  background: #f0fdf4;
}

.kaspi-product-row--selected {
  background: #ecfdf5;
  box-shadow: inset 3px 0 0 #059669;
}

.kaspi-product-row__main {
  min-width: 0;
  flex: 1;
}

.kaspi-product-row__name {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #111827;
  line-height: 1.35;
}

.kaspi-product-row__sku {
  display: block;
  margin-top: 0.125rem;
  font-size: 0.6875rem;
  color: #6b7280;
  font-family: ui-monospace, monospace;
}

.kaspi-product-row__price {
  flex-shrink: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #047857;
  white-space: nowrap;
}

.metric-hint {
  cursor: help;
  border-bottom: 1px dotted currentColor;
  text-decoration: none;
}

.kaspi-brand-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.kaspi-brand-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
}

.kaspi-brand-chip:hover {
  border-color: #059669;
  color: #047857;
}

.kaspi-brand-chip--active {
  background: #ecfdf5;
  border-color: #059669;
  color: #047857;
}

.kaspi-brand-chip__count {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #6b7280;
  background: #f3f4f6;
  border-radius: 9999px;
  padding: 0.125rem 0.4375rem;
}

.kaspi-brand-chip--active .kaspi-brand-chip__count {
  background: #d1fae5;
  color: #047857;
}

.kaspi-brand-group__title {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #047857;
  background: #f0fdf4;
  border-bottom: 1px solid #dcfce7;
}

.kaspi-catalog-toast {
  margin-bottom: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
}

.kaspi-catalog-toast--success {
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  color: #065f46;
}

.kaspi-catalog-toast--error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}
