/* Navigation consistency patch shared across public and admin pages. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

.site-nav,
.account-nav,
.navbar {
  width: 100%;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  min-height: 78px;
  padding: 0 7%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(18px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .06);
}

.site-nav .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #0f172a;
  font-size: 26px;
  font-weight: 800;
}

.site-nav .brand span {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #009688;
  color: #fff;
  font-size: 18px;
}

.site-nav .nav-toggle {
  display: none;
  border: 0;
  border-radius: 12px;
  background: #0f172a;
  color: #fff;
  cursor: pointer;
}

.site-nav .nav-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.site-nav .nav-menu a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 12px;
  color: #64748b;
  font-weight: 700;
}

.site-nav .nav-menu a.active,
.site-nav .nav-menu a:hover {
  background: #eef7f5;
  color: #006f65;
}

.site-nav .nav-menu .admin-link {
  background: #0f172a !important;
  color: #fff !important;
}

.site-nav .brand,
.account-nav .brand,
.navbar .logo {
  flex: 0 0 auto;
  min-width: 0;
  white-space: nowrap;
}

.site-nav .brand,
.site-nav .nav-menu a,
.site-nav .cart-nav,
.account-nav a,
.account-nav button,
.navbar a {
  text-decoration: none;
}

.site-nav .nav-menu {
  min-width: 0;
}

.site-nav .nav-menu a {
  white-space: nowrap;
}

.site-nav .nav-toggle {
  flex: 0 0 auto;
}

.site-nav .cart-nav {
  flex: 0 0 auto;
  position: relative;
  display: inline-flex;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 14px;
  background: #0f172a;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.site-nav .global-search-trigger {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #f8fafc;
  color: #0f172a;
  font-weight: 800;
  cursor: pointer;
}

.site-nav .global-search-trigger:hover {
  border-color: rgba(0, 150, 136, .28);
  background: #eef7f5;
  color: #006f65;
}

.site-nav a.cart-nav {
  padding: 0;
}

.site-nav .cart-nav span {
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #009688;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 920px) {
  .site-nav.has-cart {
    align-items: flex-start !important;
    flex-direction: column !important;
    min-height: 78px;
    padding: 16px 186px 16px 20px !important;
  }

  .site-nav.has-cart .brand {
    min-height: 46px;
    max-width: 100%;
  }

  .site-nav.has-cart .nav-toggle {
    display: grid !important;
    position: absolute !important;
    top: 16px !important;
    right: 78px !important;
    z-index: 25 !important;
    width: 44px;
    height: 44px;
  }

  .site-nav.has-cart .global-search-trigger {
    position: absolute !important;
    top: 16px !important;
    right: 132px !important;
    z-index: 25 !important;
    width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 !important;
    border-radius: 12px !important;
    background: #0f172a !important;
    color: #fff !important;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .18);
  }

  .site-nav.has-cart .global-search-trigger span {
    display: none !important;
  }

  .site-nav.has-cart .cart-nav {
    display: inline-flex !important;
    position: absolute !important;
    top: 15px !important;
    right: 20px !important;
    z-index: 25 !important;
    width: 44px;
    height: 44px;
    justify-content: center;
  }

  .site-nav.has-cart .nav-menu {
    display: none !important;
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    width: min(100%, calc(100vw - 40px)) !important;
    margin: 14px 0 0 !important;
    padding: 14px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .site-nav.has-cart .nav-menu.open {
    display: flex !important;
  }

  .site-nav.has-cart .nav-menu a {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
  }
}

.global-search-open {
  overflow: hidden;
}

.global-search-modal {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 72px 18px 24px;
  background: rgba(15, 23, 42, .62);
  backdrop-filter: blur(14px);
  opacity: 0;
  visibility: hidden;
  transition: .2s ease;
}

.global-search-modal.active {
  opacity: 1;
  visibility: visible;
}

.global-search-panel {
  position: relative;
  width: min(760px, 100%);
  max-height: min(760px, calc(100vh - 110px));
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(15, 23, 42, .25);
  padding: 24px;
}

.global-search-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: #f1f5f9;
  color: #0f172a;
  cursor: pointer;
}

.global-search-head {
  padding-right: 52px;
}

.global-search-head p {
  color: #d49a28;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.global-search-head h2 {
  margin-top: 6px;
  color: #0f172a;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.08;
}

.global-search-field {
  margin: 20px 0 16px;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  padding: 0 16px;
}

.global-search-field i {
  color: #009688;
}

.global-search-field input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #0f172a;
  font-size: 16px;
}

.global-search-results {
  display: grid;
  gap: 10px;
}

.global-search-quick {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.global-search-quick a,
.global-result,
.global-search-empty {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}

.global-search-quick a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 12px;
  color: #0f172a;
  font-weight: 800;
}

.global-search-quick i {
  color: #009688;
}

.global-result {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px;
  color: #0f172a;
}

.global-result img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.global-result strong,
.global-result span {
  display: block;
}

.global-result strong {
  overflow: hidden;
  color: #0f172a;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-result span {
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
}

.global-result em {
  color: #009688;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.global-search-loading,
.global-search-empty {
  padding: 18px;
  color: #64748b;
}

.global-search-empty strong {
  display: block;
  color: #0f172a;
}

.global-search-empty a {
  display: inline-flex;
  margin-top: 12px;
  color: #006f65;
  font-weight: 900;
}

@media (max-width: 620px) {
  .global-search-modal {
    padding: 84px 12px 12px;
  }

  .global-search-panel {
    padding: 18px;
  }

  .global-result {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .global-result em {
    grid-column: 2;
  }
}

@media (max-width: 820px) {
  .site-nav:not(.has-cart) {
    align-items: flex-start !important;
    flex-direction: column !important;
    min-height: 78px;
    padding: 16px 20px !important;
  }

  .site-nav:not(.has-cart) .brand {
    min-height: 46px;
    max-width: calc(100% - 64px);
  }

  .site-nav:not(.has-cart) .nav-toggle {
    display: grid !important;
    position: absolute !important;
    top: 17px !important;
    right: 20px !important;
    z-index: 25 !important;
    width: 44px;
    height: 44px;
  }

  .site-nav:not(.has-cart) .nav-menu {
    display: none !important;
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    width: 100% !important;
    margin: 14px 0 0 !important;
    padding: 14px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .site-nav:not(.has-cart) .nav-menu.open {
    display: flex !important;
  }

  .site-nav:not(.has-cart) .nav-menu a {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
  }

  .account-nav {
    align-items: stretch !important;
    flex-direction: column !important;
    gap: 14px !important;
  }

  .account-nav > div {
    display: grid !important;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px !important;
  }

  .account-nav > div a,
  .account-nav > div button {
    justify-content: center;
    min-height: 44px;
    text-align: center;
  }
}

@media (max-width: 640px) {
  .account-nav > div {
    grid-template-columns: 1fr;
  }

  .navbar {
    align-items: flex-start !important;
    flex-direction: column !important;
    gap: 12px !important;
    padding: 18px 20px !important;
  }

  .navbar .nav-links {
    display: grid !important;
    width: 100%;
    grid-template-columns: 1fr;
    gap: 8px !important;
  }

  .navbar .nav-links a {
    width: 100%;
  }
}

@media (max-width: 900px) {
  .admin-app,
  .admin-layout,
  .admin-orders-layout,
  .admin-devis-layout,
  .admin-stats-layout {
    max-width: 100%;
    overflow-x: hidden;
  }

  .main,
  .admin-main,
  .admin-orders-main,
  .admin-devis-main,
  .admin-stats-main,
  .card,
  .orders-table-card,
  .clients-card,
  .devis-panel,
  .table-wrapper {
    min-width: 0;
    max-width: 100%;
  }

  .admin-sidebar {
    min-height: auto;
  }

  .sidebar .side-menu,
  .admin-sidebar nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .admin-sidebar > div {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0 !important;
  }

  .sidebar .side-menu a,
  .sidebar .side-menu button,
  .admin-sidebar nav a {
    justify-content: center;
    min-height: 44px;
    text-align: center;
  }
}

@media (max-width: 520px) {
  .sidebar .side-menu,
  .admin-sidebar nav {
    grid-template-columns: 1fr;
  }
}

.admin-app,
.admin-layout,
.admin-orders-layout,
.admin-devis-layout,
.admin-stats-layout,
.main,
.admin-main,
.admin-orders-main,
.admin-devis-main,
.admin-stats-main,
.orders-table-card,
.clients-card,
.devis-panel,
.table-wrapper {
  min-width: 0;
}

.legal-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 26px 7%;
  background: #101820;
  color: #fff;
}

.legal-footer span {
  margin-right: 10px;
  font-weight: 900;
}

.legal-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 999px;
  color: rgba(255, 255, 255, .72);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.legal-footer a:hover {
  background: rgba(255, 255, 255, .09);
  color: #fff;
}
