/* Base */
#emendas-engbox-lista {
  --ep-bg: #ffffff;
  --ep-text: #1f2937;
  --ep-muted: #6b7280;
  --ep-border: #e5e7eb;
  --ep-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 10px 22px rgba(16, 24, 40, 0.08);

  /* Cores padrão (fallback) */
  --ep-accent: #b6b6b6;      /* cor principal */
  --ep-accent-2: #22c55e;    /* WhatsApp */
}

#emendas-engbox-single {
  --ep-bg: #ffffff;
  --ep-text: #1f2937;
  --ep-muted: #6b7280;
  --ep-border: #e5e7eb;
  --ep-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 10px 22px rgba(16, 24, 40, 0.08);

  /* Cores padrão (fallback) */
  --ep-accent: #b6b6b6;      /* cor principal */
  --ep-accent-2: #22c55e;    /* WhatsApp */
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--ep-text);
  background: #fafafa;
}

#singleInfo {
  display: none;
}

#emendas-engbox-lista .container {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

#emendas-engbox-lista .page-header {
  margin: 6px 0 22px;
}

#emendas-engbox-lista .page-header h1 {
  margin: 0 0 6px;
  font-size: 34px;
  letter-spacing: -0.02em;
}

#emendas-engbox-lista .page-header p {
  margin: 0;
  color: var(--ep-muted);
}

/* Filtros */
#emendas-engbox-lista .filters {
  display: grid;
  grid-template-columns: 2fr 2fr 1.4fr;
  gap: 12px;
  margin: 18px 0 18px;
  align-items: stretch;
}

#emendas-engbox-lista .filters__field {
  position: relative;
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--ep-border);
}

#emendas-engbox-lista .filters__field input,
#emendas-engbox-lista .filters__field select {
  width: 100%;
  height: 48px;
  border: none;
  outline: none;
  padding: 0 14px;
  font: inherit;
  color: var(--ep-text);
  background: transparent;
  appearance: none;
}

#emendas-engbox-lista .filters__field--search input {
  padding-left: 44px;
}

#emendas-engbox-lista .filters__icon {
  position: absolute;
  left: 14px;
  color: var(--ep-muted);
  pointer-events: none;
  font-size: 18px;
}

#emendas-engbox-lista .filters__field:focus-within {
  border-color: rgba(182, 182, 182, 0.45);
  box-shadow: 0 0 0 3px rgba(182, 182, 182, 0.12);
}

#emendas-engbox-lista .filters__submit {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 48px;
  border-radius: 12px;
  border: none;
  background: var(--ep-accent);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: opacity 120ms ease;
}

#emendas-engbox-lista .filters__submit:hover {
  background: var(--ep-accent) !important;
  opacity: 0.8;
}

.filters__submit:active {
  opacity: 0.7;
}

/* ========== LAYOUT HORIZONTAL POR CIDADE ========== */

/* Container principal */
#ep-grid {
  display: block;
  width: 100%;
}

/* Seção de cada cidade */
.city-section {
  margin-bottom: 3rem;
  width: 100%;
}

.city-section--new {
  animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Título da cidade */
.city-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ep-accent, #b5179e);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e5e7eb;
}

/* GRID HORIZONTAL - 3 colunas fixas */
.city-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  width: 100%;
}

/* CARD (layout horizontal) */
#emendas-engbox-lista .ep-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--ep-border);
  border-radius: 14px;
  background: var(--ep-bg);
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.03);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

#emendas-engbox-lista .ep-card:hover {
  transform: translateY(-4px);
  border-color: rgba(17, 24, 39, 0.14);
  box-shadow: var(--ep-shadow);
}

#emendas-engbox-lista .ep-card__media {
  display: block;
  height: 180px;
  background: #f3f4f6;
  overflow: hidden;
}

#emendas-engbox-lista .ep-card__media img,
#emendas-engbox-lista .ep-card .skeleton-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

#emendas-engbox-lista .ep-card:hover .ep-card__media img {
  transform: scale(1.05);
}

#emendas-engbox-lista .ep-card__body {
  padding: 14px 14px 10px;
  flex: 1 1 auto;
}

