/* Cuenta del cliente: ingreso, registro y "Mis pedidos" */

.customer-page {
  padding: 56px 16px 80px;
  font-family: 'Roboto', system-ui, sans-serif;
  color: #333;
}

.customer-card {
  max-width: 520px;
  margin: 0 auto;
}

.customer-title {
  margin: 0;
  text-align: center;
  font-size: clamp(40px, 7vw, 64px);
  font-weight: 400;
  line-height: 1.1;
}

.customer-subtitle {
  margin: 12px 0 0;
  text-align: center;
  font-size: 18px;
  font-weight: 300;
}

.customer-form {
  margin-top: 48px;
}

.customer-field {
  margin-bottom: 28px;
}

.customer-field label,
.customer-label {
  display: block;
  margin: 0 0 8px 10px;
  font-size: 14px;
}

.customer-field input[type="email"],
.customer-field input[type="text"],
.customer-field input[type="tel"],
.customer-field select {
  box-sizing: border-box;
  width: 100%;
  height: 44px;
  padding: 0 16px;
  border: 1px solid #c4c4c4;
  border-radius: 4px;
  background: #fff;
  font: inherit;
  font-size: 14px;
  color: #333;
}

.customer-field input:focus,
.customer-field select:focus {
  outline: 2px solid var(--theme-primary-color, #0000ff);
  outline-offset: 1px;
}

.customer-email-row {
  display: flex;
  align-items: center;
  gap: 20px;
}

.customer-email-row input {
  flex: 1;
  min-width: 0;
}

.customer-link-btn {
  flex: none;
  padding: 0;
  border: 0;
  background: none;
  color: var(--theme-primary-color, #0000ff);
  font: inherit;
  font-size: 16px;
  text-decoration: underline;
  cursor: pointer;
}

.customer-link-btn:disabled {
  color: #888;
  text-decoration: none;
  cursor: default;
}

.customer-help {
  margin: 12px 0 0;
  font-size: 13px;
}

.customer-notice {
  margin: 8px 0 0;
  font-size: 13px;
  color: #1a7f37;
}

.customer-phone-row {
  display: flex;
  gap: 20px;
}

.customer-phone-row select {
  flex: 0 0 132px;
  width: 132px;
}

.customer-phone-row input {
  flex: 1;
  min-width: 0;
}

.customer-code {
  display: flex;
  gap: 20px;
}

.customer-field .customer-code input[type="text"] {
  box-sizing: border-box;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #c4c4c4;
  border-radius: 4px;
  text-align: center;
  font: inherit;
  font-size: 24px;
  color: #333;
}

.customer-error {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 4px;
  background: #fdecea;
  color: #b3261e;
  font-size: 14px;
}

.customer-actions {
  margin-top: 56px;
  text-align: center;
}

.customer-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 240px;
  height: 64px;
  padding: 0 24px;
  border: 0;
  border-radius: 6px;
  background: var(--theme-primary-color, #0000ff);
  color: var(--theme-primary-text, #fff);
  font: inherit;
  font-size: 18px;
  text-decoration: none;
  cursor: pointer;
}

.customer-submit:disabled {
  opacity: .6;
  cursor: default;
}

.customer-switch {
  margin-top: 32px;
  text-align: center;
  font-size: 14px;
}

.customer-switch a {
  color: var(--theme-primary-color, #0000ff);
}

/* ---------- Mis pedidos ---------- */

.customer-orders {
  max-width: 760px;
  margin: 0 auto;
}

.customer-orders-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
}

.customer-orders-title {
  margin: 0;
  font-size: 32px;
  font-weight: 400;
}

.customer-orders-head .customer-subtitle {
  margin-top: 4px;
  text-align: left;
  font-size: 16px;
}

.customer-logout {
  flex: none;
  padding: 8px 14px;
  border: 1px solid #c4c4c4;
  border-radius: 4px;
  background: #fff;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.customer-empty {
  padding: 48px 16px;
  text-align: center;
}

.customer-order-list,
.customer-order-items {
  margin: 0;
  padding: 0;
  list-style: none;
}

.customer-order {
  margin-bottom: 12px;
  border: 1px solid #e2e2e2;
  border-radius: 6px;
  background: #fff;
}

.customer-order summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  cursor: pointer;
  list-style: none;
}

.customer-order summary::-webkit-details-marker {
  display: none;
}

.customer-order-main,
.customer-order-side {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.customer-order-side {
  align-items: flex-end;
}

.customer-order-number {
  font-weight: 500;
}

.customer-order-date {
  font-size: 13px;
  color: #666;
}

.customer-order-total {
  font-weight: 500;
}

.customer-status {
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.customer-status.is-pending {
  background: #fff4d6;
  color: #8a5a00;
}

.customer-status.is-attended {
  background: #e3f5e8;
  color: #1a7f37;
}

.customer-order-items {
  padding: 0 16px 8px;
  border-top: 1px solid #eee;
}

.customer-order-items li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f2f2f2;
}

.customer-order-items li:last-child {
  border-bottom: 0;
}

.customer-order-items img {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 4px;
  object-fit: cover;
  background: #f5f5f5;
}

.customer-item-name {
  flex: 1;
  min-width: 0;
  font-size: 14px;
}

.customer-item-name a {
  color: inherit;
}

.customer-item-name small {
  margin-left: 6px;
  color: #666;
}

.customer-item-subtotal {
  font-size: 14px;
  white-space: nowrap;
}

.customer-order-notes {
  margin: 0;
  padding: 0 16px 16px;
  font-size: 13px;
  color: #555;
}

.customer-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 24px;
  font-size: 14px;
}

.customer-pager a {
  color: var(--theme-primary-color, #0000ff);
}

@media (max-width: 560px) {
  .customer-page { padding-top: 32px; }
  .customer-email-row { flex-wrap: wrap; gap: 10px; }
  .customer-email-row input { flex-basis: 100%; }
  .customer-phone-row { gap: 10px; }
  .customer-phone-row select { flex-basis: 112px; width: 112px; }
  .customer-code { gap: 14px; }
  .customer-submit { width: 100%; min-width: 0; height: 56px; }
  .customer-orders-title { font-size: 26px; }
  .customer-order summary { align-items: flex-start; }
}

/* =====================================================================
   Layout de la cuenta (no usa el tema de la tienda)
   ===================================================================== */

.account-body {
  margin: 0;
  min-height: 100vh;
  background: #fff;
  font-family: 'Roboto', system-ui, sans-serif;
  color: #333;
}

.account-body *,
.account-body *::before,
.account-body *::after {
  box-sizing: border-box;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.account-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 72px;
  padding: 0 24px;
}

.account-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: #333;
  font-size: 20px;
  text-decoration: none;
}

.account-brand img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.account-brand span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.account-header-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  flex: none;
}

.account-store-link {
  color: #0000ff;
  font-size: 16px;
}

.account-user {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #333;
  font-size: 16px;
  text-decoration: none;
}

.account-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.account-avatar-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e3efff;
  color: #1e5fd8;
  font-size: 13px;
  font-weight: 500;
}

