/* Incremental responsive fixes kept separate until the legacy Sass build is refreshed. */

/* One talent card per row in portrait tablet widths. */
@media (max-width: 1200px) {
  .fyc-talent .content .flex-container {
    display: block;
  }

  .fyc-talent .content .flex-container .card.card-picture {
    display: flex;
    flex: 0 0 auto;
    width: calc(100% - 32px);
    max-width: none;
    margin: 16px;
  }

  .fyc-talent .content .flex-container .card-picture .card-image {
    flex: 0 0 35%;
    max-height: 260px;
    overflow: hidden;
  }

  .fyc-talent .content .flex-container .card-picture .card-image img {
    width: 100%;
    height: 260px;
    object-fit: cover;
  }
}

/* Cookie consent: keep accept and reject equally visible. */
.cc-highlight .cc-btn:first-child {
  background-color: #4b81e8 !important;
  border-color: #4b81e8 !important;
  color: #fff !important;
  text-decoration: none !important;
}

.cc-highlight .cc-btn:first-child:focus,
.cc-highlight .cc-btn:first-child:hover {
  background-color: #3a6fd6 !important;
  border-color: #3a6fd6 !important;
  color: #fff !important;
  text-decoration: none !important;
}

.cc-highlight .cc-btn:last-child {
  text-decoration: none !important;
}

.cc-highlight .cc-btn:last-child:hover,
.cc-highlight .cc-btn:last-child:focus {
  background-color: #4b81e8 !important;
  border-color: #4b81e8 !important;
  color: #fff !important;
  text-decoration: none !important;
}

/* The library may create the revoke control after a choice, including on
   mobile. Preferences are reopened from the Cookies page instead. */
.cc-revoke {
  display: none !important;
}

/* Keep both consent actions on one line on portrait tablets. */
.cc-compliance {
  flex: 0 0 auto;
}

.cc-compliance > .cc-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* Google Maps stays blocked until third-party cookies are accepted. */
.map-consent {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #e3eeee;
}

.map-consent__notice {
  max-width: 420px;
  padding: 16px 20px;
  border-left: 4px solid #014596;
  background: #fff;
  color: #4f6367;
  text-align: center;
  line-height: 1.5;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
}

/* Keep the local AMAEF artwork smaller than the surrounding partner logos. */
#colaboraciones .logo-list .logo-amaef {
  background: transparent;
  display: block;
  height: auto;
  margin: 0 auto;
  max-width: 120px;
  padding: 0;
  width: 120px;
}

#colaboraciones .logo-list .logo-amaef img {
  display: block;
  height: auto;
  max-width: 120px;
  width: 120px;
}

/* Balance partner logos in portrait tablet views (Xiaomi Pad, iPad Pro and Surface Pro). */
@media (min-width: 601px) and (max-width: 1200px) {
  #colaboraciones .logo-list .logo-amaef,
  #colaboraciones .logo-list .logo-amaef img {
    max-width: 96px;
    width: 96px;
  }

  #colaboraciones .logo-list img[src$="/acmadis.svg"] {
    max-width: 120px;
    width: 120px;
  }
}

/* Further balance logos in narrower portrait tablets such as Xiaomi Pad 5 and Surface Pro. */
@media (min-width: 601px) and (max-width: 1000px) and (orientation: portrait) {
  #colaboraciones .logo-list .logo-amaef,
  #colaboraciones .logo-list .logo-amaef img {
    max-width: 80px;
    width: 80px;
  }

  #colaboraciones .logo-list img[src$="/acmadis.svg"] {
    max-width: 100px;
    width: 100px;
  }
}

