/* ==========================================================
   INDUSTRIAMINERA.CL — FICHAS GLOBALES DE EMPRESAS Y MARCAS
   Contenedor raíz: .im-profile-page
   ========================================================== */

.im-profile-page {
  --im-yellow: #fac11c;
  --im-yellow-dark: #d89f00;
  --im-black: #222222;
  --im-text: #30343a;
  --im-muted: #68707a;
  --im-border: #e3e6e8;
  --im-soft: #f5f6f7;
  --im-review: #fff7d8;
  --im-radius: 8px;
  --im-shadow: 0 5px 20px rgba(0, 0, 0, 0.07);
  display: block;
  clear: both;
  width: 100%;
  margin: 0 !important;
  padding: 64px 12px 56px !important;
  color: var(--im-text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

.im-profile-page *,
.im-profile-page *::before,
.im-profile-page *::after {
  box-sizing: border-box;
}

.im-profile-page :where(h1, h2, h3, p, ul, ol, figure) {
  margin-top: 0;
}

.im-profile-page a {
  color: inherit;
}

.im-profile {
  width: min(100%, 1500px);
  margin: 0 auto;
}

.im-profile__hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 30px;
  align-items: start;
  min-height: 270px;
  padding: 38px;
  overflow: hidden;
  border: 1px solid var(--im-border);
  border-top: 5px solid var(--im-yellow);
  border-radius: var(--im-radius);
  background: #fff;
  box-shadow: var(--im-shadow);
}

.im-profile__hero--image {
  color: #fff;
  background-image:
    linear-gradient(90deg, rgba(10, 12, 15, 0.94), rgba(10, 12, 15, 0.70)),
    var(--im-profile-hero-image);
  background-position: center;
  background-size: cover;
}

.im-profile__hero-copy {
  min-width: 0;
}

.im-profile__eyebrow,
.im-profile__sidebox-eyebrow {
  margin-bottom: 8px;
  color: var(--im-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.07em;
  line-height: 1.2;
  text-transform: uppercase;
}

.im-profile__hero--image .im-profile__eyebrow {
  color: var(--im-yellow);
}

.im-profile__title {
  margin-bottom: 14px;
  color: var(--im-black);
  font-size: clamp(38px, 5vw, 62px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.04;
}

.im-profile__hero--image .im-profile__title,
.im-profile__hero--image .im-profile__lead {
  color: #fff;
}

.im-profile__lead {
  max-width: 820px;
  margin-bottom: 18px;
  color: var(--im-muted);
  font-size: 17px;
  line-height: 1.65;
}

.im-profile__logo-box {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 190px;
  min-height: 135px;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--im-border);
  border-radius: var(--im-radius);
  background: #fff;
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.08);
}

.im-profile__logo {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100px;
  object-fit: contain;
}

.im-profile__badges,
.im-profile__hero-actions,
.im-profile__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.im-profile__badges {
  margin-top: 18px;
}

.im-profile__hero-actions {
  margin-top: 24px;
}

.im-profile__badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 11px;
  border: 1px solid var(--im-border);
  border-radius: 6px;
  background: #fff;
  color: var(--im-text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: normal;
}

.im-profile__badge--primary {
  border-color: var(--im-yellow-dark);
  background: var(--im-yellow);
  color: var(--im-black);
}

.im-profile__hero--image .im-profile__badge:not(.im-profile__badge--primary) {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(0, 0, 0, 0.42);
  color: #fff;
}

.im-profile__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 17px;
  border: 1px solid var(--im-border);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  text-decoration: none !important;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.im-profile__button:hover,
.im-profile__button:focus {
  transform: translateY(-1px);
}

.im-profile__button--primary {
  border-color: var(--im-yellow-dark);
  background: var(--im-yellow);
  color: var(--im-black) !important;
}

.im-profile__button--secondary {
  background: #fff;
  color: var(--im-black) !important;
}

.im-profile__button--full {
  width: 100%;
  margin-top: 14px;
}

.im-profile__facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.im-profile__fact {
  min-width: 0;
  min-height: 105px;
  padding: 20px;
  border: 1px solid var(--im-border);
  border-radius: var(--im-radius);
  background: var(--im-soft);
}

.im-profile__fact-label {
  display: block;
  margin-bottom: 17px;
  color: var(--im-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-transform: uppercase;
}

.im-profile__fact-value {
  display: block;
  color: var(--im-black);
  font-size: 14px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.im-profile__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 24px;
  align-items: start;
  margin-top: 24px;
}

.im-profile__main,
.im-profile__sidebar {
  min-width: 0;
}

.im-profile__main {
  display: grid;
  gap: 20px;
}

.im-profile__sidebar {
  display: grid;
  gap: 18px;
}

.im-profile__section,
.im-profile__sidebox,
.im-profile__ad {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--im-border);
  border-radius: var(--im-radius);
  background: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.im-profile__section {
  padding: 28px 30px;
}

.im-profile__section-heading {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--im-border);
}

.im-profile__section-number {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--im-yellow);
  color: var(--im-black);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.im-profile__section-heading h2 {
  margin: 0;
  color: var(--im-black);
  font-size: clamp(24px, 3vw, 31px);
  font-weight: 800;
  line-height: 1.2;
}

.im-profile__content {
  width: 100%;
  max-width: none;
}

.im-profile__content p:last-child,
.im-profile__card p:last-child,
.im-profile__feature p:last-child,
.im-profile__notice p:last-child,
.im-profile__sidebox p:last-child {
  margin-bottom: 0;
}

.im-profile__cards,
.im-profile__features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.im-profile__card,
.im-profile__feature {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--im-border);
  border-radius: 7px;
  background: var(--im-soft);
}

