/* ===== Client auth: optional feature ===== */

.client-auth-header {
  display: flex;
  align-items: center;
  margin-right: 10px;
  flex-shrink: 0;
}

.client-auth-guest,
.client-auth-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.client-auth-btn,
.client-auth-secondary,
.client-auth-logout,
.client-auth-inline-link,
.client-auth-close,
.client-auth-tab {
  font-family: 'Comfortaa', sans-serif;
}

.client-auth-btn,
.client-auth-secondary,
.client-auth-logout {
  border: 1px solid #d9e8f3;
  cursor: pointer;
  transition: 0.2s ease;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  box-shadow: none;
}

.client-auth-btn {
  background: #1da1f2;
  color: #fff;
  border-color: #1da1f2;
}

.client-auth-btn:hover {
  background: #178bd1;
  border-color: #178bd1;
  transform: translateY(-1px);
}

.client-auth-secondary,
.client-auth-logout {
  background: #ffffff;
  color: #20486f;
}

.client-auth-secondary:hover,
.client-auth-logout:hover {
  background: #f5fbff;
  border-color: #bfe1f3;
  transform: translateY(-1px);
}

.client-auth-user-badge {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6px 12px;
  min-height: 38px;
  min-width: 0;
  border-radius: 999px;
  background: #f7fbfe;
  border: 1px solid #dcecf6;
  line-height: 1.15;
}

.client-auth-user-title {
  color: #1f4f82;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 2px;
}

.client-auth-user-name {
  color: #647686;
  font-size: 10px;
  font-weight: 600;
}

/* ===== Cart note ===== */

.client-auth-cart-note {
  margin-bottom: 18px;
  padding: 18px 18px 16px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid #dcecf6;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.04);
}

.client-auth-cart-note h3 {
  margin: 0 0 8px;
  color: #1f4f82;
  font-size: 18px;
  line-height: 1.35;
}

.client-auth-cart-note p {
  margin: 0;
  color: #5f6e7d;
  font-size: 14px;
  line-height: 1.6;
}

.client-auth-cart-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.client-auth-cart-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 9px 14px;
  background: #eef8f1;
  color: #237c49;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #d6ecdd;
}

.client-auth-fill-hint {
  margin-top: 12px;
  color: #6b7b89;
  font-size: 12px;
  line-height: 1.5;
}

/* ===== Modal ===== */

.client-auth-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.44);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000000;
}

.client-auth-backdrop.is-open {
  display: flex;
}

.client-auth-modal {
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.client-auth-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px 10px;
}

.client-auth-modal-title {
  color: #1f4f82;
  font-size: 22px;
  font-weight: 700;
}

.client-auth-close {
  border: none;
  background: #f3f7fa;
  color: #45617d;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.client-auth-close:hover {
  background: #e9f2f8;
}

.client-auth-tabs {
  display: flex;
  gap: 10px;
  padding: 0 22px 16px;
}

.client-auth-tab {
  flex: 1;
  border: none;
  border-radius: 999px;
  padding: 11px 16px;
  cursor: pointer;
  background: #f3f8fc;
  color: #47637d;
  font-size: 13px;
  font-weight: 700;
  transition: 0.2s ease;
}

.client-auth-tab:hover {
  background: #eaf4fb;
}

.client-auth-tab.is-active {
  background: #1da1f2;
  color: #fff;
}

.client-auth-modal-body {
  padding: 0 22px 22px;
}

.client-auth-panel {
  display: none;
}

.client-auth-panel.is-active {
  display: block;
}

.client-auth-subtext {
  margin: 0 0 18px;
  color: #647686;
  font-size: 14px;
  line-height: 1.6;
}

.client-auth-message {
  display: none;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
}

.client-auth-message.is-visible {
  display: block;
}

.client-auth-message.is-error {
  background: #fff1f1;
  color: #bf3d3d;
  border: 1px solid #ffd2d2;
}

.client-auth-message.is-success {
  background: #eef8f1;
  color: #237c49;
  border: 1px solid #d4f0dc;
}

.client-auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.client-auth-input {
  width: 100%;
  border: 1px solid #d9e8f3;
  border-radius: 14px;
  padding: 13px 15px;
  font-size: 14px;
  color: #22384f;
  background: #fbfdff;
  outline: none;
}

