/* Importar Font Awesome */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');
/* Tipografía moderna: Inter */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* Variables de color */
:root {
    --primary-color: #1877f2;
    --primary-dark: #166fe5;
    --secondary-color: #42b72a;
    --text-color: #1c1e21;
    --text-secondary: #65676b;
    --background-color: #f0f2f5;
    --surface-color: #ffffff;
    --border-color: #dddfe2;
    --hover-color: rgba(0, 0, 0, 0.05);
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Modo oscuro */
[data-theme="dark"] {
    --text-color: #e4e6eb;
    --text-secondary: #b0b3b8;
    --background-color: #18191a;
    --surface-color: #242526;
    --border-color: #3e4042;
    --hover-color: rgba(255, 255, 255, 0.1);
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.navbar {
    background: var(--surface-color);
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    padding: 0 20px;
    margin: 0 auto;
}

.navbar-logo {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
    margin-right: 20px;
    display: inline-flex;
    align-items: center;
}

.navbar-logo-img {
    height: 48px;
    width: auto;
    display: block;
}

.navbar-search {
    flex: 1;
    max-width: 500px;
    margin: 0 20px;
}

.navbar-search form {
    display: flex;
    width: 100%;
}

.navbar-search input[type="text"] {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 20px 0 0 20px;
    background: var(--background-color);
    color: var(--text-color);
    outline: none;
}

.navbar-search button {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0 20px 20px 0;
    padding: 0 15px;
    cursor: pointer;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    margin: 0 10px;
}

.nav-links {
    color: var(--text-color);
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.nav-links:hover {
    background-color: var(--hover-color);
}

.nav-icons {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-user-dropdown {
    position: relative;
    display: inline-block;
}

.nav-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid var(--primary-color);
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: var(--surface-color);
    min-width: 200px;
    border-radius: 8px;
    z-index: 1001;
    overflow: hidden;
}

.dropdown-content.show {
    display: block !important;
}

.dropdown-content a {
    color: var(--text-color);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: background-color 0.3s;
}

.dropdown-content a:hover {
    background-color: var(--hover-color);
}

.dropdown-header {
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.dropdown-header span {
    font-weight: 600;
    color: var(--text-color);
}

.dropdown-content hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 5px 0;
}

.nav-user-dropdown:hover .dropdown-content {
    display: none !important;
}

/* Override: keep dropdown visible when it's toggled open via class .show */
.nav-user-dropdown:hover .dropdown-content.show {
    display: block !important;
}

.mobile-menu-icon {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-color);
    z-index: 1001;
}

@media screen and (max-width: 960px) {
    .mobile-menu-icon {
        display: block;
        position: absolute;
        top: 0;
        right: 20px;
        transform: translate(-100%, 60%);
        font-size: 1.8rem;
        cursor: pointer;
    }

    .nav-menu {
        display: flex;
        flex-direction: column;
        width: 100%;
        height: 100vh;
        position: absolute;
        top: 80px;
        left: -100%;
        opacity: 1;
        transition: all 0.5s ease;
        background: var(--surface-color);
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        padding: 20px 0;
        margin: 0;
    }

    .nav-menu.active {
        left: 0;
        opacity: 1;
        transition: all 0.5s ease;
        z-index: 1000;
    }

    .nav-item {
        width: 100%;
        margin: 0;
        text-align: center;
        padding: 15px 0;
    }

    .nav-links {
        text-align: center;
        padding: 15px 0;
        width: 100%;
        display: table;
    }

    .nav-links:hover {
        background-color: var(--hover-color);
        border-radius: 0;
    }
}

.nav-icon-link {
    color: var(--text-color);
    font-size: 1.6rem;
    text-decoration: none;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.nav-icon-link:hover {
    background-color: var(--hover-color);
    color: var(--primary-color);
}

.cart-item-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
}

.nav-icons {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Navbar responsive global para todas las interfaces */
@media (max-width: 563px) {
  .navbar {
    height: 64px !important;
  }
  .navbar-container {
    padding: 0 12px !important;
    max-width: 100% !important;
  }
  .navbar-logo {
    font-size: 1.2rem !important;
    margin-right: 10px !important;
  }
  .navbar-logo-img {
    height: 30px !important; /* más pequeña en pantallas pequeñas */
  }
  .navbar-search {
    max-width: 300px !important;
    margin: 0 10px !important;
  }
  .navbar-search input[type="text"] {
    padding: 6px 10px !important;
    font-size: 0.9rem !important;
  }
  .navbar-search button {
    padding: 0 10px !important;
  }
  .nav-links {
    padding: 8px 10px !important;
    font-size: 0.9rem !important;
  }
  .nav-icon-link {
    width: 36px !important;
    height: 36px !important;
    font-size: 1.2rem !important;
  }
  .nav-user-avatar {
    width: 32px !important;
    height: 32px !important;
    border-width: 1px !important;
  }
  .cart-item-count {
    top: -5px !important;
    right: -5px !important;
    width: 20px !important;
    height: 20px !important;
  }
}

.fas, .far, .fab {
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
    font-size: 1.05em;
}

/*Estilos de la pagina del login*/
*{
  font-family:'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Liberation Sans', sans-serif;
}

body{
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--background-color);
  color: var(--text-color);
}

/* Fondo para páginas pre-login (index/registro/recuperar/código/cambiar) */
body.prelogin {
  background-color: #0f172a; /* un poco más oscuro para resaltar el logo */
  background-image: url('../img/prelogin_bg.svg');
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
  color: #e5e7eb;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* El contenedor principal ocupa el espacio disponible para empujar el footer al fondo */
body.prelogin > .container {
  flex: 1 0 auto;
}

/* SweetAlert: estilos globales (claro/oscuro) */
.swal-modal { background: var(--surface-color); color: var(--text-color); }
.swal-title, .swal-text { color: var(--text-color); }
.swal-content__input, .swal-content__textarea { background: #fff; color: #1f2937; border: 1px solid #cbd5e1; }
.swal-button { background: linear-gradient(135deg, #4f46e5, #0ea5e9) !important; color: #fff !important; box-shadow: none !important; }
.swal-button:hover { filter: brightness(1.05); }
.swal-button--cancel { background: #e5e7eb !important; color: #1f2937 !important; }
.swal-button--danger { background: linear-gradient(135deg, #ef4444, #b91c1c) !important; color: #fff !important; }
.swal-overlay { background-color: rgba(0,0,0,.5) !important; }
.swal-footer { background: transparent !important; }
/* Quitar pseudo-elementos en componentes de SweetAlert */
.swal-modal::before, .swal-modal::after,
.swal-title::before, .swal-title::after,
.swal-text::before, .swal-text::after,
.swal-content::before, .swal-content::after,
.swal-button::before, .swal-button::after { content: none !important; display: none !important; }

/* Íconos de estado */
.swal-icon--success { border-color: #22c55e !important; }
.swal-icon--success__line { background-color: #22c55e !important; }
.swal-icon--success__ring { border: 4px solid rgba(34,197,94,.35) !important; }
.swal-icon--success__hide-corners { display: none !important; width: 0 !important; height: 0 !important; }
.swal-icon--success::before, .swal-icon--success::after { content: none !important; display: none !important; }
.swal-icon--warning { border-color: #f59e0b !important; }
.swal-icon--warning__body, .swal-icon--warning__dot { background-color: #f59e0b !important; }
.swal-icon--error { border-color: #ef4444 !important; }
.swal-icon--error__line { background-color: #ef4444 !important; }


.container{
  margin: auto;
  padding: 0;
  display: flex;
  justify-content:space-between;
  align-items: center;
}



.welcome{
  width: 500px;
  margin: 0%;
  margin-right: 50px;
}

.welcome h6{
  font-size: 50px;
  color: #1877f2;
  margin: 0;
}

.welcome p{
  color: #42b72a;
  font-size: 30px;
  font-weight: 500;
}

/* Marca como imagen en la portada (index.php) */
.welcome .brand-logo{
  width: 500px;
  height: 70px;
  max-width: 100%;
  object-fit: contain;
  display: block;
}

.login-box-1 {
  background: #0f172a;
  color: #e5e7eb;
  width: 450px;
  height: fit-content;
  border-radius: 3%;
  padding: 50px 30px;
  margin: 10px;
  box-shadow: 0 1px 5px rgba(0,0,0,0.20);
}

.login-box-1 h1 {
  margin: 0;
  padding: 0 0 20px;
  text-align: center;
  font-size: 30px;
  color: #1877f2;
}

.login-box-1 input {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 15px;
  border-radius: 3px;
  outline: none;
  transition: .1s;
}

.login-box-1 input:focus{
  border-color: #1877f2;
  box-shadow: 0 0 0 0.1rem #1877f2;
}


.login-box-1 input[type="text"], .login-box-1 input[type="password"]{
  padding-left: 10px;
  height: 40px;
  font-size: 15px;
  border: 1px solid #1f2937;
  background: #111827;
  color: #e5e7eb;
}

.login-box-1 input[type="submit"] {
  border: #1877f2;
  outline: none;
  height: 40px;
  background: #1877f2;
  color: #ffffff;
  font-size: 20px;
  border-radius: 3px;
  transition: 0.3s;
}

.login-box-1 input[type="submit"]:hover {
  cursor: pointer;
  background: #42b72a;
  color: #ffffff;
}

.login-box-1 a {
  text-decoration: none;
  font-size: 15px;
  line-height: 20px;
  color: #1877f2;
  transition: 0.3s;
}

.login-box-1 a:hover {
  color: #42b72a;
  text-decoration: none;
}

.login-box-2 {
  background: #0f172a;
  color: #e5e7eb;
  width: 450px;
  height: fit-content;
  border-radius: 3%;
  padding: 50px 30px;
  margin: 10px;
  box-shadow: 0 1px 5px rgba(0,0,0,0.20);
}

.login-box-2 h1 {
  margin: 0;
  padding: 0 0 20px;
  text-align: center;
  font-size: 30px;
  color: #1877f2;
}

.login-box-2 input {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 15px;
  border-radius: 3px;
  outline: none;
  transition: .1s;
}

.login-box-2 input[type="text"], .login-box-2 input[type="password"], .login-box-2 input[type="email"]{
  padding-left: 10px;
  height: 40px;
  font-size: 15px;
  border: 1px solid #1f2937;
  background: #111827;
  color: #e5e7eb;
}

.login-box-2 input[type="text"]:focus, .login-box-2 input[type="password"]:focus, .login-box-2 input[type="email"]:focus{
  border-color: #1877f2;
  box-shadow: 0 0 0 0.1rem #1877f2;
}

.login-box-2 input[type="checkbox"] {
  appearance: none;
  width: 15px;
  height: 15px;
  border: 1px solid #1877f2;
  position: relative;
  cursor: pointer;
}

.login-box-2 input[type="checkbox"]:checked {
  background-color: #42b72a;
  border: 1px solid #42b72a;
}

.terminos{
  display: flex;
  justify-content: left;
}

.terminos label{
  margin-left: 5px;
  margin-top: 2px;
}

/* Filtros desplegables */
  .filters-toggle {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
  margin-top: 3px;
  margin-bottom: 5px;
  background: #1877f2;
  color: #ffffff;
  font-size: 20px;
  border-radius: 3px;
  transition: 0.3s;
}

/* Botón enviar (registrarse) con mismo estilo que login y enviar código */
.login-box-2 input[type="submit"] {
  border: #1877f2;
  outline: none;
  height: 40px;
  background: #1877f2;
  color: #ffffff;
  font-size: 20px;
  border-radius: 3px;
  transition: 0.3s;
}

.login-box-2 input[type="submit"]:hover {
  cursor: pointer;
  background: #42b72a;
  color: #ffffff;
}

.login-box-2 a {
  text-decoration: none;
  font-size: 15px;
  line-height: 20px;
  color: #1877f2;
  transition: 0.3s;
}

.login-box-2 a:hover {
  color: #42b72a;
  text-decoration: none;
}

.login-box-3 {
  background: #0f172a;
  color: #e5e7eb;
  width: 450px;
  height: fit-content;
  border-radius: 3%;
  padding: 40px 30px;
  margin: 10px;
  box-shadow: 0 1px 5px rgba(0,0,0,0.20);
}

.login-box-3 h1 {
  margin: 0;
  padding: 0 0 20px;
  text-align: center;
  font-size: 30px;
  color: #1877f2;
}

.login-box-3 input {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 15px;
  border-radius: 3px;
  outline: none;
  transition: .1s;
}

.login-box-3 input:focus{
  border-color: #1877f2;
  box-shadow: 0 0 0 0.1rem #1877f2;
}


.login-box-3 input[type="email"], .login-box-3 input[type="number"]{
  padding-left: 10px;
  height: 40px;
  font-size: 15px;
  border: 1px solid #1f2937;
  background: #111827;
  color: #e5e7eb;
}

.login-box-3 input[type="submit"] {
  border: #1877f2;
  outline: none;
  height: 40px;
  background: #1877f2;
  color: #ffffff;
  font-size: 20px;
  border-radius: 3px;
  transition: 0.3s;
}

.login-box-3 input[type="submit"]:hover {
  cursor: pointer;
  background: #42b72a;
  color: #ffffff;
}

.login-box-3 a {
  text-decoration: none;
  font-size: 15px;
  line-height: 20px;
  color: #1877f2;
  transition: 0.3s;
}

.login-box-3 a:hover {
  color: #42b72a;
  text-decoration: none;
}

/* Placeholders más claros sobre campos oscuros */
.login-box-1 input::placeholder,
.login-box-2 input::placeholder,
.login-box-3 input::placeholder {
  color: #9aa4b2;
}

.hrefs{
  display: flex;
  justify-content: space-between;
}

footer, .footer{
  width: 100%;
  background-color: #0f4ab8;
  color: #fff;
  padding: 1em 0;
  text-align: center;
  font-size: medium;
  font-weight: 200;
}

footer p, .footer p{
  margin: 0;
}

#Autor{
  text-decoration: none;
  font-size: small;
  line-height: 10px;
  color:#42b72a;
  transition: 0.1s;
}

#Autor:hover{
  font-size: large;
}

@media only screen and (max-width: 1085px){
  .welcome{
    width: 70%;
    text-align: center;
    margin: 0;
  }

  .welcome h6{
    font-size: 35px;
  }
  
  .welcome p{
    font-size: 25px;
    font-weight: 500;
  }

  .container{
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .login-box-1 {
    width: 70%;
    margin-bottom: 50px;
  }
  
  .login-box-2 {
    width: 70%;
    margin-bottom: 50px;
  }
  
  .login-box-3 {
    width: 70%;
    margin-bottom: 50px;
  }
  
  .hrefs{
    display: flex;
    justify-content: space-between;
  }
  
  #Autor{
    text-decoration: none;
    font-size: small;
    line-height: 10px;
    color:#42b72a;
    transition: 0.1s;
  }
  
  #Autor:hover{
    font-size: medium;
  }
}

@media only screen and (max-height: 600px){
  .container{
    width: 100%;
  }

  .welcome {
    width: 95%;
    padding-bottom: 5px;
    margin-top: 5px;
  }
  
  .welcome h6{
    font-size: 15px;
  }
  
  .welcome p{
    font-size: 13px;
    margin: 5px;
  }

  .login-box-1 {
    width: 85%;
    padding: 10px;
  }
  
  .login-box-1 h1 {
    font-size: 15px;
  }
  
  .login-box-1 input {
    padding: 0;
    margin-bottom: 5px;
  }
  
  
  .login-box-1 input[type="text"], .login-box-1 input[type="password"]{
    padding-left: 5px;
    height: 20px;
    font-size: 10px;
  }
  
  .login-box-1 input[type="submit"] {
    height: 20px;
    font-size: 10px;
  }
  
  .login-box-1 a {
    font-size: 9px;
    line-height: 10px;
  }

  .login-box-2 {
    width: 85%;
    padding: 10px;
  }
  
  .login-box-2 h1 {
    padding: 0 0 10px;
    font-size: 15px;
  }
  
  .login-box-2 input {
    padding: 0;
    margin-bottom: 5px;
  }
  
  
  .login-box-2 input[type="text"], .login-box-2 input[type="password"], .login-box-2 input[type="email"]{
    padding-left: 5px;
    height: 20px;
    font-size: 10px;
  }
  
  .login-box-2 input[type="submit"] {
    height: 20px;
    font-size: 10px;
  }

  .terminos{
    font-size: 10px;
  }
  
  .terminos label{
    margin-left: 3px;
    margin-top: 4px;
  }
  
  .login-box-2 a {
    font-size: 9px;
    line-height: 10px;
  }

  .login-box-3 {
    width: 85%;
    padding: 10px;
  }
  
  .login-box-3 h1 {
    margin: 0;
    padding: 0 0 20px;
    text-align: center;
    font-size: 15px;
    color: #1877f2;
  }
  
  .login-box-3 input {
    padding: 0;
    margin-bottom: 5px;
  }
  
  
  .login-box-3 input[type="email"], .login-box-3 input[type="number"]{
    padding-left: 5px;
    height: 20px;
    font-size: 10px;
  }
  
  .login-box-3 input[type="submit"] {
    height: 20px;
    font-size: 10px;
  }
  
  .login-box-3 a {
    font-size: 9px;
    line-height: 10px;
  }

  footer{
    padding: 0.3em 0;
    font-size: smaller;
    font-weight: 100;
  }

}