.im-profile__card h3,
.im-profile__feature h3 {
  margin-bottom: 7px;
  color: var(--im-black);
  font-size: 17px;
  line-height: 1.3;
}

.im-profile__card p,
.im-profile__feature p {
  color: var(--im-muted);
  font-size: 14px;
  line-height: 1.55;
}

.im-profile__feature {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.im-profile__feature-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: var(--im-black);
  color: var(--im-yellow);
  font-size: 10px;
  font-weight: 800;
}

.im-profile__notice {
  padding: 22px;
  border-left: 4px solid var(--im-yellow);
  background: var(--im-review);
}

.im-profile__verification-list {
  display: grid;
  gap: 10px;
}

.im-profile__verification-item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.im-profile__verification-item > span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #eceff1;
  font-weight: 800;
}

.im-profile__verification-item--ok > span {
  background: #e4f5e8;
  color: #1f6a34;
}

.im-profile__verification-item p {
  margin: 2px 0 0;
}

.im-profile__table-wrap {
  overflow-x: auto;
}

.im-profile__table {
  width: 100%;
  border-collapse: collapse;
}

.im-profile__table th,
.im-profile__table td {
  padding: 12px 13px;
  border-bottom: 1px solid var(--im-border);
  text-align: left;
  vertical-align: top;
}

.im-profile__list {
  margin: 0;
  padding-left: 20px;
}

.im-profile__list li + li {
  margin-top: 9px;
}

.im-profile__editorial-note {
  padding: 18px 20px;
  border-left: 4px solid var(--im-yellow);
  background: var(--im-soft);
  font-size: 13px;
}

.im-profile__sidebox {
  padding: 20px;
}

.im-profile__sidebox h2 {
  margin-bottom: 12px;
  color: var(--im-black);
  font-size: 20px;
  line-height: 1.25;
}

.im-profile__contact-row {
  display: grid;
  gap: 4px;
  padding: 11px 0;
  border-bottom: 1px solid var(--im-border);
}

.im-profile__contact-row span {
  color: var(--im-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.im-profile__contact-row strong {
  overflow-wrap: anywhere;
}

.im-profile__side-link {
  display: block;
  margin-top: 12px;
  overflow-wrap: anywhere;
  font-weight: 700;
  text-decoration: none;
}

.im-profile__side-list {
  display: grid;
  gap: 9px;
}

.im-profile__side-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--im-border);
  border-radius: 6px;
  background: var(--im-soft);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
}

.im-profile__side-list a::after {
  content: "›";
  color: var(--im-yellow-dark);
  font-size: 18px;
}

.im-profile__ad {
  overflow: hidden;
}

.im-profile__ad img,
.im-profile__ad iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}

.im-profile__ad > :first-child {
  margin-top: 0;
}

.im-profile__ad > :last-child {
  margin-bottom: 0;
}

.im-profile__sidebox--status {
  border-top: 4px solid var(--im-yellow);
}

.im-profile__form input,
.im-profile__form select,
.im-profile__form textarea {
  width: 100%;
}

.im-profile__form p {
  margin-bottom: 14px;
}