.account-shell {
  display: flex;
  gap: 24px;
  padding: 16px 24px 24px;
  min-height: calc(100vh - 72px);
}

.account-nav {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: none;
  width: 56px;
  padding-bottom: 8px;
}

.account-nav-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.account-nav a,
.account-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #222;
  cursor: pointer;
}

.account-nav a span,
.account-logout span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.account-nav a:hover,
.account-logout:hover {
  background: #f1f5fb;
}

.account-nav a.is-active {
  background: #e3efff;
  color: #1e7bff;
}

.account-main {
  flex: 1;
  min-width: 0;
  padding: 24px 34px;
  border: 1px solid #e3e3e3;
  border-radius: 8px;
  background: #f4f4f4;
}

.account-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 24px;
  margin-bottom: 38px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  background: #fff;
}

.account-page-head h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
}

.account-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 16px;
}

.account-breadcrumb li + li::before {
  content: '›';
  margin-right: 12px;
  font-size: 22px;
  line-height: 1;
}

.account-breadcrumb a {
  color: inherit;
  text-decoration: none;
}

.account-card {
  padding: 24px 32px 32px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  background: #fff;
}

.account-card-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin: 0 0 32px;
  padding: 10px 12px 24px;
  border-bottom: 1px solid #ddd;
  font-size: 20px;
  font-weight: 500;
}

