/* ═══════════════════════════════════════════════════════════
   MI CUENTA — Origen Tu Marca
   Versión: 1.0.0
   ═══════════════════════════════════════════════════════════ */

.sp-account-page {
  background: var(--bg);
  min-height: 70vh;
  padding: 60px 0 100px;
}

.sp-account-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 40px;
}

/* ══════════════════════════════════════════════════════════
   AUTH — Login + Registro
   ══════════════════════════════════════════════════════════ */

.sp-auth-grid {
  display: grid;
  grid-template-columns: 1fr 40px 1fr;
  gap: 0;
  align-items: start;
  max-width: 860px;
  margin: 0 auto;
}

.sp-auth-col {
  padding: 0 48px;
}

.sp-auth-col:first-child { padding-left: 0; }
.sp-auth-col:last-child  { padding-right: 0; }

.sp-auth-title {
  font-family: var(--font);
  font-size: 1.5rem;
  font-weight: 200;
  color: var(--black);
  letter-spacing: -.02em;
  margin-bottom: 32px;
}

.sp-auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Divisor vertical */
.sp-auth-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 68px;
}

.sp-auth-divider span {
  font-family: var(--font);
  font-size: .75rem;
  font-weight: 300;
  color: var(--light);
  background: var(--bg);
  position: relative;
  z-index: 1;
  padding: 8px 0;
}

.sp-auth-divider::before {
  content: '';
  position: absolute;
  top: 68px;
  bottom: 40px;
  width: 1px;
  background: var(--light);
}

/* Remember + forgot */
.sp-auth-remember {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: -4px;
}

.sp-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-family: var(--font);
  font-size: .8125rem;
  font-weight: 300;
  color: var(--mid);
}

.sp-checkbox-label input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--black);
  cursor: pointer;
}

.sp-auth-forgot {
  font-family: var(--font);
  font-size: .8125rem;
  font-weight: 300;
  color: var(--mid);
  text-decoration: none;
  transition: color .2s;
}

.sp-auth-forgot:hover { color: var(--black); }

/* Términos */
.sp-auth-terms {
  font-family: var(--font);
  font-size: .8125rem;
  font-weight: 300;
  color: var(--mid);
  line-height: 1.5;
  margin-top: -6px;
}

.sp-auth-terms a {
  color: var(--black);
  text-decoration: underline;
}

/* Botones auth */
.sp-auth-btn {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--black);
  color: var(--white);
  border: 1px solid var(--black);
  font-family: var(--font);
  font-size: .9375rem;
  font-weight: 400;
  letter-spacing: .04em;
  cursor: pointer;
  transition: opacity .2s;
  margin-top: 4px;
}

.sp-auth-btn:hover { opacity: .78; }

.sp-auth-btn--outline {
  background: transparent;
  color: var(--black);
}

.sp-auth-btn--outline:hover {
  background: var(--black);
  color: var(--white);
  opacity: 1;
}


/* ══════════════════════════════════════════════════════════
   DASHBOARD — logueado
   ══════════════════════════════════════════════════════════ */

.sp-dashboard-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 60px;
  align-items: start;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sp-dashboard-nav {
  position: sticky;
  top: 100px;
}

.sp-dashboard-user {
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--light);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sp-dashboard-user__name {
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 400;
  color: var(--black);
}

.sp-dashboard-user__email {
  font-family: var(--font);
  font-size: .8125rem;
  font-weight: 300;
  color: var(--mid);
}

.sp-dashboard-menu {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sp-dashboard-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--light);
  font-family: var(--font);
  font-size: .9375rem;
  font-weight: 300;
  color: var(--mid);
  text-decoration: none;
  transition: color .2s;
}

.sp-dashboard-menu__item:hover,
.sp-dashboard-menu__item.active {
  color: var(--black);
}

.sp-dashboard-menu__item.active {
  font-weight: 400;
}

.sp-dashboard-menu__item--logout {
  color: var(--mid);
  margin-top: 8px;
  border-bottom: none;
}

.sp-dashboard-menu__item--logout:hover {
  color: #c0392b;
}

/* ── Contenido ───────────────────────────────────────────── */
.sp-dashboard-content {
  min-height: 400px;
}

.sp-dashboard-section-title {
  font-family: var(--font);
  font-size: 1.75rem;
  font-weight: 200;
  color: var(--black);
  letter-spacing: -.02em;
  margin-bottom: 32px;
}

/* ── Pedidos vacíos ──────────────────────────────────────── */
.sp-dashboard-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: 40px 0;
}

.sp-dashboard-empty p {
  font-family: var(--font);
  font-size: .9375rem;
  font-weight: 300;
  color: var(--mid);
}

.sp-dashboard-empty__btn {
  display: inline-block;
  padding: 12px 28px;
  background: var(--black);
  color: var(--white);
  font-family: var(--font);
  font-size: .875rem;
  font-weight: 400;
  letter-spacing: .04em;
  text-decoration: none;
  transition: opacity .2s;
}

.sp-dashboard-empty__btn:hover { opacity: .78; }

/* ── Lista de pedidos ────────────────────────────────────── */
.sp-orders-list {
  width: 100%;
}

