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

:root {
  --bg: #F0E5CF;
  --navy: #003152;
  --navy-light: rgba(0, 49, 82, 0.85);
  --text-dark: #1a1a18;
  --text-muted: #3C3C3A;
  --divider: rgba(60, 60, 58, 0.3);
  --font: 'Archivo', sans-serif;
  --footer-offset: 100px;
  --services-gap: 12px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text-dark);
  min-height: 100vh;
  padding-bottom: var(--footer-offset);
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font);
}

/* ===========================
   NAVBAR
=========================== */
.navbar {
  background-color: #003152;
  padding: 20px 60px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--divider);
}

.navbar__logo {
  display: flex;
  align-items: center;
  gap: 20px;
}

.navbar__logo img {
  display: block;
  width: 238px;
  max-width: 100%;
  height: auto;
}

.logo-badges {
  display: flex;
  gap: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2.5px solid var(--text-dark);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: var(--text-dark);
  line-height: 1;
}

.navbar__tagline {
  font-size: 31.2px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #FEFFEF;
}

/* ===========================
   MAIN LAYOUT
=========================== */
.main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  min-height: calc(100vh - 85px - var(--footer-offset));
  padding: 20px 60px;  
}

/* ===========================
   PROFILE CARD (izquierda)
=========================== */
.profile-card {
  background: linear-gradient(180deg, var(--navy) 0%, rgba(0, 49, 82, 0.85) 100%);
  color: #ffffff;
  padding: clamp(30px, 4vw, 48px) clamp(22px, 4.5vw, 52px);
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 1.8vw, 20px);
  height: fit-content;
}

.profile-card__top {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: clamp(10px, 1.8vw, 16px);
}

.profile-card__name {
  font-size: clamp(32.8px, 2.25vw + 16px, 44.8px);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: clamp(10px, 1.5vw, 16px);
  color: #ffffff;
}

.profile-card__titles {
  font-size: clamp(13.44px, 0.45vw + 11.52px, 15.68px);
  line-height: 1.7;
  color: rgba(255,255,255,0.9);
}

.profile-card__photo-wrapper {
  flex-shrink: 0;
  align-self: stretch;
  display: flex;
  aspect-ratio: 1;
  width: min(36%, 190px);
  max-width: 190px;
  margin-right: clamp(0px, 2vw, 8%);
}

.profile-card__coin-wrapper {
  flex-shrink: 0;
  align-self: center;
  width: min(36%, 190px);
  max-width: 190px;
  aspect-ratio: 1;
  
  perspective: 1000px;
}

.profile-card__coin {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  cursor: pointer;
  border-radius: 50%;
}

.profile-card__coin.flipped {
  animation: flipToBack 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.profile-card__coin:not(.flipped) {
  animation: flipToFront 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.profile-card__coin-face {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  backface-visibility: hidden;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.25);
  overflow: hidden;
}

.profile-card__coin-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.profile-card__coin-face--front {
  z-index: 2;
}

.profile-card__coin-face--back {
  transform: rotateY(180deg);
  z-index: 1;
}

.profile-card__photo-wrapper.is-fallback {
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.12);
  display: grid;
  place-items: center;
}

.profile-card__photo-wrapper.is-fallback::after {
  content: 'ER';
  font-size: 35.2px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.9);
}

.profile-card__photo {
  width: auto;
  height: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  border: 3px solid rgba(255,255,255,0.25);
  display: block;
}

.profile-card__toggle {
  display: none;
  align-self: center;
  width: 48px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
}

