.customer-surface-body {
  --customer-surface-accent: #7d4d55;
  --customer-surface-accent-dark: #643b43;
  --customer-surface-border: #e7d8d2;
  --customer-surface-nav-height: 4.75rem;
  background: #fbf8f3;
}

.customer-surface-header {
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--customer-surface-border);
}

.customer-surface-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(100% - 1.5rem, 72rem);
  min-height: 4.25rem;
  margin: 0 auto;
}

.customer-surface-header__brand {
  color: inherit;
  line-height: 1;
  text-decoration: none;
}

.customer-surface-header__account {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--customer-surface-accent-dark);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.customer-surface-header__account-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  justify-content: center;
  min-height: 44px;
  padding: 0.35rem 0.1rem 0.35rem 0.45rem;
  color: inherit;
  background: transparent;
  border: 0;
}
.customer-surface-header__account-toggle::after { margin-left: 0.05rem; }
.customer-surface-header__account-toggle:focus-visible { outline: 3px solid rgba(125, 77, 85, 0.45); outline-offset: 2px; }
.customer-surface-header__initial { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; color: var(--customer-surface-accent-dark); font-size: 1rem; background: #f8f3f0; border: 1px solid var(--customer-surface-border); border-radius: 50%; }

.customer-surface-header__account .bi { font-size: 1.3rem; }

/* Avatar privado do header: círculo do mesmo tamanho do fallback de ícone.
 * A imagem vem do endpoint autenticado, nunca de URL pública da storage. */
.customer-surface-header__avatar {
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--customer-surface-border);
  border-radius: 50%;
  object-fit: cover;
}

.customer-surface-header__greeting {
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-surface-header__account-menu {
  width: 20rem;
  max-width: calc(100vw - 1rem);
  padding: 0.45rem;
  color: #4f403d;
  border: 1px solid var(--customer-surface-border);
  border-radius: 0.85rem;
  box-shadow: 0 0.75rem 2rem rgba(70, 45, 42, 0.12);
}
.customer-surface-header__account-identity {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 3.25rem;
  padding: 0.45rem 0.65rem;
}
.customer-surface-header__account-identity-name {
  min-width: 0;
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.customer-surface-header__account-menu .dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 44px;
  padding: 0.55rem 0.65rem;
  color: inherit;
  border-radius: 0.55rem;
}
.customer-surface-header__account-menu .dropdown-item .bi {
  width: 1.1rem;
  color: var(--customer-surface-accent);
  font-size: 1.05rem;
  text-align: center;
}
.customer-surface-header__account-menu .dropdown-item:hover,
.customer-surface-header__account-menu .dropdown-item:focus-visible {
  color: var(--customer-surface-accent-dark);
  background: #f8f3f0;
}
.customer-surface-header__account-menu .dropdown-item:focus-visible {
  outline: 3px solid rgba(125, 77, 85, 0.35);
  outline-offset: -2px;
}
.customer-surface-header__account-menu form { margin: 0; }
.customer-surface-header__notification-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  margin-left: auto;
  padding-inline: 0.3rem;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  background: var(--customer-surface-accent-dark);
  border-radius: 999px;
}

.customer-surface-main { min-height: 100vh; }

.customer-surface-container {
  width: min(100% - 1.5rem, 72rem);
  padding-block: 1.25rem 2rem;
  margin: 0 auto;
}

.customer-surface-body .app-page-header { margin-bottom: 1.25rem; }
.customer-surface-body .app-page-eyebrow { color: var(--customer-surface-accent); }

.customer-surface-body .btn-primary {
  background-color: var(--customer-surface-accent);
  border-color: var(--customer-surface-accent);
}

.customer-surface-body .btn-primary:hover,
.customer-surface-body .btn-primary:focus-visible {
  background-color: var(--customer-surface-accent-dark);
  border-color: var(--customer-surface-accent-dark);
}

.customer-surface-body .customer-catalog-fixed-actions { z-index: 1020; }
.customer-surface-navigation--desktop,
.customer-surface-navigation--mobile { display: none; }

