/* Design improvements - refined spacing and responsive enhancements */

:root {
  --gap-section: clamp(64px, 8vw, 144px);
  --gap-card: clamp(24px, 3vw, 40px);
  --font-size-hero: clamp(32px, 5vw, 60px);
  --font-size-heading: clamp(24px, 3.5vw, 40px);
  --font-size-button: clamp(18px, 3vw, 24px);
  --container-padding: clamp(16px, 4vw, 40px);
}

/* Hero section responsive */
.wp-block-cover.alignfull[style*="min-height:720px"] {
  min-height: clamp(400px, 60vh, 720px) !important;
}

.wp-block-cover .wp-block-cover__background.has-ast-global-color-0-background-color {
  background-color: var(--ast-global-color-0) !important;
  opacity: 0.7 !important;
  z-index: 1;
}

.wp-block-cover .wp-block-heading {
  font-size: var(--font-size-hero) !important;
  line-height: 1.1;
  margin-bottom: 0.25em;
}

.wp-block-cover mark {
  background: transparent;
}

/* Section spacing */
.wp-block-group.alignfull[style*="padding-top:144px"] {
  padding-top: var(--gap-section) !important;
  padding-bottom: var(--gap-section) !important;
}

.wp-block-group.alignfull[style*="padding-bottom:0px"] {
  padding-top: var(--gap-section) !important;
  padding-bottom: 0 !important;
}

/* Card improvements */
.wp-block-columns[style*="gap:40px"] {
  gap: var(--gap-card) !important;
}

.wp-block-cover[style*="min-height:72px"] {
  min-height: 72px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Button: "Aplica ahora!" transparent with white border */
.wp-block-button.is-style-outline--1 .wp-block-button__link {
  background: transparent !important;
  border-color: #fff !important;
  color: #fff !important;
  padding-left: 2.5rem !important;
  padding-right: 2.5rem !important;
  border-width: 2px !important;
}

.wp-block-button.is-style-outline--1 .wp-block-button__link:hover {
  background: rgba(255,255,255,0.1) !important;
}

/* Other buttons */
.wp-block-button__link[style*="font-size:59px"],
.wp-block-button.has-custom-font-size[style*="font-size:59px"] {
  font-size: clamp(20px, 4vw, 36px) !important;
  padding: 0.75em 1.25em !important;
}

.wp-block-button__link[style*="border-radius:70px"] {
  border-radius: 70px !important;
  font-size: clamp(16px, 2.5vw, 28px) !important;
  padding-top: var(--wp--preset--spacing--40) !important;
  padding-bottom: var(--wp--preset--spacing--40) !important;
}

.wp-block-button__link:hover {
  filter: brightness(1.1);
}

/* Dropdown - handle long menu items */
.main-header-menu .sub-menu {
  min-width: 280px !important;
  padding: 0.5rem 0 !important;
}

.main-header-menu .sub-menu .menu-link {
  padding: 0.5rem 1.25rem !important;
  white-space: normal !important;
  line-height: 1.4 !important;
  font-size: 0.9rem !important;
}

/* Language switcher button */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, opacity 0.2s;
  margin-left: 0.75rem;
  border: 1.5px solid rgba(255,255,255,0.5);
  color: #fff;
  background: rgba(255,255,255,0.1);
}

.lang-switcher:hover {
  background: rgba(255,255,255,0.25);
  color: #fff;
  opacity: 1;
}

/* Inner page title spacing */
.entry-header {
  padding-top: clamp(40px, 5vh, 80px) !important;
}

body.home .entry-header {
  padding-top: 0 !important;
}

.ast-theme-transparent-header .entry-title {
  padding-top: 0 !important;
}

.entry-content {
  padding: 0 var(--container-padding);
  padding-bottom: 4rem !important;
}

/* Contact page image overlay */
.contacto-image-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
}
.contacto-image-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(27, 117, 187, 0.35);
  pointer-events: none;
  border-radius: inherit;
}

/* Contact page form */
.contacto-form-wrapper {
  max-width: 640px;
  margin: 2rem auto;
}

.contacto-form-embed {
  display: block;
  width: 100%;
  max-width: 640px;
  height: 826px;
  margin: 0 auto;
  border: 0;
  border-radius: 8px;
}

.contacto-mailto-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.contacto-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.contacto-field label {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--ast-global-color-2);
}

