/*
Theme Name: Compass Shipping Agency
Theme URI: https://compassagency.cl
Description: Official theme for Compass Shipping Agency - Maritime services in Southern Chile
Author: Compass Agency
Version: 3.0.2
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: compass-agency
*/

/* ============================================================
   VARIABLES
   ============================================================ */
:root {
  --navy:       #1B2A4A;
  --navy-dark:  #111D35;
  --blue:       #2E6DA4;
  --blue-light: #4A8EC4;
  --gray-dark:  #2C3445;
  --gray-mid:   #6B7D95;
  --gray-light: #B0BDD0;
  --gray-bg:    #F4F6F9;
  --border:     rgba(0,0,0,0.09);
  --white:      #FFFFFF;
  --shadow-sm:  0 2px 12px rgba(0,0,0,0.08);
  --transition: 0.25s ease;
  --font:       'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--gray-dark);
  background: var(--white);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img  { max-width: 100%; height: auto; display: block; }
a    { color: var(--blue); text-decoration: none; transition: color var(--transition); }
ul   { list-style: none; }

/* ============================================================
   LANGUAGE TOGGLE
   ============================================================ */
.lang-es { display: none; }
body.es .lang-en { display: none; }
body.es .lang-es { display: revert; }

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 2rem;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 96px;
}

.navbar__brand img {
  height: 78px;
  width: auto;
  object-fit: contain;
  display: block;
}

.navbar__nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.navbar__nav a {
  color: var(--navy);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
  transition: border-color var(--transition);
  white-space: nowrap;
}

.navbar__nav a:hover,
.navbar__nav a.active {
  border-bottom-color: var(--navy);
  color: var(--navy);
}

.lang-switch {
  display: flex;
  align-items: center;
  border: 1px solid var(--gray-light);
  border-radius: 3px;
  overflow: hidden;
  margin-left: .5rem;
}

.lang-switch button {
  background: none;
  border: none;
  color: var(--gray-mid);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  padding: .3rem .65rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  font-family: var(--font);
}

.lang-switch button.active {
  background: var(--navy);
  color: var(--white);
}

/* En desktop el lang-switch va dentro del nav, actions solo agrupa toggle */
.navbar__actions {
  display: flex;
  align-items: center;
  gap: .6rem;
}

/* En desktop el toggle sigue oculto */
.navbar__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: .5rem;
}

.navbar__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* ============================================================
   HERO — full-viewport, overlay navy, contenido centrado
   ============================================================ */
.hero {
  min-height: calc(100vh - 96px);
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

/* Overlay oscuro diagonal */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(8, 18, 38, 0.93) 0%,
    rgba(27, 42, 74, 0.82) 55%,
    rgba(27, 42, 74, 0.55) 100%
  );
  z-index: 1;
}

/* Patrón de rombos — textura sutil */
.hero__pattern {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(45deg,  rgba(255,255,255,0.022) 0px, rgba(255,255,255,0.022) 1px, transparent 1px, transparent 30px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,0.022) 0px, rgba(255,255,255,0.022) 1px, transparent 1px, transparent 30px);
  background-size: 30px 30px;
}

/* Contenido centrado */
.hero__content {
  position: relative;
  z-index: 5;
  width: 100%;
  max-width: 820px;
  padding: 5rem 2rem 4rem;
  text-align: center;
  margin: 0 auto;
  color: var(--white);
  background: transparent;
  clip-path: none;
}

.hero__tag {
  display: inline-block;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.58);
  border: 1px solid rgba(255,255,255,0.22);
  padding: .35rem 1rem;
  border-radius: 50px;
  margin-bottom: 1.8rem;
}

.hero__title {
  font-size: clamp(3.5rem, 12vw, 8rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--white);
  text-transform: uppercase;
  margin-bottom: .3rem;
}

.hero__title span {
  display: block;
  font-size: clamp(.85rem, 2.2vw, 1.3rem);
  font-weight: 500;
  letter-spacing: .35em;
  color: rgba(255,255,255,0.72);
  margin-top: .75rem;
  text-transform: uppercase;
}

