* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: 'Manrope', sans-serif;
    background-color: #fff;
}

#main-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  justify-content: center;
  pointer-events: none;
  transition: top 0.3s;
}

.nav-wrapper {
  background-color: #2D3B40;
  padding: 1rem 2rem;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  pointer-events: all;
  width: 100%; 
}

.nav-container {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 5rem;
}

.logo {
  color: #fff;
  font-size: 1.5rem;
  font-family: "Vidaloka", serif;
  font-style: normal;
  font-weight: 400;
  text-decoration: none;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1rem;
}

.nav-links a, .nav-links button {
  color: #fff;
  text-decoration: none;
}

.nav-links a:hover, .nav-links button:hover {
  color: #d1dbb9;
  transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.login-links {
  padding-left: 30px;
  font-weight: bold;
}

.menu-toggle {
  display: none;
  font-size: 1.8rem;
  color: #fff;
  cursor: pointer;
}

#products-dropdown {
  min-width: 160px;
  width: auto;
}

/*NAV RESPONSIVE*/

@media (max-width: 900px) {
    .nav-container {
        gap: 1rem;
    }

    .menu-toggle {
        display: block;
    }

    .nav-links {
        position: absolute;
        top: 100%; /* Ahora está ANCLADO al final del .nav-container */
        right: 0;   /* Anclado a la derecha */
        /* bottom: -220px; */ /* Ya no es necesario */
        /* left: 55%; */ /* Ya no es necesario */
        
        background-color: #2D3B40;
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
        border-radius: 10px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
        width: auto; 
        min-width: 180px;     
        max-width: 90vw;
        z-index: 1200;

        opacity: 0;
        transform: translateY(-10px); 
        pointer-events: none;
        transition: all 0.5s ease; 

        /* Aseguramos que se muestre como un flex container cuando está activo */
        display: flex; /* CAMBIO: lo mantenemos como flex y la clase active lo mostrará u ocultará */
        visibility: hidden; /* Oculto por defecto, solo visible con .active */
    }

    .nav-links.active {
        /* display: flex; */ /* Ya no es necesario aquí */
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
        visibility: visible; /* Hacemos visible cuando está activo */
    }

    .login-links {
      padding-left: 0;
    }
    
    /* TU CSS ORIGINAL PARA DROPDOWN DEL USUARIO */
    /* En stylesheets/styles.css, dentro de @media (max-width: 900px) */

    #user-dropdown {
      /* 1. Comportamiento básico (lo que ya teníamos) */
      position: static !important;
      width: 100% !important;
      box-shadow: none;
      background-color: transparent !important;
      
      /* 2. ESTILO "SEPARATED LINK" (Línea divisoria) */
      /* Esto crea la línea fina arriba del bloque */
      border-top: 1px solid rgba(220, 225, 209, 0.2); 
      
      /* 3. Espaciado para que la línea respire */
      margin-top: 10px;  /* Empuja la línea hacia abajo, separándola del nombre */
      padding-top: 10px; /* Empuja el botón hacia abajo, separándolo de la línea */
      display: none;
    }

    #user-dropdown:not(.hidden) {
      display: flex;
      flex-direction: column;
    }

    /* Aseguramos que el botón esté limpio y alineado */
    #user-dropdown button {
      width: 100%;
      text-align: left;
      padding: 0.5rem 0; /* Sin padding lateral para alinearse al texto de arriba */
      background-color: transparent;
      color: #fff;
      font-size: 1rem;
      border: none;
    }

    #user-dropdown button:hover {
        color: #B5174C; 
    }
    
    /* Ajuste para el ícono del botón */
    #user-dropdown button i {
        width: 20px;
        text-align: center;
        margin-right: 5px;
    }

    .nav-links .dropdown-menu {
      position: static; /* Anula el 'absolute' para que se quede dentro */
      width: auto;      /* Anula el 'w-48' */
      box-shadow: none; /* Quita la sombra */
      background-color: transparent; /* Quita el fondo */
      padding-left: 1rem; /* Lo indenta para mostrar que es un submenú */
      margin-top: 0.5rem; /* Le da espacio */
    }

    .nav-links #products-dropdown { /* CAMBIO: Asegurarnos de que es para el dropdown de productos */
      position: static; 
      width: auto;      /* IMPORTANTE: Ancho automático para que ocupe lo que necesite */
      max-width: none;  /* Por si acaso hay un max-width */
      box-shadow: none; 
      background-color: transparent; 
      padding-left: 0.5rem; /* Menos indentación para que quepa mejor */
      margin-top: 0.2rem;   /* Más pegado a "Productos" */
      
      /* Aseguramos que el texto no se rompa */
      white-space: nowrap; /* Esto es clave para que "Ver Productos" no se rompa */
      overflow: hidden;    /* Oculta cualquier cosa que se salga (no debería si es nowrap) */
      text-overflow: ellipsis; /* Añade puntos suspensivos si se corta, aunque con nowrap no debería */
    }

    /* Si "Ver Productos" sigue rompiéndose, puedes darle un padding diferente directamente al enlace */
    .nav-links #products-dropdown li a {
        padding-left: 0.5rem; /* Ajusta este padding si el de arriba no es suficiente */
    }

    /* Oculta la flechita en el menú móvil (opcional pero recomendado) */
    .nav-links li > a .fa-chevron-down {
      display: none;
    }


}

