/* ==========================================================================
   Produtos Gramore — identidade visual (mesma linguagem do Jornada RH)
   Paleta: verde-floresta (menu), verde-folha (ação), creme (fundo),
   dourado e vermelho (destaques). Fonte: Montserrat (mesmo padrão da tabela de preços).
   ========================================================================== */

:root {
  --sidebar-width: 250px;
  --sidebar-width-collapsed: 72px;
  --topbar-height: 60px;

  --g-950: #1c2b1e;   /* menu lateral / texto principal */
  --g-600: #4a7c59;   /* cor de ação (botões, links, item ativo) */
  --g-500: #5d8a6b;
  --g-700: #3d6a4a;
  --gold:  #d4a942;
  --red:   #c0392b;
}

/* ---------- Tema claro (padrão) ---------- */
:root,
[data-bs-theme="light"] {
  --app-bg:   #faf7f2;
  --card-bg:  #ffffff;
  --line:     #e6ece1;
  --ink:      #1c2b1e;
  --muted:    #6b7d6e;
  --thead:    #eef3ee;
  --hover:    #f1f5ee;
  --side-bg:  #1c2b1e;

  --soft-green-bg: #e8f5e9; --soft-green-fg: #2e7d32;
  --soft-red-bg:   #fce4ec; --soft-red-fg:   #c0392b;
  --soft-gold-bg:  #fef9e7; --soft-gold-fg:  #9a7b1a;
  --soft-grey-bg:  #eef0ec; --soft-grey-fg:  #5b6b5e;

  --bs-body-bg: #faf7f2;
  --bs-body-bg-rgb: 250,247,242;
  --bs-body-color: #1c2b1e;
  --bs-body-color-rgb: 28,43,30;
  --bs-secondary-color: #6b7d6e;
  --bs-border-color: #e6ece1;
  --bs-tertiary-bg: #f1f5ee;
}

/* ---------- Tema escuro ---------- */
[data-bs-theme="dark"] {
  --app-bg:   #111a13;
  --card-bg:  #192619;
  --line:     #2a3c2d;
  --ink:      #e8efe6;
  --muted:    #9db0a0;
  --thead:    #213124;
  --hover:    #1f2f22;
  --side-bg:  #1c2b1e;   /* igual ao fundo do logo; o menu é verde-escuro nos dois temas */

  --soft-green-bg: rgba(76,175,80,.18);  --soft-green-fg: #81c784;
  --soft-red-bg:   rgba(229,115,115,.18); --soft-red-fg:   #ef9a9a;
  --soft-gold-bg:  rgba(212,169,66,.18);  --soft-gold-fg:  #e6c36a;
  --soft-grey-bg:  rgba(255,255,255,.08); --soft-grey-fg:  #b4c3b6;

  --bs-body-bg: #111a13;
  --bs-body-bg-rgb: 17,26,19;
  --bs-body-color: #e8efe6;
  --bs-body-color-rgb: 232,239,230;
  --bs-secondary-color: #9db0a0;
  --bs-border-color: #2a3c2d;
  --bs-tertiary-bg: #1f2f22;
}

/* ---------- Base / Bootstrap re-tematizado ---------- */
:root {
  --bs-font-sans-serif: Montserrat, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bs-body-font-size: .875rem;      /* 14px, como na tabela de preços */
  --bs-body-line-height: 1.4;
  --bs-primary: #4a7c59;
  --bs-primary-rgb: 74,124,89;
  --bs-link-color: #4a7c59;
  --bs-link-color-rgb: 74,124,89;
  --bs-link-hover-color: #3d6a4a;
  --bs-link-hover-color-rgb: 61,106,74;
  --bs-focus-ring-color: rgba(74,124,89,.25);
}

body {
  background-color: var(--app-bg);
  color: var(--ink);
  font-family: var(--bs-font-sans-serif);
}

h1, h2, h3, h4, h5, h6 { font-weight: 700; color: var(--ink); }
.text-muted { color: var(--muted) !important; }