.hero__desc {
  font-size: clamp(.88rem, 1.4vw, 1rem);
  color: rgba(255,255,255,0.68);
  max-width: 520px;
  margin: 1.6rem auto 2.5rem;
  line-height: 1.78;
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.35);
  color: var(--white);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .95rem 2rem;
  border-radius: 4px;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.hero__cta:hover {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.6);
  transform: translateY(-2px);
}

.hero__cta svg { flex-shrink: 0; }

/* Chevron scroll */
.hero__scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  color: rgba(255,255,255,0.38);
  text-decoration: none;
  animation: chevronBounce 2s ease-in-out infinite;
  transition: color var(--transition);
}

.hero__scroll:hover { color: rgba(255,255,255,0.75); }

.hero__scroll svg {
  width: 26px;
  height: 26px;
  display: block;
  margin-top: -8px;
}

.hero__scroll svg:first-child { opacity: 0.45; }

@keyframes chevronBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(6px); }
}

/* ============================================================
   TAGLINE — At Your Service
   ============================================================ */
.tagline {
  padding: 3rem 0;
  background: var(--white);
}

.tagline__card {
  background-color: var(--navy-dark);
  background-image:
    radial-gradient(ellipse 90% 140% at 50% -10%, rgba(44,90,160,0.38) 0%, transparent 65%),
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 28px,
      rgba(255,255,255,0.018) 28px,
      rgba(255,255,255,0.018) 29px
    );
  border-radius: 16px;
  padding: 4.5rem 3rem;
  text-align: center;
}

.tagline__title {
  font-size: clamp(1rem, 2vw, 1.35rem);
  font-weight: 700;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: .08em;
  line-height: 1.3;
  margin-bottom: 1rem;
}

.tagline__title .accent {
  color: #7CB9E8;
}

.tagline__rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  margin-bottom: 1rem;
}

.tagline__rule::before,
.tagline__rule::after {
  content: '';
  display: block;
  width: 28px;
  height: 1px;
  background: #7CB9E8;
  opacity: 0.6;
}

.tagline__text {
  font-size: .83rem;
  color: rgba(255,255,255,0.50);
  line-height: 1.7;
  max-width: 460px;
  margin: 0 auto;
}

/* ============================================================
   SERVICES
   ============================================================ */
.services {
  padding-block: 5rem;
  background-color: #F8FAFC;
  background-image:
    radial-gradient(circle, rgba(27,42,74,0.028) 1px, transparent 1px);
  background-size: 28px 28px;
  position: relative;
  overflow: hidden;
}

/* Rosa náutica de fondo — marca de agua */
.services::before {
  content: '';
  position: absolute;
  right: -80px;
  top: 50%;
  transform: translateY(-50%);
  width: 520px;
  height: 520px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200' fill='none' stroke='%231B2A4A' stroke-width='0.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='100' cy='100' r='90' opacity='0.3'/%3E%3Ccircle cx='100' cy='100' r='60' opacity='0.2'/%3E%3Ccircle cx='100' cy='100' r='6' fill='%231B2A4A' opacity='0.25'/%3E%3Cpolygon points='100,10 106,70 94,70' fill='%231B2A4A' opacity='0.3'/%3E%3Cpolygon points='100,190 106,130 94,130' opacity='0.15'/%3E%3Cpolygon points='10,100 70,94 70,106' opacity='0.15'/%3E%3Cpolygon points='190,100 130,94 130,106' opacity='0.15'/%3E%3Cpolygon points='126,26 118,82 110,72' fill='%231B2A4A' opacity='0.18'/%3E%3Cpolygon points='74,174 82,118 90,128' opacity='0.10'/%3E%3Cpolygon points='26,74 82,82 72,90' opacity='0.10'/%3E%3Cpolygon points='174,126 118,118 128,110' opacity='0.10'/%3E%3Cline x1='100' y1='10' x2='100' y2='190' opacity='0.12'/%3E%3Cline x1='10' y1='100' x2='190' y2='100' opacity='0.12'/%3E%3Cline x1='36' y1='36' x2='164' y2='164' opacity='0.08'/%3E%3Cline x1='164' y1='36' x2='36' y2='164' opacity='0.08'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.22;
  pointer-events: none;
}

