/* Компактные карточки каталога компаний (/companies).
   Подключается ПОСЛЕ indexcert-site.css в app.blade.php, поэтому перекрывает
   исходные «крупные» размеры без пересборки фронта.
   Плотнее сетка + меньшие лого/шрифты/отступы + обрезка длинных названий. */

/* --- Хедер: навигация отдельной строкой СЛЕВА под логотипом (десктоп) --- */
.header-content { flex-wrap: wrap; row-gap: 10px; position: relative; }
.header-actions-desktop { margin-left: auto; }
.header-nav {
  flex-basis: 100%;
  width: 100%;
  justify-content: flex-start;
}
/* На десктопе бургер и мобильный блок действий скрыты */
.mobile-menu-toggle { display: none; }
.header-actions-mobile { display: none; }

/* ================= МОБИЛЬНАЯ ВЕРСИЯ (≤992px) — чистый CSS =================
   Работает с уже задеплоенным бандлом: JS переключает класс .header-nav.active.
   Меню НЕ требует пересборки фронта — только этот статический файл.
   Скрытое меню не ловит клики (pointer-events:none), бургер всегда сверху. */
@media (max-width: 992px) {
  .mobile-menu-toggle {
    display: flex !important;
    margin-left: auto;
    position: relative;
    z-index: 1002;
    cursor: pointer;
  }
  .header-actions-desktop { display: none !important; }

  .header-nav {
    position: absolute !important;
    top: 100%;
    left: 0;
    right: 0;
    width: auto;
    flex-basis: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    margin-top: 10px;
    padding: 16px 18px;
    background: #fff !important;
    border: 1px solid #ececf6;
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(13, 16, 36, .16);
    z-index: 1001;
    /* скрытое состояние — не перехватывает клики */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
  }
  /* .mm-open — класс от no-rebuild обхода в app.blade.php (см. там комментарий).
     Дублирует .active, потому что старый бандл сам ставит .active лишь на один
     кадр и тут же снимает (эффект [location] закрывает меню) → мигание. Обход
     блокирует React-обработчик и рулит видимостью через .mm-open. */
  .header-nav.active,
  .header-nav.mm-open {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
  }

  .header-nav nav { width: 100%; }
  .header-nav nav ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
  }
  .header-nav nav ul li { width: 100%; }
  .header-nav nav ul li a {
    display: block;
    width: 100%;
    padding: 12px 10px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
  }
  .header-nav nav ul li a:hover,
  .header-nav nav ul li a.current { background: #f3f6ff; color: #625bf6; }

  /* Блок входа — стопкой внутри выпадашки */
  .header-actions-mobile { display: block !important; width: 100%; border-top: 1px solid #ececf6; padding-top: 14px; }
  .header-actions-mobile .header-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: 100%;
  }
  .header-actions-mobile .header-provider-link,
  .header-actions-mobile .btn-register,
  .header-actions-mobile .btn-signin,
  .header-actions-mobile .header-user { text-align: center; justify-content: center; }
}

/* --- Сетка: плотнее (колонки по брейкпоинтам уже заданы: 4 / 3 / 2 / 1) --- */
.companies-grid { gap: 16px; }

/* --- Компактная вертикальная карточка --- */
.company-card.vertical {
  padding: 14px;
  border-radius: 14px;
}
.company-card.vertical .card-header {
  margin-bottom: 10px;
  gap: 8px;
}

/* Лого меньше */
.company-card.vertical .company-logo,
.company-card.vertical .company-logo img,
.company-card.vertical .logo-placeholder {
  width: 44px;
  height: 44px;
}
.company-card.vertical .company-logo {
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}
/* Исходный CSS форсирует min/max-width:80px + object-fit:cover — из-за этого
   лого 80px обрезалось контейнером 44px. Сбрасываем и вписываем целиком. */
.company-card.vertical .company-logo img {
  width: 44px;
  height: 44px;
  min-width: 44px;
  max-width: 44px;
  object-fit: contain;
  border-radius: 10px;
}
.company-card.vertical .logo-placeholder {
  font-size: 18px;
  border-radius: 10px;
}

/* Рейтинг компактнее */
.company-card.vertical .company-rating .rating-value,
.company-card.vertical .company-rating .reviews-count { font-size: 13px; }
.company-card.vertical .company-rating svg { width: 16px; height: 16px; }

/* Название: меньше и обрезка в 2 строки с «…» (одинаковая высота карточек в ряду) */
.company-card.vertical .company-name {
  font-family: Gilroy, sans-serif;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  color: #1a1a1a;
  margin: 0 0 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(1.3em * 2);
}

/* Локация */
.company-card.vertical .company-location {
  font-size: 12.5px;
  margin: 0 0 10px;
}

/* Теги сертификаций компактнее */
.company-card.vertical .certifications-tags { gap: 6px; margin-bottom: 10px; }
.company-card.vertical .certification-tag { font-size: 12px; padding: 2px 10px; }
.company-card.vertical .more-tags { width: 22px; height: 22px; }

/* Бейдж аккредитации компактнее */
.company-card.vertical .accreditation-tag { padding: 3px 10px; height: 24px; }
.company-card.vertical .accreditation-text { font-size: 12px; }
.company-card.vertical .accreditation-check { width: 15px; height: 15px; }

/* --- Бейдж типа провайдера (CB / Consultancy) --- */
.company-card.vertical .company-type-row { margin-bottom: 6px; }
.company-type-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  line-height: 1.5;
  white-space: nowrap;
}
.company-type-badge.cb { background: rgba(98, 91, 246, .10); color: #625bf6; }
.company-type-badge.consultancy { background: #fff4e0; color: #c77700; }

/* --- Контакты компании: пустые поля и заблокированная кнопка «Visit Website» ---
   При отсутствии данных: адрес/телефон показывают «Not provided», кнопка сайта
   становится серой и не ведёт на «#». Клик по любому из них показывает toast
   «Information is currently unavailable», наведение — нативный title-тултип. */
.company-contact-info .contact-value.contact-value--empty {
  color: #9aa0b4;
  opacity: 1;
  font-style: italic;
}
.company-contact-info .contact-item--empty { cursor: pointer; }

/* Кнопка сайта без URL: рендерится как <button> — сбрасываем нативный вид и
   приводим к облику обычной .action-button, но серым и с курсором «нельзя». */
.company-contact-info .action-button--disabled {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: not-allowed;
  opacity: .45;
}
.company-contact-info .action-button--disabled:hover { opacity: .45; }
