/******************************************************
   TSUKI SHOP – PERFIL DE USUARIO (ESTILO PREMIUM)
******************************************************/

/* ======= CONTENEDOR GENERAL ======= */

.perfil-section {
  display: flex;
  width: 100%;
  max-width: 100rem;
  gap: 2rem;
  margin: 2rem auto;
  padding: 1rem;
  box-sizing: border-box;
}


/* ======= SIDEBAR ======= */

.sidebar {
  width: 12rem;
  padding: 1.5rem;
  border-radius: 1.5rem;
  background: #F5EAFE;
  box-shadow: 0 0 10px rgba(130, 55, 189, 0.15);
  height: max-content;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 1rem;
}

.sidebar nav a {
  padding: 0.8rem 1rem;
  border-radius: 1rem;
  font-weight: 600;
  color: #8237BD;
  text-decoration: none;
  background: #ffffff;
  border: 2px solid #e0c1f6;
  transition: all 0.2s ease;
}

.sidebar nav a:hover {
  background: #8237BD;
  color: #ffffff;
}

.sidebar nav a.active {
  background: #8237BD;
  color: white;
  border-color: #8237BD;
}


/* ======= CONTENIDO DE LA DERECHA (TABS) ======= */

.perfil-panel,
.resumen {
  flex: 1;
  background: white;
  padding: 2rem;
  padding-bottom: 3rem;
  border-radius: 1.5rem;
  box-shadow: 0 0 15px rgba(130, 55, 189, 0.12);
}

.resumen h1,
.perfil-panel h1,
.perfil-panel h2 {
  color: #8237BD;
  font-size: 2rem;
  margin-bottom: 1rem;
}

.resumen p,
.perfil-panel p {
  color: #444;
  font-size: 1rem;
  margin-bottom: 1rem;
}


/* ======= FORMULARIO DE USUARIO ======= */

.resumen label {
  display: flex;
  flex-direction: column;
  font-weight: 600;
  color: #8237BD;

  margin-bottom: 1rem;
}

.resumen input {
  margin-top: 0.4rem;
  padding: 0.7rem 1rem;
  border-radius: 0.8rem;
  border: 2px solid #d8b7ef;
  background: #faf7fd;
  font-size: 1rem;
}

.resumen .direction {
  display: flex;
  height: 5rem !important;
  resize: none;
  padding-top: 0;
  text-align: left;
  line-height: 1.4;

  justify-content: end;
  justify-items: end;
  align-items: end;
}

.perfil-acciones {
  display: flex;
  justify-items: center;
  align-items: center;
  align-content: center;
  gap: 1rem;
}

.perfil-acciones button {
  padding: 0.7rem 1.2rem;
  border-radius: 1rem;
  background: #e9d3fb;
  border: 2px solid #8237BD;
  color: #8237BD;
  cursor: pointer;
  transition: all 0.2s;
}

.perfil-acciones button:hover:not(:disabled) {
  background: #8237BD;
  color: #fff;
}

/* Guardar Cambios: opaco cuando no se está editando */
#btn-guardar:disabled,
#btn-cancelar:disabled{
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* cuando esté habilitado (editando), vuelve a normal */
#btn-guardar,
#btn-cancelar {
  opacity: 1;
}

/* ======= SELECT (NACIONALIDAD) – TSUKI STYLE ======= */

.resumen select {
  margin-top: 0.4rem;
  padding: 0.7rem 1rem;
  padding-right: 2.5rem; /* espacio para la flecha */
  border-radius: 0.8rem;
  border: 2px solid #d8b7ef;
  background: #faf7fd;
  font-size: 1rem;
  color: #444;

  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238237BD' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-size: 1rem;

  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.resumen select:focus {
  outline: none;
  border-color: #8237BD;
  box-shadow: 0 0 0 2px rgba(130, 55, 189, 0.15);
}

.resumen select:disabled {
  background: #f2edf8;
  color: #777;
  cursor: not-allowed;
}

.resumen select:not(:disabled):hover {
  border-color: #8237BD;
}

.resumen select option[value=""] {
  color: #999;
}



/* ======= PEDIDOS ======= */

.tabla-pedidos-cliente {
  width: 100%;
  margin-top: 1rem;
  border-collapse: collapse;
  font-size: 0.95rem;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(130, 55, 189, 0.15);
}

.tabla-pedidos-cliente thead {
  background: #8237BD;
  color: white;
}

.tabla-pedidos-cliente th,
.tabla-pedidos-cliente td {
  padding: 0.8rem 1rem;
  text-align: left;
}

.tabla-pedidos-cliente tbody tr:nth-child(odd) {
  background: #F8F1FF;
}

.tabla-pedidos-cliente tbody tr:hover {
  background: #f0e1ff;
}

.pedidos-empty {
  padding: 1rem;
  background: #f9f0ff;
  border: 2px dashed #d3b3f0;
  border-radius: 1rem;
  font-size: 1rem;
  color: #8237BD;
  margin-top: 1rem;
  text-align: center;
}

.btn-ir-valoraciones,
.btn-ver-factura-cliente {
  padding: 0.4rem 0.8rem;
  border-radius: 0.6rem;
  border: 2px solid #8237BD;
  background: #f4e6ff;
  color: #8237BD;
  cursor: pointer;
  font-size: 0.85rem;
  transition: 0.2s ease;
}

.btn-ir-valoraciones:hover,
.btn-ver-factura-cliente:hover {
  background: #8237BD;
  color: white;
}


/* ======= VALORACIONES ======= */

.lista-productos-valoraciones {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.valor-card {
  display: flex;
  gap: 1rem;
  background: #fdfbff;
  border: 2px solid #e2c8ff;
  padding: 1rem;
  border-radius: 1.5rem;
  align-items: center;
  box-shadow: 0 0 8px rgba(130, 55, 189, 0.12);
  transition: transform 0.15s ease;
}

.valor-card:hover {
  transform: translateY(-3px);
}

.valor-card-img {
  width: 6rem;
  height: 6rem;
  object-fit: cover;
  border-radius: 1rem;
  border: 2px solid #d1b0f0;
}

.valor-card-info h4 {
  margin: 0;
  color: #8237BD;
  font-size: 1.2rem;
}

.valor-card-info button {
  margin-top: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 1rem;
  border: 2px solid #8237BD;
  background: white;
  color: #8237BD;
  cursor: pointer;
  transition: 0.2s;
}

.valor-card-info button:hover {
  background: #8237BD;
  color: white;
}

#valoraciones-empty {
  padding: 1rem;
  border-radius: 1rem;
  border: 2px dashed #d6b4f2;
  background: #fbf4ff;
  color: #8237BD;
  margin-bottom: 1rem;
}

/* ======= MENSAJE DE CAMBIOS GUARDADOS ======= */

.perfil-msg { margin: 0; transition: opacity 0.3s ease; }
.perfil-msg.success { color: #2e7d32; }
.perfil-msg.error { color: #c62828; }