.contacto-field input,
.contacto-field textarea {
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.contacto-field input:focus,
.contacto-field textarea:focus {
  outline: none;
  border-color: var(--ast-global-color-0);
  box-shadow: 0 0 0 3px rgba(4, 107, 210, 0.1);
}

.contacto-disclaimer {
  font-size: 0.8125rem;
  color: #6b7280;
  margin: 0;
}

.contacto-submit {
  background: transparent;
  color: #fff;
  border: 2px solid #fff;
  border-radius: 70px;
  padding: var(--wp--preset--spacing--50) 0;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, filter 0.2s;
  align-self: center;
  width: 100%;
  max-width: 400px;
  letter-spacing: 0.02em;
}

.contacto-submit:hover {
  filter: brightness(1.15);
}

.contacto-mailto-hint {
  font-size: 0.8125rem;
  color: #6b7280;
  margin-top: 0.5rem;
}

.contacto-gmail-link {
  margin-top: 2rem;
  padding: 1.25rem;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  text-align: center;
}

.contacto-gmail-link a {
  color: var(--ast-global-color-0);
  font-weight: 600;
  text-decoration: none;
}

.contacto-gmail-link a:hover {
  text-decoration: underline;
}

/* Google Maps embed responsive */
.uagb-google-map__iframe,
.uagb-google-map__wrap iframe {
  max-width: 100%;
  width: 100% !important;
  height: 300px;
  border-radius: 8px;
}

/* Responsive images */
.entry-content img,
.wp-block-image img {
  max-width: 100%;
  height: auto;
}

/* Footer - matching header style */
footer.site-footer,
.site-footer {
  background: #1b75bb !important;
  padding: 2rem 0 0 !important;
}

.site-primary-footer-wrap .ast-builder-footer-grid-columns {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
}

.site-primary-footer-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--container-padding) !important;
}

.ast-builder-footer-grid-columns {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
}

.site-footer-section {
  display: flex;
  flex-direction: column;
  text-align: center;
  align-items: center;
}

.site-footer-section .widget {
  margin-bottom: 0;
}

.site-footer-section p {
  margin: 0;
  line-height: 1.8;
  color: rgba(255,255,255,0.85);
}

.site-footer-section .footer-heading {
  color: rgba(255,255,255,0.6);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.site-footer-section a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.85rem;
  line-height: 2;
  transition: color 0.2s;
}

.site-footer-section a:hover {
  color: #fff;
}

.footer-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-nav-list li a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.85rem;
  line-height: 2;
  transition: color 0.2s;
}

.footer-nav-list li a:hover {
  color: #fff;
}

.site-below-footer-wrap {
  background: #1b75bb;
  border-top: 1px solid rgba(255,255,255,0.12);
  padding: 1rem var(--container-padding) !important;
  margin-top: 1.5rem;
}

.ast-footer-social-1-wrap {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
}

.ast-footer-social-1-wrap a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  transition: background 0.2s, transform 0.2s !important;
}

.ast-footer-social-1-wrap a:hover {
  background: rgba(255,255,255,0.22);
  transform: scale(1.1);
}

.ast-footer-social-1-wrap svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: #fff;
}

.site-footer a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
}

.site-footer a:hover {
  color: #fff;
}

/* Responsive breakpoints */
@media (max-width: 768px) {
  .wp-block-columns.is-layout-flex {
    flex-direction: column;
  }

  .wp-block-columns[style*="gap:40px"] {
    gap: 2rem !important;
  }

  .wp-block-cover.alignfull[style*="min-height:720px"] .wp-block-media-text {
    grid-template-columns: 1fr !important;
  }

  .wp-block-cover.alignfull[style*="min-height:720px"] .wp-block-media-text__media {
    display: none;
  }

  .ast-builder-footer-grid-columns {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }

  .site-footer-section {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }

  .site-footer-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  .site-primary-footer-wrap {
    padding: 0 !important;
  }

  .lang-switcher {
    margin-left: 0;
    margin-top: 0.5rem;
  }
}

/* ===== Mobile Header ===== */
#ast-mobile-header {
  display: none;
}

.ast-mobile-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1b75bb !important;
  padding: 0.5rem 1rem;
  min-height: 56px;
}

.ast-mobile-header-logo img {
  max-width: 110px;
  height: auto;
  display: block;
}