.profile-card__details {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.profile-card__chevron,
.service-item__chevron {
  width: 18px;
  height: 18px;
  border-right: 5px solid #f7f1da;
  border-bottom: 5px solid #f7f1da;
  transform: rotate(45deg);
  transition: transform 0.25s ease;
}

/* Placeholder cuando no hay foto */
.profile-card__photo[src="foto.jpg"] {
  background-color: rgba(255,255,255,0.1);
}

.profile-card__bio {
  font-size: clamp(13.44px, 0.42vw + 11.52px, 15.36px);
  line-height: 1.7;
  color: rgba(255,255,255,0.88);
  text-align: justify;
  text-justify: inter-word;
}

/* ===========================
   SERVICIOS (derecha)
=========================== */
.services {
  background-color: var(--bg);
  padding: clamp(30px, 4vw, 48px) clamp(22px, 4.5vw, 52px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: #1B1B1B !important;
}

.services__header {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.6vw, 14px);
  margin-bottom: clamp(16px, 2.4vw, 28px);
}

.services__carousel {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 12px;
}

.services__nav {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--navy);
  color: #FEFFEF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 19.2px;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.services__nav:hover {
  transform: scale(1.06);
}

.services__nav:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  transform: none;
}

.services__viewport {
  overflow: hidden;
}

.services__dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.services__dots:empty {
  display: none;
}

.services__dot {
  width: 10px;
  height: 10px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 49, 82, 0.26);
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.services__dot:hover {
  transform: scale(1.14);
}

.services__dot.is-active {
  background: var(--navy);
  transform: scale(1.16);
}

.services__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  grid-template-rows: repeat(4, minmax(0, auto));
  column-gap: var(--services-gap);
  row-gap: var(--services-gap);
  align-items: start;
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.services__icon {
  font-size: auto;
  font-weight: 900;
  color: var(--text-dark);
  line-height: 1;
}

.services__title {
  font-size: clamp(32px, 2vw + 16px, 41.6px);
  font-weight: 900;
  color: var(--text-dark);
  line-height: 1.1;
}

.service-item {
  background: #FEFFEF;
  border: 1px solid rgba(0, 49, 82, 0.14);
  border-radius: 18px;
  padding: clamp(12px, 1.8vw, 18px) 18px;
  box-shadow: 0 10px 24px rgba(0, 49, 82, 0.08);
  height: fit-content;
}

.service-item__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: default;
}

.service-item__title {
  font-size: clamp(15.2px, 0.4vw + 13.12px, 17.28px);
  font-weight: 700;
  color: var(--text-dark);
}

.service-item__title.otros {
  color: #1B1B1B;
}

.service-item__desc {
  font-size: clamp(12.8px, 0.3vw + 11.52px, 14.4px);
  line-height: 1.65;
  color: var(--text-muted);
  margin-top: 10px;
  text-align: justify;
  text-justify: inter-word;
}

.service-item__content {
  display: block;
}

.service-item__chevron {
  display: none;
  flex-shrink: 0;
  border-right-color: var(--navy);
  border-bottom-color: var(--navy);
}

.services__note {
  border-top: none;
  margin-top: 8px;
  
  font-size: clamp(13.44px, 0.35vw + 11.84px, 15.04px);
  line-height: 1.35;
  color: var(--text-muted);
  text-align: justify;
  text-justify: inter-word;
}

/* ===========================
   MARCAS CAROUSEL
=========================== */
.marcas-carousel {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  height: 140px;
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 60px;
  overflow: hidden;
}

.marcas-carousel__title {
  display: none;
}

.marcas-carousel__container {
  width: 100%;
  max-width: 1400px;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}

.marcas-carousel__nav {
  display: none;
}

.marcas-carousel__viewport {
  overflow: hidden;
}

.marcas-carousel__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 120px;
  gap: 20px;
  align-items: center;
  animation: marcasScroll 30s linear infinite;
  will-change: transform;
}

@keyframes marcasScroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-1540px);
  }
}

.marcas-carousel__item {
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  overflow: hidden;
}

.marcas-carousel__item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12px;
}

.marcas-carousel__dots {
  display: none;
}

.marcas-carousel__dot {
  width: 10px;
  height: 10px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 49, 82, 0.26);
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.marcas-carousel__dot:hover {
  transform: scale(1.14);
}

.marcas-carousel__dot.is-active {
  background: var(--navy);
  transform: scale(1.16);
}

