/* ======== ESTILOS BASE ======== */
body {
  font-family: 'Segoe UI', sans-serif;
  background: #f0f4f8;
  margin: 0;
  color: #333;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: #2a9d8f;
  color: white;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.logo {
  font-weight: bold;
  font-size: 1.5rem;
}

nav a {
  margin-left: 1rem;
  color: white;
  text-decoration: none;
  font-weight: 500;
}
nav a:hover {
  text-decoration: underline;
}

/* ======== LAYOUT GENERAL ======== */
.container {
  max-width: 1100px;
  margin: auto;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.hero {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  margin-top: 1rem;
}

.card {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s, box-shadow 0.3s;
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

/* ======== PERFIL ======== */
.profile {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.avatar-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #2a9d8f;
}

.title {
  font-size: 1.4rem;
  font-weight: bold;
  margin-bottom: 0.3rem;
}

.subtitle {
  color: #264653;
  font-size: 0.95rem;
}

/* ======== SERVICIOS ======== */
.services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.service h4 {
  margin: 0.5rem 0 0.3rem;
  color: #2a9d8f;
  font-size: 1.1rem;
}

.service p {
  font-size: 0.9rem;
  line-height: 1.4;
}

.service-img,
.section-img {
  width: 100%;
  height: 150px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid #ddd;
  margin-bottom: 1rem;
}

/* ======== FORMULARIOS ======== */
label {
  font-weight: bold;
  font-size: 0.95rem;
}

input,
select {
  padding: 0.6rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 0.95rem;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 0.7rem;
}

textarea {
  resize: vertical;
  min-height: 80px;
}

/* ======== BOTONES ======== */
.btn {
  background: #e76f51;
  color: white;
  border: none;
  padding: 0.7rem 1.2rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.3s;
}

.btn:hover {
  background: #d65c42;
}

.btn.secondary {
  background: #ccc;
  color: #333;
}

.form-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}
.form-buttons .btn {
  flex: 1;
}

/* ======== LOGIN ======== */
#loginSection {
  align-self: start;
  margin-top: 0;
}

.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrapper input {
  width: 100%;
  padding-right: 2.5rem;
}

.toggle-password {
  position: absolute;
  right: 0.75rem;
  cursor: pointer;
  user-select: none;
  font-size: 1.1rem;
  color: #555;
}

/* ======== TEST ======== */
#test button {
  display: block;
  margin: 1rem auto 0 auto;
}

/* ======== MODALES ======== */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: 0.3s;
}
.modal.open {
  opacity: 1;
  pointer-events: auto;
}
.modal .slot {
  background: white;
  padding: 1.5rem;
  border-radius: 10px;
  max-width: 400px;
  text-align: center;
}

/* ======== FOOTER ======== */
footer {
  text-align: center;
  margin-top: 2rem;
  padding: 1rem;
  font-size: 0.9rem;
  color: #555;
}

/* ======== RESPONSIVO ======== */
@media (max-width: 768px) {
  .hero {
    grid-template-columns: 1fr;
  }
}

/* ===== Reset y base ===== */
body, html {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background: #f0f4f8;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background: #2a9d8f;
  color: #fff;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

header a, #usernameDisplay {
  color: #fff;
  text-decoration: none;
}

.counter {
  background: #fff;
  color: #2a9d8f;
  padding: 0.3rem 0.8rem;
  border-radius: 8px;
  font-weight: bold;
}

