/**
 * 2025 - 2026 Hispatek Internet S.L.
 *
 * Banner y panel de consentimiento de cookies (views/templates/hook/cookie_consent.tpl).
 * "Aceptar" y "Rechazar" comparten estilo a propósito: la guía de la AEPD exige que ninguna
 * de las dos opciones se destaque sobre la otra.
 */
.picoya-cookies [hidden] { display: none !important; }

.picoya-cookies__banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10500;
  background: #fff;
  color: #1d2b28;
  border-top: 3px solid #009589;
  box-shadow: 0 -4px 18px rgba(0, 0, 0, .15);
  font-size: .9rem;
}
.picoya-cookies__banner-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px 32px;
}
.picoya-cookies__text { flex: 1 1 auto; }
.picoya-cookies__title { font-weight: 700; font-size: 1rem; margin: 0 0 4px; color: #1d2b28; }
.picoya-cookies__desc { margin: 0; line-height: 1.45; }
.picoya-cookies__desc a { color: #00756c; text-decoration: underline; white-space: nowrap; }
.picoya-cookies__actions { flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.picoya-cookies__btn {
  appearance: none;
  border: 2px solid #009589;
  background: #009589;
  color: #fff;
  border-radius: 4px;
  padding: 8px 18px;
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  min-width: 120px;
}
.picoya-cookies__btn:hover,
.picoya-cookies__btn:focus-visible { background: #00756c; border-color: #00756c; }
.picoya-cookies__btn:focus-visible,
.picoya-cookies__close:focus-visible,
.picoya-cookies__reopen:focus-visible { outline: 3px solid #1d2b28; outline-offset: 2px; }
.picoya-cookies__btn--link {
  background: transparent;
  color: #00756c;
  border-color: transparent;
  text-decoration: underline;
  min-width: 0;
}
.picoya-cookies__btn--link:hover,
.picoya-cookies__btn--link:focus-visible { background: #e6f4f3; border-color: transparent; }

/* ---- Panel de configuración ---- */
.picoya-cookies__overlay {
  position: fixed;
  inset: 0;
  z-index: 10600;
  background: rgba(0, 0, 0, .5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.picoya-cookies__modal {
  background: #fff;
  color: #1d2b28;
  border-radius: 6px;
  width: 100%;
  max-width: 620px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .3);
  font-size: .9rem;
  outline: none;
}
.picoya-cookies__modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e3e6e5;
}
.picoya-cookies__modal-head .picoya-cookies__title { margin: 0; font-size: 1.15rem; }
.picoya-cookies__close {
  appearance: none;
  border: 0;
  background: transparent;
  font-size: 1.8rem;
  line-height: 1;
  color: #6c757d;
  cursor: pointer;
  padding: 0 4px;
}
.picoya-cookies__modal-body { padding: 16px 20px; overflow-y: auto; }
.picoya-cookies__modal-body > .picoya-cookies__desc { margin-bottom: 12px; }
.picoya-cookies__modal-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid #e3e6e5;
}

.picoya-cookies__cat { border: 1px solid #e3e6e5; border-radius: 4px; padding: 12px 14px; margin-top: 10px; }
.picoya-cookies__cat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.picoya-cookies__cat-name { font-weight: 700; margin: 0; cursor: pointer; }
.picoya-cookies__cat-desc { margin: 6px 0 0; color: #4b5552; line-height: 1.4; }
.picoya-cookies__always { font-size: .8rem; font-weight: 600; color: #00756c; white-space: nowrap; }

/* Interruptor */
.picoya-cookies__switch { position: relative; display: inline-block; width: 44px; height: 24px; flex: 0 0 auto; }
.picoya-cookies__switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.picoya-cookies__slider { position: absolute; inset: 0; background: #adb5bd; border-radius: 24px; transition: background .15s; }
.picoya-cookies__slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .15s;
}
.picoya-cookies__switch input:checked + .picoya-cookies__slider { background: #009589; }
.picoya-cookies__switch input:checked + .picoya-cookies__slider::before { transform: translateX(20px); }
.picoya-cookies__switch input:focus-visible + .picoya-cookies__slider { outline: 3px solid #1d2b28; outline-offset: 2px; }

/* Botón flotante para cambiar la decisión (retirar el consentimiento debe ser tan fácil como darlo) */
.picoya-cookies__reopen {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 10400;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: #009589;
  color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: .85;
}
.picoya-cookies__reopen:hover { opacity: 1; }

body.picoya-cookies-modal-open { overflow: hidden; }

@media (max-width: 767.98px) {
  .picoya-cookies__banner-inner { flex-direction: column; align-items: stretch; padding: 14px 16px; }
  .picoya-cookies__actions { justify-content: stretch; }
  .picoya-cookies__actions .picoya-cookies__btn { flex: 1 1 0; min-width: 0; padding: 8px 10px; }
  .picoya-cookies__actions .picoya-cookies__btn--link { flex-basis: 100%; order: 3; }
  .picoya-cookies__modal-foot .picoya-cookies__btn { flex: 1 1 100%; }
}