.account-card-title h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
}

.account-card-title-plain {
  padding-left: 0;
  border-bottom: 0;
}

.account-order-date {
  margin-left: auto;
  font-size: 14px;
  font-weight: 400;
  color: #666;
}

.account-table-wrap {
  overflow-x: auto;
  padding: 0 24px;
}

.account-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.account-table th {
  padding: 18px 12px;
  border-bottom: 1px solid #ddd;
  text-align: left;
  font-weight: 400;
  font-size: 16px;
  white-space: nowrap;
}

.account-table td {
  height: 124px;
  padding: 12px;
  border-bottom: 1px solid #ddd;
  color: #444;
}

.account-table .is-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.account-table .is-center {
  text-align: center;
}

.account-row-index {
  width: 64px;
  font-size: 22px;
  text-align: center;
  color: #222 !important;
}

.account-order-link {
  color: inherit;
  text-decoration: none;
}

.account-order-link:hover {
  text-decoration: underline;
}

.account-row-actions {
  width: 120px;
  white-space: nowrap;
  text-align: right;
}

.account-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-left: 4px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #111;
  cursor: pointer;
}

.account-icon-btn:hover:not(.is-disabled),
.account-icon-btn:focus-visible {
  background: #e8f1ff;
}

.account-icon-btn.is-disabled {
  color: #bbb;
  cursor: default;
}

.account-icon-btn:disabled {
  opacity: .5;
  cursor: default;
}

.account-status {
  display: inline-block;
  padding: 3px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.account-status.is-pending {
  background: #fde8e8;
  color: #e00000;
}

.account-status.is-attended {
  background: #e6f7e6;
  color: #138a13;
}

.account-item-image {
  width: 120px;
}

.account-item-image img {
  display: block;
  width: 94px;
  height: 94px;
  object-fit: cover;
  border-radius: 2px;
  background: #f2f2f2;
}

.account-item-name {
  min-width: 220px;
  max-width: 420px;
}

.account-item-name a {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
}

.account-item-name a:hover {
  text-decoration: underline;
}

.account-stepper {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 10px;
  border: 1px solid #c4c4c4;
  border-radius: 2px;
}

.account-stepper button {
  display: inline-flex;
  padding: 4px;
  border: 0;
  background: none;
  color: #111;
  cursor: pointer;
}

.account-stepper button:disabled {
  opacity: .4;
  cursor: default;
}

.account-stepper span {
  min-width: 22px;
  text-align: center;
}

.account-unit-price {
  display: block;
  margin-top: 4px;
  color: #888;
  font-size: 12px;
}

.is-saving {
  cursor: progress;
}

.account-order-total {
  padding: 32px 24px;
  border-bottom: 1px solid #ddd;
  margin: 0 24px;
  text-align: right;
  font-size: 20px;
  font-weight: 500;
}

.account-order-total strong {
  margin-left: 8px;
}

.account-order-notes {
  margin: 16px 24px 0;
  color: #555;
  font-size: 14px;
}

.account-order-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 24px 24px 0;
  font-size: 15px;
}

.account-order-footer a {
  color: #0000ff;
}

.account-btn-danger-link {
  padding: 0;
  border: 0;
  background: none;
  color: #c62828;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.account-empty {
  padding: 48px 16px;
  text-align: center;
}

/* Paginación */
.account-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 24px 40px;
  padding: 30px 24px 0;
  font-size: 16px;
  color: #444;
}

.account-pager-size {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
}

.account-pager-size select {
  width: 88px;
  height: 44px;
  padding: 0 10px;
  border: 1px solid #c4c4c4;
  border-radius: 2px;
  background: #fff;
  font: inherit;
}

.account-pager-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.account-pager-nav a {
  display: inline-flex;
  color: #222;
}

.account-pager-nav .is-disabled {
  display: inline-flex;
  color: #c4c4c4;
}

/* Perfil */
.account-profile {
  display: flex;
  flex-wrap: wrap;
  gap: 40px 110px;
  padding: 32px 48px;
}

.account-profile-photo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: 200px;
}

