/* ==========================================================================
   APS Filtros - Style
   Zero dependencies, mobile-first responsive
   ========================================================================== */

/* Custom Properties */
:root {
  --color-primary: #1a5c38;
  --color-primary-dark: #134429;
  --color-primary-light: #2d8a5e;
  --color-bg: #ffffff;
  --color-bg-alt: #f5f9f6;
  --color-text: #1a1a1a;
  --color-text-light: #3d4a42;
  --color-border: #d4e0d8;
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --max-width: 1100px;
  --nav-height: 60px;
  --transition: 0.3s ease;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--color-primary);
  text-decoration: none;
}

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

/* Container */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--color-primary);
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-logo img {
  height: 36px;
  width: auto;
  background: #ffffff;
  padding: 4px 8px;
  border-radius: 4px;
}

.nav-menu {
  list-style: none;
  display: flex;
  gap: 0.25rem;
}

.nav-menu a {
  color: rgba(255, 255, 255, 0.85);
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
}

.nav-menu a:hover,
.nav-menu a.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
}

/* Hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

/* Language Switcher */
.lang-switcher {
  margin-left: 0.5rem;
}

.lang-switcher select {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
  cursor: pointer;
  font-weight: 500;
}

.lang-switcher select:hover {
  background: rgba(255, 255, 255, 0.25);
}

.lang-switcher select option {
  background: var(--color-primary);
  color: #ffffff;
}

.hamburger,
.hamburger::before,
.hamburger::after {
  display: block;
  width: 24px;
  height: 2px;
  background: #ffffff;
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.hamburger {
  position: relative;
}

.hamburger::before,
.hamburger::after {
  content: "";
  position: absolute;
  left: 0;
}

.hamburger::before {
  top: -7px;
}

.hamburger::after {
  top: 7px;
}

/* Hamburger open state */
.nav-toggle[aria-expanded="true"] .hamburger {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .hamburger::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .hamburger::after {
  top: 0;
  transform: rotate(-45deg);
}

/* Mobile nav */
@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .nav-menu {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--color-primary);
    flex-direction: column;
    padding: 1rem;
    gap: 0;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform var(--transition), opacity var(--transition);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  }

  .nav-menu.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }

  .nav-menu a {
    display: block;
    padding: 0.75rem 1rem;
    font-size: 1rem;
  }
}

/* ==========================================================================
   Sections
   ========================================================================== */

.section {
  padding: 5rem 0;
  border-bottom: 1px solid var(--color-border);
  background-image: radial-gradient(circle, #c8d5cc 0.8px, transparent 0.8px);
  background-size: 28px 28px;
}

.section:last-of-type {
  border-bottom: none;
}

.section h2 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 400;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
  text-align: center;
}

.section h2::after {
  content: "◆";
  display: block;
  font-size: 0.6rem;
  color: var(--color-primary-light);
  margin-top: 0.5rem;
  letter-spacing: 0.5em;
}

.section-subtitle {
  text-align: center;
  color: var(--color-text-light);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

/* Hero */
.section-hero {
  padding-top: calc(var(--nav-height) + 4rem);
  padding-bottom: 4rem;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  text-align: center;
  color: #ffffff;
  position: relative;
  overflow: hidden;
}

.section-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(255,255,255,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-logo {
  margin: 0 auto 2rem;
  width: 200px;
  height: auto;
  background: #ffffff;
  padding: 12px 20px;
  border-radius: 8px;
}

.section-hero h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 400;
  color: #ffffff;
  margin-bottom: 0.75rem;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.8);
}

@media (min-width: 768px) {
  .section-hero {
    padding-top: calc(var(--nav-height) + 6rem);
    padding-bottom: 6rem;
  }

  .hero-logo {
    width: 280px;
  }

  .section-hero h1 {
    font-size: 2.75rem;
  }

  .hero-subtitle {
    font-size: 1.25rem;
  }
}

/* ==========================================================================
   Content
   ========================================================================== */

