:root {
  --color-bg: #fff8f0;
  --color-surface: #ffffff;
  --color-dark: #4a3426;
  --color-muted: #a08a78;
  --color-mango: #ffb56b;
  --color-mango-soft: #ffe3c2;
  --color-mango-deep: #e8924a;
  --color-leaf: #cfe5cf;
  --color-blush: #fbdad5;
  --font-heading: "Jost", sans-serif;
}

body {
  font-family: var(--font-heading);
  color: var(--color-dark);
  background-color: #fff4ed;
  background-image: url("/images/fundo.jpg");
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
}

a {
  color: var(--color-mango-deep);
}

/* botões da marca */
.btn-mangga {
  background: var(--color-mango);
  border: 1px solid var(--color-mango);
  color: var(--color-dark);
  border-radius: 999px;
  font-weight: 500;
  transition: all 0.2s ease;
}
.btn-mangga:hover,
.btn-mangga:focus {
  background: var(--color-mango-deep);
  border-color: var(--color-mango-deep);
  color: #fff;
}
.btn-mangga-outline {
  background: transparent;
  border: 1px solid var(--color-mango-deep);
  color: var(--color-mango-deep);
  border-radius: 999px;
  font-weight: 500;
  transition: all 0.2s ease;
}
.btn-mangga-outline:hover,
.btn-mangga-outline:focus {
  background: var(--color-mango-soft);
  border-color: var(--color-mango-deep);
  color: var(--color-dark);
}

/* topbar */
.topbar {
  background-color: var(--color-dark);
  color: #fff;
  font-size: 0.8rem;
  padding: 6px 0;
}
.topbar a {
  color: #fff;
  text-decoration: none;
  margin-right: 16px;
  opacity: 0.85;
}
.topbar a:hover {
  opacity: 1;
}
.topbar-select {
  background: transparent;
  color: #fff;
  border: none;
  font-size: 0.8rem;
}
.topbar-select option {
  color: #000;
}

/* navbar */
.main-navbar {
  position: relative;
  z-index: 1030;
  padding: 18px 0;
  background: rgba(255, 250, 246, 0.92);
  border-bottom: 1px solid rgba(232, 146, 74, 0.18);
  backdrop-filter: blur(10px);
}
.navbar-brand {
  display: flex;
  align-items: center;
  padding: 0;
}
.navbar-logo-crop {
  position: relative;
  display: block;
  width: 156px;
  height: 52px;
  overflow: hidden;
}
.navbar-logo {
  position: absolute;
  top: -25px;
  left: 0;
  display: block;
  width: 156px;
  height: auto;
}
.main-nav .nav-link {
  color: var(--color-dark);
  font-weight: 500;
  margin: 0 14px;
}
.main-nav .nav-link:hover {
  color: var(--color-mango-deep);
}
.main-nav .nav-link.active {
  color: var(--color-mango-deep);
  text-decoration: underline;
  text-underline-offset: 6px;
}
.main-nav .dropdown-menu {
  border: none;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(74, 52, 38, 0.12);
  margin-top: 8px;
  min-width: 200px;
}
.main-nav .dropdown-item:hover,
.main-nav .dropdown-item:focus {
  background: var(--color-mango-soft);
}
.nav-icon {
  color: var(--color-dark);
  font-size: 1.1rem;
}
.nav-icon:hover {
  color: var(--color-mango-deep);
}
.nav-icon-link {
  color: var(--color-dark);
  text-decoration: none;
  font-size: 0.9rem;
}
.guest-menu {
  display: flex;
  align-items: center;
  gap: 8px;
}
#userMenu .dropdown-menu {
  z-index: 1040;
  border: none;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(74, 52, 38, 0.12);
}
#userMenu .dropdown-item:hover {
  background: var(--color-mango-soft);
}

.search-bar {
  display: none;
  background: var(--color-bg);
  border-bottom: 1px solid #f3e7da;
}

/* hero */
.hero {
  position: relative;
  overflow: hidden;
  background: rgba(255, 248, 240, 0.52);
  display: flex;
  align-items: center;
  min-height: 440px;
}
.hero-text-wrap {
  position: relative;
  z-index: 2;
  padding: 40px 0;
}
.hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 0.75rem;
  color: var(--color-mango-deep);
  font-weight: 600;
}
.hero-title {
  font-size: 3rem;
  font-weight: 600;
  line-height: 1.15;
  margin-top: 12px;
}
.hero-subtitle {
  color: var(--color-muted);
  margin: 20px 0 32px;
}
.btn-hero {
  padding: 12px 32px;
}
.hero-img-wrap {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 52%;
}
.hero-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px 0 0 16px;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 30%);
  mask-image: linear-gradient(to right, transparent 0%, #000 30%);
}
.hero.hero-sem-imagem .hero-img-wrap {
  display: none;
}
.hero.hero-sem-imagem .hero-text-wrap .col-lg-5 {
  width: min(100%, 760px);
}

