/* ==============================================================================
   IGOR BRAGA IMÓVEIS - DESIGN SYSTEM & ESTILIZAÇÃO MODERNA
   Portfólio de Lançamentos de Alto Padrão - Curitiba e Região
   Corretor: Igor Braga (CRECI/PR 40.512 F)
   Design System: Executive Navy & Champagne Gold | 100% Sans-Serif
   ============================================================================== */

:root {
  /* Cores Principais */
  --color-primary: #121b22;
  --color-primary-dark: #0a1015;
  --color-primary-light: #1c2b36;
  --color-accent: #c5a059;
  --color-accent-hover: #b38e47;
  --color-accent-light: #fcf9f2;
  --color-accent-border: #e8dfc8;
  --color-accent-glow: rgba(197, 160, 89, 0.25);

  /* Backgrounds */
  --color-bg-body: #f8fafc;
  --color-bg-white: #ffffff;
  --color-bg-card: #ffffff;
  --color-bg-subtle: #f1f5f9;
  --color-bg-dark: #121b22;

  /* Tipografia */
  --color-text-main: #0f172a;
  --color-text-heading: #0f172a;
  --color-text-muted: #475569;
  --color-text-light: #94a3b8;
  --color-text-white: #ffffff;

  /* Bordas */
  --color-border: #e2e8f0;
  --color-border-subtle: #f1f5f9;
  --color-border-gold: rgba(197, 160, 89, 0.35);

  /* Ações & Status */
  --color-whatsapp: #25d366;
  --color-whatsapp-hover: #1ebd5b;
  --color-status-lancamento: #121b22;
  --color-status-obras: #d97706;
  --color-status-pronto: #059669;

  /* Tipografia do Sistema (100% Sans-Serif, Zero Bloqueio) */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Sombras */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(18, 27, 34, 0.08);
  --shadow-lg: 0 12px 30px rgba(18, 27, 34, 0.12);
  --shadow-card: 0 10px 25px -5px rgba(18, 27, 34, 0.06), 0 8px 10px -6px rgba(18, 27, 34, 0.04);
  --shadow-card-hover: 0 20px 35px -5px rgba(18, 27, 34, 0.12), 0 10px 15px -5px rgba(18, 27, 34, 0.08);

  /* Raios de borda */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transições */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base & Reset */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  max-width: 100vw;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg-body);
  color: var(--color-text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Proteção Universal contra Vazamento de Imagem no Celular */
img, picture, video, canvas, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

.property-card-item,
.card-property,
.image-container,
.lightbox-content,
article,
main,
section {
  max-width: 100%;
  word-break: break-word;
  overflow-wrap: break-word;
}

.whitespace-pre-line img,
.text-slate-700 img {
  max-width: 100% !important;
  height: auto !important;
  border-radius: var(--radius-md);
  margin: 1rem 0;
}

/* Gradiente Hero Exclusivo */
.hero-gradient-luxury {
  background: radial-gradient(circle at 50% 20%, #1c2b36 0%, #121b22 65%, #0a1015 100%);
  position: relative;
  overflow: hidden;
}

.hero-gradient-luxury::before {
  content: '';
  position: absolute;
  top: -150px;
  right: -100px;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(197, 160, 89, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-gradient-luxury::after {
  content: '';
  position: absolute;
  bottom: -150px;
  left: -100px;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(197, 160, 89, 0.10) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

/* Tipografia & Contraste Reforçado (WCAG AA/AAA) */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 700;
  color: #0f172a; /* Slate 900 de alto contraste em fundos claros */
  letter-spacing: -0.02em;
}

/* Força branco puro e contraste total para títulos dentro de containers escuros */
.hero-gradient-luxury h1,
.hero-gradient-luxury h2,
.hero-gradient-luxury h3,
.hero-gradient-luxury h4,
.hero-gradient-luxury h5,
.hero-gradient-luxury h6,
header h1, header h2, header h3,
footer h1, footer h2, footer h3, footer h4,
.text-white h1, .text-white h2, .text-white h3, .text-white h4,
[class*="hero-gradient"] h1, [class*="hero-gradient"] h2, [class*="hero-gradient"] h3,
[class*="bg-[#121b22]"] h1, [class*="bg-[#121b22]"] h2, [class*="bg-[#121b22]"] h3,
[class*="bg-[#0c1318]"] h1, [class*="bg-[#0c1318]"] h2, [class*="bg-[#0c1318]"] h3,
[class*="bg-[#0a1015]"] h1, [class*="bg-[#0a1015]"] h2, [class*="bg-[#0a1015]"] h3,
[class*="bg-slate-900"] h1, [class*="bg-slate-900"] h2, [class*="bg-slate-900"] h3,
.title-dark-bg {
  color: #ffffff !important;
}

/* Dourado escurecido para alto contraste e legibilidade sobre fundos claros (WCAG AA 4.5:1+) */
.text-gold-heading,
.text-gold-dark {
  color: #8c6b23 !important;
}

/* Dourado iluminado para alto contraste sobre fundos escuros (WCAG AAA 12:1+) */
.text-gold-light {
  color: #ffd885 !important;
}

/* Badges de Status Modernos */
.badge-luxury {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: transform var(--transition-fast);
}

.badge-lancamento {
  background: #121b22;
  color: #ffffff;
  border: 1px solid var(--color-accent);
}

.badge-em_obras {
  background: #d97706;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.badge-pronto {
  background: #059669;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Card de Empreendimento de Luxo */
.card-property {
  background: var(--color-bg-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.card-property:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--color-border-gold);
}

.card-property .image-container {
  position: relative;
  width: 100%;
  padding-top: 62.5%; /* Aspect Ratio 16:10 */
  background-color: #f1f5f9;
  overflow: hidden;
}

.card-property .image-container img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.card-property:hover .image-container img {
  transform: scale(1.06);
}

/* Botões do Sistema */
.btn-gold {
  background: linear-gradient(135deg, #c5a059 0%, #b38e47 100%);
  color: #ffffff;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(197, 160, 89, 0.3);
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.btn-gold:hover {
  background: linear-gradient(135deg, #d8b46e 0%, #c5a059 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(197, 160, 89, 0.4);
  color: #ffffff;
}

.btn-navy {
  background: var(--color-primary);
  color: #ffffff;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
}

.btn-navy:hover {
  background: var(--color-primary-light);
  transform: translateY(-2px);
  color: #ffffff;
}

.btn-whatsapp-luxury {
  background: var(--color-whatsapp);
  color: #ffffff;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.3);
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.btn-whatsapp-luxury:hover {
  background: var(--color-whatsapp-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.4);
  color: #ffffff;
}

/* Chips de Filtro Rápido */
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #ffffff;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.filter-chip:hover {
  border-color: var(--color-accent);
  color: var(--color-primary);
  background: var(--color-accent-light);
}

.filter-chip.active {
  background: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(18, 27, 34, 0.2);
}

.filter-chip.active .chip-count {
  background: var(--color-accent);
  color: #ffffff;
}

.chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  background: var(--color-bg-subtle);
  color: var(--color-text-muted);
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: 2px;
}

/* Campo de Busca Flutuante na Hero */
.search-box-luxury {
  background: #ffffff;
  border-radius: var(--radius-xl);
  padding: 8px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Ícones de Especificações */
.spec-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.spec-icon {
  width: 16px;
  height: 16px;
  color: var(--color-accent);
  flex-shrink: 0;
}

/* Botão Flutuante Pulsante do WhatsApp */
.floating-whatsapp {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 58px;
  height: 58px;
  background-color: var(--color-whatsapp);
  color: #ffffff;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
  z-index: 99;
  transition: all var(--transition-normal);
  text-decoration: none;
}

.floating-whatsapp:hover {
  background-color: var(--color-whatsapp-hover);
  transform: scale(1.1);
  box-shadow: 0 12px 30px rgba(37, 211, 102, 0.5);
  color: #ffffff;
}

.floating-whatsapp::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--color-whatsapp);
  animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* Barra de Filtros Sticky no Catálogo */
.filters-bar {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  transition: box-shadow var(--transition-fast);
}

.filters-bar:focus-within {
  box-shadow: var(--shadow-md);
  border-color: var(--color-border-gold);
}

/* Galeria Interativa na Página do Empreendimento */
.gallery-thumbnail {
  width: 90px;
  height: 70px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition-fast);
  opacity: 0.75;
}

.gallery-thumbnail:hover, .gallery-thumbnail.active {
  border-color: var(--color-accent);
  opacity: 1;
  transform: translateY(-2px);
}

/* Lightbox Modal & Suporte a Touch Drag Fluido */
#fotoPrincipal,
.lightbox-image,
.lightbox-content,
#lightboxModal {
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-drag: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

#fotoPrincipal {
  touch-action: pan-y pinch-zoom;
  cursor: grab;
  will-change: transform, opacity;
}

#fotoPrincipal:active {
  cursor: grabbing;
}

.lightbox-modal {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(10, 16, 21, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 0;
  touch-action: none;
  overflow: hidden;
}

.lightbox-modal.active {
  display: flex;
}

.lightbox-content {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  cursor: grab;
}

.lightbox-content:active {
  cursor: grabbing;
}

.lightbox-image {
  max-width: 95vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
  will-change: transform, opacity;
  pointer-events: auto;
}

.lightbox-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(18, 27, 34, 0.88);
  pointer-events: auto !important;
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  cursor: pointer;
  transition: all var(--transition-fast);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 10010 !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
}

.lightbox-btn:hover {
  background: var(--color-accent);
  color: #ffffff;
  border-color: var(--color-accent);
  transform: translateY(-50%) scale(1.08);
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: rgba(18, 27, 34, 0.88);
  pointer-events: auto !important;
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  transition: all var(--transition-fast);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 10010 !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
}

.lightbox-close:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
  transform: scale(1.08);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ==============================================================================
   BARRA DE FILTROS FLUTUANTE STICKY & MOBILE FILTER DRAWER
   ============================================================================== */
#stickyFilterBar {
  will-change: transform, top;
}

#stickyFilterBar > div {
  box-shadow: 0 10px 25px -5px rgba(18, 27, 34, 0.08), 0 8px 10px -6px rgba(18, 27, 34, 0.04);
}

@media (max-width: 1023px) {
  #stickyFilterBar {
    top: 60px;
  }
}

/* Animação suave para o Drawer do Celular */
#mobileFilterDrawer:not(.hidden) {
  animation: fadeIn 0.2s ease-out forwards;
}

#mobileFilterDrawer:not(.hidden) > div {
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* Botão Flutuante (FAB) do Celular */
#btnFloatingMobileFilter {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

/* Melhorias no Lightbox para Celular e Touch */
@media (max-width: 640px) {
  .lightbox-btn {
    width: 48px;
    height: 48px;
    font-size: 28px;
    background: rgba(18, 27, 34, 0.92);
    border: 1.5px solid rgba(255, 255, 255, 0.35);
  }
  .lightbox-btn.left-3,
  .lightbox-btn.sm\:left-6 {
    left: 8px !important;
  }
  .lightbox-btn.right-3,
  .lightbox-btn.sm\:right-6 {
    right: 8px !important;
  }
  .lightbox-close {
    top: 14px;
    right: 14px;
    width: 44px;
    height: 44px;
    font-size: 20px;
  }
}