#emendas-engbox-lista .ep-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ep-muted);
  font-size: 13px;
  margin-bottom: 10px;
}

#emendas-engbox-lista .ep-card__title {
  margin: 0 0 10px;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  font-weight: 600;
}

#emendas-engbox-lista .ep-card__title a {
  color: inherit;
  text-decoration: none;
}

.ep-card__title a:hover {
  color: var(--ep-accent) !important;
}

#emendas-engbox-lista .ep-card__title a:hover {
  color: var(--ep-accent);
  text-decoration: none;
}

#emendas-engbox-lista .ep-card__excerpt {
  margin: 0;
  color: var(--ep-muted);
  font-size: 14px;
  line-height: 1.5;
  min-height: 3.0em;
}

#emendas-engbox-lista .ep-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 16px;
  border-top: 1px solid rgba(229, 231, 235, 0.8);
  min-height: 56px;
  margin-top: auto;
}

#emendas-engbox-lista .ep-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  min-width: 140px;
  border-radius: 8px;
  background: var(--ep-accent);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
}

#emendas-engbox-lista .ep-location {
  color: var(--ep-muted);
  font-size: 13px;
  white-space: nowrap;
}

#emendas-engbox-lista .ep-card__bar {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 44px;
  height: 4px;
  background: var(--ep-accent);
}

#emendas-engbox-lista .ep-icon {
  font-size: 20px;
  line-height: 1;
}

#emendas-engbox-lista .ep-empty {
  grid-column: 1 / -1;
  color: var(--ep-muted);
  padding: 18px 0;
}

/* Botão Carregar Mais */
#emendas-engbox-lista .load-more-wrapper {
  text-align: center;
  padding: 3rem 0;
}

#emendas-engbox-lista .load-more-btn {
  background: var(--ep-accent, #b5179e);
  color: white;
  border: none;
  padding: 1rem 2.5rem;
  font-size: 1rem;
  font-weight: 500;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 200px;
}

#emendas-engbox-lista .load-more-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(181, 23, 158, 0.3);
}

#emendas-engbox-lista .load-more-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Skeleton loading */
.skeleton-card {
  pointer-events: none;
}

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-img {
  width: 100%;
  height: 180px;
}

.skeleton-text {
  height: 1rem;
  margin-bottom: 0.5rem;
}

/* Select2 no layout do filtro */
#emendas-engbox-lista .filters__field--city .select2-container {
  width: 100% !important;
}

#emendas-engbox-lista .filters__field--city .select2-selection {
  height: 48px;
  border: none !important;
  border-radius: 12px;
  background: transparent;
  display: flex;
  align-items: center;
  padding: 0 14px;
}

#emendas-engbox-lista .filters__field--city .select2-selection__rendered {
  padding-left: 0 !important;
  color: var(--ep-text);
  font-size: 14px;
}

#emendas-engbox-lista .filters__field--city .select2-selection__arrow {
  height: 48px;
  right: 10px;
}

#emendas-engbox-lista .select2-dropdown {
  border: 1px solid var(--ep-border) !important;
  border-radius: 12px !important;
  box-shadow: var(--ep-shadow);
  margin-top: 4px;
}

#emendas-engbox-lista .select2-search__field {
  border: 1px solid var(--ep-border) !important;
  border-radius: 8px !important;
  padding: 8px 12px !important;
}

#emendas-engbox-lista .select2-results__option {
  padding: 10px 14px;
  font-size: 14px;
}

#emendas-engbox-lista .select2-results__option--highlighted {
  background: var(--ep-accent) !important;
  color: #000 !important;
}

/* Botão de limpar do Select2 */
#emendas-engbox-lista .select2-container .select2-selection__clear {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 30px !important;
  height: 15px !important;
  background: var(--ep-accent) !important;
  color: #fff !important;
  font-size: 20px !important;
  margin-right: 8px !important;
  cursor: pointer;
}

#emendas-engbox-lista .select2-container .select2-selection__clear:hover {
  background: var(--ep-accent) !important;
  opacity: 0.8;
}

