:root {
  --accent: #34c759;
  --bg: #f5f5f7;
  --text: #1d1d1f;
}

.accent-text {
  color: var(--accent);
}

body {
  font-family: 'Poppins', sans-serif;
  font-weight: 400;
  margin: 0;
  background: linear-gradient(var(--bg), #e9ecef);
  color: var(--text);
  opacity: 0;
  transition: opacity 0.6s ease;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
}

body.loaded {
  opacity: 1;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
}

.topbar {
  background: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  display: inline-block;
  transition: transform .2s ease;
}

.logo:hover {
  transform: scale(1.05);
}

.logo:active {
  transform: scale(0.95);
}

.topbar .actions {
  display: flex;
  gap: 0.5rem;
}

.topbar button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: box-shadow .2s ease, transform .2s ease;
}

.topbar button:hover {
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  transform: translateY(-1px);
}


.user-greeting {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  color: var(--accent);
  font-weight: 500;
  padding: 0.5rem 0.75rem;
}

.user-greeting strong {
  font-weight: 600;
}

.user-menu {
  position: relative;
  display: flex;
  align-items: center;
}

.user-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  min-width: 150px;
  z-index: 20;
}

.user-dropdown a,
.user-dropdown button {
  display: block;
  width: 100%;
  padding: 0.5rem 1rem;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  text-decoration: none;
}

.user-dropdown a:hover,
.user-dropdown button:hover {
  background: #f5f5f5;
}

.user-dropdown.show {
  display: block;
}

@media (max-width: 480px) {
  .user-greeting {
    flex-direction: column;
    align-items: flex-end;
  }
}

.hero {
  text-align: center;
  padding: 6rem 1rem 3rem;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.hero .motto {
  font-size: 1.25rem;
  font-style: italic;
  color: #6e6e73;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.1rem;
  color: #6e6e73;
  margin-bottom: 2rem;
}

.motto {
  font-size: 1.5rem;
  font-style: italic;
  margin-top: 0;
  margin-bottom: 1rem;
}

.btn-cta {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  cursor: pointer;
  transition: box-shadow .2s ease, transform .2s ease;
}

.btn-cta:hover {
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  transform: scale(1.05);
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.btn-user {
  background: #4a90e2;
}

.btn-vendor {
  background: var(--accent);
}

.btn-profile {
  background: var(--accent);
  padding: 0.5rem 1rem;
  color: #fff;
  border: none;
  border-radius: 999px;
  display: block;
  margin: 2rem auto;
  cursor: pointer;
}

.btn-favorito {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  cursor: pointer;
  margin-top: 0.5rem;
}

.btn-favorito:hover {
  background: var(--accent);
  color: #fff;
}


.buscador {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 2.5rem;
  background: #fff;
  padding: 1rem;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.filter-pill {
  background: #fff;
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  color: var(--accent);
  cursor: pointer;
  transition: background .2s, color .2s;
}

.filter-pill:hover {
  background: var(--accent);
  color: #fff;
}

.buscador input,
.buscador select {
  padding: 0.75rem 1rem;
  border: 1px solid #d2d2d7;
  border-radius: 12px;
  font-size: 1rem;
  min-width: 180px;
}

.buscador button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  transition: box-shadow .2s ease, transform .2s ease;
}

.buscador button:hover {
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  transform: translateY(-1px);
}

.autocomplete {
  position: relative;
}

.autocomplete input {
  width: 100%;
}

.suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #d2d2d7;
  border-top: none;
  border-radius: 0 0 12px 12px;
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 200px;
  overflow-y: auto;
  z-index: 2;
}

.suggestions li {
  padding: 0.5rem 1rem;
  cursor: pointer;
}

.suggestions li:hover {
  background: var(--bg);
}

.suggestions:empty {
  display: none;
}

.suggestion-highlight {
  color: var(--accent);
  font-weight: 700;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

#lista-servicios {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.servicio {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp .6s forwards;
}

.servicio:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.servicio .service-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.service-icon-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 1rem 0;
}

.service-icon {
  width: 64px;
  height: 64px;
}

.servicio .info {
  padding: 1rem;
  flex: 1;
}

.servicio h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}


.btn-whatsapp {
  display: inline-block;
  margin-top: 0.5rem;
  background: var(--accent);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 12px;
  text-decoration: none;
  transition: box-shadow .2s ease, transform .2s ease;
}

.btn-whatsapp:hover {
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  transform: translateY(-1px);
}