/*MAIN*/

.main {
  flex: 1;
  min-height: 100vh;
}

.banner {
  position: relative;
  background-size: cover;
  background-position: top;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 5%;
  color: #2D3B40;
}

.banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to right, rgba(255,255,255,0.15) 40%, rgba(255,255,255,0.9) 100%);
  z-index: 1;
}

.banner-content {
  position: relative;
  z-index: 2;
  text-align: left;
  max-width: 500px;
  text-shadow: 1px 1px 4px #f1e8d9;
}

.banner-content h1 {
  font-size: 4rem;
  margin-bottom: 0.5rem;
  font-family: "Vidaloka", serif;
  font-style: normal;
  font-weight: 400; 
}

.banner-content p {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  font-weight: 550;
  line-height: 1.5;
}

/*BANNER RESPONSIVE*/

/* Tablets (pantallas medianas) */
@media (max-width: 992px) {
  .banner {
    justify-content: center;
    text-align: center;
    padding: 0 2rem;
    background-position: center;
  }

  .banner-content {
    max-width: 80%;
  }

  .banner-content h1 {
    font-size: 4rem;
  }

  .banner-content p {
    font-size: 1.5rem;
  }
}

/* Móviles (pantallas pequeñas) */
@media (max-width: 600px) {
  .banner {
    height: 80vh;
    justify-content: center;
    align-items: center;
    padding: 0 1rem;
    background-position: center;
  }

  .banner::before {
    background: linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0) 0%,      
      rgba(255, 255, 255, 0.15) 25%,  
      rgba(255, 255, 255, 0.9) 100%   
    );
  }

  .banner-content {
    text-align: center;
    max-width: 90%;
  }

  .banner-content h1 {
    font-size: 2.5rem;
  }

  .banner-content p {
    font-size: 1.3rem;
  }
}

/*BOTON*/

.boton-mas {
  display: block;
  width: fit-content;
  margin: 50px auto 0;
  padding: 10px 20px;
  background-color: #2D3B40;
  color: #fff;
  text-decoration: none;
  border-radius: 90px;
  font-weight: bold;
  transition: background-color 0.2s ease;
  text-align: center;
}

.boton-mas:hover {
  background-color: #DCE1D1;
  color: #2D3B40;
  box-shadow: 0 3px 9px rgba(0,0,0,0.2);
}

/*ENSAYOS*/

/* Deshabilitar barra de scroll visualmente */
.no-scrollbar::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

