/* ============================================================
   ESCRIBANÍA ALVARIÑAS CANTÓN – Stylesheet
   Mobile-first · Playfair Display + Lato
   ============================================================ */

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:        #1C3268;
  --navy-dark:   #0F1F4A;
  --navy-mid:    #2A4A8C;
  --navy-light:  #4A6BAD;
  --steel:       #8EA8CC;
  --cream:       #F7F6F3;
  --off-white:   #EEF1F8;
  --text-dark:   #1A1A2E;
  --text-mid:    #4A4A6A;
  --text-light:  #7A7A9A;
  --white:       #FFFFFF;
  --gold:        #B8965A;
  --gold-light:  #D4B07A;
  --border:      #D8E0EC;
  --nav-h:       64px;
  --radius:      8px;
  --trans:       0.3s ease;
  --section-pad: 4rem 1.25rem;
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Lato', sans-serif;
  color: var(--text-dark);
  background: var(--white);
  line-height: 1.65;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a   { color: inherit; text-decoration: none; }
h1,h2,h3,h4 { font-family: 'Playfair Display', serif; line-height: 1.2; }

/* ===== UTILITY ===== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: var(--navy);
  text-align: center;
  margin-bottom: 0.6rem;
}

.section-divider {
  width: 56px;
  height: 3px;
  background: var(--gold);
  margin: 0.6rem auto 1.25rem;
  border-radius: 2px;
}

.section-subtitle {
  font-size: 1rem;
  color: var(--text-mid);
  text-align: center;
  max-width: 620px;
  margin: 0 auto 2.75rem;
  line-height: 1.7;
}

/* ===== SCROLL REVEAL ===== */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== NAVBAR ===== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--nav-h);
  background: rgba(15, 31, 74, 0.96);
  backdrop-filter: blur(10px);
  transition: background var(--trans), box-shadow var(--trans);
}
.navbar.scrolled {
  background: var(--navy-dark);
  box-shadow: 0 2px 24px rgba(0,0,0,0.35);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Brand */
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--white);
  flex-shrink: 0;
}
.nav-brand-badge {
  height: 40px;
  width: auto;
  flex-shrink: 0;
  display: block;
}
.nav-brand-text { display: flex; flex-direction: column; line-height: 1; }
.nav-brand-text .t1 {
  font-family: 'Playfair Display', serif;
  font-size: 0.9rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.nav-brand-text .t2 {
  font-size: 0.62rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  opacity: 0.7; margin-top: 2px;
}

/* Desktop links */
.nav-links {
  display: none;
  list-style: none;
  gap: 0.1rem;
  align-items: center;
}
.nav-links a {
  color: rgba(255,255,255,0.82);
  font-size: 0.75rem;
  letter-spacing: 0.09em; text-transform: uppercase;
  padding: 0.4rem 0.65rem;
  border-radius: 4px;
  transition: color var(--trans), background var(--trans);
}
.nav-links a:hover { color: var(--white); background: rgba(255,255,255,0.1); }

.nav-lang-btn {
  color: var(--white);
  font-size: 0.72rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  border: 1px solid rgba(255,255,255,0.38);
  padding: 0.28rem 0.7rem;
  border-radius: 4px;
  margin-left: 0.4rem;
  transition: all var(--trans);
}
.nav-lang-btn:hover { background: rgba(255,255,255,0.14); border-color: var(--white); }

/* Hamburger */
.nav-toggle {
  display: flex; flex-direction: column; gap: 5px;
  cursor: pointer; padding: 0.5rem;
  background: none; border: none;
}
.nav-toggle span {
  display: block; width: 24px; height: 2px;
  background: var(--white); border-radius: 2px;
  transition: transform var(--trans), opacity var(--trans);
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile drawer */
.nav-drawer {
  position: fixed;
  top: var(--nav-h); left: 0; right: 0;
  background: var(--navy-dark);
  padding: 1rem 1.5rem 1.75rem;
  z-index: 999;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: none;
}
.nav-drawer.open { display: block; }
.nav-drawer ul { list-style: none; }
.nav-drawer a {
  display: block;
  color: rgba(255,255,255,0.82);
  font-size: 0.88rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.8rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  transition: color var(--trans);
}
.nav-drawer a:hover { color: var(--white); }
.nav-drawer .drawer-lang {
  display: inline-block;
  margin-top: 1.25rem;
  border: 1px solid rgba(255,255,255,0.38);
  padding: 0.45rem 1.1rem;
  border-radius: 4px;
  color: var(--white);
  font-size: 0.78rem;
  letter-spacing: 0.1em; text-transform: uppercase;
}

/* ===== HERO / CAROUSEL ===== */
.hero {
  width: 100%;
  /* Mobile y Desktop: el hero ocupa la pantalla completa */
  height: calc(100vh - var(--nav-h));
  min-height: 420px;
  position: relative;
  overflow: hidden;
  margin-top: var(--nav-h);
  background: var(--navy-dark);
}

.carousel-slide {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.carousel-slide.active { opacity: 1; }
.carousel-slide img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.carousel-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(15,31,74,0.18) 0%,
    rgba(15,31,74,0.08) 40%,
    rgba(15,31,74,0.32) 100%
  );
  z-index: 2;
}

.carousel-logo-wrap {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  width: 72%;          /* mobile: más generoso */
  max-width: 520px;    /* desktop: antes 300px, ahora mucho más visible */
  filter: drop-shadow(0 6px 24px rgba(0,0,0,0.45));
}
.carousel-logo-wrap img { width: 100%; }

/* ===== NOSOTROS ===== */
#nosotros, #about {
  padding: var(--section-pad);
  background: var(--white);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 3rem;
}
.stat-card {
  background: var(--off-white);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  text-align: center;
  border-bottom: 3px solid var(--navy);
  transition: transform var(--trans), box-shadow var(--trans);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(28,50,104,0.1); }
