/* Modal oficinas: portada + pago presencial, vouchers y documentación */

body.office-modal-open {
  overflow: hidden;
}

.c-office-modal {
  position: fixed;
  inset: 0;
  z-index: 12010;
  display: grid;
  place-items: center;
  align-content: center;
  justify-items: center;
  padding: max(16px, env(safe-area-inset-top, 0px))
    max(16px, env(safe-area-inset-right, 0px))
    max(16px, env(safe-area-inset-bottom, 0px))
    max(16px, env(safe-area-inset-left, 0px));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0.28s ease;
  box-sizing: border-box;
}

.c-office-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.c-office-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 32, 0.78);
  backdrop-filter: blur(8px);
}

.c-office-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(820px, calc(100vw - 32px));
  max-height: min(
    900px,
    calc(100dvh - max(32px, env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px) + 24px))
  );
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #f7f4ef;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.42);
  transform: translateY(14px) scale(0.985);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  color: #1c2430;
  margin: 0 auto;
}

.c-office-modal.is-open .c-office-modal__dialog {
  transform: translateY(0) scale(1);
}

.c-office-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #0b1220;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
}

.c-office-modal__close i {
  color: #fff;
  opacity: 1;
}

.c-office-modal__close:hover {
  background: #000;
  color: #fff;
  border-color: #fff;
}

/* Portada full-bleed */
.c-office-modal__cover {
  position: relative;
  flex: 0 0 auto;
  min-height: 160px;
  max-height: 210px;
  overflow: hidden;
  background: #15202b;
}

.c-office-modal__cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 45%;
  min-height: 160px;
}

.c-office-modal__cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(21, 32, 43, 0.18) 0%, rgba(21, 32, 43, 0.72) 68%, rgba(21, 32, 43, 0.94) 100%);
}

.c-office-modal__cover-copy {
  position: absolute;
  left: 20px;
  right: 56px;
  bottom: 16px;
  z-index: 1;
  color: #fff;
}

.c-office-modal__eyebrow {
  margin: 0 0 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f0c48a;
}

.c-office-modal__title {
  margin: 0 0 6px;
  font-size: clamp(1.35rem, 2.6vw, 1.75rem);
  font-weight: 800;
  line-height: 1.15;
  color: #fff;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.c-office-modal__lead {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
  font-weight: 500;
  color: rgba(255, 248, 240, 0.92);
  max-width: 52ch;
}

/* Todo el cuadro scrollea junto (portada + oficinas + pie) */
.c-office-modal__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  scrollbar-width: thin;
  scrollbar-color: rgba(28, 36, 48, 0.35) transparent;
}

.c-office-modal__scroll::-webkit-scrollbar {
  width: 8px;
}

.c-office-modal__scroll::-webkit-scrollbar-thumb {
  background: rgba(28, 36, 48, 0.28);
  border-radius: 999px;
}

.c-office-modal__scroll::-webkit-scrollbar-track {
  background: transparent;
}

.c-office-modal__body {
  flex: 0 0 auto;
  overflow: visible;
  padding: 18px 18px 10px;
}

/* Página propia (oficinas-pago.html): mismo contenido que el modal, pero
   fuera del diálogo flotante -sin backdrop, sin scroll interno propio-. */
.c-office-modal__body--page {
  padding: 0;
  display: grid;
  gap: 28px;
}

.c-office-modal__foot--page {
  margin-top: 0;
  padding: 24px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.c-office-modal__alert {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin: 0;
  padding: 20px 22px;
  border-radius: 16px;
  border: 1px solid #fde68a;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  color: #78350f;
  box-shadow: 0 8px 22px rgba(180, 83, 9, 0.08);
}

.c-office-modal__alert i {
  margin-top: 2px;
  color: #d97706;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.c-office-modal__alert strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1rem;
  font-weight: 700;
  color: #92400e;
  line-height: 1.35;
}

.c-office-modal__alert p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.65;
  color: #78350f;
}

