/* ==============================================
   LAYOUT — Page chrome: header, nav, footer,
   skip link, top-bar, brand. Loaded by every page.
   ============================================== */

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 6px 10px;
  background: #111827;
  color: #ffffff;
  border-radius: 999px;
  font-size: 0.9rem;
  z-index: 1000;
  transform: translateY(-120%);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.15s ease,
    opacity 0.15s ease;
}

.skip-link:focus {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
  outline: none;
}

.main-header {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(216, 225, 234, 0.95);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
  position: sticky;
  top: 0;
  z-index: 920;
}

.header-inner {
  max-width: 1360px;
  margin: 0 auto;
  min-height: 72px;
  padding: 0.78rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.1rem;
}

.header-left {
  display: flex;
  align-items: center;
}

.header-left .header-logo {
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  font-size: 1.25rem;
  text-decoration: none;
  color: #111827;
}

.header-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.header-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 0.78rem;
  border-radius: 999px;
  text-decoration: none;
  color: #516376;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

.header-link:hover {
  background: rgba(15, 23, 42, 0.045);
  color: #10233b;
}

.header-link:focus-visible {
  outline: none;
  background: rgba(15, 23, 42, 0.05);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.14);
}

.header-link.header-link-current {
  background: rgba(22, 163, 74, 0.09);
  color: #175c39;
  font-weight: 700;
}

.nav-link-admin-subtle {
  font-size: 0.76rem;
  opacity: 0.78;
  padding-inline: 0.6rem;
}