/* animação de aparição ao rolar */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* products */
.products-section {
  padding: 80px 0;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(2px);
}
.section-title {
  font-weight: 600;
  letter-spacing: 1px;
}
.busca-subheader {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 24px 0 4px;
}
.btn-category {
  border: 1px solid var(--color-mango-deep);
  background: transparent;
  color: var(--color-mango-deep);
  border-radius: 999px;
  padding: 6px 20px;
  margin: 0 6px 10px;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}
.btn-category.active,
.btn-category:hover {
  background: var(--color-mango);
  border-color: var(--color-mango);
  color: var(--color-dark);
}
.product-image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 14px;
  background: rgba(255, 248, 240, 0.65);
}
.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.product-card:hover .product-image {
  transform: scale(1.04);
}
.btn-ver-mais {
  position: absolute;
  left: 50%;
  bottom: -50px;
  transform: translateX(-50%);
  border-radius: 999px;
  font-size: 0.8rem;
  padding: 8px 20px;
  white-space: nowrap;
  transition: bottom 0.25s ease;
  background: var(--color-dark);
  border: none;
  color: #fff;
}
.btn-ver-mais:hover {
  background: var(--color-mango-deep);
  color: #fff;
}
.product-image-wrapper:hover .btn-ver-mais {
  bottom: 16px;
}
.btn-favorito {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--color-dark);
  transition: transform 0.15s ease;
  z-index: 2;
}
.btn-favorito:hover {
  transform: scale(1.1);
}
.btn-favorito i.bi-heart-fill {
  color: #e0574c;
}
.product-name {
  margin: 14px 0 4px;
  color: var(--color-muted);
}
.product-price {
  font-weight: 600;
  color: var(--color-mango-deep);
}
.product-infinite-status {
  min-height: 42px;
  padding-top: 20px;
  text-align: center;
  color: var(--color-muted);
  font-size: 0.9rem;
}
.product-infinite-sentinel {
  height: 1px;
}
.product-loading-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin: 0 3px;
  border-radius: 50%;
  background: var(--color-mango-deep);
  animation: product-loading-pulse 0.9s ease-in-out infinite alternate;
}
.product-loading-dot:nth-child(2) {
  animation-delay: 0.18s;
}
.product-loading-dot:nth-child(3) {
  animation-delay: 0.36s;
}
@keyframes product-loading-pulse {
  from { opacity: 0.25; transform: translateY(0); }
  to { opacity: 1; transform: translateY(-4px); }
}
@media (prefers-reduced-motion: reduce) {
  .product-loading-dot {
    animation: none;
  }
}

/* footer */
.site-footer {
  background: var(--color-dark);
  color: #fff;
  font-size: 0.85rem;
}

/* back to top */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
.back-to-top.show {
  display: flex;
}

/* modais */
.modal-content {
  border: none;
  border-radius: 16px;
}
.modal-sm-plus {
  max-width: 420px;
}
.form-control,
.form-select {
  border-radius: 10px;
  border-color: #ecdccb;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--color-mango);
  box-shadow: 0 0 0 0.2rem rgba(255, 181, 107, 0.25);
}
.password-input-group {
  border-radius: 10px;
}
.password-input-group #toggleLoginPassword {
  background-color: var(--color-surface);
  border-color: #ecdccb;
  color: var(--color-muted);
}
.password-input-group #toggleLoginPassword:hover {
  background-color: var(--color-bg);
  border-color: #ecdccb;
  color: var(--color-dark);
}
.password-input-group:focus-within {
  box-shadow: 0 0 0 0.2rem rgba(255, 181, 107, 0.25);
}
.password-input-group:focus-within .form-control,
.password-input-group:focus-within #toggleLoginPassword {
  border-color: var(--color-mango);
  box-shadow: none;
}
.form-label {
  font-weight: 500;
  font-size: 0.9rem;
}

/* filtros + busca (sem !important para não brigar com jQuery show/hide) */
.filtros-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
}

/* busca de produtos na home */
.search-produtos {
  align-items: stretch;
  margin-bottom: 10px;
}
.search-produtos input {
  min-width: 220px;
  height: 34px;
  border-radius: 999px;
}
.search-produtos .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  min-width: 38px;
  padding-top: 0;
  padding-bottom: 0;
}

/* checkboxes de categorias (cadastro / minha conta) */
.categorias-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.categorias-checkboxes .cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--color-mango-deep);
  color: var(--color-mango-deep);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 0.85rem;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}