/* ===========================
   FOOTER
=========================== */
.footer {
  background-color: var(--navy);
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 60px;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
}

.footer__headline {
  font-size: clamp(16px, 1vw + 10.4px, 23.2px);
  font-weight: 800;
  color: #ffffff;
  line-height: 1.1;
  margin-right: 16px;
  white-space: nowrap;
}

.footer__social {
  display: flex;
  gap: 16px;
  align-items: center;
}

.footer__social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.footer__social-link:hover {
  opacity: 0.7;
}

.footer__social-link svg {
  width: auto;
  height: 40%;
}

.footer__social-icon {
  width: 39px;
  height: 39px;
  display: block;
}

.footer__contact {
  text-align: right;
  color: #ffffff;
  font-size: 11.84px;
  line-height: 1.35;
  font-weight: 500;
}

/* ===========================
   ANIMACIONES
=========================== */
@keyframes flipToBack {
  0% {
    transform: rotateY(0deg);
  }
  50% {
    z-index: 1;
  }
  100% {
    transform: rotateY(180deg);
    z-index: 1;
  }
}

@keyframes flipToFront {
  0% {
    transform: rotateY(180deg);
    z-index: 2;
  }
  50% {
    z-index: 2;
  }
  100% {
    transform: rotateY(0deg);
  }
}

.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===========================
   RESPONSIVE
=========================== */
/* Tablet */
@media (max-width: 1024px) {
  .navbar {
    padding: 16px 32px;
  }

  .navbar__logo img {
    width: 210px;
  }

  .profile-card {
    padding: 40px 36px;
  }

  .profile-card__name {
    font-size: 37.6px;
  }

  .services {
    padding: 40px 36px;
  }

  .services__title {
    font-size: 35.2px;
  }

  .footer {
    padding: 0 32px;
  }
}

/* Mobile landscape / tablet pequeña */
@media (max-width: 900px) {
  .navbar {
    padding: 14px 24px;
  }

  .navbar__logo img {
    width: 190px;
  }

  .main {
    grid-template-columns: 1fr;
  }

  .profile-card {
    padding: 36px 24px;
  }

  .profile-card__name {
    font-size: 33.6px;
  }

  .profile-card__photo {
    max-width: 100%;
  }

  .profile-card__photo-wrapper {
    width: min(34vw, 122px);
    max-width: 122px;
    margin-right: 0;
  }

  .services {
    padding: 36px 24px;
  }

  .services__title {
    font-size: 32px;
  }

  .services__icon {
    font-size: 32px;
  }

  .footer {
    flex-direction: column;
    height: auto;
    padding: 28px 24px;
    gap: 20px;
  }

  .footer__headline {
    margin-right: 0;
  }

  .footer__contact {
    text-align: center;
  }
}

