/* =========================================================
   ADADP 11.121.0 - Dirección CP + Población (override real)
   Corrige una regla antigua del propio módulo que, hasta 991 px,
   forzaba este bloque a una sola columna con mayor especificidad.

   Escritorio/tablet >= 768 px:
      [ Código postal ] [ Población ]
                         [ Provincia ]
   Móvil < 768 px: una columna.
   ========================================================= */

/* Base común */
html body .adadp-postcode-place-wrap {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 0 10px !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

/*
 * IMPORTANTE: body#checkout aporta más especificidad que las reglas
 * antiguas de adadpcustomcss-v243.css, incluidas las del @media 991px.
 */
@media (min-width: 768px) {
  html body#checkout .adadp-postcode-place-wrap,
  html body .adadp-postcode-place-wrap {
    display: grid !important;
    grid-template-columns: minmax(0, 1.15fr) minmax(260px, .85fr) !important;
    column-gap: 22px !important;
    row-gap: 10px !important;
    align-items: start !important;
  }

  html body#checkout .adadp-postcode-place-wrap > .adadp-postcode-row,
  html body .adadp-postcode-place-wrap > .adadp-postcode-row {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  html body#checkout .adadp-postcode-place-wrap > .adadp-spain-place-box,
  html body .adadp-postcode-place-wrap > .adadp-spain-place-box {
    grid-column: 2 !important;
    grid-row: 1 !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  /* Anula el max-width:150px antiguo del código postal. */
  html body#checkout .adadp-postcode-place-wrap .adadp-postcode-row .form-control,
  html body#checkout .adadp-postcode-place-wrap .adadp-postcode-row input,
  html body .adadp-postcode-place-wrap .adadp-postcode-row .form-control,
  html body .adadp-postcode-place-wrap .adadp-postcode-row input {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  html body#checkout .adadp-postcode-place-wrap .adadp-postcode-row [class*="col-"],
  html body .adadp-postcode-place-wrap .adadp-postcode-row [class*="col-"] {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
  }

  html body#checkout .adadp-postcode-place-wrap .adadp-spain-place-box .adadp-place-field,
  html body#checkout .adadp-postcode-place-wrap .adadp-spain-place-box .adadp-province-field,
  html body .adadp-postcode-place-wrap .adadp-spain-place-box .adadp-place-field,
  html body .adadp-postcode-place-wrap .adadp-spain-place-box .adadp-province-field {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  html body#checkout .adadp-postcode-place-wrap #adadp-city-select,
  html body#checkout .adadp-postcode-place-wrap .adadp-province-value,
  html body .adadp-postcode-place-wrap #adadp-city-select,
  html body .adadp-postcode-place-wrap .adadp-province-value {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
}

/* Móvil: apilado, que es más legible. */
@media (max-width: 767px) {
  html body#checkout .adadp-postcode-place-wrap,
  html body .adadp-postcode-place-wrap {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
  }

  html body#checkout .adadp-postcode-place-wrap > .adadp-postcode-row,
  html body#checkout .adadp-postcode-place-wrap > .adadp-spain-place-box,
  html body .adadp-postcode-place-wrap > .adadp-postcode-row,
  html body .adadp-postcode-place-wrap > .adadp-spain-place-box {
    grid-column: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
}