.nav-link-admin-subtle:hover {
  opacity: 1;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.header-language-switcher {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.header-language-label {
  font-size: 0.92rem;
  line-height: 1;
  color: #6b7280;
  display: inline-flex;
  align-items: center;
}

.header-language-label.header-language-flag {
  width: 20px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid #d9e1ea;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.header-language-select {
  border: 1px solid #d1d5db;
  background: #ffffff;
  border-radius: 999px;
  color: #111827;
  font-size: 0.8rem;
  padding: 0.2rem 0.55rem;
}

.header-cart-button {
  min-height: 40px;
  border: 1px solid rgba(214, 223, 231, 0.95);
  background: rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  padding: 0.35rem 0.82rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.42rem;
  color: #13283e;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.12s ease;
}

.header-cart-button:hover {
  background: #ffffff;
  border-color: #c8d5e2;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
  transform: translateY(-1px);
}

.header-cart-button:focus-visible {
  outline: none;
  border-color: #9dc9ab;
  box-shadow:
    0 0 0 4px rgba(22, 163, 74, 0.08),
    0 6px 16px rgba(15, 23, 42, 0.05);
}

.header-cart-count {
  min-width: 1.25rem;
  font-size: 0.84rem;
  font-weight: 700;
  text-align: center;
  color: #17324d;
}

.header-cart-count[data-count="0"] {
  display: none;
}

.header-account {
  position: relative;
  min-width: 0;
}

.account-menu .account-button {
  min-height: 40px;
  border: 1px solid rgba(214, 223, 231, 0.95);
  background: rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  padding: 0.35rem 0.82rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: #13283e;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.12s ease;
}

.account-menu .account-button:hover {
  background: #ffffff;
  border-color: #c8d5e2;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
  transform: translateY(-1px);
}

.account-menu .account-button:focus-visible {
  outline: none;
  border-color: #9dc9ab;
  box-shadow:
    0 0 0 4px rgba(22, 163, 74, 0.08),
    0 6px 16px rgba(15, 23, 42, 0.05);
}

.header-account .account-button.account-button-signed-out {
  position: relative;
  min-height: 40px;
  min-width: 0;
  justify-content: flex-start;
  gap: 0.42rem;
  padding: 0.46rem 0.88rem 0.46rem 0.74rem;
  border-radius: 999px;
  border: 1px solid rgba(36, 110, 69, 0.12);
  background: linear-gradient(180deg, rgba(244, 251, 246, 0.96), rgba(235, 245, 239, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 4px 12px rgba(15, 23, 42, 0.05);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    border-color 0.12s ease,
    background-color 0.12s ease,
    color 0.12s ease;
}

.header-account .account-button.account-button-signed-out::before {
  content: "Z";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-right: 0.08rem;
  border-radius: 999px;
  border: 1px solid rgba(36, 110, 69, 0.12);
  background: rgba(255, 255, 255, 0.72);
  color: #166534;
  font-size: 0.79rem;
  line-height: 1;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  flex-shrink: 0;
}

.header-account .account-button.account-button-signed-out:hover {
  transform: translateY(-1px);
  border-color: rgba(36, 110, 69, 0.18);
  background: linear-gradient(180deg, #f8fcf9, #e8f3ec);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 6px 16px rgba(15, 23, 42, 0.06);
}

.header-account .account-button.account-button-signed-out:focus-visible {
  outline: none;
  border-color: rgba(36, 110, 69, 0.2);
  box-shadow:
    0 0 0 4px rgba(22, 163, 74, 0.08),
    0 6px 16px rgba(15, 23, 42, 0.06);
}

.account-avatar {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--color-primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
}

.account-label {
  color: #13283e;
  line-height: 1;
}

.account-label.account-label-signed-out {
  color: #163a2a;
  font-size: 0.87rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.account-dropdown {
  position: absolute;
  right: 0;
  margin-top: 0.55rem;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(216, 225, 234, 0.95);
  border-radius: 14px;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
  padding: 0.4rem;
  min-width: 190px;
  z-index: 20;
  display: none;
}

.account-dropdown.open {
  display: block;
}

.account-dropdown a,
.account-dropdown button.account-logout-button,
.account-dropdown button {
  display: block;
  width: calc(100% - 0.7rem);
  margin: 0 0.35rem;
  text-align: left;
  padding: 0.62rem 0.9rem;
  border-radius: 10px;
  font-size: 0.88rem;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #374151;
  text-decoration: none;
}

.account-dropdown a:hover,
.account-dropdown button.account-logout-button:hover,
.account-dropdown button:hover {
  background: #f5f8fb;
}

.nav-compat-hidden {
  display: none !important;
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 12px max(18px, calc((100vw - 1100px) / 2 + 16px));
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.top-bar-left,
.top-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

/* =========================
   Brand Logo
========================= */
.brand-logo-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.brand-logo {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #f97316, #facc15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111827;
  font-weight: 800;
  box-shadow: 0 0 0 2px #f9fafb;
}

.brand-name {
  font-weight: 700;
  font-size: 1.1rem;
  color: #111827;
}

@media (min-width: 769px) {
  .main-header {
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.045);
  }

  .header-inner {
    min-height: 76px;
    justify-content: flex-start;
    padding: 0.82rem 1.35rem 0.82rem 1.12rem;
    gap: 1.3rem;
  }

  .header-left {
    flex: 0 0 auto;
    min-width: 0;
    gap: 0.26rem;
  }

  .header-left .header-logo {
    min-height: 42px;
  }

  .brand-logo-wrapper {
    gap: 0.64rem;
  }

  .brand-logo {
    width: 33px;
    height: 33px;
    box-shadow:
      0 0 0 2px rgba(249, 250, 251, 0.96),
      0 7px 18px rgba(15, 23, 42, 0.08);
  }

  .brand-name {
    font-size: 1.14rem;
    font-weight: 750;
    letter-spacing: -0.02em;
  }

  .header-nav-row {
    display: flex;
    flex: 1 1 auto;
    justify-content: center;
    min-width: 0;
  }

  .header-nav {
    width: 100%;
    justify-content: center;
    gap: 0.22rem;
  }

  .header-link {
    min-height: 40px;
    padding: 0 0.88rem;
    border-radius: 12px;
  }

  .header-link[href="/seller.html"],
  .header-link.header-link-sell {
    margin-left: 0.5rem;
    padding-inline: 0.88rem;
    color: #175c39;
    font-weight: 600;
    border: 1.5px solid rgba(22, 163, 74, 0.35);
    border-radius: 12px;
  }

  .header-link[href="/seller.html"]:hover,
  .header-link.header-link-sell:hover {
    background: rgba(22, 163, 74, 0.07);
    border-color: rgba(22, 163, 74, 0.6);
    color: #0f4a2b;
  }

  .header-link.header-link-current[href="/seller.html"],
  .header-link.header-link-current.header-link-sell {
    background: rgba(22, 163, 74, 0.1);
    border-color: rgba(22, 163, 74, 0.5);
    color: #175c39;
  }

  .header-right {
    flex: 0 0 auto;
    gap: 0.4rem;
    margin-left: auto;
    padding-left: 0.2rem;
  }

  .header-language-switcher {
    min-height: 40px;
    gap: 0.32rem;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
  }

  .header-language-switcher:focus-within {
    border-radius: 999px;
    box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.08);
  }

  .header-language-select {
    background: transparent;
    padding: 0.22rem 0.22rem 0.22rem 0.08rem;
  }

  .header-language-select:focus-visible {
    outline: none;
  }

  .header-cart-button,
  .account-menu .account-button {
    min-height: 42px;
    padding: 0.38rem 0.84rem;
    border-color: rgba(214, 223, 231, 0.9);
    background: rgba(255, 255, 255, 0.84);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
  }

  .header-cart-button:hover,
  .account-menu .account-button:hover {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.84),
      0 5px 14px rgba(15, 23, 42, 0.04);
  }

  .header-account .account-button.account-button-signed-out {
    padding: 0.46rem 0.88rem 0.46rem 0.74rem;
    border-color: rgba(36, 110, 69, 0.08);
    background: linear-gradient(180deg, rgba(246, 251, 247, 0.92), rgba(239, 246, 241, 0.92));
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.86),
      0 2px 8px rgba(15, 23, 42, 0.035);
  }

  .header-account .account-button.account-button-signed-out:hover {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.9),
      0 5px 14px rgba(15, 23, 42, 0.04);
  }
}

.top-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.top-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}

.top-nav a:hover {
  background: #edf2f7;
  color: var(--text-main);
  transform: translateY(-1px);
}

.top-nav a.nav-current {
  background: var(--brand-dark);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 10px 22px rgba(16, 35, 63, 0.18);
}

.top-nav .nav-admin-link {
  min-width: 64px;
  text-align: center;
}

.top-nav .nav-orders-link {
  min-width: 82px;
  text-align: center;
}

.top-nav .nav-item-hidden {
  visibility: hidden;
  pointer-events: none;
}

.cart-icon {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: #ffffff;
  color: var(--brand-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cart-icon:hover {
  background: #f2f7fb;
}

.cart-icon-glyph {
  font-size: 17px;
}

.cart-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 19px;
  height: 19px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  background: #71839a;
  transition: background-color 0.15s ease;
}

.cart-badge.has-items {
  background: var(--brand-accent);
}

.profile-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: #ffffff;
  color: var(--text-main);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
  transition:
    background-color 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.profile-pill:hover {
  background: #f4f7fb;
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
}

.customer-greeting {
  font-size: 12px;
  color: var(--text-muted);
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-primary {
  border-radius: 999px;
  border: none;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  transition:
    transform 0.12s ease,
    filter 0.12s ease,
    background-color 0.12s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-accent), var(--brand-accent-strong));
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(15, 122, 74, 0.32);
}

.btn-primary:hover {
  filter: brightness(1.04);
}

.btn-primary:disabled,
.btn-outline:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-outline {
  border: 1px solid var(--line-soft);
  background: #ffffff;
  color: var(--text-main);
}

.btn-outline:hover {
  background: var(--bg-soft);
}

.btn-outline.danger {
  border-color: #efc3c8;
  color: #9d2232;
}

.btn-outline.danger:hover {
  background: #fff1f3;
}

.footer {
  border-top: 1px solid var(--line-soft);
  padding: 12px 20px;
  color: var(--text-muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.footer.footer-site {
  display: block;
  padding: 34px 20px 46px;
  background: linear-gradient(180deg, #f6fafc 0%, #edf3f7 100%);
  border-top: 1px solid #dde6ee;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.footer-site .footer-content {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, 1fr));
  gap: 24px 56px;
  align-items: start;
}

.footer-site .footer-column {
  min-width: 0;
}

.footer-site .footer-column h2 {
  margin: 0 0 14px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #4b637b;
}

.footer-site .footer-badge {
  margin: 0 0 10px;
  color: #17304a;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-site .footer-note {
  margin: 0 0 14px;
  max-width: 36rem;
  font-size: 0.92rem;
  line-height: 1.72;
  color: #60748b;
}

.footer-site .footer-meta {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.65;
  color: #6d8094;
}

.footer-site .footer-meta a,
.footer-site .footer-link-list a {
  color: #36506c;
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-site .footer-meta a:hover,
.footer-site .footer-link-list a:hover {
  color: #17304a;
}

.footer-site .footer-link-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.92rem;
  line-height: 1.55;
  color: #60748b;
}

@media (max-width: 780px) {
  .footer.footer-site {
    padding: 30px 20px 100px;
  }

  .footer-site .footer-content {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

.hidden {
  display: none !important;
}

.text-right {
  text-align: right !important;
}

.ml-8 {
  margin-left: 8px !important;
}

/* ── App layout wrapper ──────────────────────────────────────────
   Reusable centered-content container. Apply to a page's outermost
   content wrapper when you want centered max-width layout with
   safe-area insets on notched/island devices.
   NOT applied automatically — add the class explicitly per page.
   ────────────────────────────────────────────────────────────── */
.app-layout {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  min-height: 100dvh;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}
