/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
address { font-style: normal; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }

/* ===== CSS VARIABLES — white / black / red only ===== */
:root {
  --color-white:         #FFFFFF;
  --color-black:         #000000;
  --color-red:           #C40000;
  --color-red-hover:     #9E0000;
  --color-red-soft:      #FFF0F0;

  /* Semantic aliases (all map to white, black, or red) */
  --color-primary:       var(--color-white);
  --color-secondary:     var(--color-white);
  --color-accent:        var(--color-red);
  --color-accent-hover:  var(--color-red-hover);
  --color-amber:         var(--color-red);
  --color-amber-light:   var(--color-red-soft);
  --color-off-white:     var(--color-white);
  --color-text-dark:     var(--color-black);
  --color-text-muted:    rgba(0, 0, 0, 0.72);
  --color-text-light:    var(--color-black);
  --color-text-lighter:  rgba(0, 0, 0, 0.62);
  --color-border-dark:   rgba(0, 0, 0, 0.22);
  --color-border-light:  rgba(0, 0, 0, 0.12);
  --color-card-dark:     var(--color-white);
  --color-heading:       var(--color-red);
  --color-success:       var(--color-black);
  /* Floating call / WhatsApp FABs use recognisable brand fills */
  --color-fab-whatsapp:       #25D366;
  --color-fab-whatsapp-hover: #1DA851;
  --color-fab-phone:        #0084FF;
  --color-fab-phone-hover:    #006ED6;
  /* semrush.com pattern: Inter (UI/body), DM Sans (display; Factor A is proprietary) */
  --font-sans:           'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:           'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-display:        'DM Sans', var(--font-sans);
  --font-body:           var(--font-sans);
  --container-max:       1200px;
  --section-py:          5rem;
  --section-py-sm:       3rem;
  --border-radius-sm:    0.375rem;
  --border-radius-md:    0.75rem;
  --border-radius-lg:    1.25rem;
  --transition:          0.22s ease;
  /* Stack height: 2× FAB + gap; scroll button sits above this + breathing room */
  --fab-stack-offset: calc(2rem + 52px + 0.75rem + 52px + 1rem);
}

/* ===== BASE ===== */
body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-text-dark);
  background: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body.nav-open { overflow: hidden; }
h1, h2, h3, h4, h5, h6,
[class$="-title"],
[class*="-headline"] {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  line-height: 1.2;
  font-weight: 700;
  color: var(--color-heading);
}

/* ===== CONTAINER ===== */
.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--border-radius-sm);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
  text-align: center;
  cursor: pointer;
}
.btn-lg { padding: 0.9rem 2rem; font-size: 1rem; }
.btn-sm { padding: 0.5rem 1.1rem; font-size: 0.85rem; gap: 0.35rem; }
.btn:disabled,
.btn.is-submitting {
  opacity: 0.7;
  cursor: not-allowed;
  pointer-events: none;
}
.btn-primary { background: var(--color-accent); color: var(--color-white); }
.btn-primary:hover { background: var(--color-accent-hover); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--color-accent); border: 1.5px solid var(--color-accent); }
.btn-outline:hover { background: var(--color-accent); color: var(--color-white); }
.btn-outline-light { background: transparent; color: var(--color-black); border: 1.5px solid var(--color-black); }
.btn-outline-light:hover { background: var(--color-red-soft); color: var(--color-black); }
.btn-whatsapp { background: var(--color-accent); color: var(--color-white); }
.btn-whatsapp:hover { background: var(--color-accent-hover); }

/* ===== SECTION TITLES ===== */
.section-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.75rem;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1rem;
  color: var(--color-heading);
}
.section-sub {
  font-size: 1.05rem;
  color: var(--color-text-dark);
  max-width: 640px;
  line-height: 1.7;
}
.section-title.light { color: var(--color-heading); }
.section-sub.light { color: var(--color-text-dark); }
.text-center { text-align: center; }
.text-center .section-sub,
.section-sub.text-center {
  text-align: center;
  margin-inline: auto;
}