.services__header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.services__title {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .7rem;
}

.services__divider {
  width: 56px;
  height: 3px;
  background: var(--navy);
  border: none;
  margin: 0 auto;
}

.services__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}

.service-card {
  padding: 2.5rem 2rem;
  background: var(--white);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--transition);
}

.service-card:hover {
  box-shadow: 0 6px 24px rgba(27,42,74,0.12);
  position: relative;
  z-index: 1;
}

.service-card__icon {
  width: 80px;
  height: 80px;
  margin-bottom: 1.25rem;
  color: var(--navy);
}

.service-card__icon svg {
  width: 100%;
  height: 100%;
}

.service-card__name {
  font-size: .82rem;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: .5rem;
}

.service-card__line {
  width: 30px;
  height: 2px;
  background: var(--blue);
  margin-bottom: .9rem;
}

.service-card p {
  font-size: .88rem;
  color: var(--gray-mid);
  line-height: 1.65;
}

/* ============================================================
   ABOUT THE AREA
   ============================================================ */
.area {
  padding-block: 5rem;
  background: var(--white);
}

.area__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
}

.area__text h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 800;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-bottom: .75rem;
}

.area__accent {
  width: 44px;
  height: 3px;
  background: var(--navy);
  margin-bottom: 1.5rem;
}

.area__text p {
  font-size: .97rem;
  color: var(--gray-mid);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.area__image {
  overflow: hidden;
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue-light) 100%);
}

.area__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact {
  padding: 5rem 0;
  background-color: #F8FAFC;
  background-image:
    radial-gradient(circle, rgba(27,42,74,0.028) 1px, transparent 1px);
  background-size: 28px 28px;
}

.contact__inner {
  display: grid;
  grid-template-columns: 1fr 1.9fr;
  gap: 4.5rem;
  align-items: start;
  margin-top: 3rem;
}

.contact__intro {
  font-size: .95rem;
  color: var(--gray-text);
  line-height: 1.75;
  margin-bottom: 2rem;
}

.contact__details {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact__details li {
  display: flex;
  align-items: center;
  gap: .7rem;
  font-size: .9rem;
  color: var(--navy);
}

.contact__details svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  color: var(--blue);
}

.contact__details a {
  color: var(--navy);
  transition: color var(--transition);
}
.contact__details a:hover { color: var(--blue); }

/* Form */
.contact__form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.form__field {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.form__field label {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--navy);
}

.form__req { color: var(--blue); margin-left: 2px; }

.form__field input,
.form__field textarea {
  width: 100%;
  padding: .7rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: .9rem;
  color: var(--navy);
  background: #fafbfc;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  resize: vertical;
}

.form__field input:focus,
.form__field textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(30,90,150,.10);
  background: var(--white);
}

.form__field textarea { min-height: 130px; }

