/* ===== Printflow - Estilos globais ===== */

:root {
  --primary: #4f7fb3;
  --primary-dark: #3e5f9a;
  --secondary: #e62a6c;
  --accent: #f2c94c;
  --bg-main: #0f1115;
  --bg-secondary: #1a1d23;
  --text-primary: #ffffff;
  --text-secondary: #d1d5db;
  --neutral-gray: #6b7280;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Darker Grotesque', sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  overflow-x: hidden;
}

.font-mono {
  font-family: 'Space Mono', monospace;
}

/* ----- Overlays e fundos ----- */
.grain-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
  z-index: 9999;
  mix-blend-mode: overlay;
}

.gradient-mesh {
  position: absolute;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(
      ellipse at 20% 30%,
      rgba(79, 127, 179, 0.15) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse at 80% 70%,
      rgba(230, 42, 108, 0.15) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse at 50% 50%,
      rgba(242, 201, 76, 0.08) 0%,
      transparent 50%
    );
  filter: blur(60px);
  opacity: 0.6;
}

/* ----- Navegação (header partilhado) ----- */
nav {
  backdrop-filter: blur(20px);
  background: rgba(15, 17, 21, 0.8);
  border-bottom: 1px solid rgba(79, 127, 179, 0.2);
}

.site-logo-link {
  display: inline-block;
  line-height: 0;
}

.site-logo {
  display: block;
  height: 2.5rem;
  width: auto;
  object-fit: contain;
}

.site-logo-link.footer-logo .site-logo {
  height: 3rem;
}

nav a.nav-current {
  color: var(--accent) !important;
  font-weight: 700;
}

/* ----- Tipografia ----- */
.hero-text {
  font-size: clamp(3rem, 10vw, 8rem);
  line-height: 0.95;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.section-title {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 900;
  letter-spacing: -0.02em;
}

.section-title--large {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.1;
}

/* ----- Animações ----- */
.floating {
  animation: floating 6s ease-in-out infinite;
}

@keyframes floating {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(2deg);
  }
}

.slide-in {
  animation: slideIn 0.8s ease-out forwards;
  opacity: 0;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-out forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stagger-1 {
  animation-delay: 0.1s;
}
.stagger-2 {
  animation-delay: 0.2s;
}
.stagger-3 {
  animation-delay: 0.3s;
}
.stagger-4 {
  animation-delay: 0.4s;
}
.stagger-5 {
  animation-delay: 0.5s;
}
.stagger-6 {
  animation-delay: 0.6s;
}

.scroll-indicator {
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

/* ----- Componentes: cards de produto ----- */
.product-card {
  background: var(--bg-secondary);
  border: 1px solid rgba(79, 127, 179, 0.2);
  border-radius: 24px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.product-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(79, 127, 179, 0.1),
    transparent
  );
  transition: left 0.6s;
  z-index: 1;
}

.product-card:hover::before {
  left: 100%;
}

.product-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: var(--primary);
  box-shadow: 0 20px 60px rgba(79, 127, 179, 0.3);
}

/* Catálogo: cards com mais altura no hover */
.page-catalogo .product-card:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow: 0 25px 70px rgba(79, 127, 179, 0.35);
}

.product-image-wrap {
  cursor: pointer;
  outline: none;
}

.product-image-wrap:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.product-image {
  width: 100%;
  height: 280px;
  background: linear-gradient(
    135deg,
    rgba(79, 127, 179, 0.1),
    rgba(230, 42, 108, 0.1)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  position: relative;
  overflow: hidden;
}

.product-image .product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

.product-image .product-img.img-failed {
  opacity: 0;
  position: absolute;
  pointer-events: none;
}

.product-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.5rem 1rem;
  background: rgba(242, 201, 76, 0.9);
  color: var(--bg-main);
  font-weight: bold;
  border-radius: 20px;
  font-size: 0.85rem;
  z-index: 2;
}

.product-category {
  display: inline-block;
  padding: 0.4rem 1rem;
  background: rgba(79, 127, 179, 0.15);
  border: 1px solid rgba(79, 127, 179, 0.3);
  border-radius: 20px;
  font-size: 0.9rem;
  color: var(--primary);
  font-weight: 600;
}