.no-scrollbar {
    -ms-overflow-style: none !important;  /* IE and Edge */
    scrollbar-width: none !important;     /* Firefox */
    overflow: -moz-scrollbars-none;
}

/* Opcional: Asegurar que el contenedor del carrusel no corte las sombras de las tarjetas */
#essays-carousel {
    padding-top: 10px;
    padding-bottom: 20px;
    margin-bottom: -20px;
}

@media (max-width: 768px) {
  .md\:px-16 {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/*TEMAS*/

.temas {
  text-align: start;
  padding: 3rem 1rem;
  background: #fff;
  max-width: 1200px;
  margin: 0 auto;
}

.temas h2 {
  text-align: start;
  font-size: 2rem;
  margin-bottom: 2rem;
  color: #2D3B40;
  font-weight: 700;
}

.box-topics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  max-width: 900px;
  margin: 0 auto;
  margin-top: 3rem;
}

.topic {
  background: white;
  color: #2D3B40;
  padding: 0.8rem 1.5rem;
  border-radius: 12px;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 500;
  transition: all 0.25s ease;
  border: 1px solid #2D3B40;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.topic:hover {
  background: #2D3B40;
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.12);
}

/*TEMAS RESPONSIVE*/

@media (max-width: 768px) {
    .box-topics {
        grid-template-columns: repeat(2, 1fr); 
    }
}

@media (max-width: 480px) {
    .box-topics {
        grid-template-columns: 1fr; 
    }
}

/*VIDEOS*/

.videos-recientes {
  max-width: 1100px;
  margin: auto;
  padding: 20px;
}

.videos-recientes h2 {
  font-size: 1.6rem;
  margin-bottom: 20px;
  color: #2D3B40;
  font-weight: bold; /* Aseguramos negrita por si acaso */
}

/* --- Video Destacado --- */
.ultimo-video {
  display: flex;
  flex-direction: row;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 40px;
}

.ultimo-video iframe {
  width: 65%;
  border: none;
  min-height: 350px; /* Altura mínima para que no se vea aplastado */
}

.ultimo-video .info-card {
  padding: 20px;
  padding-top: 0;
  width: 35%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.ultimo-video .titulo-video {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.3;
  color: #2D3B40; /* Color base forzado por si Tailwind falla */
}

.ultimo-video .desc-video {
  font-size: 0.95rem;
  color: #444;
  margin-bottom: 20px;
  line-height: 1.6;
  user-select: text;
  flex-grow: 1;
}

/* --- Videos Anteriores (Grid) --- */
.videos-anteriores {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
}

.video-anterior {
  background: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 12px; /* Añadido para consistencia */
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.video-anterior iframe {
  width: 100%;
  aspect-ratio: 16/9;
  border: none;
}

.video-anterior .info-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px; /* Ajustado padding */
}

.video-anterior .titulo-video {
  font-size: 1.3rem;
  font-weight: bold;
  margin-bottom: 0;
  color: #2D3B40;
}

/* --- Comunes --- */
.info-link {
  text-decoration: none;
  display: block;
  color: inherit;
  user-select: none;
}

.info-link:hover {
  cursor: pointer;
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .ultimo-video {
        flex-direction: column;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    }

    .ultimo-video iframe,
    .ultimo-video .info-card {
        width: 100%;
    }

    .ultimo-video iframe {
        aspect-ratio: 16/9;
        min-height: auto;
    }

    .ultimo-video .info-card {
        padding: 20px;
    }

    .ultimo-video .titulo-video {
        font-size: 1.3rem;
        margin-bottom: 20px;
    }

    .videos-anteriores {
        grid-template-columns: 1fr;
    }
}

/*CONTACT ME*/

.contact-wrapper button {
  background-color: #2D3B40;
}

.contact-wrapper button:hover {
  background-color: #DCE1D1;
  color: #2D3B40;
}

/*ABOUT ME*/

.about-wrapper {
  margin-top: 3rem;
}