* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

body {
  background: #f4f6f9;
}

/* ================= HEADER ================= */

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 40px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  flex-wrap: wrap; /* ESSENCIAL pro mobile */
  gap: 15px;
}

/* LOGO */

.logo img {
  width: 220px;
  height: auto;
  object-fit: contain;
}

/* SEARCH */

.search-bar {
  display: flex;
  gap: 10px;
  flex: 1;
  min-width: 250px;
}

.search-bar input {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 14px;
}

.search-bar button {
  padding: 10px 18px;
  border: none;
  background: #6a0dad;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: 0.2s;
}

.search-bar button:hover {
  background: #5800b3;
}

/* NAV */

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

.nav a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
}

.btn-register {
  background: #6a0dad;
  color: white !important;
  padding: 8px 14px;
  border-radius: 8px;
}

/* PROFILE */

.profile-wrapper {
  position: relative;
}

.profile-btn {
  background: #6a0dad;
  color: white;
  border: none;
  padding: 8px 14px;
  cursor: pointer;
  border-radius: 8px;
  font-weight: bold;
}

.profile-btn:hover {
  background: #5800b3;
}

.profile-menu {
  position: absolute;
  top: 45px;
  right: 0;
  background: white;
  width: 200px;
  box-shadow: 0 6px 15px rgba(0,0,0,0.15);
  border-radius: 10px;
  display: none;
  flex-direction: column;
  z-index: 1000;
}

.profile-menu a {
  padding: 12px;
  text-decoration: none;
  color: #333;
}

.profile-menu a:hover {
  background: #f2f2f2;
}

.profile-menu.active {
  display: flex;
}

.user-name {
  font-weight: bold;
}

/* ================= GRID ================= */

main {
  padding: 40px;
}

.grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 25px;
}

.card {
  background: white;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  transition: 0.2s;
}

.card:hover {
  transform: translateY(-5px);
}

.card img {
  width: 100%;
  border-radius: 10px;
}

/* LIMITAR TEXTO */

.card h3,
.card p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* PAGINATION */

.pagination {
  margin-top: 30px;
}

.pagination a {
  margin-right: 10px;
  text-decoration: none;
  color: #6a0dad;
}

/* ================= LOGIN ================= */

.auth-body {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

.auth-container {
  background: white;
  padding: 40px;
  width: 320px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.auth-container input {
  width: 100%;
  padding: 12px;
  margin-bottom: 15px;
  border-radius: 8px;
  border: 1px solid #ccc;
}

.auth-container button {
  width: 100%;
  padding: 12px;
  border: none;
  background: #6a0dad;
  color: white;
  border-radius: 8px;
  cursor: pointer;
}

/* ================= RESPONSIVO ================= */

@media (max-width: 900px) {

  header {
    padding: 15px 20px;
  }

  .logo img {
    width: 160px;
  }

  .search-bar {
    order: 3;
    width: 100%;
  }

  .nav {
    order: 2;
    width: 100%;
    justify-content: flex-end;
  }

  main {
    padding: 20px;
  }

  .grid {
    gap: 15px;
  }
}

@media (max-width: 600px) {

  header {
    flex-direction: column;
    align-items: stretch;
  }

  .nav {
    justify-content: space-between;
  }

  .search-bar {
    width: 100%;
  }

  .search-bar input {
    font-size: 13px;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}
