/* =========================================================================
   DIMAQ Header — menu "Zaloguj ▾" (platforma certyfikacyjna + zamówienia)
   Desktop: top-bar-account-menu (dropdown)
   Mobile:  dimaq-mobile-account (ta sama zawartość, partials/header-account-options)
   ========================================================================= */

/* ==================== FIX: wyśrodkowane linki nawigacji w menu mobilnym ==================== */
/* Skompilowany bundle ma stare, nieusunięte reguły z wcześniejszej wersji
   komponentu menu mobilnego (m.in. #mobile-menu-panel a{display:block;...}),
   które kolidują z bieżącym wp_nav_menu (te <a> nie mają własnej klasy).
   Wymuszamy jawnie pełną szerokość + wyrównanie do lewej wysoką specyficznością,
   niezależnie od tego, która reguła akurat wygrywa w kaskadzie. */
#mobile-menu-panel .mobile-menu-list a {
  display: block;
  width: 100%;
  text-align: left;
}

/* ==================== SHARED (avatar + dropdown body, reused desktop/mobile) ==================== */

.dimaq-account-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #EEEEEE;
  color: #212121;
  font-family: "Fira Sans", sans-serif;
  font-weight: 600;
  font-size: 12px;
  line-height: 1;
  flex-shrink: 0;
}

.dimaq-account-avatar--lg {
  width: 40px;
  height: 40px;
  font-size: 14px;
}

.dimaq-account-dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dimaq-account-dropdown-header strong {
  display: block;
  font-family: "Fira Sans", sans-serif;
  font-weight: 600;
  font-size: 14px;
  line-height: 20px;
  color: #212121;
}

.dimaq-account-dropdown-header > div span {
  display: block;
  font-family: "Fira Sans", sans-serif;
  font-weight: 400;
  font-size: 12px;
  line-height: 16px;
  color: #9E9E9E;
}

/* ==================== DESKTOP: "Zaloguj ▾" (pkt 21, 2026-11-19) ==================== */
/* Jedno wejście zamiast dwóch przycisków. Zawartość menu (platforma
   certyfikacyjna + zamówienia) = partials/header-account-options.blade.php,
   ta sama w menu mobilnym. */

.top-bar-account-menu {
  position: relative;
}

.top-bar-account-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px 9px 18px;
  border: 1px solid #E0E0E0;
  border-radius: 999px;
  background: #FFFFFF;
  color: #212121;
  font-family: "Fira Sans", sans-serif;
  font-size: 13px;
  font-weight: 600;
  line-height: 16px;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.top-bar-account-trigger.is-logged-in {
  padding: 3px 12px 3px 3px;
}

.top-bar-account-trigger:hover,
.top-bar-account-menu.is-open .top-bar-account-trigger {
  border-color: #212121;
}

.top-bar-account-trigger:focus-visible {
  outline: 2px solid #EF1800;
  outline-offset: 2px;
}

.top-bar-account-chevron {
  flex-shrink: 0;
  color: #757575;
  transition: transform 0.2s;
}

.top-bar-account-menu.is-open .top-bar-account-chevron {
  transform: rotate(180deg);
}

.top-bar-account-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 320px;
  padding: 16px;
  background: #FFFFFF;
  border: 1px solid #EEEEEE;
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
  z-index: 60;
}

.top-bar-account-menu.is-open .top-bar-account-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ==================== MENU KONTA — wspólne (dropdown + mobile) ==================== */
/* Selektory z #mobile-menu-panel niżej: bundle ma #mobile-menu-panel a
   {display:block;color:#212121}, który bije same klasy. */

.dimaq-account-section + .dimaq-account-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #EEEEEE;
}

.dimaq-account-section-label {
  display: block;
  margin: 0 0 8px;
  font-family: "Fira Sans", sans-serif;
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9E9E9E;
}

.dimaq-account-platform,
#mobile-menu-panel a.dimaq-account-platform {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #212121;
  color: #FFFFFF;
  text-decoration: none;
  transition: background-color 0.2s;
}

.dimaq-account-platform:hover,
#mobile-menu-panel a.dimaq-account-platform:hover {
  background: #000000;
  color: #FFFFFF;
}

.dimaq-account-platform svg,
.dimaq-account-orders svg {
  flex-shrink: 0;
}

.dimaq-account-platform-text,
.dimaq-account-orders-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  font-family: "Fira Sans", sans-serif;
}

