:root {
  --bg: #f7f8fb;
  --bg-soft: #ffffff;
  --panel: #ffffff;
  --text: #111319;
  --muted: #626978;
  --line: rgba(17, 19, 25, 0.12);
  --gold: #d8b45e;
  --red: #b71928;
  --navy: #151b2a;
  --white: #ffffff;
  --shadow: 0 24px 70px rgba(21, 27, 42, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

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

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

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(20px, 5vw, 72px);
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
}

.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(132px, 14vw, 190px);
  min-height: 64px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 14px 34px rgba(21, 27, 42, 0.12);
}

.brand-logo img {
  width: 100%;
  height: auto;
  max-height: 58px;
  object-fit: contain;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 34px);
  color: rgba(17, 19, 25, 0.76);
  font-size: 0.9rem;
  font-weight: 700;
}

.main-nav a:hover {
  color: var(--red);
}

.hero {
  position: relative;
  min-height: 92vh;
  display: grid;
  align-items: end;
  overflow: hidden;
  padding: 150px clamp(20px, 6vw, 88px) 82px;
}

.carousel,
.carousel-slide,
.hero-overlay {
  position: absolute;
  inset: 0;
}

.carousel-slide {
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transform: scale(1.04);
  transition:
    opacity 800ms ease,
    transform 1400ms ease;
}

.carousel-slide.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.carousel-slide img,
.carousel-slide video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-slide video {
  display: block;
}

.hero-overlay {
  background:
    linear-gradient(90deg, rgba(247, 248, 251, 0.95), rgba(247, 248, 251, 0.72) 48%, rgba(247, 248, 251, 0.24)),
    linear-gradient(0deg, rgba(247, 248, 251, 0.9), transparent 56%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(780px, 100%);
  max-width: 100%;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--red);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
  overflow-wrap: break-word;
}

h1 {
  margin-bottom: 22px;
  font-size: clamp(3.2rem, 7vw, 7rem);
  line-height: 0.92;
  letter-spacing: 0;
  max-width: 920px;
}

h2 {
  margin-bottom: 24px;
  font-size: clamp(2rem, 4.8vw, 4.4rem);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 12px;
  font-size: 1.2rem;
  line-height: 1.2;
}

.hero-content p:not(.eyebrow) {
  max-width: 680px;
  color: rgba(17, 19, 25, 0.72);
  font-size: clamp(1rem, 1.6vw, 1.25rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 13px 20px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 850;
}

.button-primary {
  background: var(--red);
  color: var(--white);
}

.button-secondary {
  border-color: rgba(17, 19, 25, 0.2);
  color: var(--text);
  background: rgba(255, 255, 255, 0.62);
}

.carousel-controls {
  position: absolute;
  right: clamp(20px, 5vw, 72px);
  bottom: 48px;
  z-index: 3;
  display: flex;
  gap: 10px;
}

.carousel-button {
  width: 46px;
  height: 46px;
  border: 1px solid rgba(17, 19, 25, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  cursor: pointer;
  font-size: 1.9rem;
  line-height: 1;
}

.section {
  padding: clamp(76px, 10vw, 132px) clamp(20px, 6vw, 88px);
}

.agency-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 520px);
  gap: clamp(34px, 6vw, 86px);
  align-items: center;
  background: var(--bg-soft);
}

.section-copy p:not(.eyebrow),
.location-copy p {
  color: var(--muted);
  font-size: 1.04rem;
}

.founder-photo {
  margin: 0;
  overflow: hidden;
  background: var(--panel);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.founder-photo img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: center top;
}

.founder-photo figcaption {
  padding: 16px 18px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
}

.services-section {
  background: #f1f3f7;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 42px;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.service-card {
  min-height: 340px;
  padding: 28px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
}

.service-number {
  display: block;
  margin-bottom: 90px;
  color: var(--red);
  font-weight: 900;
}

.service-card p,
.team-card p {
  color: var(--muted);
}

.team-section {
  background: var(--white);
  color: #111;
}

.team-section .eyebrow {
  color: var(--red);
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.team-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(21, 27, 42, 0.1);
}

.team-card img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.team-card div {
  padding: 22px;
}

.team-card h3 {
  color: #111;
}

.location-section {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1.3fr);
  gap: clamp(28px, 5vw, 70px);
  align-items: stretch;
  background: #f1f3f7;
}

.location-copy {
  align-self: center;
}

