/* Gestión de consentimiento de cookies y contenidos de terceros.
   Se mantiene aislada del CSS principal para no alterar el diseño existente. */
.cookie-consent,
.cookie-preferences {
  --cc-olive: #8e9769;
  --cc-olive-dark: #596044;
  --cc-olive-deep: #3f4731;
  --cc-cream: #f7f4ed;
  --cc-ink: #201713;
  --cc-ink-soft: #655d57;
  --cc-white: #ffffff;
  font-family: "DM Sans", Arial, sans-serif;
}

.cookie-consent[hidden],
.cookie-preferences[hidden] { display: none !important; }

.cookie-consent {
  position: fixed;
  right: 22px;
  bottom: 22px;
  left: 22px;
  z-index: 12000;
  width: min(760px, calc(100% - 44px));
  margin-inline: auto;
  padding: 22px;
  border: 1px solid rgba(89, 96, 68, .18);
  border-radius: 24px;
  background: rgba(247, 244, 237, .98);
  color: var(--cc-ink);
  box-shadow: 0 24px 70px rgba(32, 23, 19, .22);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.cookie-consent__title {
  margin: 0 0 7px;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 25px;
  font-weight: 500;
  line-height: 1.12;
}

.cookie-consent__text {
  margin: 0;
  color: var(--cc-ink-soft);
  font-size: 14px;
  line-height: 1.55;
}

.cookie-consent__text a {
  color: var(--cc-olive-dark);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-consent__actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.cookie-consent__button,
.cookie-preferences__button {
  min-height: 46px;
  padding: 10px 16px;
  border: 1px solid var(--cc-olive-dark);
  border-radius: 999px;
  background: transparent;
  color: var(--cc-olive-deep);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, color .2s ease, box-shadow .2s ease;
}

.cookie-consent__button:hover,
.cookie-preferences__button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(63, 71, 49, .12);
}

/* Aceptar y rechazar tienen exactamente el mismo peso visual. */
.cookie-consent__button--decision {
  background: var(--cc-olive-dark);
  color: var(--cc-white);
}
.cookie-consent__button--decision:hover { background: var(--cc-olive-deep); }
.cookie-consent__button--settings { background: var(--cc-white); }

.cookie-preferences {
  position: fixed;
  inset: 0;
  z-index: 12010;
  display: grid;
  place-items: center;
  padding: 20px;
}

.cookie-preferences__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(32, 23, 19, .54);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.cookie-preferences__dialog {
  position: relative;
  z-index: 1;
  width: min(610px, 100%);
  max-height: min(720px, calc(100vh - 40px));
  overflow: auto;
  padding: 28px;
  border-radius: 28px;
  background: var(--cc-cream);
  color: var(--cc-ink);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .28);
}

.cookie-preferences__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(89, 96, 68, .18);
  border-radius: 50%;
  background: var(--cc-white);
  color: var(--cc-ink);
  font-size: 20px;
  cursor: pointer;
}

.cookie-preferences__eyebrow {
  display: block;
  margin-bottom: 10px;
  color: var(--cc-olive-dark);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.cookie-preferences__dialog h2 {
  margin: 0 48px 12px 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 34px;
  font-weight: 500;
  line-height: 1.08;
}

.cookie-preferences__intro {
  margin: 0 0 24px;
  color: var(--cc-ink-soft);
  font-size: 14px;
  line-height: 1.6;
}

.cookie-preferences__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 20px 0;
  border-top: 1px solid rgba(89, 96, 68, .16);
}

.cookie-preferences__item strong { display: block; margin-bottom: 5px; }
.cookie-preferences__item p { margin: 0; color: var(--cc-ink-soft); font-size: 13px; line-height: 1.5; }
.cookie-preferences__required { color: var(--cc-olive-dark); font-size: 12px; font-weight: 800; }

.cookie-switch {
  position: relative;
  width: 52px;
  height: 30px;
  flex: 0 0 auto;
}
.cookie-switch input { position: absolute; opacity: 0; pointer-events: none; }
.cookie-switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #c9c8c2;
  cursor: pointer;
  transition: background .2s ease;
}
.cookie-switch span::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 7px rgba(0,0,0,.18);
  transition: transform .2s ease;
}
.cookie-switch input:checked + span { background: var(--cc-olive-dark); }
.cookie-switch input:checked + span::after { transform: translateX(22px); }
.cookie-switch input:focus-visible + span { outline: 3px solid rgba(142,151,105,.32); outline-offset: 3px; }

.cookie-preferences__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}
.cookie-preferences__button--primary { background: var(--cc-olive-dark); color: white; }
.cookie-preferences__button--primary:hover { background: var(--cc-olive-deep); }

.cookie-settings-link {
  appearance: none;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.cookie-settings-link:hover { color: var(--cc-olive-dark, #596044); }

.contact-map__embed { position: relative; min-height: 210px; background: #ece6da; }
.contact-map__embed iframe { min-height: 210px; }
.cookie-map-placeholder[hidden] { display: none !important; }

.cookie-map-placeholder {
  min-height: 210px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px;
  background: linear-gradient(145deg, rgba(217,220,201,.9), rgba(247,244,237,.98));
  color: #201713;
  text-align: center;
}
.cookie-map-placeholder__inner { max-width: 440px; }
.cookie-map-placeholder strong {
  display: block;
  margin-bottom: 7px;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 23px;
  font-weight: 500;
}
.cookie-map-placeholder p { margin: 0 0 14px; color: #655d57; font-size: 13px; line-height: 1.5; }
.cookie-map-placeholder button {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid #596044;
  border-radius: 999px;
  background: #596044;
  color: white;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

@media (max-width: 620px) {
  .cookie-consent {
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    left: 12px;
    width: auto;
    padding: 18px;
    border-radius: 20px;
  }
  .cookie-consent__title { font-size: 22px; }
  .cookie-consent__actions { grid-template-columns: 1fr; }
  .cookie-consent__button { min-height: 44px; }
  .cookie-preferences { padding: 12px; }
  .cookie-preferences__dialog { padding: 23px 18px; border-radius: 22px; }
  .cookie-preferences__dialog h2 { font-size: 29px; }
  .cookie-preferences__item { gap: 12px; }
  .cookie-preferences__actions { grid-template-columns: 1fr; }
  .contact-map__embed,
  .contact-map__embed iframe,
  .cookie-map-placeholder { min-height: 230px; }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-consent__button,
  .cookie-preferences__button,
  .cookie-switch span,
  .cookie-switch span::after { transition: none; }
}