.btn-whatsapp.disabled {
  background: #ccc;
  color: #666;
}

.rating span {
  font-size: 1.25rem;
  color: #d2d2d7;
}

.rating span.filled {
  color: gold;
}

.rating .no-rating {
  color: #6e6e73;
  font-size: 0.9rem;

}

.comentarios textarea {
  width: 100%;
  border: 1px solid #d2d2d7;
  border-radius: 12px;
  padding: 0.5rem;
  font-family: inherit;
  font-size: 1rem;
}

.comentarios textarea[disabled] {
  filter: blur(2px);
}

.comentarios button {
  margin-top: 0.5rem;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 12px;
  cursor: pointer;
  transition: box-shadow .2s ease, transform .2s ease;
}

.comentarios button:hover {
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  transform: translateY(-1px);
}

.comentarios button[disabled] {
  background: #ccc;
  cursor: not-allowed;
}

.login-prompt {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #666;
}

#paginacion {
  padding: 2rem;
  text-align: center;
}

#paginacion button {
  margin: 0 0.25rem;
  background: #fff;
  border: 1px solid #d2d2d7;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: background .2s, color .2s;
}

#paginacion button:hover {
  background: var(--accent);
  color: #fff;
}

.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}

.modal.show {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: #fff;
  padding: 2rem;
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  position: relative;
  transform: translateY(-20px);
  transition: transform .3s ease;
}

.modal.show .modal-content {
  transform: translateY(0);
}

.cerrar {
  position: absolute;
  top: 1rem;
  right: 1rem;
  cursor: pointer;
  font-size: 1.5rem;
}

.modal-content h2 {
  margin-top: 0;
}

.modal-content input,
.modal-content select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #d2d2d7;
  border-radius: 12px;
  margin-bottom: 1rem;
  font-size: 1rem;
}

.social-login button {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 12px;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: box-shadow .2s ease, transform .2s ease;
}

.social-login button:hover {
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  transform: translateY(-1px);
}


.modal-content button[type="submit"] {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  cursor: pointer;
  transition: box-shadow .2s ease, transform .2s ease;
}

.modal-content button[type="submit"]:hover {
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  transform: translateY(-1px);
}

.tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.tab {
  flex: 1;
  padding: 0.5rem;
  background: #eee;
  border: none;
  border-radius: 12px;
  cursor: pointer;
}

.tab.active {
  background: var(--accent);
  color: #fff;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.register-options {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.register-switch {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid var(--accent);
  background: #fff;
  border-radius: 12px;
  cursor: pointer;
}

.register-switch.active {
  background: var(--accent);
  color: #fff;
}

.register-form { display: none; }
.register-form.active { display: block; }

footer {
  background: #fff;
  padding: 2rem;
  text-align: center;
  border-top: 1px solid #e1e1e1;
}

footer .legal a {
  margin: 0 0.5rem;
  color: var(--accent);
  text-decoration: none;
}

footer .social a {
  margin: 0 0.5rem;
  color: var(--accent);
  text-decoration: none;
}

.legal-page main {
  max-width: 800px;
  margin: 4rem auto;
  padding: 0 1rem;
}

/* Profile theming */
body.perfil-usuario {
  --accent: #4a90e2;
  --bg: #f0f8ff;
}

body.perfil-servicio {
  --accent: #e67e22;
  --bg: #fff7e6;
}

/* Profile layout */
.profile-card {
  background: #fff;
  max-width: 500px;
  margin: 2rem auto;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.user-avatar {
  max-width: 120px;
  width: 100%;
  height: auto;
  border-radius: 50%;
  display: block;
  margin: 0 auto 1rem;
}

@media (min-width: 600px) {
  .profile-card {
    flex-direction: row;
    text-align: left;
  }
  .profile-card .user-info {
    margin-left: 1.5rem;
  }
  .user-avatar {
    margin: 0;
  }
}

.favorites {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.favorites-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.favorite-card {
  background: #fff;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
}

.favorite-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.favorite-card p {
  flex-grow: 1;
  margin: 0 0 0.75rem;
  color: #555;
}

.favorite-card a {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  align-self: flex-start;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 600px) {
  .hero h1 {
    font-size: 1.75rem;
  }

  .hero {
    padding-top: 4rem;
  }
}

button:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.error-message {
  color: #d93025;
  font-size: 0.9rem;
  margin: 0.5rem 0;
}
