/* ==========================================================================
   Tá Feito - Site de Anúncios
   CSS Principal
   ========================================================================== */

/* --------------------------------------------------------------------------
   Reset e Base
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Cores do App Tá Feito - Estilo Banco Inter */
  --primary-color: #FF7A00;       /* Laranja vibrante estilo Inter */
  --primary-dark: #E56A00;
  --primary-light: #FF9933;
  --blue-primary: #1A73E8;        /* Azul mais escuro para contraste */
  --blue-dark: #1557B0;
  --red-accent: #D93025;          /* Vermelho mais escuro */
  --green-accent: #188038;        /* Verde mais escuro para contraste */
  --yellow-accent: #F9AB00;       /* Amarelo mais escuro */
  --secondary-color: #1A1A2E;
  --text-color: #202124;          /* Texto mais escuro */
  --text-light: #5F6368;          /* Texto secundário mais escuro */
  --text-muted: #80868B;          /* Texto terciário mais escuro */
  --background: #FAFAFA;
  --white: #FFFFFF;
  --border-color: #DADCE0;
  --success-color: #188038;
  --error-color: #D93025;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
  --radius: 8px;
  --radius-lg: 12px;
  /* Transições compostas (GPU-accelerated) */
  --transition-opacity: opacity 0.3s ease;
  --transition-transform: transform 0.3s ease;
  --transition-shadow: box-shadow 0.3s ease;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background-color: var(--background);
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  /* Sem transição - mudança instantânea de cor é aceitável */
}

a:hover {
  color: var(--primary-dark);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  cursor: pointer;
  border: none;
  font-family: inherit;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.header {
  background: var(--white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.header__logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.08rem; /* Reduzido 30% total (era 1.5rem) */
  font-weight: 700;
  text-decoration: none;
}

.header__logo img {
  height: 42px; /* Aumentado 5% (era 40px) */
  width: auto;
}

.header__logo-ta {
  color: var(--blue-primary);
}

.header__logo-feito {
  color: var(--blue-primary);
}

/* Search Bar */
.search-bar {
  flex: 1;
  max-width: 600px;
  display: flex;
  gap: 8px;
}

.search-bar__input-wrapper {
  flex: 1;
  position: relative;
}

.search-bar__input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 1rem;
}

.search-bar__input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.search-bar__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 20px;
  height: 20px;
}

.search-bar__btn {
  padding: 12px 24px;
  background: var(--primary-color);
  color: var(--white);
  border-radius: var(--radius);
  font-weight: 600;
}

.search-bar__btn:hover {
  background: var(--primary-dark);
}

/* Location */
.header__location {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-light);
  font-size: 0.9rem;
  min-width: 150px; /* Largura mínima para evitar CLS */
  height: 40px; /* Altura fixa */
  cursor: pointer;
  padding: 8px 12px;
  border-radius: var(--radius);
}

.header__location:hover {
  background: var(--background);
}

.header__location-icon {
  width: 18px;
  height: 18px;
  color: var(--primary-color);
}

.header__location-text {
  min-width: 100px; /* Largura mínima para evitar CLS */
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* CTA Download */
.header__cta {
  padding: 10px 20px;
  background: var(--secondary-color);
  color: var(--white);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
}

.header__cta:hover {
  background: #2a2a4e;
  color: var(--white);
}

/* --------------------------------------------------------------------------
   Categories Bar
   -------------------------------------------------------------------------- */
.categories-bar {
  background: var(--white);
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  position: relative;
  z-index: 100; /* Abaixo do header (1000) mas acima do conteúdo */
}

.categories-bar::-webkit-scrollbar {
  display: none;
}

.categories-bar__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
}

.category-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  min-height: 44px; /* Área de toque mínima */
  color: var(--text-color);
  font-size: 0.9rem;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  flex-shrink: 0;
}

.category-chip:hover,
.category-chip.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.category-chip__icon {
  font-size: 1.1rem;
}

/* --------------------------------------------------------------------------
   Main Content
   -------------------------------------------------------------------------- */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px;
}

/* Location Banner */
.location-banner {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: var(--white);
  padding: 16px 24px;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.location-banner__text {
  display: flex;
  align-items: center;
  gap: 12px;
}

.location-banner__icon {
  width: 24px;
  height: 24px;
}

.location-banner__city {
  font-weight: 600;
  font-size: 1.1rem;
}

.location-banner__change {
  background: rgba(255, 255, 255, 0.2);
  color: var(--white);
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 0.9rem;
}

.location-banner__change:hover {
  background: rgba(255, 255, 255, 0.3);
  color: var(--white);
}

/* Section Title */
.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--secondary-color);
  margin-bottom: 16px;
}