.c-office-modal__grid {
  display: grid;
  gap: 20px;
}

@media (min-width: 720px) {
  .c-office-modal__grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
}

.c-office-modal__card {
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  min-width: 0;
}

.c-office-modal__card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
  padding-top: 4px;
}

.c-office-modal__card-actions .c-button {
  flex: 1 1 auto;
  min-height: 42px;
  justify-content: center;
  font-weight: 700;
}

.c-office-modal__card-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.c-office-modal__card-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #15202b;
  color: #f4e7d4;
  flex-shrink: 0;
}

.c-office-modal__card-name {
  margin: 0 0 4px;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
  color: #0f172a;
}

.c-office-modal__card-badge {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #c2410c;
}

.c-office-modal__card > p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.65;
  color: #4b5563;
}

.c-office-modal__meta {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.c-office-modal__meta li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 0.9rem;
  line-height: 1.4;
}

.c-office-modal__meta i {
  margin-top: 2px;
  color: #8a5a2b;
  width: 1em;
}

.c-office-modal__note {
  margin-top: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(21, 32, 43, 0.05);
  font-size: 0.86rem;
  line-height: 1.45;
  color: rgba(28, 36, 48, 0.8);
}

.c-office-modal__services {
  margin: 0;
  padding: 24px;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.c-office-modal__services h3 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}

.c-office-modal__services ul {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 8px;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #4b5563;
}

.c-office-modal__foot {
  flex: 0 0 auto;
  padding: 14px 18px 16px;
  border-top: 1px solid rgba(28, 36, 48, 0.08);
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.86rem;
  line-height: 1.45;
  color: rgba(28, 36, 48, 0.7);
}

.c-office-modal__foot p {
  margin: 10px 0 0;
}

.c-office-modal__foot a {
  color: #8a5a2b;
  font-weight: 600;
}

.c-office-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.c-office-modal__actions .c-button {
  min-height: 40px;
}

.c-office-home-cta {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.c-office-home-note {
  margin: 12px 0 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: rgba(28, 36, 48, 0.78);
}

@media (max-width: 1024px) {
  .c-office-modal {
    place-items: center;
    padding:
      max(20px, calc(env(safe-area-inset-top, 0px) + 12px))
      max(12px, env(safe-area-inset-right, 0px))
      max(20px, calc(env(safe-area-inset-bottom, 0px) + 12px))
      max(12px, env(safe-area-inset-left, 0px));
  }

  .c-office-modal__dialog {
    width: min(820px, calc(100vw - 24px));
    max-height: calc(
      100dvh
      - max(20px, calc(env(safe-area-inset-top, 0px) + 12px))
      - max(20px, calc(env(safe-area-inset-bottom, 0px) + 12px))
    );
    border-radius: 18px;
  }

  .c-office-modal__close {
    top: max(10px, env(safe-area-inset-top, 0px));
    right: max(10px, env(safe-area-inset-right, 0px));
  }

  .c-office-modal__cover {
    min-height: 130px;
    max-height: 160px;
  }

  .c-office-modal__cover img {
    min-height: 130px;
  }

  .c-office-modal__cover-copy {
    left: 14px;
    right: 48px;
    bottom: 12px;
  }

  .c-office-modal__title {
    font-size: 1.25rem;
  }

  .c-office-modal__body {
    padding: 14px 12px 8px;
  }

  .c-office-modal__foot {
    padding: 14px 12px max(16px, env(safe-area-inset-bottom, 0px));
  }

  .c-office-modal__actions .c-button {
    flex: 1 1 100%;
    justify-content: center;
  }
}

@media (max-width: 560px) {
  .c-office-modal__dialog {
    width: calc(100vw - 20px);
    border-radius: 16px;
  }

  .c-office-modal__cover {
    min-height: 120px;
    max-height: 140px;
  }

  .c-office-modal__cover img {
    min-height: 120px;
  }

  .c-office-modal__lead {
    font-size: 0.86rem;
  }
}