.ast-mobile-menu-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.5);
  border-radius: 6px;
  cursor: pointer;
  gap: 5px;
  padding: 8px;
}

.hamburger-line {
  display: block;
  width: 20px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

#ast-mobile-header.open .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

#ast-mobile-header.open .hamburger-line:nth-child(2) {
  opacity: 0;
}

#ast-mobile-header.open .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.ast-mobile-menu-panel {
  display: none;
  background: #1b75bb !important;
  padding: 0 1rem 1rem;
  max-height: calc(100vh - 56px);
  overflow-y: auto;
}

#ast-mobile-header.open .ast-mobile-menu-panel {
  display: block;
}

.ast-mobile-menu-panel ul,
.ast-mobile-menu-panel ul ul {
  list-style: none;
  margin: 0;
  padding: 0;
  background: transparent !important;
  box-shadow: none !important;
}

.ast-mobile-menu-panel .menu-item {
  border-bottom: 1px solid rgba(255,255,255,0.12);
  background: transparent !important;
}

.ast-mobile-menu-panel .menu-item a,
.ast-mobile-menu-panel .menu-link {
  display: block;
  padding: 0.75rem 0 !important;
  color: rgba(255,255,255,0.9) !important;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  background: transparent !important;
}

.ast-mobile-menu-panel .menu-item a:hover,
.ast-mobile-menu-panel .menu-link:hover {
  color: #fff !important;
}

.ast-mobile-menu-panel .menu-item-has-children > a {
  position: relative;
}

.ast-mobile-menu-panel .sub-menu,
.ast-mobile-menu-panel .main-header-menu .sub-menu {
  padding-left: 1rem;
  display: none;
  background: transparent !important;
}

.ast-mobile-menu-panel .sub-menu.open {
  display: block;
}

.ast-mobile-menu-panel .sub-menu .menu-item:last-child {
  border-bottom: none;
}

.ast-mobile-menu-panel .sub-menu-toggle {
  display: none !important;
}

.ast-mobile-menu-panel .ast-menu-toggle {
  display: none !important;
}

.ast-mobile-menu-panel .menu-item .dropdown-menu-toggle {
  display: none !important;
}

.ast-mobile-menu-panel .main-header-menu {
  background: transparent !important;
}

.ast-mobile-menu-panel .ast-left-align-sub-menu {
  display: none !important;
}

.ast-mobile-menu-panel .ast-mobile-nav-separator {
  border-top: 1px solid rgba(255,255,255,0.2);
  margin: 0.5rem 0;
}

.ast-mobile-menu-panel .lang-switcher-mobile {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid rgba(255,255,255,0.5);
  color: #fff;
  background: rgba(255,255,255,0.1);
  margin-top: 0.75rem;
}

.ast-mobile-menu-panel .lang-switcher-mobile:hover {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

.ast-mobile-menu-panel .ast-header-search-mobile {
  margin-top: 0.75rem;
}

.ast-mobile-menu-panel .ast-header-search-mobile .search-form {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 6px;
  overflow: hidden;
}

.ast-mobile-menu-panel .ast-header-search-mobile .search-field {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0.5rem 0.75rem;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
}

.ast-mobile-menu-panel .ast-header-search-mobile .search-field::placeholder {
  color: rgba(255,255,255,0.5);
}

.ast-mobile-menu-panel .ast-header-search-mobile .search-submit {
  background: transparent;
  border: none;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  color: rgba(255,255,255,0.7);
}

@media (max-width: 921px) {
  #ast-desktop-header {
    display: none !important;
  }

  #ast-mobile-header {
    display: block;
  }
}

@media (max-width: 768px) {
  .site-below-footer-wrap {
    padding: 1.5rem 1rem !important;
    margin-top: 0;
  }

  .ast-footer-social-1-wrap {
    gap: 0.8rem;
  }

  .ast-footer-social-1-wrap a {
    width: 2.5rem;
    height: 2.5rem;
  }
}

@media (max-width: 1024px) and (min-width: 769px) {
  .wp-block-columns.is-layout-flex {
    gap: 1.5rem;
  }

  .ast-builder-footer-grid-columns {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media (max-width: 782px) {
  .contacto-page .wp-block-columns {
    flex-direction: column-reverse;
  }

  .contacto-page .wp-block-columns .wp-block-column {
    flex-basis: 100% !important;
  }
}