/* Botões */
.btn { border-radius: 10px; font-weight: 600; }
.btn-primary {
  --bs-btn-bg: #4a7c59; --bs-btn-border-color: #4a7c59; --bs-btn-color: #fff;
  --bs-btn-hover-bg: #3d6a4a; --bs-btn-hover-border-color: #3d6a4a; --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: #355d41; --bs-btn-active-border-color: #355d41; --bs-btn-active-color: #fff;
  --bs-btn-disabled-bg: #4a7c59; --bs-btn-disabled-border-color: #4a7c59;
  --bs-btn-focus-shadow-rgb: 74,124,89;
}
.btn-success {
  --bs-btn-bg: #2e7d32; --bs-btn-border-color: #2e7d32;
  --bs-btn-hover-bg: #276a2b; --bs-btn-hover-border-color: #276a2b;
  --bs-btn-active-bg: #205824; --bs-btn-active-border-color: #205824;
}
.btn-outline-primary {
  --bs-btn-color: #4a7c59; --bs-btn-border-color: #4a7c59;
  --bs-btn-hover-bg: #4a7c59; --bs-btn-hover-border-color: #4a7c59; --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: #3d6a4a; --bs-btn-active-border-color: #3d6a4a; --bs-btn-active-color: #fff;
  --bs-btn-focus-shadow-rgb: 74,124,89;
}
/* Botão "neutro" branco com borda suave (como o CSV / Imprimir da referência) */
.btn-outline-secondary {
  --bs-btn-color: var(--ink); --bs-btn-bg: var(--card-bg); --bs-btn-border-color: var(--line);
  --bs-btn-hover-color: var(--ink); --bs-btn-hover-bg: var(--hover); --bs-btn-hover-border-color: #cbd8c6;
  --bs-btn-active-color: var(--ink); --bs-btn-active-bg: var(--hover); --bs-btn-active-border-color: #cbd8c6;
}
.btn-outline-danger { --bs-btn-color: var(--red); --bs-btn-border-color: var(--red); --bs-btn-hover-bg: var(--red); --bs-btn-hover-border-color: var(--red); }