.categorias-checkboxes .cat-chip input {
  display: none;
}
.categorias-checkboxes .cat-chip.ativo {
  background: var(--color-mango);
  border-color: var(--color-mango);
  color: var(--color-dark);
}

/* termos de uso */
.termos-texto {
  white-space: pre-wrap;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--color-dark);
}

/* meus produtos / admin */
.produto-linha:last-child {
  border-bottom: none !important;
}
.produto-linha-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 10px;
  margin-right: 12px;
}
.admin-preview-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #ecdccb;
}
.admin-preview-details dt {
  color: var(--color-muted);
  font-weight: 500;
}
.admin-preview-details dd {
  color: var(--color-dark);
  overflow-wrap: anywhere;
}
.admin-users-table th {
  color: var(--color-muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
}
.admin-users-table td {
  min-width: 120px;
  padding: 0.55rem 0.45rem;
  font-size: 0.82rem;
  line-height: 1.25;
}
.admin-users-table .user-products-count {
  min-width: 70px;
  width: 70px;
  font-size: 0.9rem;
}
.admin-user-created-at {
  font-size: 0.78rem;
}
.admin-users-table .admin-user-created-cell {
  min-width: 88px;
  width: 88px;
}
.admin-users-table .admin-user-categories {
  min-width: 150px;
  max-width: 260px;
}
.admin-user-photo-cell {
  min-width: 92px;
}
.admin-user-photo {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #ecdccb;
}
.admin-user-category {
  background: var(--color-mango-soft);
  color: var(--color-dark);
  font-weight: 500;
}

/* produto clicável / detalhe */
.product-image,
.product-name {
  cursor: pointer;
}

/* perfil do artesão */
.perfil-artesao-info {
  max-width: 560px;
  margin: 24px auto 0;
  text-align: center;
}
.perfil-artesao-info .avatar-iniciais,
.perfil-artesao-info img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 12px;
  font-size: 2rem;
}
.perfil-artesao-info .contatos a {
  margin: 0 8px;
  font-size: 1.2rem;
}

/* cards de artesãos */
.artesao-card {
  cursor: pointer;
}
.avatar-iniciais {
  aspect-ratio: 1 / 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.2rem;
  font-weight: 600;
  border-radius: 14px;
  letter-spacing: 2px;
}
.artesao-card .product-name {
  color: var(--color-dark);
  font-weight: 500;
}
.np-imagem-row .input-group-text {
  background: #fff;
}
.np-imagem-preview {
  min-width: 0;
  padding: 6px 10px;
  border-top: 1px solid #dee2e6;
  border-bottom: 1px solid #dee2e6;
  background: #fff;
}
.np-imagem-preview img {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}
.mc-foto-preview {
  width: 112px;
  height: 112px;
  flex: 0 0 112px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px dashed rgba(0, 0, 0, 0.2);
  border-radius: 14px;
  background: rgba(255, 248, 240, 0.65);
}
.mc-foto-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#pdGaleria .pd-main-image {
  width: 100%;
  height: 420px;
  max-height: 420px;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(255, 248, 240, 0.65);
}
.pd-thumbnails {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  padding: 3px;
  overflow-x: auto;
}
.pd-thumbnail {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  padding: 3px;
  border: 2px solid transparent;
  border-radius: 10px;
  background: #fff;
  opacity: 0.7;
  transition: border-color 0.2s ease, opacity 0.2s ease;
}
.pd-thumbnail:hover,
.pd-thumbnail:focus,
.pd-thumbnail.active {
  border-color: var(--color-mango-deep);
  opacity: 1;
}
.pd-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}
.pd-categorias {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pd-categoria-link {
  padding: 4px 12px;
  border: 1px solid var(--color-mango-deep);
  border-radius: 999px;
  background: var(--color-mango-soft);
  color: var(--color-dark);
  font-size: 0.8rem;
  transition: background 0.2s ease, color 0.2s ease;
}
.pd-categoria-link:hover,
.pd-categoria-link:focus {
  background: var(--color-mango);
  color: var(--color-dark);
}

@media (max-width: 991px) {
  #pdGaleria .pd-main-image {
    height: 300px;
  }
  .navbar-logo-crop {
    width: 128px;
    height: 44px;
  }
  .navbar-logo {
    top: -20px;
    width: 128px;
  }
  .hero {
    display: block;
    min-height: 0;
  }
  .hero-text-wrap {
    padding: 48px 0;
  }
  .hero-img-wrap {
    display: none;
  }
  .hero-title {
    font-size: 2.2rem;
  }
  .main-nav .nav-link {
    margin: 6px 0;
  }
}