.text-block {
  max-width: 750px;
  margin: 1.5rem auto 0;
  text-align: center;
}

.text-block p {
  font-size: 1.05rem;
  color: var(--color-text-light);
  line-height: 1.8;
}

/* Product Cards */
.product-card {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-primary);
  border-radius: 4px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  max-width: 750px;
  margin-left: auto;
  margin-right: auto;
}


/* Side-by-side cards on desktop */
@media (min-width: 768px) {
  .product-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    max-width: 900px;
    margin: 0 auto 1rem;
  }

  .product-cards-grid .product-card {
    max-width: none;
    margin-bottom: 0;
  }
}

.product-card h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.product-card p {
  color: var(--color-text-light);
  line-height: 1.7;
}

/* ==========================================================================
   Gallery
   ========================================================================== */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 768px) {
  .gallery {
    grid-template-columns: repeat(3, 1fr);
  }

  .gallery--four {
    grid-template-columns: repeat(4, 1fr);
  }
}

.gallery-item {
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 1;
  background: var(--color-bg-alt);
  padding: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: transform var(--transition), box-shadow var(--transition);
}

.gallery-item:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.08);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
  transition: transform var(--transition);
}

.gallery-item:hover img {
  transform: scale(1.05);
}

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

/* ==========================================================================
   Lightbox
   ========================================================================== */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.lightbox:not([hidden]) {
  opacity: 1;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: none;
  border: none;
  color: #ffffff;
  cursor: pointer;
  font-size: 2.5rem;
  padding: 0.5rem;
  line-height: 1;
  opacity: 0.7;
  transition: opacity var(--transition);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  opacity: 1;
}

.lightbox-close {
  top: 1rem;
  right: 1.5rem;
  font-size: 3rem;
}

.lightbox-prev {
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3.5rem;
}

.lightbox-next {
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3.5rem;
}

@media (max-width: 768px) {
  .lightbox-prev {
    left: 0.25rem;
    font-size: 2.5rem;
  }

  .lightbox-next {
    right: 0.25rem;
    font-size: 2.5rem;
  }
}

/* ==========================================================================
   Contact
   ========================================================================== */

.contact-info {
  max-width: 600px;
  margin: 2rem auto 0;
}

@media (min-width: 768px) {
  .contact-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    max-width: 800px;
    margin: 2rem auto 0;
  }

  .contact-layout .contact-info {
    margin: 0;
    max-width: none;
  }
}

.contact-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
}

.contact-item:last-child {
  border-bottom: none;
}

.contact-item strong {
  color: var(--color-primary);
  min-width: 80px;
  font-weight: 600;
}

.contact-item a {
  color: var(--color-primary-light);
}

.contact-item a:hover {
  text-decoration: underline;
}

.contact-item address {
  font-style: normal;
  line-height: 1.6;
}

.contact-visual {
  display: none;
}

@media (min-width: 768px) {
  .contact-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
  }

  .contact-visual img {
    width: 160px;
    height: auto;
  }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: var(--color-primary-dark);
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  padding: 2rem 0;
  font-size: 0.85rem;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: center;
}

.footer-nav a {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
  transition: color var(--transition);
}

.footer-nav a:hover {
  color: #ffffff;
}

/* ==========================================================================
   Utility
   ========================================================================== */

/* Scroll offset for sections (accounts for fixed nav) */
.section {
  scroll-margin-top: var(--nav-height);
}

/* Accessibility: focus visible */
:focus-visible {
  outline: 2px solid var(--color-primary-light);
  outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   Scroll Animations
   ========================================================================== */

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger gallery items */
.gallery-item.fade-in {
  transition-delay: calc(var(--item-index, 0) * 0.1s);
}

/* ==========================================================================
   Back to Top Button
   ========================================================================== */

.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  background: var(--color-primary);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
  z-index: 100;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: all;
}

.back-to-top:hover {
  transform: translateY(-2px);
  background: var(--color-primary-light);
}