.client-auth-input:focus {
  border-color: #9fd9f7;
  box-shadow: 0 0 0 3px rgba(47, 179, 240, 0.12);
}

.client-auth-submit {
  margin-top: 6px;
  width: 100%;
  height: 44px;
  font-size: 13px;
}

.client-auth-bottom-note {
  margin-top: 12px;
  color: #7a8996;
  font-size: 12px;
  line-height: 1.6;
}

.client-auth-inline-link {
  color: #178bd1;
  font-weight: 700;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.client-auth-inline-link:hover {
  text-decoration: underline;
}

/* ===== Header adaptation ===== */

@media (max-width: 1250px) {
  .client-auth-user-badge {
    display: none;
  }
}

@media (max-width: 1100px) {
  .client-auth-header {
    margin-right: 0;
  }

  .client-auth-user,
  .client-auth-guest {
    gap: 6px;
  }

  .client-auth-btn,
  .client-auth-secondary,
  .client-auth-logout {
    padding: 0 12px;
    font-size: 11px;
    height: 36px;
  }
}

@media (max-width: 860px) {
  .client-auth-header {
    width: 100%;
    justify-content: center;
    margin-top: 8px;
  }

  .client-auth-user,
  .client-auth-guest {
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .client-auth-cart-actions {
    flex-direction: column;
  }

  .client-auth-btn,
  .client-auth-secondary,
  .client-auth-logout {
    width: 100%;
  }

  .client-auth-modal {
    border-radius: 20px;
  }

  .client-auth-tabs {
    flex-direction: column;
  }

  .client-auth-header {
    display: none;
  }
}
/* ===== FIX: меню в шапке в одну строку ===== */

.navigation,
header nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 18px;
  min-width: 0;
}

.navigation a,
header nav a {
  margin: 0 !important;
  white-space: nowrap;
  display: inline-block;
  line-height: 1;
  font-size: 15px;
}

/* чтобы центр шапки не схлопывался */
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.logo {
  flex-shrink: 0;
}

.navigation,
header nav {
  flex: 1 1 auto;
}

.header-actions {
  flex-shrink: 0;
}/* ===== HEADER FINAL FIX ===== */

.header-inner {
  display: grid;
  grid-template-columns: 250px 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 12px 0;
}

.logo {
  display: flex;
  align-items: center;
}

.navigation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  min-width: 0;
}