@media (max-width: 600px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  #modal_home,
  #modal_home .panel-modal,
  #modal_home .modal-body,
  #modal_home .row,
  #modal_home .acuerdo,
  #modal_home .logos_large {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  #modal_home {
    left: 12px;
    right: 12px;
    width: auto !important;
    max-width: none !important;
  }

  /* Keep the decorative edge flush with the hero; the legacy -1px offset
     exposes a hairline of the hero background below the white chevron. */
  .chevron-bottom::after {
    bottom: 0;
  }

  .chevron-bottom + section {
    margin-top: -1px;
  }

  .jumbotron .jumbotron-title {
    width: 280px !important;
    max-width: calc(100vw - 48px) !important;
    margin-left: auto;
    margin-right: auto;
    font-size: clamp(24px, 7vw, 30px) !important;
    line-height: 1.1;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .jumbotron .scroll-down {
    left: 0;
    right: 0;
    width: auto;
  }

  .grid.grid-6-6 {
    display: block;
  }

  .contact > .container > .grid > .col,
  .contact .grid .col-06,
  .contact form,
  .contact form .form-control {
    width: calc(100vw - 32px) !important;
    min-width: 0;
    max-width: 100%;
  }

  /* The legacy grid has -16px side margins and 16px column gutters. Reset
     both at the narrow breakpoint so the contact content has a real gutter
     instead of cancelling the padding visually. */
  .contact > .container {
    width: 100%;
    max-width: 100%;
    padding-left: 24px;
    padding-right: 24px;
  }

  .contact > .container > .grid {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .contact > .container > .grid > .col {
    padding-left: 0;
    padding-right: 0;
  }

  .contact .instructions {
    width: 100% !important;
    padding-left: 32px;
  }

  .contact .instructions li {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .contact .categorias ul.icons {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 1.25rem !important;
  }

  .categorias ul.icons li {
    min-width: 0;
  }

  .requisitos,
  .requisitos .grid-9-3,
  .requisitos .grid-9-3 > div {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .requisitos .grid-9-3 {
    display: block;
  }

  .requisitos ul.checks {
    column-count: 1;
    padding-left: 40px;
  }

  .requisitos .btn {
    max-width: 100%;
    white-space: normal;
  }

  .cc-window.cc-banner {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
  }

  .cc-banner .cc-message {
    width: 100%;
    margin: 0 0 12px;
  }

  .cc-banner .cc-compliance {
    display: block;
    width: 100%;
  }

  .cc-banner .cc-btn {
    width: 100%;
    min-width: 0;
    margin: 0;
    white-space: normal;
  }

  /* CookieConsent uses the floating layout on mobile user agents. Keep it as
     a full-width bottom banner and prevent the message from sharing a narrow
     row with the buttons. */
  .cc-window.cc-floating {
    align-items: stretch;
    bottom: 0 !important;
    display: flex;
    flex-direction: column;
    left: 0 !important;
    max-width: none;
    padding: 16px;
    right: 0 !important;
    top: auto !important;
    width: 100%;
  }

  .cc-window.cc-floating .cc-message {
    flex: 0 0 auto;
    margin: 0 0 12px;
    width: 100%;
  }

  .cc-window.cc-floating .cc-compliance {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
    width: 100%;
  }

  .cc-window.cc-floating .cc-compliance > .cc-btn {
    flex: 1 1 0;
    margin: 0;
    min-width: 0;
    white-space: nowrap;
  }

  /* Keep every collaboration group visible and stacked in narrow views. */
  #colaboraciones .logo-list > li {
    display: block;
    width: 100%;
  }

  #colaboraciones .logo-list .flex-container {
    align-items: center;
    display: flex;
    flex-direction: column;
  }

  #colaboraciones .logo-list .flex-container > li {
    display: block;
    margin: 0 0 16px;
    width: 100%;
  }

  #colaboraciones .logo-list img {
    display: block;
    height: auto;
    max-width: 200px;
    width: auto;
  }

  #colaboraciones .logo-list .logo-amaef {
    background: transparent;
    display: block;
    height: auto;
    margin: 0 auto;
    max-width: 120px;
    padding: 0;
    width: 120px;
  }

  #colaboraciones .logo-list .logo-amaef img {
    max-height: none;
    max-width: 120px;
    width: 120px;
  }

  /* The service cards are fixed-size circles. At 360–600px a nowrap row
     makes the third card paint outside the viewport. */
  .fyc-lms .circle-block {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: center;
    margin-top: 48px;
  }

  .fyc-lms .circle-block .circle-item {
    flex: 0 0 auto;
    width: 160px;
    max-width: 100%;
    margin: 0 auto 56px;
  }

  .fyc-lms .circle-block .circle-item:last-child {
    margin-bottom: 24px;
  }

  /* Talent solution cards must become full-width cards before the legacy
     flex row reaches the 360px-only mobile rule. */
  .fyc-talent .content .flex-container {
    display: block;
  }

  .fyc-talent .content .flex-container .card.card-picture {
    display: flex;
    flex: 0 0 auto;
    width: calc(100% - 32px);
    max-width: none;
    margin: 16px;
    flex-direction: column;
  }

  .fyc-talent .content .flex-container .card-picture .card-image {
    flex: 0 0 auto;
    width: 100%;
    height: 180px;
    max-height: 180px;
  }

  .fyc-talent .content .flex-container .card-picture .card-image img {
    width: 100%;
    height: 180px;
    object-fit: cover;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .chevron-bottom + section {
    margin-top: -1px;
  }

  .main-footer {
    background-image: none;
  }

  .main-footer .company .container {
    display: block;
    text-align: center;
  }

  .main-footer .company .fyc-logo svg {
    margin: 0 auto 24px;
  }

  .main-footer .company .oficinas {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 24px;
  }

  .main-footer .company .certificados {
    justify-content: center;
  }

  .main-footer .property .container {
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
  }

  .main-footer .legal nav {
    justify-content: center;
    flex-wrap: wrap;
  }
}

.modal {
  width: min(720px, calc(100% - 24px));
  max-width: none;
  box-sizing: border-box;
}

#modal_home {
  width: calc(100vw - 24px) !important;
  max-width: calc(100vw - 24px) !important;
}

.modal .panel-modal,
.modal .modal-body,
.modal .row,
.modal .col-6,
.modal .acuerdo,
.modal .contenido_acuerdo {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.modal .panel-modal {
  width: 100%;
}

.modal .modal-body img {
  max-width: 100%;
  height: auto;
}

@media (max-width: 768px) {
  .modal {
    top: 16px;
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    max-height: calc(100vh - 32px);
  }

  .modal .modal-body {
    padding: 20px 16px;
  }

  .modal .row {
    display: block;
  }

  .modal .col-6 {
    width: 100%;
    padding-left: 0;
    padding-right: 0;
  }

  .modal .acuerdo h3 {
    font-size: clamp(24px, 8vw, 36px);
    line-height: 1.05;
    overflow-wrap: anywhere;
  }

  .modal .acuerdo {
    width: 100% !important;
    max-width: 100% !important;
    flex-direction: column;
  }

  .modal .acuerdo img,
  .modal .acuerdo .contenido_acuerdo {
    width: 100% !important;
    max-width: 100% !important;
  }
}