.stat-number {
  font-family: 'Playfair Display', serif;
  font-size: 2.25rem; font-weight: 700;
  color: var(--navy); line-height: 1;
  margin-bottom: 0.35rem;
}
.stat-label {
  font-size: 0.76rem; color: var(--text-mid);
  text-transform: uppercase; letter-spacing: 0.07em;
}

.about-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.about-text p {
  color: var(--text-mid);
  margin-bottom: 1rem;
  font-size: 0.96rem;
  line-height: 1.78;
  text-align: justify;
}

.values-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.value-card {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  background: var(--off-white);
  border-radius: var(--radius);
  border-left: 3px solid var(--gold);
}
.value-icon { font-size: 1.15rem; flex-shrink: 0; margin-top: 0.1rem; }
.value-card h4 { font-size: 0.88rem; color: var(--navy); margin-bottom: 0.2rem; font-family: 'Lato', sans-serif; font-weight: 700; }
.value-card p  { font-size: 0.82rem; color: var(--text-mid); line-height: 1.55; text-align: justify; }

/* ===== SERVICIOS ===== */
#servicios, #services {
  padding: var(--section-pad);
  background: var(--cream);
}

.accordion {
  display: flex; flex-direction: column; gap: 0.5rem;
  max-width: 860px; margin: 0 auto;
}
.services-note {
  max-width: 860px;
  margin: 1.5rem auto 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--steel);
}
.acc-item {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: box-shadow var(--trans);
}
.acc-item:hover { box-shadow: 0 4px 18px rgba(28,50,104,0.09); }

.acc-trigger {
  width: 100%; background: none; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.25rem;
  text-align: left;
  color: var(--navy);
  font-family: 'Lato', sans-serif;
  font-size: 0.93rem; font-weight: 700; letter-spacing: 0.02em;
  transition: background var(--trans);
}
.acc-trigger:hover { background: var(--off-white); }
.acc-trigger.active { background: var(--navy); color: var(--white); }

.acc-icon {
  font-size: 1.2rem; flex-shrink: 0; margin-left: 1rem;
  transition: transform 0.35s ease;
  line-height: 1;
}
.acc-trigger.active .acc-icon { transform: rotate(45deg); }

.acc-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s ease;
  padding: 0 1.25rem;
  border-top: 0px solid var(--border);
}
.acc-body.open {
  max-height: 700px;
  padding: 1.25rem;
  border-top: 1px solid var(--border);
}

.acc-body p { font-size: 0.87rem; color: var(--text-mid); margin-bottom: 0.9rem; line-height: 1.65; text-align: justify; }
.doc-list { list-style: none; display: flex; flex-direction: column; gap: 0.45rem; }
.doc-list li {
  display: flex; align-items: flex-start; gap: 0.65rem;
  font-size: 0.84rem; color: var(--text-mid);
}
.doc-list li::before {
  content: '→'; color: var(--navy-light);
  font-size: 0.78rem; flex-shrink: 0; margin-top: 0.18rem;
}

/* ===== EQUIPO ===== */
#equipo, #team {
  padding: var(--section-pad);
  background: var(--white);
}