.btn {
  background-color: #2a9d8f;
  color: #fff;
  border: none;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s;
}
.btn:hover { background-color: #21867a; }
.btn.logout { background: #e76f51; }
.btn.cancel { background: #aaa; }

.container {
  flex: 1;
  padding: 2rem;
  max-width: 1100px;
  margin: auto;
}

.title { text-align: center; color: #2a9d8f; margin-bottom: 0.3rem; }
.subtitle { text-align: center; color: #555; margin-bottom: 2rem; }

/* ===== Grid de productos ===== */
.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  justify-items: center;
}

/* ===== Tarjetas de producto ===== */
.product-card {
  background: #fff;
  padding: 1rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.3s, box-shadow 0.3s;
  height: 360px; /* altura uniforme */
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.product-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.product-card h4 {
  color: #2a9d8f;
  margin: 0.5rem 0;
}

.product-card p {
  margin: 0.3rem 0;
  font-size: 0.95rem;
}

.product-card .price {
  font-weight: bold;
  margin-top: 0.5rem;
}

.product-card button {
  margin-top: auto;
}

/* ===== Footer ===== */
footer {
  text-align: center;
  padding: 1rem 0;
  background: #e0e5ec;
  font-size: 0.9rem;
}

/* ===== Modal ===== */
.modal {
  display: none;
  position: fixed;
  top:0; left:0;
  width:100%; height:100%;
  background: rgba(0,0,0,0.5);
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.modal.open {
  display: flex;
}

.slot {
  background: #fff;
  border-radius: 10px;
  padding: 2rem;
  width: 90%;
  max-width: 400px;
  text-align: center;
}

/* ===== Responsive ===== */
@media(max-width: 768px) {
  .store-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Grid de productos (horizontal) ===== */
.store-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
}

/* Cada tarjeta mantiene la misma altura */
.product-card {
  background: #fff;
  padding: 1rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.3s, box-shadow 0.3s;
  width: 220px;   /* ancho fijo para uniformidad */
  height: 360px;  /* altura uniforme */
}

@media(max-width: 768px) {
  .store-grid {
    flex-direction: column;
    align-items: center;
  }
}

.tienda-header {
  text-align: center;
  background: #f0f8ff;       /* color de fondo suave */
  padding: 1.5rem 1rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  margin-bottom: 2rem;
}

.tienda-header .title {
  color: #2a9d8f;
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.tienda-header .welcome {
  font-size: 1.2rem;
  font-weight: 500;
  color: #264653;
  margin-bottom: 0.5rem;
}

.tienda-header .subtitle {
  font-size: 1rem;
  color: #555;
}

/* ===== Bloque de bienvenida y agendar cita estilizado ===== */
.cita-form-container .card {
  background: linear-gradient(135deg, #ffffff, #e0f7f5); /* degradado suave */
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  transition: transform 0.3s, box-shadow 0.3s;
}

.cita-form-container .card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

.cita-form-container .welcome {
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: 0.3rem;
  color: #264653;
}

.cita-form-container .subtitle {
  font-size: 1rem;
  margin-bottom: 1.5rem;
  color: #2a9d8f;
  font-weight: 500;
}

.cita-form-container .cita-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cita-form-container label {
  font-weight: 600;
}

.cita-form-container input,
.cita-form-container select,
.cita-form-container .btn {
  font-size: 1rem;
}

/* ===== Tarjetas de citas futuras ===== */
.cita-card {
  background: #fff;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: transform 0.3s, box-shadow 0.3s;
}

.cita-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.cita-card p {
  margin: 0;
  font-size: 0.95rem;
  color: #264653;
}

.cita-card button.btn-eliminar {
  align-self: flex-end;
  background: #e76f51;
  color: #fff;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background 0.3s;
}

.cita-card button.btn-eliminar:hover {
  background: #d65c42;
}

/* ===== Historial de citas ===== */
.cita-card.historial {
  background: #f0f4f8;
  color: #555;
}

.cita-card.historial p {
  color: #264653;
  font-size: 0.9rem;
}

/* ===== Secciones de listas de citas ===== */
.citas-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

/* Tablas de Citas y Usuarios */
table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
}

table th,
table td {
  padding: 10px 15px; /* espacio interno */
  border: 1px solid #ccc; /* opcional, mejora legibilidad */
}

thead tr {
  font-weight: bold;
}

tbody tr {
  height: 50px; /* fila más alta para que no se vea tan apretado */
}

/* Espaciado entre contenedores */
.card {
  margin-bottom: 20px;
  padding: 15px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* opc