/* ===== HEADER ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border-light);
  transition: background 0.35s ease, border-color 0.35s ease;
}
.site-header.transparent:not(.scrolled) {
  background: var(--color-white);
  border-bottom-color: var(--color-border-light);
}
.site-header.scrolled {
  background: var(--color-white);
  border-bottom-color: var(--color-border-light);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}
@media (min-width: 769px) {
  .main-nav {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    min-width: 0;
    align-items: center;
  }
}
.logo-link {
  flex-shrink: 0;
  text-decoration: none;
}
.logo-brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  line-height: 1;
}
.nav-close {
  display: none;
}
.nav-list { display: flex; align-items: center; gap: 0.25rem; flex-wrap: wrap; }
@media (min-width: 769px) {
  .nav-list { flex-wrap: nowrap; }
}
.nav-link,
.nav-dropdown-toggle {
  padding: 0.5rem 0.85rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-dark);
  border: none;
  outline: none;
  box-shadow: none;
  background: transparent;
  border-radius: 0;
  transition: var(--transition);
  position: relative;
  -webkit-appearance: none;
  appearance: none;
}
.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  text-align: left;
}
.nav-dropdown-chevron {
  font-size: 0.62rem;
  opacity: 0.9;
  transition: transform 0.22s ease;
  line-height: 1;
}
.nav-dropdown.open .nav-dropdown-chevron {
  transform: rotate(180deg);
}
.nav-link:hover,
.nav-link.active,
.nav-dropdown-toggle:hover,
.nav-dropdown-toggle.active { color: var(--color-accent); }

.nav-dropdown { position: relative; flex-shrink: 0; }
.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-white);
  border: 1px solid var(--color-border-light);
  border-radius: var(--border-radius-md);
  padding: 1.35rem 1.5rem;
  width: min(860px, calc(100vw - 2rem));
  max-width: 860px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.12);
  z-index: 1100;
}
.nav-dropdown.open .dropdown-menu { display: block; }
.dropdown-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem 1rem;
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.6rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-dark);
  border-radius: var(--border-radius-sm);
  transition: var(--transition);
  line-height: 1.35;
}
.dropdown-item-icon {
  flex-shrink: 0;
  width: 1.2rem;
  font-size: 0.9rem;
  line-height: 1;
  text-align: center;
  color: var(--color-accent);
}
.dropdown-item:hover .dropdown-item-icon {
  color: var(--color-accent-hover);
}
.dropdown-item-text {
  flex: 1;
  min-width: 0;
}
.dropdown-item:hover {
  background: var(--color-red-soft);
  color: var(--color-accent);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 40px;
  height: 40px;
  justify-content: center;
  align-items: center;
  padding: 4px;
  border-radius: var(--border-radius-sm);
  background: transparent;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-black);
  border-radius: 2px;
  transition: var(--transition);
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--color-white);
  color: var(--color-text-dark);
  padding-top: 4rem;
  border-top: 1px solid var(--color-border-light);
}
.footer-inner {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 2fr;
  gap: 4rem;
  padding-bottom: 3rem;
  align-items: start;
}
.footer-brand {
  text-align: left;
  max-width: 300px;
}
.footer-company-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-red);
  line-height: 1.35;
  margin: 0 0 0.65rem;
}
.footer-about {
  margin: 0 0 1rem;
  padding: 0;
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--color-text-muted);
  text-align: justify;
  text-justify: inter-word;
}
.footer-social { display: flex; gap: 0.75rem; }
.footer-social a {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--color-red);
  border: 1px solid var(--color-red);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  color: var(--color-white);
}
.footer-social a:hover {
  background: var(--color-white);
  color: var(--color-red);
  border-color: var(--color-red);
}
.footer-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
/* Desktop only: nudge Services column slightly left, same row */
@media (min-width: 1025px) {
  .footer-col--services {
    margin-left: -1.25rem;
  }
}
.footer-contact-line {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}
.footer-contact-line:last-child {
  margin-bottom: 0;
}
.footer-contact-icon {
  flex-shrink: 0;
  width: 1rem;
  margin-top: 0.15rem;
  color: var(--color-red);
  font-size: 0.9rem;
  line-height: 1.4;
}
.footer-contact-line a {
  color: inherit;
  text-decoration: none;
}
.footer-contact-line a:hover {
  color: var(--color-accent);
}
.footer-col-title {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-heading);
  margin-bottom: 1rem;
}
.footer-col ul { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-col a { font-size: 0.875rem; transition: var(--transition); }
.footer-col a:hover { color: var(--color-accent); }

@media (min-width: 769px) {
  .footer-col--services ul {
    max-height: calc((0.875rem * 1.5 * 5) + (0.5rem * 4) + 0.5rem);
    overflow-y: auto;
    padding-right: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--color-red) transparent;
  }
  .footer-col--services ul::-webkit-scrollbar {
    width: 6px;
  }
  .footer-col--services ul::-webkit-scrollbar-track {
    background: transparent;
  }
  .footer-col--services ul::-webkit-scrollbar-thumb {
    background: var(--color-red);
    border-radius: 3px;
  }
  .footer-col--services ul::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent-hover);
  }
}
.footer-address { font-style: normal; }
.footer-address p { font-size: 0.875rem; }
.footer-address a:hover { color: var(--color-accent); }
.footer-bottom {
  border-top: 1px solid var(--color-border-dark);
  padding: 1.25rem 0;
  text-align: center;
}
.footer-bottom p { font-size: 0.8rem; color: var(--color-text-lighter); }