@media (max-width: 1100px) {
  .im-profile__layout {
    grid-template-columns: minmax(0, 1fr) 280px;
  }

  .im-profile__facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .im-profile-page {
    padding-top: 44px !important;
  }

  .im-profile__hero,
  .im-profile__layout {
    grid-template-columns: 1fr;
  }

  .im-profile__logo-box {
    grid-row: 1;
    width: 150px;
    min-height: 105px;
  }

  .im-profile__logo {
    height: 74px;
  }

  .im-profile__sidebar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .im-profile-page {
    padding-right: 10px;
    padding-left: 10px;
  }

  .im-profile__hero,
  .im-profile__section {
    padding: 22px 18px;
  }

  .im-profile__title {
    font-size: 38px;
  }

  .im-profile__lead {
    font-size: 16px;
  }

  .im-profile__facts,
  .im-profile__cards,
  .im-profile__features,
  .im-profile__sidebar {
    grid-template-columns: 1fr;
  }

  .im-profile__fact {
    min-height: 0;
  }

  .im-profile__button {
    width: 100%;
  }

  .im-profile__section-heading {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .im-profile__section-number {
    width: 30px;
    height: 30px;
  }
}

/* ==========================================================
   FORMULARIO GLOBAL DE CONTACTO — CONTACT FORM 7
   Corrige inputs, grilla, casillas y botón en fichas IM.
   ========================================================== */

.im-profile__form,
.im-profile__form .wpcf7,
.im-profile__form .wpcf7-form {
  width: 100%;
  max-width: none;
}

.im-profile__form .wpcf7-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
  margin: 0;
}

.im-profile__form .wpcf7-form > p {
  min-width: 0;
  margin: 0 !important;
}

.im-profile__form .wpcf7-form > p:nth-of-type(1),
.im-profile__form .wpcf7-form > p:nth-of-type(2),
.im-profile__form .wpcf7-form > p:nth-of-type(3),
.im-profile__form .wpcf7-form > p:nth-of-type(4),
.im-profile__form .wpcf7-form > p:nth-of-type(5),
.im-profile__form .wpcf7-form > p:nth-of-type(6) {
  grid-column: auto;
}

/* Botón final */
.im-profile__form .wpcf7-form > p:last-of-type {
  grid-column: 1 / -1;
  margin-top: 2px !important;
}

/* Bloques de aceptación, captcha y mensajes */
.im-profile__form .wpcf7-form > div:not([style*="display: none"]),
.im-profile__form .wpcf7-form > .wpcf7-response-output,
.im-profile__form .wpcf7-form > .wpcf7-spinner {
  grid-column: 1 / -1;
}