/* Tema escuro: tons de verde mais claros para manter contraste */
[data-bs-theme="dark"] {
  --bs-link-color: #8cc29d;
  --bs-link-color-rgb: 140,194,157;
  --bs-link-hover-color: #a9d6b7;
  --bs-link-hover-color-rgb: 169,214,183;
}
[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-color: #8cc29d; --bs-btn-border-color: #4a7c59; }
[data-bs-theme="dark"] .pagination { --bs-pagination-color: #8cc29d; --bs-pagination-hover-color: #a9d6b7; }
[data-bs-theme="dark"] .auth-body a { color: #3d6a4a; }

/* Formulários */
.form-label { font-weight: 700; font-size: .82rem; color: var(--ink); }
.form-control, .form-select {
  background-color: var(--card-bg);
  border-color: var(--line);
  border-radius: 10px;
  color: var(--ink);
}
.form-control:focus, .form-select:focus {
  border-color: var(--g-600);
  box-shadow: 0 0 0 .2rem rgba(74,124,89,.18);
  background-color: var(--card-bg);
  color: var(--ink);
}
.form-check-input:checked { background-color: var(--g-600); border-color: var(--g-600); }
.form-check-input:focus { border-color: var(--g-600); box-shadow: 0 0 0 .2rem rgba(74,124,89,.18); }

/* Cards */
.card {
  --bs-card-bg: var(--card-bg);
  --bs-card-border-color: var(--line);
  --bs-card-border-radius: 16px;
  --bs-card-inner-border-radius: 15px;
  --bs-card-cap-bg: var(--card-bg);
  border-radius: 16px;
}

/* Tabelas: cabeçalho esverdeado em caixa-alta */
.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--ink);
  --bs-table-border-color: var(--line);
  --bs-table-hover-bg: var(--hover);
  --bs-table-hover-color: var(--ink);
}
.card > .table-responsive { border-radius: 16px; }
.table thead th {
  background-color: var(--thead);
  color: var(--muted);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-bottom: 0;
  padding: .85rem .9rem;
  white-space: nowrap;
}
.table tbody td { padding: .8rem .9rem; font-size: .9rem; }

/* Selos "suaves" (fundo claro + texto colorido) */
.badge { font-weight: 700; letter-spacing: .02em; border-radius: 999px; padding: .38em .7em; }
.badge.bg-success   { background-color: var(--soft-green-bg) !important; color: var(--soft-green-fg) !important; }
.badge.bg-danger    { background-color: var(--soft-red-bg)   !important; color: var(--soft-red-fg)   !important; }
.badge.bg-warning   { background-color: var(--soft-gold-bg)  !important; color: var(--soft-gold-fg)  !important; }
.badge.bg-secondary { background-color: var(--soft-grey-bg)  !important; color: var(--soft-grey-fg)  !important; }
.badge.bg-info      { background-color: var(--soft-green-bg) !important; color: var(--soft-green-fg) !important; }

/* Alertas */
.alert { border-radius: 12px; border: 0; }
.alert-info    { --bs-alert-bg: var(--soft-green-bg); --bs-alert-color: var(--soft-green-fg); --bs-alert-border-color: transparent; }
.alert-success { --bs-alert-bg: var(--soft-green-bg); --bs-alert-color: var(--soft-green-fg); --bs-alert-border-color: transparent; }
.alert-danger  { --bs-alert-bg: var(--soft-red-bg);   --bs-alert-color: var(--soft-red-fg);   --bs-alert-border-color: transparent; }
.alert-warning { --bs-alert-bg: var(--soft-gold-bg);  --bs-alert-color: var(--soft-gold-fg);  --bs-alert-border-color: transparent; }

/* Paginação */
.pagination {
  --bs-pagination-color: var(--g-600);
  --bs-pagination-bg: var(--card-bg);
  --bs-pagination-border-color: var(--line);
  --bs-pagination-hover-color: var(--g-700);
  --bs-pagination-hover-bg: var(--hover);
  --bs-pagination-hover-border-color: var(--line);
  --bs-pagination-focus-color: var(--g-700);
  --bs-pagination-focus-bg: var(--hover);
  --bs-pagination-focus-box-shadow: 0 0 0 .2rem rgba(74,124,89,.18);
  --bs-pagination-active-bg: var(--g-600);
  --bs-pagination-active-border-color: var(--g-600);
  --bs-pagination-disabled-bg: var(--card-bg);
  --bs-pagination-disabled-border-color: var(--line);
  --bs-pagination-border-radius: 8px;
}

/* Dropdowns, modais e listas */
.dropdown-menu {
  --bs-dropdown-bg: var(--card-bg);
  --bs-dropdown-border-color: var(--line);
  --bs-dropdown-border-radius: 12px;
  --bs-dropdown-link-color: var(--ink);
  --bs-dropdown-link-hover-bg: var(--hover);
  --bs-dropdown-link-active-bg: var(--g-600);
  --bs-dropdown-divider-bg: var(--line);
  box-shadow: 0 10px 30px rgba(28,43,30,.12);
}
.modal-content { --bs-modal-bg: var(--card-bg); --bs-modal-border-color: var(--line); --bs-modal-border-radius: 16px; --bs-modal-inner-border-radius: 15px; border-radius: 16px; }
.modal-header, .modal-footer { border-color: var(--line); }
.list-group {
  --bs-list-group-bg: var(--card-bg);
  --bs-list-group-border-color: var(--line);
  --bs-list-group-color: var(--ink);
  --bs-list-group-action-hover-bg: var(--hover);
  --bs-list-group-action-hover-color: var(--ink);
  --bs-list-group-active-bg: var(--g-600);
  --bs-list-group-active-border-color: var(--g-600);
}
.nav-tabs { --bs-nav-tabs-link-active-bg: var(--card-bg); --bs-nav-tabs-border-color: var(--line); --bs-nav-link-color: var(--g-600); --bs-nav-link-hover-color: var(--g-700); }

/* ---------- Login / recuperação de senha ---------- */
.auth-body {
  min-height: 100vh;
  background: linear-gradient(135deg, #1c2b1e 0%, #2f4e38 50%, #497b58 100%);
  background-attachment: fixed;
}
.auth-body .card {
  border: 0;
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(0,0,0,.30);
}
.auth-body .card-body { padding: 2.25rem 2rem !important; }
.auth-logo { display: block; width: 150px; height: auto; margin: 0 auto 1.1rem; }
.auth-title { font-size: 1.2rem; font-weight: 700; margin: 0; color: var(--ink); }
.auth-sub { font-size: .78rem; color: var(--muted); }
.auth-body .btn-primary { padding: .7rem; font-weight: 700; border-radius: 10px; }
.auth-body .form-control { padding: .6rem .8rem; font-size: .9rem; }
.auth-body a { color: var(--g-700); font-weight: 600; text-decoration: none; }
.auth-body a:hover { text-decoration: underline; }
.auth-body .btn { text-decoration: none; }

/* ---------- Layout / Sidebar ---------- */
#appWrapper { min-height: 100vh; }
.main-content { min-width: 0; }

.sidebar {
  width: var(--sidebar-width);
  background-color: var(--side-bg);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  overflow: hidden;
  flex-shrink: 0;
  transition: width .2s ease;
}

.sidebar-brand {
  position: relative;
  padding: 1.5rem 1rem 1.15rem;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-logo { height: auto; }
.brand-full { width: 138px; }
.brand-mini { width: 34px; display: none; margin: 0 auto; }
.brand-sub {
  margin-top: .6rem;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #8fa593;
}
.sidebar-close {
  position: absolute; top: .5rem; right: .4rem;
  color: #fff !important; text-decoration: none;
}

.sidebar nav { flex: 1; overflow-y: auto; padding: .9rem .65rem; flex-wrap: nowrap; }
.sidebar .nav-link {
  color: rgba(255,255,255,.68);
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .62rem .85rem;
  margin-bottom: .15rem;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color .15s, color .15s;
}
.sidebar .nav-link i { font-size: 1.1rem; width: 1.25rem; text-align: center; flex-shrink: 0; }
.sidebar .nav-link:hover { background-color: rgba(255,255,255,.07); color: #fff; }
.sidebar .nav-link.active {
  background: linear-gradient(135deg, #4a7c59 0%, #5d8a6b 100%);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0,0,0,.18);
}
.sidebar hr { border-color: rgba(255,255,255,.12); opacity: 1; margin: .8rem .5rem; }
.sidebar .nav-section-title {
  padding: .2rem .85rem .4rem;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #7f967f !important;
}

/* Rodapé do menu: usuário + sair */
.sidebar-footer { padding: .85rem .8rem 1rem; border-top: 1px solid rgba(255,255,255,.08); }
.user-box { display: flex; align-items: center; gap: .6rem; margin-bottom: .75rem; }
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: var(--g-600); color: #fff; font-weight: 700; font-size: .85rem;
  display: flex; align-items: center; justify-content: center;
  object-fit: cover; text-transform: uppercase;
}
.user-meta { min-width: 0; flex: 1; line-height: 1.25; }
.user-name { font-size: .82rem; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: .62rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #8fa593; }
.user-key {
  width: 30px; height: 30px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,.18); border-radius: 8px;
  color: #cfe0d1; text-decoration: none; transition: background-color .15s;
}
.user-key:hover { background: rgba(255,255,255,.1); color: #fff; }
.logout-btn {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem .8rem; border-radius: 10px;
  background: rgba(255,255,255,.06); color: #cfe0d1;
  font-size: .82rem; font-weight: 600; text-decoration: none;
  transition: background-color .15s;
}
.logout-btn:hover { background: rgba(255,255,255,.13); color: #fff; }

/* Menu compacto */
#appWrapper.collapsed .sidebar { width: var(--sidebar-width-collapsed); }
#appWrapper.collapsed .brand-text,
#appWrapper.collapsed .link-text,
#appWrapper.collapsed .nav-section-title,
#appWrapper.collapsed .brand-sub,
#appWrapper.collapsed .brand-full,
#appWrapper.collapsed .user-key { display: none; }
#appWrapper.collapsed .brand-mini { display: block; }
#appWrapper.collapsed .sidebar-brand { padding: 1.3rem .5rem 1rem; }
#appWrapper.collapsed .sidebar .nav-link { justify-content: center; padding: .7rem 0; }
#appWrapper.collapsed .user-box { justify-content: center; }
#appWrapper.collapsed .logout-btn { justify-content: center; padding: .6rem 0; }

/* Barra superior */
.topbar {
  min-height: var(--topbar-height);
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--line) !important;
}
.topbar .topbar-title { font-size: 1.05rem; font-weight: 700; color: var(--ink); }
.topbar .topbar-left { display: flex; align-items: center; }
.topbar .topbar-title { flex: 1 1 auto; }

/* Título centralizado (ativado com $centerTitle = true na página):
   os lados ocupam o mesmo espaço, então o título fica no centro real da barra */
.topbar-centered .topbar-left,
.topbar-centered .topbar-right { flex: 1 1 0; min-width: max-content; }
.topbar-centered .topbar-right { justify-content: flex-end; }
.topbar-centered .topbar-title { flex: 0 1 auto; min-width: 0; text-align: center; padding: 0 .75rem; }
@media (max-width: 575.98px) {
  .topbar-centered .topbar-title { font-size: .85rem; line-height: 1.15; padding: 0 .4rem; }
}
.topbar .btn-link { text-decoration: none; }

/* ---------- Cartões de indicadores (dashboard) ---------- */
.kpi-card .card-body { display: flex; flex-direction: column; gap: .35rem; padding: 1.2rem 1.3rem; }
.kpi-head { display: flex; align-items: center; gap: .75rem; }
.kpi-icon {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.15rem;
}
.kpi-icon.green { background: var(--soft-green-bg); color: var(--soft-green-fg); }
.kpi-icon.gold  { background: var(--soft-gold-bg);  color: var(--soft-gold-fg); }
.kpi-icon.red   { background: var(--soft-red-bg);   color: var(--soft-red-fg); }
.kpi-label { font-size: .7rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.kpi-value { font-size: 2rem; font-weight: 700; line-height: 1.15; color: var(--ink); }

/* ---------- Camera capture (Produtos > Fotos) ---------- */
.camera-wrapper {
  position: relative;
  background: #000;
  border-radius: .75rem;
  overflow: hidden;
  max-width: 480px;
  margin: 0 auto;
}
.camera-wrapper video,
.camera-wrapper canvas { width: 100%; display: block; }
.photo-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: .75rem;
  border: 1px solid var(--line);
}
.photo-slot { position: relative; }
.photo-slot .attention-badge { position: absolute; top: 6px; right: 6px; }

/* Product search autocomplete */
#productSuggestions {
  box-shadow: 0 8px 24px rgba(28,43,30,.14);
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--line);
}
#productSuggestions .list-group-item {
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 8px 12px;
  background: transparent;
}
#productSuggestions .list-group-item:last-child { border-bottom: 0; }
#productSuggestions .list-group-item:hover { background-color: var(--hover); }

/* ---------- Notificações (dropdown do topbar) ---------- */
/* O botão usa data-bs-display="static" (ver header.php), então o Popper não
   posiciona esta caixa — a posição é controlada só por CSS. */
#notifDropdown { max-width: calc(100vw - 1.5rem); }

@media (max-width: 767.98px) {
  #notifDropdown {
    position: fixed !important;
    top: var(--topbar-height) !important;
    left: 8px !important;
    right: 8px !important;
    bottom: auto !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    transform: none !important;
    z-index: 1050 !important; /* acima da sidebar mobile (1040) */
  }
}

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
  .sidebar { position: fixed; top: 0; left: 0; z-index: 1040; }
  #appWrapper.collapsed .sidebar { width: 0; overflow: hidden; }
  /* no celular o menu "recolhido" fica totalmente oculto, nunca em modo compacto */
}


