@import url("fonts.css");
:root {
  --color-principal: #143da5;
  --color-texto: #333333;
  --bg-odd: #ffffff;
  --bg-even: #ededed;
  --padding-vertical: 60px;
  --padding-horizontal: 20px;
  --gap: 40px;
  --max-content-width: 1440px;
  --border-radius-img: 12px;
}

.header-modal {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  height: min-content;
}

.TitleCB {
  color: var(--color-principal);
  font-family: "Montserrat-Medium";
  font-size: 1.5rem;
  margin-bottom: 0rem;
  font-weight: 1400;
  margin-bottom: 10px;
}

.close {
  display: flex;
  position: relative;
  color: #aaa;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  align-items: center;
  justify-content: center;
  height: 30px;
}

.close:hover {
  color: #000;
  transform: rotate(90deg);
  text-decoration: none;
}

.LinkPP {
  color: var(--color-texto);
  cursor: pointer;
}

#cookieBanner {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: var(--bg-odd);
  padding: 15px 20px 15px;
  text-align: center;
  z-index: 9999;
  box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.15);
  max-width: 100%;
  box-sizing: border-box;
}

#cookieBanner p {
  position: relative;
  font-family: "Poppins-Regular", sans-serif;
  font-size: 1rem;
  color: var(--color-texto);
  max-width: 1200px;
  margin: auto;
  margin-bottom: 10px;
}

.ButtonsCB {
  position: relative;
  display: flex;
  gap: 10px;
  margin: 0;
  padding: 0;
  width: 100%;
  align-items: center;
  justify-content: center;
}

#acceptAllCookies {
  background: var(--color-principal);
}

#rejectAllCookiesBanner,
#customizeCookies {
  background: var(--color-texto);
}

#cookieBanner button {
  font-family: "Poppins-Regular";
  padding: 12px 20px;
  max-width: 80%;
  width: fit-content;
  color: #f9f9f9;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  cursor: pointer;
  transition: 0.3s;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#cookieBanner button:hover {
  font-family: "Poppins-Bold";
  transform: scale(1.1);
}

#cookieModal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 10000;
  justify-content: center;
  align-items: center;
}

.modal-content {
  position: relative;
  background-color: white;
  padding: 30px;
  border-radius: 12px;
  max-width: 800px;
  width: 90%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  font-family: "Poppins-Regular";
  font-size: 1.1rem;
  color: var(--color-texto);
}

.modal-content p {
  font-family: "Poppins-Regular";
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-texto);
  margin-bottom: 1rem;
}

/* Nuevos estilos para switches */
.cookie-setting {
  display: flex;
  flex-direction: column;
  padding: 15px;
  margin-bottom: 15px;
  border-radius: 12px;
  background-color: #f8f9fa;
  transition: all 0.3s ease;
  gap: 2px;
}

.cookie-setting:hover {
  background-color: #eef2f7;
  transform: translateY(-2px);
}

.switch-container {
  position: relative;
  display: inline-block;
  align-items: center;
  width: 56px;
  height: 28px;
}

.switch-container input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 30px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background: linear-gradient(135deg, var(--color-principal) 0%, #2575fc 100%);
}

input:checked + .slider:before {
  transform: translateX(26px);
}

input:disabled + .slider {
  background: #95a5a6;
  cursor: not-allowed;
}

input:disabled + .slider:before {
  background-color: #ecf0f1;
}

.cookie-text {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.cookie-title {
  font-weight: 600;
  font-size: 1.1rem;
  display: block;
  font-family: "Poppins-Regular";
  color: var(--color-texto);
}

.cookie-description {
  color: #666;
  font-family: "Poppins-Regular";
  font-size: 0.9rem;
  line-height: 1.6;
}

.modal-buttons {
  position: relative;
  display: flex;
  gap: 10px;
  margin: 0;
  padding: 0;
  width: 100%;
  align-items: center;
  justify-content: center;
  margin-top: 25px;
}

.modal-buttons button {
  font-family: "Poppins-Regular";
  padding: 12px 20px;
  max-width: 90%;
  width: fit-content;
  color: #f9f9f9;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  cursor: pointer;
  transition: 0.3s;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  gap: 10px;
}

#acceptAllCookiesModal {
  background-color: var(--color-principal);
}

#saveCookiePreferences,
#rejectAllCookiesModal {
  background-color: var(--color-texto);
}

.modal-buttons button:hover {
  font-family: "Poppins-Bold";
  transform: scale(1.05);
}

#reopenCookiePreferences {
  display: flex;
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: var(--color-principal);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  z-index: 9998;
  height: 60px;
  width: 60px;
  align-items: center;
  justify-content: center;
}

#reopenCookiePreferences svg {
  position: relative;
  height: 35px;
  width: 35px;
  transition: all 0.3s;
}

#reopenCookiePreferences:hover svg {
  transform: rotate(90deg);
}

#reopenCookiePreferences svg path {
  fill: #ffffff;
}

@media (max-width: 550px) {
  .TitleCB {
    font-size: 1.3rem;
    margin-bottom: 10px;
  }

  #cookieBanner {
    padding: 15px 10px;
  }

  #cookieBanner p {
    font-size: 0.9rem;
  }

  .ButtonsCB {
    gap: 10px;
    margin: auto;
    width: 100%;
  }

  #cookieBanner button {
    font-size: 0.7rem;
  }

  .switch-container {
    width: 50px;
    height: 28px;
  }

  .slider:before {
    height: 20px;
    width: 20px;
  }

  input:checked + .slider:before {
    transform: translateX(22px);
  }

  .modal-content p {
    font-size: 0.8rem;
  }

  .cookie-title {
    font-size: 1rem;
  }

  .cookie-description {
    font-size: 0.8rem;
  }

  #reopenCookiePreferences {
    height: 40px;
    width: 40px;
    left: 10px;
    bottom: 10px;
  }

  #reopenCookiePreferences svg {
    top: 1px;
    height: 32px;
    width: 32px;
    transition: all 0.3s;
  }

  #reopenCookiePreferences:hover svg {
    transform: rotate(90deg);
  }

  #reopenCookiePreferences svg path {
    fill: #ffffff;
  }

  .modal-buttons {
    position: relative;
    display: flex;
    margin: 0;
    width: 100%;
    align-items: center;
    justify-content: center;
    margin-top: 15px;
    padding: 0px 15px 15px;
    flex-direction: column;
    gap: 5px;
  }

  .modal-buttons button {
    font-family: "Poppins-Regular";
    font-size: 0.8rem;
    padding: 12px 20px;
    max-width: 95%;
    width: 90%;
  }

  #cookieModal {
    align-items: flex-end; /* Alinea el modal al fondo de la pantalla */
    overflow-y: scroll; /* Permite scroll si el modal es más alto */
    padding: 0;
    -webkit-overflow-scrolling: touch;
  }

  .modal-content {
    width: 100%;
    border-radius: 12px 12px 0 0;
    padding: 0px;
  }

  .modal-scroll {
    padding: 15px;
    align-items: flex-start;
    max-height: 55vh;
    overflow-y: auto;
  }

  #acceptAllCookiesModal {
    order: 1;
  }

  #rejectAllCookiesModal {
    order: 2;
  }

  #saveCookiePreferences {
    order: 3;
  }
}
