/* Estilos Generales */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Arial', sans-serif;
  background: linear-gradient(to bottom, #0d1b2a, #1b263b); /* Azul marino degradado */
  color: white;
  overflow-x: hidden; /* Evita el fondo blanco al mover la página */
}

/* Header */
.header {
  display: flex;
  align-items: center;
  padding: 10px 20px;
  background: #162447; /* Azul más profundo */
  color: white;
}

.logo {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 50%;
  margin-right: 15px;
}

/* Portada */
.portada {
  width: 100%;
  text-align: center;
  overflow: hidden;
}

.portada-imagen {
  width: 100%;
  height: auto;
  max-height: 425px; 
  object-fit: cover;
  border-bottom: 5px solid #1f4068;
  animation: fadeIn 2s ease-in-out; 
}


/* Menú */
.menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: 20px 0;
  gap: 10px;
}

.menu-btn {
  background-color: #1f4068;
  color: white;
  border: none;
  margin: 10px;
  padding: 15px 30px;
  font-size: 18px;
  cursor: pointer;
  border-radius: 30px;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.menu-btn:hover {
  background-color: #3a0ca3;
  transform: scale(1.1);
}

/* Responsive Menú */
@media (max-width: 768px) {
  .menu {
      flex-direction: column;
      align-items: center;
  }
}

/* Contenido de Secciones */
main {
  padding: 20px;
}

.contenido {
  display: none;
  color: white;
}

/* Formulario */
.formulario {
  max-width: 600px;
  margin: 30px auto;
  background: #1b263b;
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0px 4px 10px rgba(0,0,0,0.5);
}

.formulario form {
  display: flex;
  flex-direction: column;
}

.formulario label {
  margin-top: 10px;
  margin-bottom: 5px;
  font-weight: bold;
  color: #ffffff;
}

.formulario input, 
.formulario select, 
.formulario textarea {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  margin-bottom: 15px;
  background: #e0e0e0;
  color: #000;
}

/* Botón de formulario */
.formulario button {
  background-color: #3a0ca3;
  color: white;
  border: none;
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 18px;
  transition: background-color 0.3s ease;
}

.formulario button:hover {
  background-color: #7209b7;
}


/* Estilos para ofertas */
.contenedor-ofertas {
  display: flex; /* CAMBIO: de grid a flex para listado vertical */
  flex-direction: column;
  align-items: center;
  gap: 30px;
  margin-top: 20px;
}


.oferta-card {
  background: white;
  color: black;
  border-radius: 15px;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
  padding: 20px;
  text-align: center; /* Centra el texto */
  display: flex;
  flex-direction: column;
  align-items: center; /* Centra todo el contenido horizontalmente */
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.imagen-contenedor {
  width: 100%;
  max-width: 400px; /* Limita el tamaño máximo */
  height: 250px;
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.img-oferta {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}


.oferta-card:hover {
  transform: scale(1.05);
  box-shadow: 0px 6px 15px rgba(0, 0, 0, 0.4);
}

/* Búsqueda */
.busqueda {
  width: 100%;
  padding: 12px;
  margin-bottom: 20px;
  border-radius: 10px;
  border: 1px solid #ccc;
  background: #e0e0e0;
  color: #000;
}

@keyframes fadeIn {
  0% {
      opacity: 0;
  }
  100% {
      opacity: 1;
  }
}


/* Estilo especial para el formulario de Login */
.login {
  max-width: 400px;
  margin: 80px auto;
  background: linear-gradient(to bottom, #1b263b, #162447);
  padding: 40px;
  border-radius: 20px;
  box-shadow: 0px 8px 20px rgba(0, 0, 0, 0.6);
  text-align: center;
  animation: fadeIn 1.5s ease;
}

.login h2 {
  margin-bottom: 20px;
  font-size: 26px;
}

.login label {
  display: block;
  margin-top: 10px;
  margin-bottom: 5px;
  font-weight: bold;
  font-size: 14px;
  color: #ffffff;
}

.login input {
  width: 100%;
  padding: 12px;
  margin-bottom: 20px;
  border-radius: 10px;
  border: none;
  background: #e0e0e0;
  color: #000;
  font-size: 16px;
}

.login button {
  width: 100%;
  padding: 12px;
  border: none;
  background-color: #7209b7;
  color: white;
  border-radius: 12px;
  font-size: 18px;
  transition: background-color 0.3s ease;
}

.login button:hover {
  background-color: #560bad;
}

/* Panel de administración */
.container-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header h1 {
  font-size: 28px;
}

/* Estilos para el main de administración */
.main-admin {
  padding: 40px 20px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: calc(100vh - 80px); /* para ocupar casi toda la pantalla menos el header */
}

/* Tarjeta del formulario */
.admin-card {
  background: #1b263b;
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0px 4px 15px rgba(0,0,0,0.5);
  width: 100%;
  max-width: 700px;
  animation: fadeIn 1.5s ease;
}

.admin-card h2 {
  margin-bottom: 20px;
  font-size: 24px;
  text-align: center;
}

.alerta {
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 20px;
  text-align: center;
  font-weight: bold;
  animation: fadeIn 1s ease;
}

.alerta-exito {
  background-color: #4caf50;
  color: white;
}

.alerta-error {
  background-color: #f44336;
  color: white;
}

.footer {
  background-color: #004080;
  color: white;
  text-align: center;
  padding: 20px 10px;
  margin-top: 40px;
  font-family: 'Arial', sans-serif;
}

.footer-contenido {
  max-width: 800px;
  margin: 0 auto;
}

.by-cavna {
  font-family: 'Lucida Handwriting', cursive; /* Puedes ajustar según tu logo */
  font-size: 1.5em;
  margin-bottom: 10px;
}

.footer a {
  color: #ffcc00;
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

.terminos {
  font-size: 0.9em;
}

/* Modal */
.modal {
  display: none; /* Oculto por defecto */
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.6);
}

.modal-contenido {
  background-color: #fefefe;
  margin: 10% auto;
  padding: 20px;
  border-radius: 10px;
  width: 80%;
  max-width: 500px;
  font-family: Arial, sans-serif;
  color: #333;
  box-shadow: 0px 5px 15px rgba(0,0,0,0.3);
}

.cerrar {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.cerrar:hover,
.cerrar:focus {
  color: black;
  text-decoration: none;
}

/* Estilos para contacto y privacidad */
.contacto-info,
.politica-privacidad {
background-color: #483D8B;
border: 1px solid #483D8B;
border-radius: 10px;
padding: 20px;
margin: 20px; 
}

.contacto-info a {
color: #007acc;
text-decoration: none;
}

.contacto-info a:hover {
text-decoration: underline;
}

.politica-privacidad p {
line-height: 1.6;
}


/* Adaptaciones para tablets */
@media (max-width: 1024px) {
  .header h1 {
    font-size: 22px;
  }

  .formulario,
  .admin-card,
  .login {
    padding: 20px;
  }

  .menu-btn {
    font-size: 16px;
    padding: 12px 25px;
  }

  .oferta-card {
    width: 90%;
  }

  .modal-contenido {
    width: 90%;
  }
}

/* Adaptaciones para móviles */
@media (max-width: 600px) {
  .header {
    flex-direction: column;
    text-align: center;
    padding: 10px;
  }

  .logo {
    margin-bottom: 10px;
  }

  .menu {
    flex-direction: column;
    gap: 15px;
  }

  .menu-btn {
    width: 90%;
    padding: 12px;
    font-size: 16px;
  }

  .formulario,
  .admin-card,
  .login {
    margin: 20px 10px;
    padding: 15px;
  }

  .imagen-contenedor {
    height: 200px;
  }

  .footer {
    padding: 15px 5px;
    font-size: 14px;
  }

  .by-cavna {
    font-size: 1.2em;
  }

  .modal-contenido {
    margin: 20% auto;
    width: 95%;
  }
}

@media (max-width: 600px) {
  .imagen-contenedor {
    max-width: 90%;       /* Reduce el ancho en móviles */
    height: auto;         /* Altura automática para mantener proporciones */
  }

  .img-oferta {
    height: auto;         /* También que la imagen se escale proporcionalmente */
    max-height: 200px;    /* Limita la altura máxima */
  }

  .oferta-card {
    padding: 15px;
  }
}

@media (max-width: 600px) {
  .imagen-contenedor {
    width: 90% !important;
    max-width: 90% !important;
    height: auto !important;
  }

  .img-oferta {
    width: 100% !important;
    height: auto !important;
    max-height: 180px !important;
    object-fit: cover;
  }

  .oferta-card {
    padding: 10px !important;
  }
}

.anuncio {
  width: 80%;
  max-width: 600px;
  margin: 20px auto;
  padding: 30px;
  background-color: white;
  color: black;
  text-align: center;
  font-size: 24px;
  border-radius: 10px;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
}
