/* cookies.css - Estilos unificados para banner y modales de cookies */

/* === Banner de cookies === */
.cookies-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--rosa-muy-claro, #f8d8f0);
  color: var(--morado, #78278b);
  padding: 1.5em 1em;
  box-shadow: 0 -4px 24px rgba(120, 39, 139, 0.15);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-top: 3px solid var(--morado, #78278b);

  &__acciones {
    display: flex;
    gap: 1.5em;
  }

  @media (max-width: 600px) {
    &__acciones {
      flex-direction: column;
      width: 100%;
      gap: 0.7em;
    }

    .btn-cookies {
      width: 100%;
      margin: 0;
    }
  }
}

/* === Modales de cookies (configuración y técnicas) === */
.cookies-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(60, 16, 80, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;

  &[hidden] {
    display: none;
  }

  &__contenido {
    background: var(--blanco);
    color: var(--morado);
    border-radius: var(--borde-radio-grande);
    border-top: 3px solid var(--morado, #78278b);
    border-bottom: 3px solid var(--morado, #78278b);
    box-shadow: 0 6px 32px rgba(120, 39, 139, 0.18);
    padding: 2.2rem 2.5rem 1.5rem 2.5rem;
    max-width: 95vw;
    margin: 0 auto;
    outline: none;
    overflow-x: auto;

    .tabla-cookies,
    table {
      width: 100%;
      max-width: 100%;
      margin-bottom: 1.5em;
      border-radius: var(--borde-radio-peq);
      box-shadow: none;
      background: var(--blanco);
      color: var(--morado);
      word-break: break-word;
      display: block;
      overflow-x: auto;

      th,
      td {
        padding: 0.6em 0.7em;
        border-bottom: 1px solid #e0c6e6;
      }

      th {
        background: var(--rosa-muy-claro);
        font-weight: 600;
      }

      tr:last-child td {
        border-bottom: none;
      }
    }
  }

  &__opcion {
    margin-bottom: 1.2em;
    display: flex;
    align-items: center;
    gap: 0.7em;
    text-align: left;

    input[type="checkbox"] {
      accent-color: var(--morado);
      width: 1.3em;
      height: 1.3em;
      margin: 0;
      vertical-align: middle;
      box-shadow: 0 0 0 2px var(--morado) inset;

      &:checked {
        accent-color: var(--rosa);
        box-shadow: 0 0 0 2px var(--rosa) inset;
      }
    }

    label {
      font-weight: 500;
      line-height: 1.5;
      text-align: left;
    }
  }

  &__acciones {
    display: flex;
    gap: 1.2em;
    justify-content: flex-end;
    margin-top: 1.5em;
  }

  #cookies-modal-titulo {
    margin-top: 0;
    margin-bottom: 1.2em;
  }

  @media (max-width: 700px) {
    &__contenido {
      width: 100vw;
      max-width: 100vw;
      padding-left: 4vw;
      padding-right: 4vw;
      box-sizing: border-box;
      margin: 0;

      table {
        display: block;
        width: 100%;
        border: 0;
        background: none;
        box-shadow: none;
        margin-bottom: 1.5em;
      }

      thead {
        display: none;
      }

      tbody,
      tr {
        display: block;
        width: 100%;
      }

      td {
        display: block;
        width: 100%;
        border: none;
        padding: 0.5em 0.7em;
        background: var(--blanco);

        &:before {
          content: attr(data-label) ": ";
          font-weight: 600;
          color: var(--morado, #78278b);
          display: inline-block;
          min-width: 90px;
        }
      }

      tr {
        margin-bottom: 1.2em;
        border-radius: var(--borde-radio-grande);
        box-shadow: 0 2px 10px rgba(120, 39, 139, 0.08);
        background: var(--rosa-muy-claro, #f8d8f0);
        padding: 0.5em 0.5em 0.3em 0.5em;
      }

      td:last-child {
        margin-bottom: 0.2em;
      }
    }
  }
}

.notificacion-cookies {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #22c55e;
  color: white;
  padding: 12px 20px;
  border-radius: var(--borde-radio-grande);
  z-index: 9999;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-size: var(--h1-size);
}