.customer-surface-navigation__icon-wrap { position: relative; display: inline-flex; }

.customer-surface-navigation__badge {
  position: absolute;
  top: -0.5rem;
  right: -0.7rem;
  min-width: 1.05rem;
  padding: 0.08rem 0.25rem;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1.1;
  background: var(--customer-surface-accent-dark);
  border: 1px solid #fff;
  border-radius: 999px;
}

@media (min-width: 768px) {
  .customer-surface-navigation--desktop {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
  }

  .customer-surface-navigation--desktop .customer-surface-navigation__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 44px;
    padding: 0.5rem 0.65rem;
    color: #6b5a56;
    font-size: 0.86rem;
    font-weight: 650;
    text-decoration: none;
  }

  .customer-surface-navigation--desktop .customer-surface-navigation__item.is-active,
  .customer-surface-navigation--desktop .customer-surface-navigation__item[aria-current="page"] {
    color: var(--customer-surface-accent-dark);
    font-weight: 800;
    text-decoration: underline;
    text-decoration-thickness: 0.15rem;
    text-underline-offset: 0.32rem;
  }

  .customer-surface-navigation--desktop .customer-surface-navigation__item:focus-visible {
    outline: 3px solid rgba(125, 77, 85, 0.45);
    outline-offset: -3px;
  }
}

@media (max-width: 767.98px) {
  .customer-surface-header__inner,
  .customer-surface-container {
    width: min(100% - 1.25rem, 42rem);
  }
  .customer-surface-header__inner { min-height: 4rem; }
  .customer-surface-header__greeting { max-width: 8.5rem; }
  .customer-surface-header__account-menu { width: min(20rem, calc(100vw - 1rem)); }
  .customer-surface-container {
    padding-top: 1rem;
    padding-bottom: calc(var(--customer-surface-nav-height) + env(safe-area-inset-bottom) + 1.25rem);
  }

  .customer-surface-navigation--mobile {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1030;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    min-height: var(--customer-surface-nav-height);
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(255, 255, 255, 0.97);
    border-top: 1px solid var(--customer-surface-border);
    box-shadow: 0 -0.35rem 1.25rem rgba(70, 45, 42, 0.08);
  }

  .customer-surface-navigation--mobile .customer-surface-navigation__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    min-width: 0;
    min-height: 44px;
    padding: 0.4rem 0.2rem;
    color: #6b5a56;
    font-size: 0.69rem;
    font-weight: 650;
    line-height: 1.1;
    text-align: center;
    text-decoration: none;
  }
  .customer-surface-navigation--mobile .customer-surface-navigation__item .bi { font-size: 1.2rem; }
  .customer-surface-navigation--mobile .customer-surface-navigation__item.is-active,
  .customer-surface-navigation--mobile .customer-surface-navigation__item[aria-current="page"] {
    color: var(--customer-surface-accent-dark);
    font-weight: 800;
  }

  .customer-surface-navigation--mobile .customer-surface-navigation__item.is-active::after,
  .customer-surface-navigation--mobile .customer-surface-navigation__item[aria-current="page"]::after {
    width: 1.35rem;
    height: 0.18rem;
    content: "";
    background: currentColor;
    border-radius: 999px;
  }

  .customer-surface-navigation--mobile .customer-surface-navigation__item:focus-visible,
  .customer-surface-header__account:focus-visible,
  .customer-surface-header__brand:focus-visible {
    outline: 3px solid rgba(125, 77, 85, 0.45);
    outline-offset: -3px;
  }
  .customer-surface-body .customer-catalog-fixed-actions {
    bottom: calc(var(--customer-surface-nav-height) + env(safe-area-inset-bottom));
  }

  .customer-surface-body .customer-catalog--has-fixed-actions {
    padding-bottom: calc(
      var(--customer-catalog-cart-clearance, 5.25rem) +
      var(--customer-surface-nav-height) +
      env(safe-area-inset-bottom)
    );
  }
}