.navigation a {
  margin: 0;
  white-space: nowrap;
  font-size: 15px;
  line-height: 1;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.contact {
  position: relative !important;
  display: inline-block !important;
  flex-shrink: 0;
}

.main-phone {
  min-width: 330px !important;
  width: auto !important;
  white-space: nowrap !important;
  padding: 14px 20px !important;
}

.main-phone a,
.main-phone a:visited,
.main-phone a:active,
.main-phone a:hover {
  white-space: nowrap !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
  display: inline-block !important;
  line-height: 1.2 !important;
}

.contact-dropdown {
  left: auto !important;
  right: 0 !important;
  width: 330px !important;
  top: calc(100% + 10px) !important;
}

.client-auth-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.client-auth-guest,
.client-auth-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.client-auth-btn,
.client-auth-secondary,
.client-auth-logout {
  height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid #dcedf7;
  background: #f7fbfe;
  color: #163b66;
  font-size: 14px;
  font-weight: 700;
  font-family: 'Comfortaa', sans-serif;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(0,0,0,0.05);
  transition: 0.25s ease;
  cursor: pointer;
}

.client-auth-secondary {
  background: linear-gradient(135deg, #1aa2e8, #0d8ed0);
  color: #fff;
  border: none;
}

.client-auth-btn:hover,
.client-auth-secondary:hover,
.client-auth-logout:hover {
  transform: translateY(-2px);
}

.client-auth-user-badge {
  height: 44px;
  padding: 0 14px;
  border-radius: 16px;
  border: 1px solid #dcedf7;
  background: #f7fbfe;
  display: flex;
  flex-direction: column;
  justify-content: center;
  white-space: nowrap;
}

.client-auth-user-title {
  font-size: 11px;
  font-weight: 700;
  color: #1f4f82;
  line-height: 1.1;
}

.client-auth-user-name {
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  line-height: 1.1;
}

@media (max-width: 1400px) {
  .header-inner {
    grid-template-columns: 230px 1fr auto;
    gap: 18px;
  }

  .navigation {
    gap: 18px;
  }

  .main-phone {
    min-width: 290px !important;
  }

  .client-auth-user-badge {
    display: none;
  }
}
/* ===== HEADER FINAL REAL FIX ===== */

.header-inner {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 24px !important;
  padding: 15px 0 !important;
}

.logo {
  flex: 0 0 250px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
}

.navigation {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 24px !important;
  padding: 0 10px !important;
}

.navigation a {
  margin: 0 !important;
  white-space: nowrap !important;
  font-size: 15px !important;
  line-height: 1 !important;
  flex: 0 0 auto !important;
}

.header-actions {
  flex: 0 0 auto !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  margin-left: auto !important;
}

.client-auth-header,
.client-auth-guest,
.client-auth-user {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex: 0 0 auto !important;
}

.client-auth-btn,
.client-auth-secondary,
.client-auth-logout {
  height: 44px !important;
  padding: 0 16px !important;
  font-size: 14px !important;
  white-space: nowrap !important;
}

.contact {
  position: relative !important;
  display: inline-block !important;
  flex: 0 0 auto !important;
}

.main-phone {
  min-width: 0 !important;
  width: 340px !important;
  max-width: 340px !important;
  padding: 14px 20px !important;
  white-space: nowrap !important;
}

.main-phone a,
.main-phone a:visited,
.main-phone a:active,
.main-phone a:hover {
  display: inline-block !important;
  white-space: nowrap !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
}

.contact-dropdown {
  right: 0 !important;
  left: auto !important;
  width: 340px !important;
}

@media (max-width: 1450px) {
  .navigation {
    gap: 18px !important;
  }

  .client-auth-user-badge {
    display: none !important;
  }

  .main-phone {
    width: 300px !important;
    max-width: 300px !important;
  }
}
/* ===== HEADER: шире по экрану ===== */

header .container.header-inner {
  width: calc(100% - 32px) !important;
  max-width: 1760px !important;
  margin: 0 auto !important;
}/* ===== FIX: цвета кнопок авторизации в шапке ===== */

.client-auth-header .client-auth-btn,
.client-auth-header .client-auth-btn:visited,
.client-auth-header .client-auth-btn:hover,
.client-auth-header .client-auth-btn:focus,
.client-auth-header .client-auth-btn:active {
  background: #f7fbfe !important;
  color: #163b66 !important;
  border: 1px solid #dcedf7 !important;
  opacity: 1 !important;
}

.client-auth-header .client-auth-secondary,
.client-auth-header .client-auth-secondary:visited,
.client-auth-header .client-auth-secondary:hover,
.client-auth-header .client-auth-secondary:focus,
.client-auth-header .client-auth-secondary:active {
  background: linear-gradient(135deg, #1aa2e8, #0d8ed0) !important;
  color: #ffffff !important;
  border: none !important;
  opacity: 1 !important;
}

/* если где-то на кнопку вешается active/is-active */
.client-auth-header .client-auth-btn.active,
.client-auth-header .client-auth-btn.is-active,
.client-auth-header .client-auth-btn[aria-current="page"] {
  background: #f7fbfe !important;
  color: #163b66 !important;
  border: 1px solid #dcedf7 !important;
}
/* ===== FIX: кабинет не должен перекрывать навигацию ===== */

.client-auth-user-badge {
  max-width: 260px !important;
  overflow: hidden !important;
}

.client-auth-user-title,
.client-auth-user-name {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}



/* чуть компактнее правый блок */
.header-actions {
  gap: 10px !important;
}

.client-auth-btn,
.client-auth-secondary,
.client-auth-logout {
  padding: 0 14px !important;
}
/* ===== FIX: компактный badge аккаунта ===== */

.client-auth-user-badge {
  max-width: 170px !important;
  padding: 0 12px !important;
  overflow: hidden !important;
}

.client-auth-user-title,
.client-auth-user-name {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.client-auth-user-title {
  font-size: 10px !important;
}

.client-auth-user-name {
  font-size: 10px !important;
}

/* немного ужимаем правую часть */
.header-actions {
  gap: 8px !important;
}

.client-auth-btn,
.client-auth-secondary,
.client-auth-logout {
  padding: 0 12px !important;
  font-size: 13px !important;
}
/* ===== HEADER LAYOUT SAFE FIX ===== */

header .container.header-inner {
  display: grid !important;
  grid-template-columns: 220px minmax(420px, 1fr) auto auto !important;
  align-items: center !important;
  column-gap: 18px !important;
}

/* логотип */
.logo {
  min-width: 0 !important;
  flex: none !important;
}

/* меню всегда в своей колонке и по центру */
.navigation,
header nav {
  min-width: 0 !important;
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 18px !important;
  overflow: hidden !important;
}

.navigation a,
header nav a {
  flex: 0 0 auto !important;
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 44px !important;
  padding: 0 16px !important;
  line-height: 1 !important;
}

/* правый блок авторизации не должен растягивать меню */
.header-actions {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex: none !important;
  min-width: fit-content !important;
  margin-left: 0 !important;
}

/* блок пользователя ужимаем и запрещаем ему налезать */
.client-auth-header,
.client-auth-guest,
.client-auth-user {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  min-width: 0 !important;
}

.client-auth-user-badge {
  max-width: 150px !important;
  min-width: 0 !important;
  padding: 0 10px !important;
  overflow: hidden !important;
}

.client-auth-user-title,
.client-auth-user-name {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* почта — отдельная колонка, не ломает меню */
.contact {
  min-width: 0 !important;
  flex: none !important;
}

.main-phone {
  width: 300px !important;
  max-width: 300px !important;
  min-width: 300px !important;
  box-sizing: border-box !important;
}

/* когда места уже мало — сначала прячем badge, а не ломаем меню */
@media (max-width: 1380px) {
  .client-auth-user-badge {
    display: none !important;
  }

  header .container.header-inner {
    grid-template-columns: 200px minmax(360px, 1fr) auto auto !important;
  }

  .main-phone {
    width: 270px !important;
    max-width: 270px !important;
    min-width: 270px !important;
  }
}

@media (max-width: 1240px) {
  .main-phone {
    display: none !important;
  }

  header .container.header-inner {
    grid-template-columns: 200px minmax(320px, 1fr) auto !important;
  }
}
/* ===== HEADER MICRO-COMPACT FIX ===== */

header .container.header-inner {
  grid-template-columns: 170px minmax(320px, 1fr) auto auto !important;
  column-gap: 12px !important;
}

.navigation,
header nav {
  gap: 8px !important;
}

.navigation a,
header nav a {
  padding: 0 12px !important;
  font-size: 14px !important;
}

.logo {
  flex: 0 0 170px !important;
  max-width: 170px !important;
  overflow: hidden !important;
}

.client-auth-user-badge {
  max-width: 130px !important;
  padding: 0 8px !important;
}

.client-auth-user-title,
.client-auth-user-name {
  font-size: 9px !important;
}

.client-auth-btn,
.client-auth-secondary,
.client-auth-logout {
  height: 40px !important;
  padding: 0 10px !important;
  font-size: 12px !important;
}

.header-actions {
  gap: 6px !important;
}

.cart-btn {
  width: 46px !important;
  height: 46px !important;
}
/* =========================================
   GLOBAL MOBILE FIX
   вставить В КОНЕЦ client-auth.css
   ========================================= */

   @media (max-width: 768px) {
    html,
    body {
      overflow-x: hidden !important;
    }
  
    header {
      height: auto !important;
      padding: 10px 0 !important;
    }
  
    .header-inner {
      display: grid !important;
      grid-template-columns: 1fr !important;
      align-items: center !important;
      gap: 12px !important;
    }
  
    .logo {
      display: flex !important;
      justify-content: center !important;
      width: 100% !important;
    }
  
    #logo {
      width: 170px !important;
      height: auto !important;
      max-width: 100% !important;
    }
  
    .navigation {
      width: 100% !important;
      display: flex !important;
      justify-content: center !important;
      flex-wrap: wrap !important;
      gap: 8px 10px !important;
      margin: 0 !important;
    }
  
    .navigation a {
      margin: 0 !important;
      padding: 8px 10px !important;
      font-size: 13px !important;
      line-height: 1.2 !important;
      white-space: nowrap !important;
    }
  
    .header-actions {
      width: 100% !important;
      display: flex !important;
      justify-content: flex-end !important;
      align-items: flex-start !important;
      gap: 8px !important;
      margin: 0 !important;
    }
  
    #client-auth-header,
    .client-auth-header {
      width: 140px !important;
      min-width: 140px !important;
      max-width: 140px !important;
      display: flex !important;
      flex-direction: column !important;
      align-items: stretch !important;
      gap: 8px !important;
      flex: 0 0 140px !important;
    }
  
    #client-auth-header *,
    .client-auth-header * {
      box-sizing: border-box !important;
    }
  
    #client-auth-header a,
    #client-auth-header button,
    .client-auth-header a,
    .client-auth-header button,
    .client-auth-header .auth-btn,
    .client-auth-header .login-btn,
    .client-auth-header .register-btn,
    .client-auth-header .sign-in-btn,
    .client-auth-header .sign-up-btn {
      width: 100% !important;
      min-width: 0 !important;
      max-width: 100% !important;
      min-height: 38px !important;
      padding: 9px 10px !important;
      font-size: 13px !important;
      line-height: 1.2 !important;
      display: flex !important;
      align-items: center !important;
      justify-content: center !important;
      text-align: center !important;
      white-space: nowrap !important;
      border-radius: 999px !important;
    }
  
    .cart-btn {
      position: relative !important;
      top: auto !important;
      right: auto !important;
      left: auto !important;
      bottom: auto !important;
      transform: none !important;
      margin: 0 6px 0 0 !important;
      flex: 0 0 44px !important;
      width: 44px !important;
      height: 44px !important;
      display: flex !important;
      align-items: center !important;
      justify-content: center !important;
      align-self: flex-start !important;
    }
  
    .cart-icon {
      width: 22px !important;
      height: 22px !important;
      max-width: 22px !important;
      object-fit: contain !important;
    }
  
    .cart-count {
      top: 2px !important;
      right: 2px !important;
      transform: none !important;
    }
  
    .contact {
      display: none !important;
    }
  
    .categories {
      width: 100% !important;
      display: grid !important;
      grid-template-columns: 1fr !important;
      gap: 12px !important;
      padding: 0 14px !important;
      margin-top: 12px !important;
      box-sizing: border-box !important;
    }
  
    .cat-item {
      width: 100% !important;
      min-width: 0 !important;
      padding: 14px 10px !important;
      text-align: center !important;
      box-sizing: border-box !important;
    }
  
    .cat-item img {
      max-width: 72px !important;
      height: auto !important;
    }
  
    .cat-item span,
    .cat-item p {
      font-size: 14px !important;
      line-height: 1.35 !important;
      overflow-wrap: anywhere !important;
    }
  
    .cat-dropdown {
      position: static !important;
      left: auto !important;
      right: auto !important;
      top: auto !important;
      opacity: 1 !important;
      visibility: visible !important;
      transform: none !important;
      width: 100% !important;
      margin-top: 10px !important;
      padding: 0 !important;
      box-shadow: none !important;
      background: transparent !important;
    }
  
    .cat-dropdown-row {
      display: grid !important;
      grid-template-columns: 1fr !important;
      gap: 10px !important;
    }
  
    .cat-card {
      width: 100% !important;
      min-width: 0 !important;
      box-sizing: border-box !important;
    }
  }
  
  @media (max-width: 480px) {
    #logo {
      width: 155px !important;
    }
  
    .navigation a {
      font-size: 12px !important;
      padding: 7px 8px !important;
    }
  
    #client-auth-header,
    .client-auth-header {
      width: 132px !important;
      min-width: 132px !important;
      max-width: 132px !important;
      flex-basis: 132px !important;
    }
  
    #client-auth-header a,
    #client-auth-header button,
    .client-auth-header a,
    .client-auth-header button,
    .client-auth-header .auth-btn,
    .client-auth-header .login-btn,
    .client-auth-header .register-btn,
    .client-auth-header .sign-in-btn,
    .client-auth-header .sign-up-btn {
      min-height: 36px !important;
      font-size: 12px !important;
      padding: 8px 8px !important;
    }
  
    .cart-btn {
      width: 42px !important;
      height: 42px !important;
      margin-right: 4px !important;
    }
  }