.form__actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.form__btn {
  background: var(--navy);
  color: var(--white);
  border: none;
  padding: .82rem 2.4rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.form__btn:hover   { background: var(--blue); }
.form__btn:active  { transform: scale(.98); }
.form__btn:disabled { opacity: .6; cursor: not-allowed; }

.form__status { font-size: .875rem; line-height: 1.5; }
.form__status--ok  { color: #1a7a4a; }
.form__status--err { color: #c0392b; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--navy-dark);
  color: rgba(255,255,255,0.55);
  padding-top: 4.5rem;
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

/* Wordmark (replaces logo image in footer) */
.footer__wordmark {
  display: inline-block;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--white);
  line-height: 1.15;
  margin-bottom: 1.1rem;
}
.footer__wordmark span {
  display: block;
  font-size: .65rem;
  font-weight: 500;
  letter-spacing: .18em;
  color: rgba(255,255,255,0.45);
  margin-top: 3px;
}

.footer__tagline {
  font-size: .88rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.45);
  max-width: 260px;
}

/* Column headings */
.footer__heading {
  color: var(--white);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .10em;
  margin-bottom: 1.1rem;
}

/* Nav & service lists */
.footer__col ul {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.footer__col ul li,
.footer__col ul a {
  font-size: .88rem;
  color: rgba(255,255,255,0.50);
  transition: color var(--transition);
  text-decoration: none;
}

.footer__col ul a:hover { color: var(--white); }

/* Contact list with icons */
.footer__contact-list { gap: .85rem !important; }

.footer__contact-list li {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
}

.footer__contact-list svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  margin-top: 3px;
  color: var(--blue-light);
}

.footer__contact-list a {
  color: rgba(255,255,255,0.50) !important;
}

.footer__contact-list a:hover { color: var(--white) !important; }

/* Bottom bar */
.footer__bottom {
  padding-block: 1.25rem;
  border-top: none;
}

.footer__bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer__bottom p {
  font-size: .8rem;
  color: rgba(255,255,255,0.28);
}

.footer__bottom-location {
  display: flex;
  align-items: center;
  gap: .4rem;
}

.footer__bottom-location svg {
  color: rgba(255,255,255,0.28);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
/* En desktop: lang-switch está en navbar__actions (fuera del nav) */
@media (min-width: 641px) {
  .navbar__actions .lang-switch { display: flex; }
  .navbar__nav .lang-switch    { display: none; }
  .tagline { display: none; }
}

@media (max-width: 1100px) {
  .navbar__nav { gap: 1.25rem; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .hero { min-height: calc(100svh - 80px); }
  .services__grid { grid-template-columns: repeat(2, 1fr); }
  .area__inner { grid-template-columns: 1fr; gap: 2rem; }
  .area { padding-bottom: 0; }
  .area__image {
    aspect-ratio: unset;
    height: 72vw;
    margin-inline: -2rem;
    border-radius: 0;
    position: relative;
  }
  .area__image::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 55%;
    background: linear-gradient(to bottom, transparent, var(--navy-dark));
    pointer-events: none;
  }
  .contact__inner { grid-template-columns: 1fr; gap: 2.5rem; }
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}

@media (max-width: 768px) {
  .form__row { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {

  /* Navbar */
  .navbar__inner { height: 80px; }

  /* Logo más pequeño en mobile para que entre sin recorte */
  .navbar__brand img { height: 62px; }

  /* Acciones siempre visibles: EN/ES + hamburguesa */
  .navbar__actions {
    display: flex;
    align-items: center;
    gap: .6rem;
  }

  .navbar__toggle { display: flex; }

  /* Menú colapsable */
  .navbar__nav { display: none; }
  .navbar__nav.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 80px 0 0;
    background: var(--white);
    padding: 2rem;
    gap: 1.5rem;
    z-index: 999;
    border-top: 1px solid var(--border);
    overflow-y: auto;
  }
  .navbar__nav.open a { font-size: 1rem; }

  /* Hero mobile */
  .hero { min-height: calc(100svh - 80px); align-items: flex-end; background-position: 62% center; }
  .hero__content { padding: 3rem 1.5rem 5rem; }
  .hero__title { letter-spacing: -.01em; }
  .hero__scroll { display: flex; }
  .hero__cta { display: none; }

  /* Tagline: franja 100% en mobile */
  .tagline { padding: 0; }
  .tagline__card {
    border-radius: 0;
    padding: 2.8rem 1.5rem;
    margin-inline: -2rem;
  }

  /* Servicios: quitar compass rose de fondo en mobile */
  .services::before { display: none; }
  .services__grid { grid-template-columns: 1fr; }

  /* Footer: ocultar columna de servicios */
  .footer__col--services { display: none; }
  .footer__grid { grid-template-columns: 1fr; }
  .footer__bottom-inner { flex-direction: column; text-align: center; gap: .5rem; }
}