.dimaq-account-platform-text strong,
.dimaq-account-orders-text strong {
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
}

.dimaq-account-platform-text small,
.dimaq-account-orders-text small {
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
}

.dimaq-account-platform-text small {
  color: #BDBDBD;
}

.dimaq-account-orders-text small {
  color: #9E9E9E;
}

.dimaq-account-orders,
#mobile-menu-panel a.dimaq-account-orders {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  color: #212121;
  text-decoration: none;
  transition: background-color 0.15s;
}

.dimaq-account-orders:hover,
#mobile-menu-panel a.dimaq-account-orders:hover {
  background: #F5F5F5;
}

.dimaq-account-link,
#mobile-menu-panel a.dimaq-account-link {
  display: block;
  padding: 8px 14px 8px 46px;
  border-radius: 8px;
  font-family: "Fira Sans", sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  color: #212121;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}

.dimaq-account-link:hover,
#mobile-menu-panel a.dimaq-account-link:hover {
  background: #F5F5F5;
}

.dimaq-account-link--logout,
#mobile-menu-panel a.dimaq-account-link--logout {
  margin-top: 8px;
  padding-left: 14px;
  color: #9E9E9E;
}

.dimaq-account-link--logout:hover,
#mobile-menu-panel a.dimaq-account-link--logout:hover {
  background: #FFF5F4;
  color: #EF1800;
}

.dimaq-account-section .dimaq-account-dropdown-header {
  padding: 4px 14px 8px;
}

.dimaq-account-section .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==================== MOBILE MENU ==================== */

/* Niezalogowany: "Moje zamówienia" jako obramowany przycisk pod platformą. */
#mobile-menu-panel .dimaq-mobile-account a.dimaq-account-orders {
  border: 1px solid #E0E0E0;
}

#mobile-menu-panel .dimaq-mobile-account .dimaq-account-dropdown-header + a.dimaq-account-orders {
  border-color: transparent;
}

/* ==================== MOBILE HEADER — koszyk + szukaj + hamburger, do prawej ==================== */
/* Wszystkie trzy w jednym flex-kontenerze, żeby .header-content (space-between)
   traktował je jako JEDEN element przyklejony do prawej krawędzi, zamiast
   rozstrzeliwać je po całej szerokości. .header-cart-wrapper jest widoczny na
   każdej szerokości (dimaq-mini-cart.css), search-toggle/menu-toggle tylko <1024px. */

.header-icon-group {
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
  z-index: 100;
}

.mobile-search-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  color: #212121;
  cursor: pointer;
  padding: 0;
}

@media (max-width: 1279px) {
  .mobile-search-toggle {
    display: flex;
  }
}

/* --- Panel wyszukiwania: pełnoszerokościowy panel wysuwany od góry ekranu,
   nie wciśnięty w wiersz nagłówka (ten sam wzorzec co .mobile-menu-overlay /
   .mobile-menu-panel, żeby nie "nachodził" na resztę headera). --- */

.mobile-search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  /* Above .header-icon-group (z-index:100 above, for the minicart dropdown)
     — otherwise the cart icon pokes through the search panel. */
  z-index: 110;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.mobile-search-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

.mobile-search-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #FFFFFF;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
  z-index: 111;
  transform: translateY(-100%);
  transition: transform 0.25s ease;
}

.mobile-search-panel.is-active {
  transform: translateY(0);
}

.mobile-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px;
}

.mobile-search-back,
.mobile-search-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  color: #212121;
  cursor: pointer;
  padding: 0;
}

.mobile-search-form {
  flex: 1;
  min-width: 0;
}

.mobile-search-input {
  width: 100%;
  height: 44px;
  padding: 0 4px;
  border: none;
  background: none;
  color: #212121;
  font-family: "Fira Sans", sans-serif;
  font-size: 16px;
  outline: none;
}

.mobile-search-input::placeholder {
  color: #9E9E9E;
}

/* Hide the browser's own native "x" clear icon on type=search — we already
   have our own .mobile-search-clear button, so both were showing at once. */
.mobile-search-input::-webkit-search-cancel-button,
.mobile-search-input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.mobile-search-input::-ms-clear {
  display: none;
}

@media (min-width: 1280px) {
  .mobile-search-overlay,
  .mobile-search-panel {
    display: none !important;
  }
}