/* ---------- Cabeçalho padrão (gx-head), igual ao da tabela de preços ---------- */
.gx-head {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px 28px; background: var(--card-bg);
  border-top: 3px solid #E52A3F; border-bottom: 1px solid var(--line);
}
.gx-logo { display: inline-flex; align-items: center; }
.gx-logo img { height: 34px; width: auto; display: block; }
.gx-title { font-size: 17px; font-weight: 700; letter-spacing: -.2px; margin: 0; white-space: nowrap; }
.gx-spacer { flex: 1; }
.gx-theme { display: inline-flex; background: var(--thead); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.gx-theme button {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 28px;
  border-radius: 999px; border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 0;
}
.gx-theme button[aria-pressed="true"] { background: var(--bs-success, #3f7d52); background: #3f7d52; color: #fff; }
.gx-actions { display: flex; align-items: center; gap: 10px; }
.gx-btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; text-decoration: none;
  font: 600 13px Montserrat, sans-serif; padding: 9px 14px; border-radius: 10px;
  border: 1px solid #3f7d52; color: #3f7d52; background: transparent; white-space: nowrap;
}
[data-bs-theme="dark"] .gx-btn { color: #86c795; border-color: #5a9a6b; }
.gx-btn:hover, .gx-btn:focus { background: rgba(90,154,107,.12); color: inherit; }
.gx-btn.fill, [data-bs-theme="dark"] .gx-btn.fill { background: #3f7d52; color: #fff; border-color: #3f7d52; padding: 9px 18px; }
[data-bs-theme="dark"] .gx-btn.fill { background: #5a9a6b; border-color: #5a9a6b; color: #0f1a14; }
.gx-btn.fill:hover { opacity: .92; }
@media (max-width: 640px) {
  .gx-head { padding-left: 16px; padding-right: 16px; gap: 12px; }
  .gx-title { display: none; }
  .gx-logo { order: 1; } .gx-spacer { order: 2; } .gx-theme { order: 3; } .gx-actions { order: 4; }
  .gx-actions .gx-btn span { display: none; }
  .gx-actions .gx-btn { padding: 9px 11px; }
}
.gx-head #sidebarToggle { color: var(--ink) !important; }

/* Barra de atendimento e redes sociais (acima do gx-head) */
.gx-util {
  min-height: 32px; background: var(--thead); border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 28px; font-size: 12px; color: var(--muted);
}
.gx-util a { color: var(--muted); display: inline-flex; align-items: center; gap: 7px; text-decoration: none; }
.gx-util a:hover { color: var(--ink); }
.gx-util .gx-social { display: inline-flex; align-items: center; gap: 10px; }
@media (max-width: 640px) { .gx-util { padding-left: 16px; padding-right: 16px; } .gx-soc-txt { display: none; } }
.gx-util img { width: 14px; height: 14px; }


/* ---------- Página do produto (produto.php) ---------- */
.pd { max-width: 1240px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; --pd-soft: var(--hover); --pd-green: #3f7d52; --pd-green-ink: #2a6b3b; --pd-red: #CC1F36; }
[data-bs-theme="dark"] .pd { --pd-green-ink: #86c795; }
.pd-crumb { font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; }
.pd-crumb a { text-decoration: none; }
.pd-crumb strong { color: var(--ink); font-weight: 600; }
.pd-card { background: var(--card-bg); border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
.pd-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }
.pd-muted { font-size: 12px; color: var(--muted); }

.pd-hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 32px; }
.pd-gallery { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pd-photo { position: relative; aspect-ratio: 4 / 3; border-radius: 14px; background: var(--pd-soft); overflow: hidden; }
.pd-photo img { width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; display: block; }
.pd-photo-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 12.5px; border: 1px dashed var(--line); }
.pd-photo-empty i { font-size: 40px; }
.pd-photo-count { position: absolute; left: 12px; top: 12px; padding: 4px 10px; border-radius: 999px; background: #1c2b1e; color: #fff; font-size: 11.5px; font-weight: 600; }
.pd-photo-zoom { position: absolute; right: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: var(--card-bg); border: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--ink); cursor: pointer; }
.pd-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 8px; }
.pd-thumbs .photo-thumb { aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--line); background: var(--pd-soft); padding: 0; overflow: hidden; cursor: pointer; }
.pd-thumbs .photo-thumb.on { border: 2px solid var(--pd-green); }
.pd-thumbs .photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.pd-info { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pd-title { margin: 6px 0 0; font-size: 30px; line-height: 1.15; font-weight: 700; letter-spacing: -.5px; overflow-wrap: anywhere; }
.pd-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pd-lead { margin: 0; font-size: 15px; }
.pd-buy { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; padding: 16px 18px; border-radius: 14px; background: var(--pd-soft); }
.pd-price { flex: 1 1 160px; }
.pd-packs { flex: 1 1 200px; }
.pd-promo { margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: var(--soft-red-bg); color: var(--soft-red-fg); font-size: 11px; letter-spacing: 0; text-transform: none; }
.pd-price-val { font-size: 30px; font-weight: 700; letter-spacing: -.5px; }
.pd-price-old { font-size: 14px; color: var(--muted); text-decoration: line-through; }
.pd-price-unit { font-size: 12.5px; color: var(--muted); }
.pd-pack-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pd-pack { padding: 9px 14px; border-radius: 10px; background: var(--card-bg); border: 1px solid var(--line); color: var(--ink); font-weight: 600; font-size: 13px; text-decoration: none; }
a.pd-pack:hover { border-color: var(--pd-green); color: var(--ink); }
.pd-pack.on { background: var(--pd-green); border-color: var(--pd-green); color: #fff; }
.pd-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.pd-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--pd-green); background: transparent; color: var(--pd-green-ink); font: 600 14px Montserrat, sans-serif; text-decoration: none; cursor: pointer; }
.pd-btn:hover { background: rgba(90,154,107,.12); color: var(--pd-green-ink); }
.pd-btn.fill { background: var(--pd-green); color: #fff; }
.pd-btn.fill:hover { background: var(--pd-green); color: #fff; opacity: .92; }
.pd-btn.ghost { border-color: var(--line); color: var(--ink); background: var(--card-bg); }

.pd-nav { position: sticky; top: 0; z-index: 20; display: flex; gap: 4px; flex-wrap: wrap; padding: 4px; background: var(--card-bg); border: 1px solid var(--line); border-radius: 14px; }
.pd-nav a { padding: 10px 16px; border-radius: 10px; color: var(--ink); font-weight: 600; font-size: 13px; text-decoration: none; }
.pd-nav a:hover { background: var(--pd-soft); }
.pd-nav a.on, .pd-nav a.on:hover { background: var(--pd-red); color: #fff; }

.pd-cols { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.pd-main { flex: 2 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.pd-side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.pd-sec { display: flex; flex-direction: column; gap: 16px; scroll-margin-top: 72px; }
.pd-h2 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -.2px; }
.pd-h3 { margin: 0 0 8px; font-size: 14px; font-weight: 700; }
.pd-items.multi { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px 24px; }
.pd-item > :last-child { margin-bottom: 0; }
.pd-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.pd-list li { position: relative; padding-left: 32px; }
.pd-list li::before { content: "\F26E"; font-family: "bootstrap-icons"; position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--soft-green-bg); color: var(--soft-green-fg); display: flex; align-items: center; justify-content: center; font-size: 14px; }
.pd-caution { background: var(--soft-gold-bg); border-color: transparent; }
.pd-item-caution { background: var(--soft-gold-bg); border-radius: 12px; padding: 14px 16px; }
.pd-caution .pd-list li::before, .pd-item-caution .pd-list li::before { content: "\F33B"; background: transparent; color: var(--soft-gold-fg); }
.pd-caution .pd-h2 i { color: var(--soft-gold-fg); }

.pd-kpis { display: flex; flex-wrap: wrap; gap: 8px; }
.pd-kpi { flex: 1 1 100px; padding: 12px 14px; border-radius: 12px; background: var(--pd-soft); }
.pd-kpi strong { display: block; font-size: 18px; font-weight: 700; }
.pd-kpi span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.pd-nut { width: 100%; border-collapse: collapse; font-size: 13px; }
.pd-nut th { text-align: right; padding: 0 0 8px 12px; font-size: 11px; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.pd-nut td { padding: 9px 0 9px 12px; border-top: 1px solid var(--line); text-align: right; vertical-align: top; }
.pd-nut td:first-child { text-align: left; padding-left: 0; font-weight: 600; }
.pd-nut tr.sub td:first-child { padding-left: 16px; font-weight: 400; color: var(--muted); }
.pd-docs { display: flex; flex-direction: column; gap: 10px; }
.pd-doc { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); }
.pd-doc:hover { border-color: var(--pd-green); color: var(--ink); }
.pd-doc-ico { display: inline-flex; width: 34px; height: 34px; border-radius: 10px; background: var(--soft-green-bg); color: var(--soft-green-fg); align-items: center; justify-content: center; flex: none; font-size: 16px; }
.pd-doc strong { display: block; font-weight: 600; font-size: 13.5px; }
.pd-doc small { display: block; font-size: 11.5px; color: var(--muted); }
.pd-help { border-radius: 16px; padding: 20px 24px; background: #1c2b1e; color: #fff; display: flex; flex-direction: column; gap: 10px; }
.pd-help strong { font-size: 16px; }
.pd-help span { font-size: 13px; color: #d5e0d3; }
.pd-help a { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; background: #fff; color: #1c2b1e; font-weight: 600; text-decoration: none; }
@media (max-width: 640px) {
  .pd { gap: 16px; }
  .pd-card { padding: 16px; }
  .pd-title { font-size: 24px; }
  .pd-nav { position: static; flex-wrap: nowrap; overflow-x: auto; }
  .pd-nav a { white-space: nowrap; }
  .pd-actions .pd-btn { flex: 1 1 100%; justify-content: center; }
}

/* Modal da foto: botão Baixar no canto inferior direito da imagem */
.pd-modal-wrap { position: relative; display: inline-block; max-width: 100%; line-height: 0; }
.pd-modal-wrap img { max-width: 100%; max-height: 80vh; display: block; }
.pd-modal-dl { position: absolute; right: 12px; bottom: 12px; line-height: 1.5; box-shadow: 0 2px 8px rgba(0,0,0,.35); }

/* Foto aguardando aprovação (visível só para quem enxerga fotos não aprovadas) */
.pd-photo-pending { position: absolute; right: 12px; top: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: #f2c36b; color: #4f3a00; font-size: 11.5px; font-weight: 700; }
.pd-thumbs .photo-thumb { position: relative; }
.pd-thumb-pending { position: absolute; right: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #f2c36b; color: #4f3a00; display: flex; align-items: center; justify-content: center; font-size: 11px; }

/* ---------- Registro de fotos (products_photos.php): mobile-first ---------- */
.fp { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; padding-bottom: 8px; }
.fp-card { background: var(--card-bg); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.fp-h { font-size: 15px; font-weight: 700; margin: 0 0 12px; }
.fp-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.fp-req, .fp-opt { margin-left: 6px; font-size: 11px; font-weight: 600; color: var(--muted); }
.fp-req { color: var(--soft-red-fg); }
.fp-hint { font-size: 12.5px; color: var(--muted); }
.fp-input { width: 100%; min-height: 50px; padding: 0 14px; font-size: 16px; color: var(--ink); background: var(--card-bg); border: 1.5px solid var(--line); border-radius: 12px; }
.fp-input:focus { outline: none; border-color: #3f7d52; box-shadow: 0 0 0 3px rgba(63,125,82,.18); }
.fp-input[readonly] { background: var(--hover); color: var(--muted); }
.fp-field { margin-bottom: 14px; }
.fp-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.fp-two .fp-field { min-width: 0; }
.fp-input[type=date] { min-width: 0; max-width: 100%; -webkit-appearance: none; appearance: none; text-align: left; }
.fp-msg { padding: 10px 12px; border-radius: 10px; background: var(--soft-red-bg); color: var(--soft-red-fg); font-size: 13px; font-weight: 600; margin-bottom: 10px; }

/* passos */
.fp-steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; }
.fp-steps li { flex: 1; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: var(--hover); color: var(--muted); font-size: 12.5px; font-weight: 600; }
.fp-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; flex: none; }
.fp-dot i { display: none; }
.fp-steps li.on { background: var(--card-bg); color: var(--ink); border: 1.5px solid #3f7d52; }
.fp-steps li.on .fp-dot { background: #3f7d52; color: #fff; }
.fp-steps li.done { color: var(--ink); }
.fp-steps li.done .fp-dot { background: #3f7d52; color: #fff; }
.fp-steps li.done .fp-dot b { display: none; }
.fp-steps li.done .fp-dot i { display: inline; }

/* produto */
.fp-search { position: relative; }
.fp-search > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.fp-search .fp-input { padding-left: 42px; }
.fp-results { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; max-height: 52vh; overflow-y: auto; }
.fp-result { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 10px 12px; text-align: left; background: var(--card-bg); border: 1px solid var(--line); border-radius: 12px; color: var(--ink); width: 100%; }
.fp-result:active, .fp-result:hover { border-color: #3f7d52; background: var(--hover); }
.fp-result-n { font-weight: 600; font-size: 14px; line-height: 1.25; }
.fp-cod { flex: none; padding: 3px 8px; border-radius: 8px; background: var(--soft-green-bg); color: var(--soft-green-fg); font-weight: 700; font-size: 12px; }
.fp-empty { padding: 14px; text-align: center; color: var(--muted); font-size: 13px; }
.fp-recent { margin-top: 14px; }
.fp-chip { display: block; width: 100%; text-align: left; min-height: 44px; padding: 8px 12px; margin-top: 6px; border-radius: 12px; border: 1px dashed var(--line); background: transparent; color: var(--ink); font-size: 13px; }
.fp-prod { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fp-prod-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; align-items: flex-start; }
.fp-prod-txt strong { font-size: 16px; line-height: 1.25; }
.fp-trocar { min-height: 40px; flex: none; }

/* fotos */
.fp-fotos-head { display: flex; align-items: center; justify-content: space-between; }
.fp-fotos-head .fp-h { margin: 0; }
.fp-count { font-size: 13px; color: var(--muted); }
.fp-count b { color: var(--ink); font-size: 16px; }
.fp-progress { height: 6px; border-radius: 999px; background: var(--hover); margin: 10px 0 12px; overflow: hidden; }
.fp-progress span { display: block; height: 100%; background: #3f7d52; transition: width .3s; }
.fp-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0; }
.fp-tile { position: relative; width: 100%; aspect-ratio: 1; padding: 0; overflow: hidden; border-radius: 14px; border: 2px dashed var(--line); background: var(--hover); color: var(--muted); display: flex; align-items: center; justify-content: center; }
.fp-tile:not(:disabled):active { transform: scale(.98); }
.fp-tile:not(:disabled) { border-color: #3f7d52; color: #2a6b3b; cursor: pointer; }
.fp-tile:disabled { opacity: .6; }
.fp-ph { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.fp-ph i { font-size: 34px; }
.fp-ph em { font-style: normal; font-size: 12.5px; font-weight: 600; }
.fp-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.fp-slot.ok .fp-tile { border-style: solid; border-color: #3f7d52; opacity: 1; }
.fp-status { min-height: 20px; margin-top: 6px; font-size: 12px; text-align: center; color: var(--muted); }
.fp-status.err { color: var(--soft-red-fg); font-weight: 600; }

/* barra de ação colada ao rodapé */
.fp-bar { position: sticky; bottom: 0; z-index: 15; margin: 0 -12px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bs-body-bg, #faf7f2) 70%, transparent); }
.fp-cta { width: 100%; min-height: 54px; font-size: 16px; font-weight: 700; border-radius: 14px; display: flex; align-items: center; justify-content: center; gap: 10px; }

/* histórico */
.fp-hist summary { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 14px; cursor: pointer; min-height: 32px; }
.fp-lote { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.fp-lote-h { font-weight: 700; font-size: 13.5px; }
.fp-lote-h small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.fp-lote-fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; margin-top: 8px; }
.fp-lote-fotos figure { margin: 0; text-align: center; }
.fp-lote-fotos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.fp-lote-fotos figcaption { margin-top: 4px; }

/* câmera em tela cheia */
.fp-cam { background: #000; color: #fff; border: 0; border-radius: 0; height: 100%; }
@media (min-width: 576px) { .fp-cam { border-radius: 16px; height: auto; max-height: 92vh; } }
.fp-cam-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; }
.fp-cam-info { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.fp-cam-info small { color: #c9d4c9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-cam-close { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 18px; flex: none; }
.fp-cam-view { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; background: #000; }
.fp-cam-view video, .fp-cam-view canvas { max-width: 100%; max-height: 100%; width: 100%; height: 100%; object-fit: contain; }
.fp-cam-ctl { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); min-height: 110px; }
.fp-cam-btn { min-height: 54px; flex: 1; font-size: 16px; font-weight: 700; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.fp-shutter { width: 76px; height: 76px; border-radius: 50%; border: 4px solid #fff; background: transparent; padding: 5px; }
.fp-shutter span { display: block; width: 100%; height: 100%; border-radius: 50%; background: #fff; }
.fp-shutter:active span { transform: scale(.9); }
@media (min-width: 768px) { .fp { max-width: 720px; } .fp-slots { grid-template-columns: repeat(4, 1fr); } }