.team-category { margin-bottom: 2.75rem; }
.team-cat-label {
  font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--gold); font-family: 'Lato', sans-serif; font-weight: 700;
  text-align: center; margin-bottom: 1.5rem;
}

.team-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  max-width: 700px; margin: 0 auto;
}

@media (min-width: 480px) {
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.team-card {
  background: var(--off-white);
  border-radius: var(--radius); overflow: hidden;
  transition: transform var(--trans), box-shadow var(--trans);
}
.team-card:hover { transform: translateY(-5px); box-shadow: 0 14px 32px rgba(28,50,104,0.13); }
.team-card-img {
  width: 100%; aspect-ratio: 3/4;
  object-fit: cover; object-position: center top;
}
.team-card-body { padding: 1rem; }
.team-card-name { font-size: 0.92rem; color: var(--navy); margin-bottom: 0.2rem; }
.team-card-role {
  font-size: 0.69rem; color: var(--gold);
  text-transform: uppercase; letter-spacing: 0.07em;
  font-family: 'Lato', sans-serif; font-weight: 700;
  margin-bottom: 0.55rem;
}
.team-card-bio { font-size: 0.79rem; color: var(--text-mid); line-height: 1.57; text-align: justify; }

/* ===== TESTIMONIOS ===== */
#testimonios, #testimonials {
  padding: var(--section-pad);
  background: var(--navy-dark);
}
#testimonios .section-title, #testimonials .section-title   { color: var(--white); }
#testimonios .section-divider, #testimonials .section-divider { background: var(--gold); }
#testimonios .section-subtitle, #testimonials .section-subtitle{ color: rgba(255,255,255,0.62); }

.testimonials-grid {
  display: flex; flex-direction: column; gap: 1.25rem;
}
.tcard {
  background: rgba(255,255,255,0.055);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 1.6rem 1.25rem 1.25rem;
  position: relative;
}
.tcard::before {
  content: '"';
  position: absolute; top: -0.4rem; left: 1.1rem;
  font-family: 'Playfair Display', serif;
  font-size: 4.5rem; color: var(--gold);
  line-height: 1; opacity: 0.55;
}
.tcard-stars { color: var(--gold); font-size: 0.72rem; margin-bottom: 0.6rem; letter-spacing: 2px; }
.tcard-text {
  font-size: 0.88rem; color: rgba(255,255,255,0.84);
  line-height: 1.72; font-style: italic; margin-bottom: 1.1rem;
  text-align: justify;
}
.tcard-author { display: flex; align-items: center; gap: 0.75rem; }
.tcard-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--navy-mid);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 0.9rem; font-weight: 600; color: var(--white);
  flex-shrink: 0;
}
.tcard-name  { font-size: 0.84rem; font-weight: 700; color: var(--white); }
.tcard-company{ font-size: 0.73rem; color: var(--steel); margin-top: 0.12rem; }

/* ===== CLIENTES ===== */
#clientes, #clients {
  padding: var(--section-pad);
  background: var(--white);
}
.clients-note {
  font-size: 0.8rem; color: var(--text-light);
  text-align: center; margin-bottom: 1.5rem; font-style: italic;
}
.clients-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  max-width: 900px; margin: 0 auto;
}
.client-cell {
  display: flex; align-items: center; justify-content: center;
  padding: 1.25rem 0.875rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--off-white);
  min-height: 80px;
  transition: box-shadow var(--trans), transform var(--trans);
}
.client-cell:hover { box-shadow: 0 4px 18px rgba(28,50,104,0.1); transform: translateY(-2px); }
.client-cell img {
  max-height: 48px; object-fit: contain;
  filter: grayscale(100%); opacity: 0.6;
  transition: filter var(--trans), opacity var(--trans);
}
.client-cell:hover img { filter: grayscale(0%); opacity: 1; }
/* Placeholder when no logo yet */
.client-placeholder {
  width: 80px; height: 28px;
  background: var(--border); border-radius: 4px; opacity: 0.4;
}