.account-profile-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 200px;
  height: 200px;
  overflow: hidden;
  border-radius: 50%;
  background: #e3efff;
  color: #1e5fd8;
  font-size: 56px;
  font-weight: 300;
}

.account-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-avatar-change {
  cursor: pointer;
}

.account-help {
  margin: 0;
  text-align: center;
  font-size: 12px;
  color: #777;
}

.account-profile-form {
  flex: 0 1 360px;
  min-width: 260px;
}

.account-profile-form .customer-field {
  margin-bottom: 22px;
}

.account-profile-form input:disabled {
  background: #f6f6f6;
  color: #777;
}

.account-save {
  min-width: 240px;
  margin-top: 18px;
}

/* Diálogo de confirmación */
.account-dialog {
  width: min(420px, calc(100vw - 32px));
  padding: 24px;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .2);
  font-family: 'Roboto', system-ui, sans-serif;
  color: #333;
}

.account-dialog::backdrop {
  background: rgba(0, 0, 0, .35);
}

.account-dialog h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 500;
}

.account-dialog p {
  margin: 0 0 24px;
  font-size: 15px;
}

.account-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.account-btn-secondary,
.account-btn-danger {
  height: 40px;
  padding: 0 18px;
  border-radius: 4px;
  font: inherit;
  cursor: pointer;
}

.account-btn-secondary {
  border: 1px solid #c4c4c4;
  background: #fff;
}

.account-btn-danger {
  border: 0;
  background: #d32f2f;
  color: #fff;
}

/* Aviso inferior */
.account-toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  z-index: 50;
  transform: translateX(-50%);
  min-width: 300px;
  max-width: calc(100vw - 32px);
  padding: 10px 24px;
  border-radius: 2px;
  background: #000;
  color: #fff;
  text-align: center;
  font-size: 16px;
}

.account-toast.is-error {
  background: #b3261e;
}

/* Móvil: la barra lateral pasa abajo y las tablas se apilan */
@media (max-width: 760px) {
  .account-header { height: 60px; padding: 0 16px; }
  .account-brand { font-size: 17px; }
  .account-user-name { display: none; }
  .account-header-actions { gap: 14px; }
  .account-shell { flex-direction: column-reverse; gap: 0; padding: 0 0 72px; min-height: 0; }
  .account-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    flex-direction: row; justify-content: space-around; width: auto; height: 64px; padding: 4px 8px;
    border-top: 1px solid #e3e3e3; background: #fff;
  }
  .account-nav-main { flex-direction: row; gap: 8px; }
  .account-main { padding: 16px; border: 0; border-radius: 0; }
  .account-page-head { padding: 16px; margin-bottom: 16px; }
  .account-breadcrumb { display: none; }
  .account-card { padding: 16px; }
  .account-card-title { margin-bottom: 8px; padding: 4px 0 16px; }
  .account-table-wrap { padding: 0; overflow: visible; }
  .account-table thead { display: none; }
  .account-table, .account-table tbody, .account-table tr, .account-table td { display: block; width: 100%; }
  .account-table tr { position: relative; padding: 12px 0 12px 44px; border-bottom: 1px solid #ddd; }
  .account-table td { height: auto; padding: 3px 0; border: 0; text-align: left !important; }
  .account-table td[data-label]::before { content: attr(data-label) ': '; color: #888; font-size: 13px; }
  .account-row-index { position: absolute; left: 0; top: 12px; width: 32px !important; font-size: 18px; }
  .account-row-actions { position: absolute; right: 0; top: 6px; width: auto !important; }
  .account-items-table tr { padding-left: 120px; min-height: 120px; }
  .account-items-table .account-row-index { display: none !important; }
  .account-item-image { position: absolute; left: 0; top: 12px; width: 104px !important; }
  .account-item-name { min-width: 0; padding-right: 48px !important; }
  .account-order-total { margin: 0; padding: 20px 0; }
  .account-order-footer { margin: 16px 0 0; }
  .account-pager { justify-content: center; gap: 16px 24px; padding: 20px 0 0; }
  .account-profile { padding: 16px 0; justify-content: center; }
  .account-profile-form { flex-basis: 100%; }
  .account-save { width: 100%; }
}