/* ----- Ícone de categoria (página inicial) ----- */
.category-icon {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    rgba(79, 127, 179, 0.2),
    rgba(230, 42, 108, 0.2)
  );
  border: 2px solid rgba(79, 127, 179, 0.3);
  transition: all 0.3s ease;
}

.category-icon:hover {
  transform: scale(1.1) rotate(5deg);
  border-color: var(--accent);
}

/* ----- Stats ----- */
.stat-number {
  font-size: clamp(2rem, 6vw, 4rem);
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ----- Badge e botões ----- */
.tech-badge {
  position: relative;
  padding: 0.5rem 1.5rem;
  background: linear-gradient(
    135deg,
    rgba(79, 127, 179, 0.1),
    rgba(230, 42, 108, 0.1)
  );
  border: 1px solid rgba(79, 127, 179, 0.3);
  clip-path: polygon(
    10px 0,
    100% 0,
    100% calc(100% - 10px),
    calc(100% - 10px) 100%,
    0 100%,
    0 10px
  );
}

.cta-button {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.cta-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition:
    width 0.6s,
    height 0.6s;
}

.cta-button:hover::before {
  width: 300px;
  height: 300px;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(79, 127, 179, 0.4);
}

/* ----- Processo (passos) ----- */
.process-step {
  position: relative;
  padding-left: 3rem;
}

.process-step::before {
  content: '';
  position: absolute;
  left: 0.75rem;
  top: 3rem;
  width: 2px;
  height: calc(100% - 2rem);
  background: linear-gradient(180deg, var(--primary), transparent);
}

.process-number {
  position: absolute;
  left: 0;
  top: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.25rem;
}

/* ----- Catálogo: filtros e pesquisa ----- */
.filter-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  border: 2px solid rgba(79, 127, 179, 0.3);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
  font-size: 1.1rem;
}

.filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}

.filter-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-color: var(--primary);
  color: white;
  box-shadow: 0 10px 30px rgba(79, 127, 179, 0.4);
}

.search-bar {
  background: var(--bg-secondary);
  border: 2px solid rgba(79, 127, 179, 0.3);
  border-radius: 50px;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  color: var(--text-primary);
  transition: all 0.3s ease;
  width: 100%;
  max-width: 500px;
}

.search-bar:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79, 127, 179, 0.1);
}

.search-bar::placeholder {
  color: var(--neutral-gray);
}

/* ----- Footer ----- */
.site-footer {
  border-color: rgba(79, 127, 179, 0.2);
}

.site-footer .footer-border {
  border-color: rgba(79, 127, 179, 0.2);
}

/* ----- Catálogo: botão WhatsApp no card ----- */
.btn-whatsapp:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* ----- Modal de detalhe do produto ----- */
body.modal-open {
  overflow: hidden;
}

.product-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: modalFadeIn 0.3s ease;
}

.product-modal[aria-hidden='true'] {
  display: none;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.product-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

.product-modal-content {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid rgba(79, 127, 179, 0.3);
  border-radius: 24px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
  animation: modalSlideIn 0.35s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.product-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  transition:
    background 0.2s,
    transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-modal-close:hover {
  background: rgba(230, 42, 108, 0.3);
  transform: scale(1.05);
}

.product-modal-body {
  padding: 2rem;
}

.product-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding: 2rem 2rem 2rem 2rem;
}

@media (max-width: 768px) {
  .product-modal-grid {
    grid-template-columns: 1fr;
    padding: 3rem 1.5rem 1.5rem;
  }
}

.product-modal-images {
  min-height: 200px;
}

.product-modal-main-img-wrap {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(
    135deg,
    rgba(79, 127, 179, 0.1),
    rgba(230, 42, 108, 0.1)
  );
}

.product-modal-main-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-modal-gallery .product-modal-thumbs {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.product-modal-thumb {
  width: 56px;
  height: 56px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-main);
  transition:
    border-color 0.2s,
    transform 0.2s;
}

.product-modal-thumb:hover,
.product-modal-thumb.active {
  border-color: var(--primary);
}

.product-modal-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-modal-info {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