/* --------------------------------------------------------------------------
   Ads Grid
   -------------------------------------------------------------------------- */
.ads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  grid-auto-rows: 1fr; /* Todas as linhas com mesma altura */
}

/* Ad Card */
.ad-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  /* Layout flexbox para altura uniforme */
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 320px;
  contain: layout style;
  /* Transições compostas (GPU-accelerated) */
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ad-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

/* Skeleton Loading Cards */
.ad-card--skeleton {
  pointer-events: none;
}

.ad-card--skeleton .skeleton-image {
  aspect-ratio: 4/3;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
}

.ad-card--skeleton .skeleton-content {
  padding: 16px;
}

.ad-card--skeleton .skeleton-line {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 4px;
  margin-bottom: 12px;
}

.ad-card--skeleton .skeleton-line--price {
  height: 24px;
  width: 50%;
}

.ad-card--skeleton .skeleton-line--title {
  height: 18px;
  width: 80%;
}

.ad-card--skeleton .skeleton-line--location {
  height: 14px;
  width: 60%;
  margin-bottom: 0;
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.ad-card__image-wrapper {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--background);
}

.ad-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.ad-card:hover .ad-card__image {
  transform: scale(1.05);
}

.ad-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  background: var(--primary-color);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
  text-transform: uppercase;
}

.ad-card__badge--used {
  background: var(--text-light);
}

.ad-card__content {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.ad-card__price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 8px;
}

.ad-card__title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-color);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
  min-height: 2.8em; /* Reservar espaço para 2 linhas */
}

.ad-card__location {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--text-light);
}

.ad-card__location-icon {
  width: 14px;
  height: 14px;
}

/* User info in card */
.ad-card__user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 12px;
  margin-top: auto; /* Empurrar para baixo */
  border-top: 1px solid var(--border-color);
}

.ad-card__user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--blue-primary);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
}

.ad-card__user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ad-card__user-info {
  flex: 1;
  min-width: 0;
}

.ad-card__user-name {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-color);
}

.ad-card__user-handle {
  font-size: 0.75rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ad-card__verified {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  color: var(--green-accent);
  flex-shrink: 0;
}

.ad-card__verified svg {
  width: 100%;
  height: 100%;
}

/* Transaction Badge (Venda/Aluguel/Procura-se) */
.ad-card__transaction {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 4px;
  text-transform: uppercase;
}

.ad-card__transaction--sell {
  background: var(--green-accent);
  color: var(--white);
}

.ad-card__transaction--rent {
  background: var(--blue-primary);
  color: var(--white);
}

.ad-card__transaction--buy {
  background: var(--primary-color);
  color: var(--white);
}

/* Ad Card Price Row */
.ad-card__price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

/* Extra Badges (Negociável, PRO) */
.ad-card__extra-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.ad-card__extra-badge {
  padding: 2px 6px;
  font-size: 0.6rem;
  font-weight: 600;
  border-radius: 3px;
  text-transform: uppercase;
}

.ad-card__extra-badge--negotiable {
  background: var(--yellow-accent);
  color: #333;
}

.ad-card__extra-badge--pro {
  background: linear-gradient(135deg, #9333EA, #7C3AED);
  color: var(--white);
}

/* Category Attributes */
.ad-card__attrs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  min-height: 24px; /* Reservar espaço mesmo quando vazio */
}

.ad-card__attr {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  background: var(--background);
  border-radius: 4px;
  font-size: 0.7rem;
  color: var(--text-light);
}

.ad-card__attr .material-symbols-outlined {
  font-size: 14px;
  color: var(--text-muted);
}

/* Location with Material Symbol */
.ad-card__location .material-symbols-outlined {
  font-size: 14px;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Loading State
   -------------------------------------------------------------------------- */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.loading__animation {
  width: 90px;
  height: 90px;
}

.loading__spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading__text {
  margin-top: 8px;
  font-size: 0.95rem;
}

/* Splash Screen */
.splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.splash-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.splash-screen__animation {
  width: 150px;
  height: 150px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state__icon {
  width: 80px;
  height: 80px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.empty-state__title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--secondary-color);
  margin-bottom: 8px;
}

.empty-state__text {
  color: var(--text-light);
  margin-bottom: 24px;
}

.empty-state__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--primary-color);
  color: var(--white);
  border-radius: var(--radius);
  font-weight: 600;
}