.im-profile__form label,
.im-profile__form p {
  color: var(--im-text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.im-profile__form .wpcf7-form-control-wrap {
  display: block;
  width: 100%;
  margin-top: 7px;
}

.im-profile__form input[type="text"],
.im-profile__form input[type="email"],
.im-profile__form input[type="tel"],
.im-profile__form input[type="url"],
.im-profile__form input[type="number"],
.im-profile__form select,
.im-profile__form textarea {
  display: block;
  width: 100% !important;
  max-width: 100%;
  margin: 0;
  padding: 11px 13px;
  border: 1px solid var(--im-border);
  border-radius: 6px;
  background: #fff;
  color: var(--im-text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.4;
  box-shadow: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.im-profile__form input[type="text"],
.im-profile__form input[type="email"],
.im-profile__form input[type="tel"],
.im-profile__form input[type="url"],
.im-profile__form input[type="number"],
.im-profile__form select {
  min-height: 48px;
}

.im-profile__form textarea {
  min-height: 126px;
  resize: vertical;
}

.im-profile__form input:focus,
.im-profile__form select:focus,
.im-profile__form textarea:focus {
  outline: none;
  border-color: var(--im-yellow-dark);
  box-shadow: 0 0 0 3px rgba(250, 193, 28, 0.18);
}

/* Aceptaciones: corrige el width:100% heredado en checkbox */
.im-profile__form input[type="checkbox"],
.im-profile__form input[type="radio"] {
  flex: 0 0 auto;
  width: 18px !important;
  height: 18px !important;
  min-width: 18px;
  margin: 2px 0 0;
  padding: 0;
  accent-color: var(--im-yellow-dark);
}

.im-profile__form .wpcf7-acceptance,
.im-profile__form .wpcf7-checkbox,
.im-profile__form .wpcf7-radio {
  display: block;
  width: 100%;
}

.im-profile__form .wpcf7-list-item {
  display: block;
  margin: 0;
}

.im-profile__form .wpcf7-list-item label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}

.im-profile__form .wpcf7-list-item-label {
  display: block;
  min-width: 0;
}

/* Los div del formulario traían márgenes inline muy grandes */
.im-profile__form .wpcf7-form > div:not([style*="display: none"]) {
  margin: 0 !important;
  padding: 0;
  font-size: 14px !important;
  line-height: 1.5 !important;
}

/* Enviar */
.im-profile__form input[type="submit"],
.im-profile__form button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto !important;
  min-width: 230px;
  min-height: 46px;
  margin: 0;
  padding: 0 24px;
  border: 1px solid var(--im-yellow-dark);
  border-radius: 6px;
  background: var(--im-yellow);
  color: var(--im-black);
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.15;
  text-transform: none;
  cursor: pointer;
  box-shadow: none;
}

.im-profile__form input[type="submit"]:hover,
.im-profile__form input[type="submit"]:focus,
.im-profile__form button[type="submit"]:hover,
.im-profile__form button[type="submit"]:focus {
  background: var(--im-yellow-dark);
  color: var(--im-black);
}

/* Validación y respuesta */
.im-profile__form .wpcf7-not-valid-tip {
  display: block;
  margin-top: 5px;
  color: #b42318;
  font-size: 12px;
  font-weight: 600;
}

.im-profile__form .wpcf7-not-valid {
  border-color: #b42318 !important;
}

.im-profile__form .wpcf7-response-output {
  margin: 0 !important;
  padding: 12px 14px !important;
  border-width: 1px !important;
  border-radius: 6px;
  font-size: 13px;
}

.im-profile__form .wpcf7-spinner {
  margin: 0 0 0 10px;
  vertical-align: middle;
}

.im-profile__form .wpcf7-form > br,
.im-profile__form .wpcf7-form > p:empty {
  display: none !important;
}

@media (max-width: 720px) {
  .im-profile__form .wpcf7-form {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .im-profile__form .wpcf7-form > p,
  .im-profile__form .wpcf7-form > div:not([style*="display: none"]),
  .im-profile__form .wpcf7-form > .wpcf7-response-output {
    grid-column: 1 !important;
  }

  .im-profile__form input[type="submit"],
  .im-profile__form button[type="submit"] {
    width: 100% !important;
    min-width: 0;
  }
}

/* ==========================================================
   PRIVACIDAD DE CONTACTO Y SOLICITUDES — V1.3
   ========================================================== */

.im-profile__contact-actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.im-profile__phone-box {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--im-border);
  border-radius: 7px;
  background: var(--im-soft);
}

.im-profile__phone-label {
  display: block;
  margin-bottom: 5px;
  color: var(--im-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.im-profile__phone-mask,
.im-profile__phone-output {
  display: block;
  margin-bottom: 10px;
  color: var(--im-text);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
  word-break: break-word;
}

.im-profile__phone-output:empty {
  display: none;
}

.im-profile__phone-reveal[disabled] {
  cursor: wait;
  opacity: 0.72;
}

.im-profile__request-intro {
  max-width: 780px;
  margin: 0 0 20px;
  color: var(--im-muted);
  font-size: 15px;
  line-height: 1.65;
}

.im-profile__request-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.im-profile__request-field {
  min-width: 0;
}

.im-profile__request-field label {
  display: block;
  margin-bottom: 7px;
  color: var(--im-text);
  font-size: 14px;
  font-weight: 700;
}

.im-profile__request-field input[type="text"],
.im-profile__request-field input[type="email"],
.im-profile__request-field input[type="tel"] {
  display: block;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 11px 13px;
  border: 1px solid var(--im-border);
  border-radius: 6px;
  background: #fff;
  color: var(--im-text);
  font-family: inherit;
  font-size: 15px;
  box-shadow: none;
}

.im-profile__request-field input:focus {
  outline: none;
  border-color: var(--im-yellow-dark);
  box-shadow: 0 0 0 3px rgba(250, 193, 28, 0.18);
}

.im-profile__request-field--honeypot {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.im-profile__request-consent,
.im-profile__request-submit,
.im-profile__request-message {
  grid-column: 1 / -1;
}

.im-profile__request-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--im-text);
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
}

.im-profile__request-consent input[type="checkbox"] {
  flex: 0 0 auto;
  width: 18px !important;
  height: 18px !important;
  margin: 2px 0 0;
  accent-color: var(--im-yellow-dark);
}

.im-profile__request-submit {
  margin-top: 2px;
}

.im-profile__request-message {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid var(--im-border);
  border-left-width: 4px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
}

.im-profile__request-message--success {
  border-left-color: #27864b;
  background: #eef9f2;
}

.im-profile__request-message--warning {
  border-left-color: var(--im-yellow-dark);
  background: #fff8df;
}

.im-profile__request-message--error {
  border-left-color: #b42318;
  background: #fff1f0;
}

@media (max-width: 720px) {
  .im-profile__request-form {
    grid-template-columns: 1fr;
  }

  .im-profile__request-field,
  .im-profile__request-consent,
  .im-profile__request-submit,
  .im-profile__request-message {
    grid-column: 1;
  }

  .im-profile__request-submit .im-profile__button {
    width: 100%;
  }
}

/* V1.4: consentimiento de contacto y suscripción opcional */
.im-profile__request-consent--optional {
  margin-top: -6px;
  color: var(--im-muted);
}

.im-profile__request-consent--optional span {
  font-weight: 500;
}

/* V1.7: administración de la ficha */
.im-profile__section--management {
  border-top: 4px solid var(--im-yellow);
}

.im-profile__management-note {
  margin: 18px 0 0;
  color: var(--im-muted);
  font-size: 14px;
}

.im-profile__management-note a {
  font-weight: 700;
}