/* Responsivo */
@media (max-width: 1024px) {
  #emendas-engbox-lista .city-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  #emendas-engbox-lista .container { 
    width: calc(100% - 28px); 
  }
  #emendas-engbox-lista .city-grid { 
    grid-template-columns: 1fr; 
  }
  #emendas-engbox-lista .filters { 
    grid-template-columns: 1fr; 
  }
  #emendas-engbox-lista .ep-card__footer {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    justify-content: center;
    gap: 12px;
  }
}

/* ===== SINGLE ===== */
#emendas-engbox-single .single .ep-single__header {
  margin: 6px 0 18px;
  text-align: center;
}

#title {
  text-align: center !important;
}

#emendas-engbox-single .single h1 {
  margin: 0 0 10px;
  font-size: 34px;
  text-align: center !important;
  letter-spacing: -0.02em;
}

#emendas-engbox-single .ep-single__requester {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--ep-muted);
  font-size: 14px;
}

#emendas-engbox-single .ep-single__meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--ep-muted);
  flex-wrap: wrap;
}

#emendas-engbox-single .ep-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(182, 182, 182, 0.10);
  color: var(--ep-accent);
  border: 1px solid rgba(182, 182, 182, 0.18);
  font-weight: 700;
  font-size: 12px;
}

#emendas-engbox-single .ep-dot {
  opacity: 0.6;
}

#emendas-engbox-single .ep-single__grid {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 26px;
  align-items: start;
}

#emendas-engbox-single .ep-single__image {
  margin: 0 0 12px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--ep-border);
  background: #f3f4f6;
}

#emendas-engbox-single .ep-single__image img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 520px;
  object-fit: cover;
}

#emendas-engbox-single .ep-tabs {
  display: flex;
  gap: 18px;
  padding: 10px 2px 0;
  margin: 0 0 12px;
}

#emendas-engbox-single .ep-tab {
  border: 0;
  background: transparent;
  color: var(--ep-muted);
  padding: 10px 0;
  cursor: pointer;
  font-weight: 700;
}

#emendas-engbox-single .ep-tab:hover {
  background: transparent !important;
  color: var(--ep-muted) !important;
  opacity: 0.8 !important;
}

#emendas-engbox-single .ep-tab.active {
  color: var(--ep-text);
  border-bottom: 2px solid var(--ep-accent);
}

#emendas-engbox-single .ep-tabpanel {
  border-top: 1px solid rgba(229, 231, 235, 0.8);
  padding-top: 14px;
}

#emendas-engbox-single .ep-single__content {
  color: var(--ep-text);
  line-height: 1.7;
  font-size: 15px;
}

#emendas-engbox-single .ep-muted {
  color: var(--ep-muted);
}

#emendas-engbox-single .ep-sidecard {
  position: relative;
  top: 0;
  border: 1px solid var(--ep-border);
  border-radius: 14px;
  background: #fff;
  padding: 16px;
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.03);
}

#emendas-engbox-single .ep-sidecard__count {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
}

#emendas-engbox-single .ep-progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.08);
  overflow: hidden;
  margin: 12px 0 16px;
}

#emendas-engbox-single .ep-icon {
  font-size: 20px;
  line-height: 1;
}

#emendas-engbox-single .ep-icon-user {
  font-size: 32px;
  line-height: 1;
}

#emendas-engbox-single .ep-progress__bar {
  height: 100%;
  width: 10%;
  background: var(--ep-accent);
  border-radius: 999px;
}

#emendas-engbox-single .ep-btn-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 46px;
  border-radius: 10px;
  background: var(--ep-accent-2);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
}

#emendas-engbox-single .ep-btn-whatsapp:hover {
  opacity: 0.8;
}

#emendas-engbox-single .ep-consent {
  margin-top: 12px;
  font-size: 14px;
}

#emendas-engbox-single .ep-consent input {
  margin-right: 6px;
}

#emendas-engbox-single .ep-btn-whatsapp.disabled {
  pointer-events: none;
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 980px) {
  #emendas-engbox-single .ep-single__grid {
    grid-template-columns: 1fr;
  }

  #emendas-engbox-single .single {
    padding-bottom: 96px;
  }
}