/* Mobile */
@media (max-width: 480px) {
  body {
    background: var(--bg);
  }

  p {
    font-size: 16px;
  }

  .navbar {
    padding: 20px 0 28px;
    justify-content: center;
    border-bottom: 6px solid rgba(240, 229, 207, 0.95);
  }

  .navbar__logo {
    width: 100%;
    padding: 0 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .navbar__logo img {
    width: min(280px, 86vw);
  }

  .navbar__tagline {
    font-size: 31.2px;
    letter-spacing: 0;
    text-transform: none;
  }

  .main {
    padding: 0;
  }

  .profile-card {
    padding: 22px 10px 14px;
    gap: 14px;
  }

  .profile-card__name {
    font-size: 32px;
    margin-bottom: 10px;
  }

  .profile-card__top {
    align-items: stretch;
    gap: 10px;
  }

  .profile-card__titles {
    font-size: 12.48px;
    line-height: 1.15;
  }

  .profile-card__photo {
    max-width: 100%;
    border-width: 6px;
    border-color: rgba(240, 229, 207, 0.7);
  }

  .profile-card__photo-wrapper {
    width: min(42vw, 148px);
    max-width: 148px;
    margin-right: 0;
  }

  .profile-card__photo-wrapper.is-fallback {
    border-width: 6px;
    border-color: rgba(240, 229, 207, 0.7);
  }

  .profile-card__photo-wrapper.is-fallback::after {
    font-size: 28.8px;
  }

  .profile-card__text {
    flex: 1;
  }

  .profile-card__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .js-ready .profile-card__details {
    display: flex;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    will-change: max-height, opacity;
    transition: max-height 0.38s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.24s ease;
  }

  .js-ready .profile-card.is-expanded .profile-card__details {
    opacity: 1;
  }

  .js-ready .profile-card.is-expanded .profile-card__chevron {
    transform: rotate(225deg);
  }

  .profile-card__chevron {
    transition: transform 0.35s ease;
  }

  .profile-card__bio {
    font-size: 14px;
    line-height: 1.2;
  }

  .services {
    padding: 26px 0 22px;
    gap: 10px;
  }

  .services__dots {
    margin-top: 6px;
    gap: 8px;
  }

  .services__carousel {
    display: block;
  }

  .services__nav {
    display: none;
  }

  .services__dots {
    display: none;
  }

  .services__viewport {
    overflow: visible;
  }

  .services__track {
    display: flex;
    flex-direction: column;
    transform: none !important;
    gap: 10px;
  }

  .services__header {
    gap: 18px;
    margin-bottom: 22px;
    padding: 0 8px 0 16px;
  }

  .services__title {
    font-size: 32px;
  }

  .services__icon {
    width: 84px;
    height: 84px;
  }

  .service-item {
    margin: 0;
    padding: 0;
    border-radius: 16px;
    border: 1px solid rgba(0, 49, 82, 0.12);
    box-shadow: 0 8px 18px rgba(0, 49, 82, 0.08);
    overflow: hidden;
  }

  .service-item__trigger {
    padding: 14px 12px;
    cursor: pointer;
  }

  .service-item__title {
    font-size: 15.68px;
  }

  .service-item__chevron {
    display: block;
    width: 14px;
    height: 14px;
    border-right-width: 4px;
    border-bottom-width: 4px;
    margin-right: 12px;
    transition: transform 0.35s ease;
  }

  .js-ready .service-item__content {
    display: block;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0 12px;
    will-change: max-height, opacity;
    transition: max-height 0.38s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.24s ease, padding-bottom 0.38s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .js-ready .service-item.is-open .service-item__content {
    opacity: 1;
    padding: 0 12px 14px;
  }

  .js-ready .service-item.is-open .service-item__chevron {
    transform: rotate(225deg);
  }

  .service-item__desc {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.15;
  }

  .services__note {
    margin-top: 0;
    padding: 16px 14px 0;
    font-size: 14px;
    line-height: 1.2;
  }

  .footer {
    padding: 22px 16px 26px;
    background-color: var(--bg);
    gap: 0;
  }

  .footer__headline {
    color: var(--navy);
    margin-bottom: 12px;
  }

  .footer__social {
    width: 100%;
    justify-content: space-evenly;
    gap: 12px;
  }

  .footer__social-icon {
    width: 72px;
    height: 72px;
  }

  .footer__contact {
    display: none;
  }
}

/* Mobile marcas carousel */
@media (max-width: 480px) {
  .marcas-carousel {
    padding: 0 16px;
    height: 100px;
  }

  .marcas-carousel__container {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .marcas-carousel__nav {
    display: none;
  }

  .marcas-carousel__track {
    grid-auto-columns: 80px;
    gap: 14px;
    animation: marcasScrollMobile 30s linear infinite;
  }

  @keyframes marcasScrollMobile {
    0% {
      transform: translateX(0);
    }
    100% {
      transform: translateX(-658px);
    }
  }

  .marcas-carousel__item {
    width: 80px;
    height: 80px;
    border: none;
    background: transparent;
  }

  .marcas-carousel__dot {
    display: none;
  }
}


.footer__contact a {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: #FEFFEF;
}

.footer__contact a img {
  width: 21px;
  height: 21px;
}