/* ===== CONTACTO ===== */
#contacto, #contact {
  padding: var(--section-pad);
  background: var(--cream);
}
.contact-grid {
  display: flex; flex-direction: column; gap: 2.5rem;
}
.contact-info h3 {
  font-size: 1.2rem; color: var(--navy); margin-bottom: 1.25rem;
}
.cdetail {
  display: flex; align-items: flex-start; gap: 0.8rem;
  margin-bottom: 1.1rem;
}
.cdetail-icon { font-size: 1.05rem; flex-shrink: 0; color: var(--navy-light); margin-top: 0.12rem; }
.cdetail-text { font-size: 0.88rem; color: var(--text-mid); line-height: 1.55; }
.cdetail-text strong {
  display: block; color: var(--text-dark);
  font-size: 0.73rem; text-transform: uppercase;
  letter-spacing: 0.07em; margin-bottom: 0.18rem;
}
.cdetail-text a { color: var(--navy-light); transition: color var(--trans); }
.cdetail-text a:hover { color: var(--navy); }

.map-frame {
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); height: 260px;
  margin-top: 1.5rem;
}
.map-frame iframe { width: 100%; height: 100%; border: 0; }

/* Form */
.contact-form { display: flex; flex-direction: column; gap: 1rem; }
.form-row { display: flex; flex-direction: column; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: 0.3rem; }
.form-group label {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--text-mid); font-weight: 700;
}
.form-group input,
.form-group textarea,
.form-group select {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-family: 'Lato', sans-serif; font-size: 0.9rem;
  color: var(--text-dark); background: var(--white);
  transition: border-color var(--trans), box-shadow var(--trans);
  outline: none; appearance: none;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(28,50,104,0.1);
}
.form-group textarea { resize: vertical; min-height: 130px; }

.btn-submit {
  background: var(--navy); color: var(--white);
  border: none; border-radius: var(--radius);
  padding: 0.9rem 2.25rem;
  font-family: 'Lato', sans-serif;
  font-size: 0.82rem; font-weight: 700;
  letter-spacing: 0.09em; text-transform: uppercase;
  cursor: pointer;
  transition: background var(--trans), transform var(--trans);
  align-self: flex-start;
}
.btn-submit:hover { background: var(--navy-mid); transform: translateY(-2px); }

.form-success {
  display: none;
  color: #2A7A4A; font-size: 0.86rem; margin-top: 0.25rem;
  padding: 0.65rem 1rem; background: #EAF5EE;
  border-radius: var(--radius); border: 1px solid #B8DEC7;
}

/* ===== FOOTER ===== */
.footer {
  background: var(--navy-dark);
  color: rgba(255,255,255,0.65);
  padding: 2.5rem 1.25rem;
  text-align: center;
}
.footer-brand {
  display: flex; align-items: center; justify-content: center;
  gap: 0.75rem; margin-bottom: 1.1rem;
}
.footer-badge {
  width: 34px; height: 34px; border-radius: 6px;
  background: var(--navy-mid);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 0.88rem; font-weight: 700; color: var(--white);
}
.footer-name {
  font-family: 'Playfair Display', serif;
  color: var(--white); font-size: 0.88rem; letter-spacing: 0.05em;
}
.footer-nav {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 0.5rem 1.25rem; margin-bottom: 1.5rem;
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em;
}
.footer-nav a:hover { color: var(--white); }
.footer-copy { font-size: 0.72rem; color: rgba(255,255,255,0.38); }

/* ===== WHATSAPP FLOTANTE ===== */
.whatsapp-float {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999;
  width: 56px;
  height: 56px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(37,211,102,0.45);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: wa-pulse 2.5s ease-out infinite;
}
.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(37,211,102,0.6);
  animation: none;
}
.whatsapp-float svg {
  width: 30px;
  height: 30px;
  fill: #fff;
}
@keyframes wa-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(37,211,102,0.5); }
  70%  { box-shadow: 0 0 0 14px rgba(37,211,102,0); }
  100% { box-shadow: 0 0 0 0 rgba(37,211,102,0); }
}

/* ===== DESKTOP OVERRIDES ===== */
@media (min-width: 600px) {
  .form-row { display: grid; grid-template-columns: 1fr 1fr; }
}

@media (min-width: 768px) {
  :root { --section-pad: 6rem 1.25rem; }

  .nav-links  { display: flex; }
  .nav-toggle { display: none; }

  /* Desktop: sólo ajustamos min/max para pantallas muy grandes o pequeñas */
  .hero {
    min-height: 500px;
    max-height: 900px;
  }

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

  .about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
  .values-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

  .testimonials-grid { display: grid; grid-template-columns: repeat(2, 1fr); }

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

  .contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
}

@media (min-width: 1024px) {
  .testimonials-grid { grid-template-columns: repeat(3, 1fr); }
  .clients-grid      { grid-template-columns: repeat(5, 1fr); }
}