/* ===== PAGE HERO (inner pages base) ===== */
.page-hero {
  background: var(--color-white);
  padding: 5rem 0 4rem;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: transparent;
  pointer-events: none;
}
.page-hero .container { position: relative; z-index: 1; }
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}
.breadcrumb a { transition: var(--transition); color: var(--color-text-dark); }
.breadcrumb a:hover { color: var(--color-accent); }
.breadcrumb-sep { opacity: 0.4; }
.page-hero-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: var(--color-heading);
  margin-bottom: 1rem;
}
.page-hero-sub {
  font-size: 1.05rem;
  color: var(--color-text-dark);
  max-width: 600px;
}

/* ===== FLOATING ACTIONS ===== */
.floating-actions {
  position: fixed;
  bottom: 2rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}
.fab {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  text-decoration: none;
  color: var(--color-white);
}
.fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}
.fab-call {
  background: var(--color-fab-phone);
}
.fab-call:hover {
  background: var(--color-fab-phone-hover);
}
.fab-whatsapp {
  background: var(--color-fab-whatsapp);
}
.fab-whatsapp:hover {
  background: var(--color-fab-whatsapp-hover);
}

.scroll-top-btn {
  position: fixed;
  bottom: var(--fab-stack-offset);
  right: 1.5rem;
  z-index: 10000;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-white);
  border: 1.5px solid var(--color-black);
  color: var(--color-black);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.scroll-top-btn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.scroll-top-btn:hover {
  background: var(--color-accent);
  color: var(--color-white);
  border-color: var(--color-accent);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .dropdown-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-inner { grid-template-columns: 1fr; gap: 2rem; }
  .footer-links { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .main-nav {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--color-white);
    z-index: 999;
    padding: 4rem 1.5rem 2rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    flex: unset;
    min-width: unset;
    justify-content: flex-start;
    align-items: center;
    min-height: 100dvh;
    box-sizing: border-box;
  }
  .main-nav.open {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
  }
  .nav-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 2;
    width: 2.75rem;
    height: 2.75rem;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--color-text-dark);
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: 50%;
    transition: var(--transition);
    -webkit-appearance: none;
    appearance: none;
  }
  .main-nav.open .nav-close {
    display: flex;
  }
  .nav-close:hover,
  .nav-close:focus-visible {
    color: var(--color-accent);
    background: var(--color-red-soft);
    outline: none;
  }
  .main-nav .nav-list {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    width: auto;
    max-width: 100%;
    flex-shrink: 0;
    margin-block: auto;
  }
  .main-nav .nav-list > li {
    margin: 0;
    padding: 0;
    width: auto;
    text-align: center;
  }
  .nav-link,
  .nav-dropdown-toggle {
    width: auto;
    min-width: 10rem;
    padding: 0.85rem 1rem;
    font-size: 1.1rem;
    border-bottom: none;
    min-height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    text-align: center;
  }
  .nav-dropdown {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    width: auto;
    max-width: min(100%, 22rem);
  }
  .nav-dropdown .dropdown-menu {
    position: static;
    transform: none;
    width: 100%;
    max-width: none;
    box-shadow: none;
    border: none;
    background: var(--color-red-soft);
    display: block;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: max-height 0.25s ease, padding 0.25s ease, opacity 0.2s ease;
  }
  .nav-dropdown.open .dropdown-menu {
    max-height: min(70vh, 520px);
    overflow-y: auto;
    padding: 0.75rem;
    margin-top: 0.35rem;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  .dropdown-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-links { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .footer-links { grid-template-columns: 1fr; }
  .dropdown-grid { grid-template-columns: 1fr; }
}

/* Desktop: full-bleed Services mega-menu (wide + tall), Anthropic-style panel */
@media (min-width: 769px) {
  .nav-dropdown .dropdown-menu {
    position: fixed;
    left: 0.75rem;
    right: 0.75rem;
    top: 70px;
    margin-top: 0.35rem;
    transform: none;
    width: auto;
    max-width: none;
    min-height: min(32rem, calc(100vh - 6rem));
    max-height: calc(100vh - 5.25rem);
    overflow-y: auto;
    padding: 2.5rem clamp(1.5rem, 4vw, 3rem);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 28px 60px rgba(0, 0, 0, 0.12);
  }
  .nav-dropdown .dropdown-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.55rem 1.75rem;
    min-height: 20rem;
    align-content: start;
  }
  .nav-dropdown .dropdown-item {
    font-size: 0.94rem;
    padding: 0.65rem 0.9rem;
    min-height: 2.85rem;
  }
  .nav-dropdown .dropdown-item-icon {
    width: 1.35rem;
    font-size: 1.05rem;
  }
}