.empty-state__btn:hover {
  background: var(--primary-dark);
  color: var(--white);
}

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
}

.pagination__btn {
  padding: 10px 16px;
  background: var(--white);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-weight: 500;
}

.pagination__btn:hover,
.pagination__btn.active {
  background: var(--primary-color);
  color: var(--white);
  border-color: var(--primary-color);
}

.pagination__btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer {
  background: var(--secondary-color);
  color: var(--white);
  padding: 40px 20px;
  margin-top: 60px;
}

.footer__container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
}

.footer__section h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--white);
}

.footer__section a {
  display: block;
  color: rgba(255, 255, 255, 0.85);
  padding: 12px 0; /* Aumentado para área de toque mínima 48px */
  font-size: 0.9rem;
  min-height: 44px; /* Mínimo recomendado para touch */
  display: flex;
  align-items: center;
}

.footer__section a:hover {
  color: var(--white);
}

.footer__download {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.footer__download img {
  height: 40px;
  width: auto;
}

.footer__bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 24px;
  margin-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

/* --------------------------------------------------------------------------
   Ad Detail Page
   -------------------------------------------------------------------------- */
.ad-detail {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 20px;
}

.ad-detail__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-light);
  margin-bottom: 20px;
  font-size: 0.9rem;
  position: relative;
  z-index: 10; /* Acima do conteúdo mas abaixo do header */
}

.ad-detail__back:hover {
  color: var(--primary-color);
}

.ad-detail__card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.ad-detail__gallery {
  position: relative;
  aspect-ratio: 16/10;
  background: var(--background);
}

.ad-detail__gallery img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ad-detail__gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.5);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-detail__gallery-nav:hover {
  background: rgba(0, 0, 0, 0.7);
}

.ad-detail__gallery-nav--prev {
  left: 16px;
}

.ad-detail__gallery-nav--next {
  right: 16px;
}

.ad-detail__thumbnails {
  display: flex;
  gap: 8px;
  padding: 12px;
  overflow-x: auto;
  background: var(--background);
}

.ad-detail__thumbnail {
  width: 60px;
  height: 60px;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  opacity: 0.6;
  /* Transição composta (GPU-accelerated) */
  transition: opacity 0.3s ease;
  flex-shrink: 0;
}

.ad-detail__thumbnail.active,
.ad-detail__thumbnail:hover {
  opacity: 1;
}

.ad-detail__thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ad-detail__content {
  padding: 24px;
}

.ad-detail__price {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 8px;
}

.ad-detail__title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--secondary-color);
  margin-bottom: 16px;
  line-height: 1.4;
}

.ad-detail__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
}

.ad-detail__meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--text-light);
}

.ad-detail__meta-icon {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.ad-detail__description {
  margin-bottom: 24px;
}

.ad-detail__description h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.ad-detail__description p {
  color: var(--text-light);
  white-space: pre-wrap;
  line-height: 1.6;
}

/* Seção de Características/Atributos */
.ad-detail__attributes {
  margin-bottom: 24px;
  padding: 20px;
  background: var(--background);
  border-radius: var(--radius-lg);
}

.ad-detail__attributes h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.attributes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.attribute-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.attribute-item__icon {
  font-size: 24px;
  color: var(--primary-color);
}

.attribute-item__info {
  flex: 1;
  min-width: 0;
}

.attribute-item__label {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-bottom: 2px;
}

.attribute-item__value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ad-detail__cta {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ad-detail__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 24px;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
}

.ad-detail__btn--primary {
  background: var(--primary-color);
  color: var(--white);
}

.ad-detail__btn--primary:hover {
  background: var(--primary-dark);
  color: var(--white);
}

.ad-detail__btn--secondary {
  background: var(--secondary-color);
  color: var(--white);
}

.ad-detail__btn--secondary:hover {
  background: #2a2a4e;
  color: var(--white);
}

.ad-detail__btn-icon {
  width: 20px;
  height: 20px;
}

/* Seller Info */
.seller-info {
  background: var(--background);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 16px;
}

.seller-info__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.seller-info__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-color);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.25rem;
  overflow: hidden;
  flex-shrink: 0;
}

.seller-info__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.seller-info__name {
  font-weight: 600;
  color: var(--secondary-color);
}

.seller-info__rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.9rem;
  color: var(--text-light);
}

.seller-info__rating-star {
  color: #FFB800;
}

.seller-info__note {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

/* --------------------------------------------------------------------------
   Download Modal
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none; /* Escondido por padrão - evita CLS */
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  transform: scale(0.9);
  /* Transição composta (GPU-accelerated) */
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
}

