/* ==========================================================================
   Base / Reset / Typography / Utilities
   ========================================================================== */

* , *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

a { color: inherit; text-decoration: none; }

ul { list-style: none; margin: 0; padding: 0; }

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--color-primary);
  line-height: 1.2;
  margin: 0 0 var(--space-3);
  font-weight: 600;
}

h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-lg); }
p { margin: 0 0 var(--space-3); color: var(--color-text-muted); }

button, input, textarea, select { font-family: inherit; font-size: inherit; }

/* Layout helpers */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.section { padding: var(--space-8) 0; }
.section-alt { background: var(--color-bg-alt); }
.section-dark { background: var(--gradient-dark); color: var(--color-text-inverse); }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-dark p { color: #c3c9de; }

.section-head { max-width: 680px; margin: 0 auto var(--space-6); text-align: center; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-secondary-dark);
  background: rgba(30, 158, 80, 0.1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  margin-bottom: var(--space-3);
}
.section-dark .eyebrow { color: var(--color-accent); background: rgba(230, 160, 33, 0.14); }

.page-banner {
  background: var(--gradient-dark);
  color: #fff;
  padding: var(--space-7) 0 var(--space-6);
  text-align: center;
}
.page-banner h1 { color: #fff; margin-bottom: var(--space-2); }
.page-banner .breadcrumb { color: #aab1cc; font-size: var(--fs-sm); }
.page-banner .breadcrumb a { color: var(--color-accent); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.85rem 1.7rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: var(--fs-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary { background: var(--color-secondary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--color-secondary-dark); box-shadow: var(--shadow-md); }

.btn-outline { background: transparent; border-color: currentColor; color: var(--color-primary); }
.btn-outline:hover { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

.btn-light { background: #fff; color: var(--color-primary); }
.btn-light:hover { background: var(--color-accent); color: #fff; }

.btn-ghost { background: rgba(255,255,255,0.1); color: #fff; border-color: rgba(255,255,255,0.4); }
.btn-ghost:hover { background: #fff; color: var(--color-primary); }

.btn-block { width: 100%; }

/* Cards */
.card {
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }

/* Grid helpers */
.grid { display: grid; gap: var(--space-5); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 960px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  h1 { font-size: var(--fs-2xl); }
  h2 { font-size: var(--fs-xl); }
  .section { padding: var(--space-7) 0; }
}

/* Misc */
.text-center { text-align: center; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Floating action buttons — Call + WhatsApp always on, back-to-top fades
   in on scroll. Stacked bottom-right so they never collide. */
.floating-actions {
  position: fixed;
  right: var(--space-4);
  bottom: var(--space-4);
  z-index: 90;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: var(--space-3);
}

.floating-actions > * {
  position: static;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition), opacity var(--transition);
  border: none;
  cursor: pointer;
}
.floating-actions > *:hover { transform: scale(1.08); }

.back-to-top {
  background: var(--color-primary);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.9);
}
.back-to-top.is-visible { opacity: 1; pointer-events: auto; transform: translateY(0) scale(1); }
.back-to-top.is-visible:hover { transform: scale(1.08); }

.call-float { background: var(--color-primary); color: #fff; }

.whatsapp-float {
  background: #25d366;
  position: relative;
}
.whatsapp-float::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #25d366;
  opacity: 0.55;
  animation: whatsapp-pulse 2.2s ease-out infinite;
  z-index: -1;
}
@keyframes whatsapp-pulse {
  0% { transform: scale(1); opacity: 0.55; }
  100% { transform: scale(1.7); opacity: 0; }
}

@media (max-width: 600px) {
  .floating-actions { right: var(--space-3); bottom: var(--space-3); gap: var(--space-2); }
  .floating-actions > * { width: 48px; height: 48px; }
  .floating-actions svg { width: 22px; height: 22px; }
}

/* Page loader for fetch-based includes */
[data-include]:empty { min-height: 40px; }

/* Preloader */
.preloader {
  position: fixed; inset: 0; background: #fff; z-index: 999;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
.preloader.is-hidden { opacity: 0; visibility: hidden; }
.preloader__spinner {
  width: 48px; height: 48px; border-radius: 50%;
  border: 4px solid var(--color-border);
  border-top-color: var(--color-secondary);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Reveal-on-scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