.sp-orders-header {
  display: grid;
  grid-template-columns: 100px 1fr 1fr 1fr 60px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--light);
  font-family: var(--font);
  font-size: .75rem;
  font-weight: 400;
  color: var(--mid);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.sp-orders-row {
  display: grid;
  grid-template-columns: 100px 1fr 1fr 1fr 60px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--light);
  font-family: var(--font);
  font-size: .9375rem;
  font-weight: 300;
  color: var(--black);
}

.sp-orders-row__id {
  font-weight: 400;
}

.sp-orders-row__date {
  color: var(--mid);
  font-size: .875rem;
}

/* Estados */
.sp-orders-row__status {
  display: inline-flex;
  align-items: center;
  font-size: .8125rem;
  font-weight: 400;
  padding: 3px 10px;
  width: fit-content;
}

.sp-status--completed   { background: #e8f5e9; color: #2a7a2a; }
.sp-status--processing  { background: #e3f2fd; color: #1565c0; }
.sp-status--pending     { background: #fff8e1; color: #f57f17; }
.sp-status--on-hold     { background: #f3e5f5; color: #6a1b9a; }
.sp-status--cancelled   { background: #fce4ec; color: #c62828; }
.sp-status--refunded    { background: #f5f5f5; color: #616161; }
.sp-status--failed      { background: #fce4ec; color: #c62828; }

.sp-orders-row__view {
  font-family: var(--font);
  font-size: .8125rem;
  font-weight: 400;
  color: var(--mid);
  text-decoration: none;
  letter-spacing: .04em;
  transition: color .2s;
}

.sp-orders-row__view:hover { color: var(--black); }

/* ── Formularios cuenta ──────────────────────────────────── */
.sp-account-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 600px;
}

.sp-account-form__divider {
  padding: 12px 0 4px;
  border-top: 1px solid var(--light);
  margin-top: 8px;
}

.sp-account-form__divider span {
  font-family: var(--font);
  font-size: .75rem;
  font-weight: 400;
  color: var(--mid);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.sp-account-form__btn {
  display: inline-block;
  padding: 14px 32px;
  background: var(--black);
  color: var(--white);
  border: none;
  font-family: var(--font);
  font-size: .9375rem;
  font-weight: 400;
  letter-spacing: .04em;
  cursor: pointer;
  transition: opacity .2s;
  margin-top: 8px;
  align-self: flex-start;
}

.sp-account-form__btn:hover { opacity: .78; }

/* Reusar campos de checkout */
.sp-account-page .sp-field label {
  font-family: var(--font);
  font-size: .8125rem;
  font-weight: 300;
  color: var(--mid);
}

.sp-account-page .sp-field input[type="text"],
.sp-account-page .sp-field input[type="email"],
.sp-account-page .sp-field input[type="tel"],
.sp-account-page .sp-field input[type="password"],
.sp-account-page .sp-field select {
  border: none;
  border-bottom: 1px solid var(--light);
  background: transparent;
  padding: 10px 0;
  font-family: var(--font);
  font-size: .9375rem;
  font-weight: 300;
  color: var(--black);
  outline: none;
  transition: border-color .2s;
  width: 100%;
  -webkit-appearance: none;
  border-radius: 0;
}

.sp-account-page .sp-field input:focus,
.sp-account-page .sp-field select:focus {
  border-bottom-color: var(--black);
}

.sp-account-page .sp-field input::placeholder {
  color: var(--light);
}

.sp-account-page .sp-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.sp-account-page .sp-field--full { width: 100%; }

.sp-account-page .sp-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.sp-account-page .sp-field select {
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%237A7872' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
  padding-right: 20px;
  cursor: pointer;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════ */
@media (max-width: 860px) {
  .sp-auth-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .sp-auth-col { padding: 0; }

  .sp-auth-divider {
    flex-direction: row;
    padding: 0;
    height: 20px;
    position: relative;
  }

  .sp-auth-divider::before {
    top: 50%;
    bottom: auto;
    left: 0;
    right: 0;
    width: auto;
    height: 1px;
  }

  .sp-dashboard-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .sp-dashboard-nav {
    position: static;
  }

  .sp-dashboard-menu {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0;
  }

  .sp-dashboard-menu__item {
    padding: 10px 16px;
    border-bottom: 2px solid transparent;
    border-right: none;
    font-size: .875rem;
  }

  .sp-dashboard-menu__item.active {
    border-bottom-color: var(--black);
  }
}

@media (max-width: 600px) {
  .sp-account-wrap { padding: 0 20px; }
  .sp-account-page { padding: 40px 0 80px; }

  .sp-orders-header { display: none; }

  .sp-orders-row {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 6px;
  }

  .sp-orders-row__id    { grid-column: 1; }
  .sp-orders-row__date  { grid-column: 2; text-align: right; }
  .sp-orders-row__status { grid-column: 1; }
  .sp-orders-row__total  { grid-column: 2; text-align: right; }
  .sp-orders-row__view   { grid-column: 1 / 3; }

  .sp-account-page .sp-field-row {
    grid-template-columns: 1fr;
  }
}