.modal__title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--secondary-color);
  margin-bottom: 8px;
}

.modal__text {
  color: var(--text-light);
  margin-bottom: 24px;
  line-height: 1.5;
}

.modal__buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: var(--radius);
  font-weight: 600;
}

.modal__btn--ios {
  background: #000;
  color: var(--white);
}

.modal__btn--android {
  background: #3DDC84;
  color: #000;
}

.modal__btn:hover {
  opacity: 0.9;
}

.modal__close {
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px 16px;
}

.modal__close:hover {
  color: var(--text-color);
}

/* --------------------------------------------------------------------------
   Location Modal
   -------------------------------------------------------------------------- */
.location-modal__search {
  margin-bottom: 16px;
}

.location-modal__input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 1rem;
}

.location-modal__input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.location-modal__list {
  max-height: 200px;
  overflow-y: auto;
}

.location-modal__item {
  padding: 12px;
  cursor: pointer;
  border-radius: var(--radius);
}

.location-modal__item:hover {
  background: var(--background);
}

.location-modal__use-gps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  background: var(--background);
  color: var(--primary-color);
  border-radius: var(--radius);
  font-weight: 500;
  margin-top: 12px;
}

.location-modal__use-gps:hover {
  background: var(--primary-color);
  color: var(--white);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .header {
    height: auto; /* Permite altura dinâmica no mobile */
  }

  .header__container {
    flex-wrap: wrap;
    padding: 10px 12px;
    gap: 10px;
  }

  .header__logo {
    font-size: 1.25rem;
  }

  .header__logo img {
    height: 32px;
  }

  .search-bar {
    order: 3;
    flex: none;
    width: 100%;
    max-width: none;
  }

  .search-bar__input {
    padding: 10px 12px 10px 40px;
    font-size: 0.95rem;
  }

  .search-bar__btn {
    padding: 10px 16px;
    font-size: 0.9rem;
  }

  .header__location {
    margin-left: auto;
    padding: 6px 8px;
  }

  .header__location-text {
    max-width: 100px;
    font-size: 0.8rem;
  }

  .header__cta {
    display: none;
  }

  /* Categories Bar Mobile */
  .categories-bar {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .categories-bar::-webkit-scrollbar {
    display: none;
  }

  .categories-bar__container {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    padding: 8px 12px;
    min-width: max-content;
  }

  .category-chip {
    flex-shrink: 0;
    padding: 10px 14px;
    min-height: 44px; /* Área de toque mínima */
    font-size: 0.85rem;
    white-space: nowrap;
  }

  .category-chip__icon {
    font-size: 1rem;
  }

  /* Main Content Mobile */
  .main {
    padding: 16px 12px;
    min-height: calc(100vh - 200px);
  }

  .location-banner {
    flex-direction: row;
    text-align: left;
    padding: 8px 12px;
    margin-bottom: 12px;
    border-radius: 8px;
  }

  .location-banner__text {
    font-size: 0.8rem;
    gap: 6px;
  }

  .location-banner__icon {
    width: 16px;
    height: 16px;
  }

  .location-banner__change {
    padding: 4px 10px;
    font-size: 0.75rem;
  }

  .section-title {
    font-size: 1.1rem;
    margin-bottom: 12px;
  }

  /* Ads Grid Mobile */
  .ads-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .ad-card {
    border-radius: 8px;
  }

  .ad-card__content {
    padding: 10px;
  }

  .ad-card__price {
    font-size: 0.95rem;
    margin-bottom: 4px;
  }

  .ad-card__title {
    font-size: 0.8rem;
    -webkit-line-clamp: 2;
    margin-bottom: 4px;
  }

  .ad-card__location {
    font-size: 0.75rem;
  }

  .ad-card__location-icon {
    width: 12px;
    height: 12px;
  }

  .ad-card__user {
    padding-top: 8px;
    margin-top: 8px;
  }

  .ad-card__user-avatar {
    width: 24px;
    height: 24px;
    font-size: 0.65rem;
  }

  .ad-card__user-name {
    font-size: 0.7rem;
  }

  .ad-card__user-handle {
    font-size: 0.65rem;
  }

  .ad-card__verified {
    width: 12px;
    height: 12px;
  }

  /* Transaction Badge Mobile */
  .ad-card__transaction {
    top: 8px;
    left: 8px;
    padding: 3px 6px;
    font-size: 0.55rem;
  }

  /* Price Row Mobile */
  .ad-card__price-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .ad-card__extra-badges {
    gap: 2px;
  }

  .ad-card__extra-badge {
    padding: 1px 4px;
    font-size: 0.5rem;
  }

  /* Attributes Mobile */
  .ad-card__attrs {
    gap: 4px;
    margin-bottom: 6px;
  }

  .ad-card__attr {
    padding: 2px 4px;
    font-size: 0.6rem;
    gap: 2px;
  }

  .ad-card__attr .material-symbols-outlined {
    font-size: 12px;
  }

  /* Location Mobile */
  .ad-card__location .material-symbols-outlined {
    font-size: 12px;
  }

  /* Loading State Mobile */
  .loading {
    padding: 30px 16px;
  }

  .loading__animation {
    width: 60px;
    height: 60px;
  }

  .loading__text {
    font-size: 0.8rem;
  }

  .splash-screen__animation {
    width: 120px;
    height: 120px;
  }

  /* Empty State Mobile */
  .empty-state {
    padding: 40px 16px;
  }

  .empty-state__icon {
    width: 60px;
    height: 60px;
  }

  .empty-state__title {
    font-size: 1.1rem;
  }

  .empty-state__text {
    font-size: 0.9rem;
  }

  /* Footer Mobile - Compacto */
  .footer {
    margin-top: 24px;
    padding: 16px 12px;
  }

  .footer__container {
    grid-template-columns: 1fr 1fr;
    text-align: left;
    gap: 12px;
  }

  .footer__section h2 {
    font-size: 0.8rem;
    margin-bottom: 6px;
  }

  .footer__section a {
    font-size: 0.85rem;
    padding: 10px 0;
    min-height: 44px; /* Área de toque mínima */
  }

  .footer__section p {
    font-size: 0.7rem !important;
    margin-bottom: 6px !important;
  }

  .footer__section:last-child {
    grid-column: span 2;
    text-align: center;
  }

  .footer__download {
    justify-content: center;
    gap: 8px;
  }

  .footer__download img {
    height: 32px;
  }

  .footer__bottom {
    font-size: 0.65rem;
    padding-top: 10px;
    margin-top: 10px;
  }

  /* Ad Detail Mobile */
  .ad-detail {
    padding: 16px 12px;
  }

  .ad-detail__gallery {
    aspect-ratio: 4/3;
  }

  .ad-detail__content {
    padding: 16px;
  }

  .ad-detail__price {
    font-size: 1.5rem;
  }

  .ad-detail__title {
    font-size: 1.1rem;
  }

  /* Modal Mobile */
  .modal {
    padding: 24px 20px;
    margin: 16px;
    max-width: calc(100% - 32px);
  }

  .modal__title {
    font-size: 1.1rem;
  }

  .modal__text {
    font-size: 0.9rem;
  }

  .modal__btn {
    padding: 12px 20px;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .ads-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .ad-card__image-wrapper {
    aspect-ratio: 1/1;
  }

  .ad-card__content {
    padding: 8px;
  }

  .ad-card__price {
    font-size: 0.85rem;
  }

  .ad-card__title {
    font-size: 0.75rem;
    -webkit-line-clamp: 2;
  }

  .ad-card__location {
    font-size: 0.7rem;
  }

  .ad-card__user {
    padding-top: 6px;
    margin-top: 6px;
  }

  .ad-card__user-avatar {
    width: 20px;
    height: 20px;
    font-size: 0.6rem;
  }

  .ad-card__user-name {
    font-size: 0.65rem;
  }

  .ad-card__user-handle {
    display: none;
  }

  .category-chip {
    padding: 10px 12px;
    min-height: 44px; /* Área de toque mínima */
    font-size: 0.8rem;
  }

  .category-chip__icon {
    font-size: 0.9rem;
  }

  .search-bar__input {
    padding: 8px 10px 8px 36px;
    font-size: 0.9rem;
  }

  .search-bar__btn {
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  /* Transaction Badge Extra Small */
  .ad-card__transaction {
    top: 6px;
    left: 6px;
    padding: 2px 5px;
    font-size: 0.5rem;
  }

  /* Hide attributes on very small screens */
  .ad-card__attrs {
    display: none;
  }

  /* Extra badges smaller */
  .ad-card__extra-badge {
    font-size: 0.45rem;
  }

  .ad-card__attr .material-symbols-outlined,
  .ad-card__location .material-symbols-outlined {
    font-size: 10px;
  }
}

/* Fix para garantir que o conteúdo principal seja visível */
@media (max-width: 768px) {
  body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }

  .main {
    flex: 1;
  }
}

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */
.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