.map-frame {
  min-height: 430px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.map-frame iframe {
  width: 100%;
  height: 100%;
  min-height: 430px;
  border: 0;
  filter: grayscale(0.18) contrast(1.04);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px clamp(20px, 6vw, 88px);
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: var(--white);
}

.site-footer p {
  margin: 0;
}

.edit-toolbar {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
  width: min(760px, calc(100vw - 36px));
  max-width: calc(100vw - 36px);
  padding: 12px;
  border: 1px solid rgba(17, 19, 25, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 60px rgba(21, 27, 42, 0.18);
  color: var(--text);
  backdrop-filter: blur(16px);
}

.edit-toolbar-main,
.text-style-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.edit-toolbar-main {
  width: 100%;
}

.text-style-panel {
  width: 100%;
  padding-top: 10px;
  border-top: 1px solid rgba(17, 19, 25, 0.1);
}

.text-style-panel::before {
  content: "Texto seleccionado";
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.text-style-panel label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.text-style-panel input[type="number"] {
  width: 72px;
  min-height: 38px;
  border: 1px solid rgba(17, 19, 25, 0.16);
  border-radius: 6px;
  padding: 6px 8px;
  color: var(--text);
  font: inherit;
  font-weight: 800;
}

.text-style-panel input[type="color"] {
  width: 44px;
  height: 38px;
  border: 1px solid rgba(17, 19, 25, 0.16);
  border-radius: 6px;
  background: var(--white);
  cursor: pointer;
}

.edit-toolbar strong {
  color: var(--red);
}

.edit-toolbar span {
  color: var(--muted);
  font-size: 0.9rem;
}

.edit-toolbar button {
  min-height: 38px;
  border: 1px solid rgba(17, 19, 25, 0.16);
  border-radius: 6px;
  background: var(--white);
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
  padding: 8px 12px;
}

.edit-toolbar [data-save-edits] {
  border-color: var(--red);
  background: var(--red);
  color: var(--white);
}

.editable-text,
.editable-image {
  outline: 2px dashed rgba(183, 25, 40, 0.42);
  outline-offset: 5px;
  transition:
    outline-color 180ms ease,
    box-shadow 180ms ease;
}

.editable-text:hover,
.editable-text:focus,
.editable-image:hover {
  outline-color: var(--red);
  box-shadow: 0 0 0 8px rgba(183, 25, 40, 0.08);
}

.editable-text:focus {
  border-radius: 4px;
}

.editable-text.is-editing {
  outline-color: var(--red);
  box-shadow: 0 0 0 8px rgba(183, 25, 40, 0.12);
}

.editable-image {
  cursor: pointer;
}

.edit-mode .button {
  cursor: text;
}

.edit-mode .hero-overlay {
  pointer-events: none;
}

.edit-mode .carousel-slide.is-active {
  outline: 2px dashed rgba(183, 25, 40, 0.42);
  outline-offset: -14px;
}

.edit-mode .editable-image::selection,
.edit-mode .editable-text::selection {
  background: rgba(183, 25, 40, 0.18);
}

.edits-saved .edit-toolbar::after {
  content: "Guardado";
  position: absolute;
  right: 12px;
  top: -40px;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--navy);
  color: var(--white);
  font-weight: 800;
}

.edit-mode {
  padding-bottom: 92px;
}

@media (max-width: 980px) {
  .site-header {
    position: fixed;
    align-items: center;
    padding: 12px 18px;
  }

  .main-nav {
    display: none;
  }

  .agency-section,
  .location-section {
    grid-template-columns: 1fr;
  }

  .services-grid,
  .team-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section {
    padding: 82px clamp(18px, 5vw, 42px);
  }

  .service-number {
    margin-bottom: 44px;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }

  .site-header {
    min-height: 76px;
    justify-content: center;
    padding: 10px 14px;
  }

  .edit-toolbar {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    max-height: 38vh;
    overflow: auto;
    padding: 10px;
  }

  .edit-toolbar button {
    flex: 1;
    min-width: 118px;
  }

  .text-style-panel label,
  .text-style-panel input[type="number"] {
    flex: 1;
  }

  .brand-logo {
    width: 124px;
    min-height: 54px;
    padding: 7px 10px;
  }

  .hero {
    min-height: 100svh;
    align-items: center;
    padding: 116px 18px 112px;
  }

  h1 {
    font-size: clamp(2.35rem, 13vw, 3.85rem);
    line-height: 1;
  }

  h2 {
    font-size: clamp(2rem, 11vw, 3.2rem);
    line-height: 1.04;
  }

  .hero-content p:not(.eyebrow) {
    font-size: 1rem;
  }

  .hero-actions,
  .site-footer {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .carousel-controls {
    right: auto;
    left: 18px;
    bottom: 58px;
  }

  .services-grid,
  .team-grid {
    grid-template-columns: 1fr;
  }

  .service-card {
    min-height: 0;
    padding: 24px;
  }

  .service-number {
    margin-bottom: 34px;
  }

  .section {
    padding: 68px 18px;
  }

  .founder-photo img {
    aspect-ratio: 4 / 3;
  }

  .map-frame,
  .map-frame iframe {
    min-height: 330px;
  }

  .editable-text,
  .editable-image {
    outline-offset: 3px;
  }

  .edit-mode .carousel-slide.is-active {
    outline-offset: -8px;
  }
}
