/* PSI — estilos del sitio y del portal */
:root {
  --ground: #F3F5F7;
  --surface: #FFFFFF;
  --soft: #F8FAFB;
  --ink: #0F1C2B;
  --ink-2: #3E4C5B;
  --muted: #4A5868;
  --line: #DDE3E9;
  --field: #B9C4CF;
  --accent: #1C67AB;
  --accent-strong: #134B7E;
  --accent-soft: #E6EFF8;
  --navy: #0F1C2B;
  --navy-2: #0A1420;
  --navy-line: #3A5572;
  --navy-muted: #B8C6D4;
  --navy-text: #D5DEE8;
  --sky: #8DB8E0;
  --danger: #9B2C2C;
  --danger-soft: #FDF0F0;
  --ok: #1E6B45;
  --ok-soft: #E5F3EB;
  --amber: #7A4B00;
  --amber-soft: #FFF1D6;
  --violet: #5B2E91;
  --violet-soft: #F1E8FB;
  --display: "Sora", "Helvetica Neue", Helvetica, sans-serif;
  --body: "IBM Plex Sans", "Helvetica Neue", Helvetica, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto
  }
}

body {
  margin: 0;
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--ground)
}

h1,
h2,
h3 {
  font-family: var(--display);
  margin: 0;
  line-height: 1.15
}

p {
  margin: 0
}

a {
  color: var(--accent-strong)
}

img,
svg {
  max-width: 100%
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px
}

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

[hidden] {
  display: none !important
}

.wrap {
  max-width: 1248px;
  margin: 0 auto;
  padding: 0 24px
}

.eyebrow {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent)
}

.lead {
  font-size: 18px;
  color: var(--ink-2)
}

.muted {
  color: var(--muted)
}

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
  background: none
}

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

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

.btn-primary:disabled {
  opacity: .55;
  cursor: not-allowed
}

.btn-outline {
  background: var(--surface);
  border-color: var(--field);
  color: var(--ink)
}

.btn-outline:hover {
  border-color: var(--ink)
}

.btn-sm {
  min-height: 44px;
  padding: 0 14px;
  font-size: 15px;
  border-radius: 10px
}

.icon-btn {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--field);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer
}

/* Formularios */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  font-weight: 500
}

.field input,
.field select,
.field textarea {
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--field);
  border-radius: 10px;
  background: var(--surface);
  font-size: 16px;
  font-weight: 400;
  width: 100%
}

.field textarea {
  resize: vertical;
  min-height: 120px
}

.grid2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px
}

.req {
  color: var(--danger)
}

.hint {
  font-size: 14px;
  color: var(--muted)
}

.msg-box {
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 500
}

.msg-box.ok {
  background: var(--ok-soft);
  color: var(--ok)
}

.msg-box.err {
  background: var(--danger-soft);
  color: #8A1F1F;
  border: 1px solid #E3A5A5
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden
}

/* Encabezado del sitio */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--surface);
  border-bottom: 1px solid var(--line)
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 100px
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink)
}

.brand-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: .02em;
  line-height: 1.1
}

.brand-sub {
  display: block;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.2
}

.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-weight: 500
}

.nav a {
  color: var(--ink);
  text-decoration: none
}

.nav a:hover {
  color: var(--accent-strong)
}

.nav .btn-primary {
  color: #fff
}

.nav-portal {
  display: inline-flex;
  align-items: center;
  gap: 8px
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--field);
  border-radius: 10px;
  background: var(--surface);
  font-weight: 600;
  cursor: pointer
}

.menu-btn {
  display: none
}

.brand-logo {
  display: flex;
  align-items: center;
  height: 95px;
  max-height: 95px;
  flex-shrink: 0;
  text-decoration: none;
}

.brand-logo img {
  height: 100% !important;
  max-height: 95px !important;
  width: auto !important;
  object-fit: contain;
}

/* Portada */
.hero .wrap {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 64px;
  align-items: center;
  padding-top: 88px;
  padding-bottom: 96px
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 26px
}

.hero h1 {
  font-size: clamp(38px, 5vw, 60px);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.08
}

.hero .lead {
  max-width: 560px;
  font-size: 20px
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px
}

.hero-art {
  width: 100%;
  height: auto
}

/* Secciones */
.section {
  padding: 96px 0
}

.section-white {
  background: var(--surface)
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 760px;
  margin-bottom: 44px
}

.section-head h2 {
  font-size: clamp(30px, 3.4vw, 44px);
  letter-spacing: -.01em
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px
}

.card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--soft)
}

.card h3 {
  font-size: 20px;
  font-weight: 600
}

.card p {
  color: var(--ink-2);
  font-size: 16px
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px
}

.step {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 34px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px
}

.step-n {
  font-family: var(--display);
  font-size: 38px;
  font-weight: 700;
  color: var(--accent)
}

.step h3 {
  font-size: 21px;
  font-weight: 600
}

.step p {
  color: var(--ink-2)
}

/* Contacto */
.contact {
  background: var(--navy);
  color: #fff
}

.contact .wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px
}

.contact .eyebrow {
  color: var(--sky)
}

.contact h2 {
  font-size: clamp(30px, 3.4vw, 44px);
  margin-top: 16px
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 28px;
  color: var(--navy-text);
  font-size: 17px
}

.contact-card {
  padding: 36px;
  background: var(--surface);
  color: var(--ink);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative
}

.site-footer {
  background: var(--navy-2);
  color: #A9B6C4;
  font-size: 14px
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  min-height: 88px
}

.site-footer a {
  color: #D5DEE8
}

/* Chat flotante */
.chat-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  width: 64px;
  height: 64px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 30px rgba(15, 28, 43, .28);
  cursor: pointer
}

.chat-fab:hover {
  background: var(--accent-strong)
}

.chat-panel {
  position: fixed;
  right: 24px;
  bottom: 100px;
  z-index: 40;
  width: 390px;
  height: min(600px, calc(100vh - 140px));
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(15, 28, 43, .22);
  overflow: hidden
}

.chat-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 12px 14px 18px;
  background: var(--navy);
  color: #fff
}

.chat-top .avatar {
  width: 60px;
  height: 60px;
  border-radius: 60%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0
}

.chat-top .avatar img {
  width: 45px !important;
  height: 45px !important;
  max-width: 50px !important;
  max-height: 50px !important;
  object-fit: contain !important;
}

.chat-top .t {
  font-family: var(--display);
  font-weight: 600
}

.chat-top .s {
  font-size: 13px;
  color: var(--navy-muted)
}

.chat-top .grow {
  flex: 1
}

.chat-close {
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  color: #fff;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center
}

.chat-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  background: var(--ground)
}

.bubble {
  max-width: 85%;
  padding: 11px 14px;
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere
}

.bubble.bot {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px
}

.bubble.user {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px
}

.bubble.wait {
  color: var(--muted)
}

.bubble.err {
  align-self: flex-start;
  border: 1px solid var(--danger);
  color: var(--danger);
  background: transparent
}

.bubble.saved {
  align-self: center;
  background: var(--ok-soft);
  color: var(--ok);
  border-radius: 999px;
  font-weight: 500;
  font-size: 14px;
  padding: 6px 14px
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px
}

.chip {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent-strong);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  text-align: left
}

.chip:hover {
  background: var(--accent-soft)
}

.chat-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px 10px;
  border-top: 1px solid var(--line)
}

.chat-row {
  display: flex;
  gap: 8px;
  align-items: flex-end
}

.chat-row textarea {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  max-height: 120px;
  resize: none;
  padding: 10px 12px;
  border: 1px solid var(--field);
  border-radius: 10px;
  font-size: 15px;
  line-height: 1.4
}

.chat-send {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer
}

.chat-send:disabled {
  opacity: .5;
  cursor: not-allowed
}

.chat-note {
  font-size: 12px;
  color: var(--muted)
}

/* Portal */
.portal-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column
}

.p-header {
  background: var(--navy);
  color: #fff
}

.p-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 85px;
  flex-wrap: wrap
}

.p-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #fff;
  text-decoration: none
}

.p-brand img {
  height: 80px;
  max-height: 80px;
  width: auto;
  object-fit: contain
}

.p-brand .brand-name {
  font-size: 20px
}

.p-brand .p-label {
  font-size: 15px;
  color: var(--navy-muted);
  padding-left: 14px;
  border-left: 1px solid var(--navy-line)
}

.p-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  font-size: 15px
}

.p-nav a {
  color: var(--navy-text);
  text-decoration: none;
  padding: 10px 0;
  border-bottom: 2px solid transparent
}

.p-nav a[aria-current="page"] {
  color: #fff;
  font-weight: 600;
  border-bottom-color: var(--sky)
}

.p-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 20px;
  border-left: 1px solid var(--navy-line)
}

.p-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px
}

.p-user .n {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3
}

.p-user .e {
  font-size: 13px;
  color: var(--navy-muted);
  line-height: 1.3
}

.p-logout {
  border: none;
  background: none;
  color: var(--navy-muted);
  cursor: pointer;
  min-height: 44px;
  font-size: 14px
}

.p-logout:hover {
  color: #fff
}

.p-main {
  flex: 1;
  padding: 40px 0 64px
}

.p-main .wrap {
  display: flex;
  flex-direction: column;
  gap: 24px
}

.p-title {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  justify-content: space-between
}

.p-title h1 {
  font-size: 32px
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px
}

.stat {
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 2px
}

.stat .k {
  font-size: 14px;
  color: var(--muted)
}

.stat .v {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 700
}

.stat.hot {
  border-color: var(--violet)
}

.stat.hot .k,
.stat.hot .v {
  color: var(--violet)
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px
}

.panel-pad {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line)
}

.seg {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap
}

.seg button {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer
}

.seg button[aria-pressed="true"] {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff
}

.toolbar .field {
  min-width: 180px
}

.toolbar .field input,
.toolbar .field select {
  min-height: 44px
}

.table-wrap {
  overflow-x: auto
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  min-width: 900px
}

th,
td {
  text-align: left;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  vertical-align: top
}

th {
  background: var(--ground);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted)
}

tbody tr:last-child td {
  border-bottom: none
}

td .sub {
  font-size: 13px;
  color: var(--muted)
}

td select {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--field);
  border-radius: 8px;
  background: var(--surface)
}

.folio {
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
  color: var(--accent-strong)
}

.empty {
  padding: 44px 20px;
  text-align: center;
  color: var(--muted)
}

.tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap
}

.st-abierto {
  background: var(--accent-soft);
  color: var(--accent-strong)
}

.st-proceso {
  background: var(--amber-soft);
  color: var(--amber)
}

.st-espera {
  background: var(--violet-soft);
  color: var(--violet)
}

.st-resuelto {
  background: var(--ok-soft);
  color: var(--ok)
}

.st-cerrado {
  background: var(--ground);
  color: var(--muted);
  border: 1px solid var(--line)
}

.st-nuevo {
  background: var(--accent-soft);
  color: var(--accent-strong)
}

.pr-alta,
.pr-urgente {
  color: var(--danger);
  font-weight: 600
}

.detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  align-items: start
}

.crumbs {
  display: flex;
  gap: 8px;
  font-size: 15px;
  color: var(--muted)
}

.crumbs a {
  font-weight: 600
}

.thread {
  display: flex;
  flex-direction: column;
  gap: 14px
}

.tmsg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 80%
}

.tmsg .who {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600
}

.tmsg .body {
  padding: 13px 16px;
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere
}

.tmsg.them {
  align-self: flex-start
}

.tmsg.them .body {
  background: var(--ground);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px
}

.tmsg.me {
  align-self: flex-end;
  align-items: flex-end
}

.tmsg.me .body {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px
}

dl.meta {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px
}

dl.meta dt {
  font-size: 13px;
  color: var(--muted)
}

dl.meta dd {
  margin: 2px 0 0;
  font-weight: 500;
  overflow-wrap: anywhere
}

dl.meta select,
dl.meta input {
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid var(--field);
  border-radius: 8px;
  background: var(--surface);
  width: 100%;
  margin-top: 4px
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px
}

.timeline div {
  display: flex;
  gap: 10px;
  align-items: center
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0
}

.prio-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 10px
}

.prio-pick button {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid var(--field);
  background: var(--surface);
  font-weight: 600;
  cursor: pointer
}

.prio-pick button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong)
}

.side-tip {
  padding: 26px;
  background: var(--navy);
  color: #fff;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px
}

.side-tip p {
  color: var(--navy-text);
  font-size: 15px
}

.form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  align-items: start
}

.temp-pass {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 20px;
  font-weight: 600;
  padding: 12px 16px;
  background: var(--ground);
  border: 1px dashed var(--field);
  border-radius: 10px;
  user-select: all
}

/* Login */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 540px) minmax(0, 1fr)
}

.auth-side {
  background: var(--navy);
  color: #fff;
  padding: 56px;
  display: flex;
  flex-direction: column;
  gap: 28px
}

.auth-side .brand {
  color: #fff
}

.auth-side .brand img {
  max-height: 100px;
  width: auto;
  object-fit: contain;
}

.auth-side .brand-sub {
  color: var(--navy-muted)
}

.auth-side h2 {
  font-size: 38px;
  margin-top: 40px
}

.auth-side p {
  color: var(--navy-muted);
  font-size: 18px
}

.auth-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: var(--navy-text)
}

.auth-list div {
  display: flex;
  gap: 12px;
  align-items: center
}

.auth-side .art {
  margin-top: auto
}

.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px
}

.auth-form {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 20px
}

.auth-form h1 {
  font-size: 32px
}

.pw-wrap {
  position: relative;
  display: flex
}

.pw-wrap input {
  padding-right: 56px
}

.pw-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted)
}

.row-between {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 15px
}

.check input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent)
}

.divider {
  padding-top: 14px;
  border-top: 1px solid var(--line)
}

.center-card {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 24px
}

.center-card .panel {
  width: 100%;
  max-width: 480px
}

@media (max-width: 1080px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr))
  }

  .hero .wrap {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-top: 56px;
    padding-bottom: 64px
  }

  .hero-art {
    max-width: 520px
  }

  .contact .wrap {
    grid-template-columns: 1fr;
    gap: 36px
  }

  .detail,
  .form-layout {
    grid-template-columns: 1fr
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr))
  }
}

@media (max-width: 900px) {
  .menu-btn {
    display: inline-flex
  }

  .nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 8px 24px 20px
  }

  .nav.open {
    display: flex
  }

  .nav a {
    padding: 14px 0;
    border-bottom: 1px solid var(--line)
  }

  .nav .btn-primary {
    margin-top: 14px;
    border-bottom: none
  }

  .header-tools {
    display: flex;
    gap: 8px;
    align-items: center
  }

  .auth {
    grid-template-columns: 1fr
  }

  .auth-side {
    padding: 28px 24px;
    gap: 12px
  }

  .auth-side h2 {
    font-size: 26px;
    margin-top: 8px
  }

  .auth-side .auth-list,
  .auth-side .art,
  .auth-side p {
    display: none
  }
}

@media (max-width: 640px) {
  .section {
    padding: 64px 0
  }

  .cards,
  .steps,
  .grid2 {
    grid-template-columns: 1fr
  }

  .brand-sub {
    display: none
  }

  .contact-card {
    padding: 24px
  }

  .chat-panel {
    left: 10px;
    right: 10px;
    width: auto;
    bottom: 92px;
    height: calc(100vh - 120px)
  }

  .chat-fab {
    right: 16px;
    bottom: 16px
  }

  .p-brand .p-label {
    display: none
  }

  .p-user {
    border-left: none;
    padding-left: 0
  }

  .p-user .e {
    display: none
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr))
  }

  .tmsg {
    max-width: 92%
  }
}

.header-tools {
  display: flex;
  gap: 8px;
  align-items: center
}

.legal {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 16px
}

.legal h1 {
  font-size: 34px
}

.legal h2 {
  font-size: 20px;
  margin-top: 12px
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 18px
}

fieldset {
  border: none;
  margin: 0;
  padding: 0;
  min-width: 0
}

legend {
  padding: 0
}

.stack-sm {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start
}

.file-btn {
  cursor: pointer;
  position: relative
}

.file-btn:focus-within {
  outline: 3px solid var(--accent);
  outline-offset: 2px
}

.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px
}

.file-list li {
  display: flex;
  gap: 10px;
  align-items: center
}

.link-btn {
  border: none;
  background: none;
  color: var(--accent-strong);
  font-weight: 600;
  cursor: pointer;
  min-height: 36px;
  padding: 0 4px
}

.attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px
}

.thumb {
  display: block;
  width: 120px;
  height: 90px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--ground)
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block
}

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-size: 14px
}

.file-chip:hover {
  border-color: var(--accent)
}

.tmsg.me .attachments {
  justify-content: flex-end
}

/* Reportes */
.subtabs {
  margin-bottom: -8px
}

.subtab {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid var(--field);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none
}

.subtab[aria-current="page"] {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff
}

.range-bar {
  border-bottom: none
}

.range-bar input[type=date] {
  min-height: 44px
}

.section-label {
  font-size: 22px;
  margin-top: 8px
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px
}

.report-card h2 {
  font-size: 19px
}

.chart-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px
}

.chart {
  width: 100%;
  height: auto;
  display: block
}

.chart .grid {
  stroke: var(--line);
  stroke-width: 1
}

.chart .axis {
  font-size: 12px;
  fill: var(--muted);
  font-family: var(--body)
}

.chart .bar.c1 {
  fill: var(--accent)
}

.chart .bar.c2 {
  fill: var(--sky)
}

.legend {
  display: flex;
  gap: 18px;
  font-size: 14px;
  color: var(--muted)
}

.legend>span {
  display: inline-flex;
  align-items: center;
  gap: 8px
}

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block
}

.swatch.c1 {
  background: var(--accent)
}

.swatch.c2 {
  background: var(--sky)
}

.barlist {
  display: flex;
  flex-direction: column;
  gap: 10px
}

.barrow {
  display: grid;
  grid-template-columns: minmax(120px, 1.1fr) minmax(80px, 2fr) auto;
  gap: 12px;
  align-items: center;
  font-size: 14px
}

.barrow .lbl {
  overflow-wrap: anywhere
}

.barrow .track {
  height: 12px;
  border-radius: 6px;
  background: var(--ground);
  overflow: hidden
}

.barrow .fill {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 6px
}

.barrow .num {
  font-weight: 600;
  white-space: nowrap
}

table.compact {
  min-width: 0;
  font-size: 14px
}

table.compact th,
table.compact td {
  padding: 10px 12px
}

.data-details summary {
  cursor: pointer;
  color: var(--accent-strong);
  font-weight: 600;
  font-size: 14px;
  min-height: 36px;
  display: flex;
  align-items: center
}

.stat .hint {
  font-size: 13px
}

@media (max-width: 1080px) {
  .report-grid {
    grid-template-columns: 1fr
  }
}

@media print {

  .p-header,
  .no-print,
  .subtabs,
  .data-details summary {
    display: none !important
  }

  .data-details {
    display: none
  }

  body {
    background: #fff
  }

  .p-main {
    padding: 0
  }

  .panel,
  .stat {
    break-inside: avoid;
    border-color: #ccc
  }

  .report-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr))
  }
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end
}

/* Nosotros */
.mv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px
}

.mv-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 36px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--soft)
}

.mv-card p {
  font-size: 19px;
  line-height: 1.6;
  color: var(--ink-2)
}

.mv-dark {
  background: var(--navy);
  border-color: var(--navy)
}

.mv-dark p {
  color: var(--navy-text)
}

.mv-label {
  font-family: var(--display);
  font-weight: 700;
  font-size: 24px
}

.mv-dark .mv-label {
  color: #fff
}

.values-title {
  font-size: 26px;
  margin: 56px 0 22px
}

.values {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px
}

.value {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface)
}

.value h4 {
  font-family: var(--display);
  font-size: 19px;
  margin: 0
}

.value p {
  color: var(--ink-2);
  font-size: 16px
}

/* Marcas */
.brands-head {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px
}

.brands-head .section-head {
  margin-bottom: 0
}

.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent)
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee var(--dur, 40s) linear infinite
}

.marquee:hover .marquee-track,
.marquee:focus-within .marquee-track,
.marquee.paused .marquee-track {
  animation-play-state: paused
}

@keyframes marquee {
  to {
    transform: translateX(-50%)
  }
}

.brand-list {
  display: flex;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0 10px
}

.brand-item {
  flex: 0 0 auto;
  min-width: 190px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface)
}

.brand-item img {
  max-height: 46px;
  max-width: 150px;
  object-fit: contain;
  filter: none;
  opacity: 1;
  transition: filter .2s, opacity .2s
}

.brand-item:hover img {
  filter: none;
  opacity: 1
}

.brand-text {
  font-family: var(--display);
  font-weight: 600;
  font-size: 21px;
  color: var(--muted);
  white-space: nowrap
}

@media (prefers-reduced-motion: reduce) {
  .marquee {
    -webkit-mask-image: none;
    mask-image: none
  }

  .marquee-track {
    animation: none;
    width: auto
  }

  .brand-list {
    flex-wrap: wrap;
    justify-content: center
  }

  .brand-dup,
  .brand-item[aria-hidden="true"],
  .marquee-toggle {
    display: none
  }
}

@media (max-width: 1080px) {
  .values {
    grid-template-columns: repeat(2, minmax(0, 1fr))
  }
}

@media (max-width: 640px) {

  .mv-grid,
  .values {
    grid-template-columns: 1fr
  }

  .mv-card {
    padding: 26px
  }

  .mv-card p {
    font-size: 17px
  }

  .brand-item {
    min-width: 150px;
    height: 80px;
    padding: 0 20px
  }
}

.card-art {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px
}

.card {
  padding: 18px 18px 26px
}

.card h3,
.card p {
  padding: 0 8px
}

.card-art {
  overflow: hidden
}

/* Catálogo */
.catalog-cta {
  background: linear-gradient(180deg, var(--surface) 0, var(--accent-soft) 100%)
}

.catalog-grid {
  display: grid;
  grid-template-columns: minmax(220px, 360px) 1fr;
  gap: 64px;
  align-items: center
}

.catalog-cover {
  width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 30px 60px rgba(15, 28, 43, .28), 0 4px 10px rgba(15, 28, 43, .15);
  transform: rotate(-3deg)
}

.catalog-copy {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 620px
}

.catalog-copy h2 {
  font-size: clamp(30px, 3.4vw, 44px)
}

.footer-links {
  display: inline-flex;
  gap: 20px;
  flex-wrap: wrap
}

@media (max-width: 900px) {
  .catalog-grid {
    grid-template-columns: 1fr;
    gap: 36px
  }

  .catalog-cover {
    max-width: 280px;
    margin: 0 auto
  }
}

@media (prefers-reduced-motion: reduce) {
  .catalog-cover {
    transform: none
  }
}

/* Mapa de ubicación */
.map-block {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 28px
}

.map-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #2A4058;
  background: #13263A
}

.map-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0
}

.map-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px
}

.contact .map-outline {
  background: transparent;
  color: #fff;
  border-color: #3A5572
}

.contact .map-outline:hover {
  border-color: #8DB8E0
}

.map-static {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%
}

/* Valores (rediseño) */
.values-band {
  margin-top: 48px;
  display: grid;
  grid-template-columns: minmax(200px, 260px) 1fr;
  gap: 40px;
  align-items: center;
  padding: 36px 40px;
  border-radius: 22px;
  background: var(--accent-soft)
}

.values-intro {
  display: flex;
  flex-direction: column;
  gap: 10px
}

.values-band .values-title {
  margin: 0;
  font-size: 28px
}

.values-intro p {
  color: var(--ink-2);
  font-size: 16px
}

.values-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0
}

.val {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px 24px;
  border-left: 1px solid #C3D7EC
}

.val:first-child {
  border-left: none;
  padding-left: 0
}

.val-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px
}

.val h4 {
  font-family: var(--display);
  font-size: 18px;
  margin: 0
}

.val p {
  font-size: 15px;
  color: var(--ink-2);
  line-height: 1.5
}

@media (max-width: 1080px) {
  .values-band {
    grid-template-columns: 1fr;
    gap: 24px
  }

  .values-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 0
  }

  .val:nth-child(3) {
    border-left: none;
    padding-left: 0
  }
}

@media (max-width: 640px) {
  .values-band {
    padding: 26px 22px
  }

  .values-list {
    grid-template-columns: 1fr;
    gap: 18px
  }

  .val {
    border-left: none;
    padding: 0 0 18px;
    border-bottom: 1px solid #C3D7EC;
    flex-direction: row;
    flex-wrap: wrap;
    column-gap: 14px;
    align-items: center
  }

  .val:last-child {
    border-bottom: none;
    padding-bottom: 0
  }

  .val-icon {
    margin-bottom: 0
  }

  .val p {
    flex-basis: 100%
  }
}

/* Página de productos */
.prod-topnav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-weight: 500
}

.prod-topnav a {
  color: var(--ink);
  text-decoration: none
}

.prod-topnav a[aria-current="page"] {
  color: var(--accent-strong);
  font-weight: 600
}

.prod-topnav .btn-primary {
  color: #fff
}

.prod-hero {
  background: var(--navy);
  color: #fff;
  padding: 64px 0 56px
}

.prod-hero .wrap {
  display: flex;
  flex-direction: column;
  gap: 14px
}

.prod-hero .eyebrow {
  color: var(--sky)
}

.prod-hero h1 {
  font-size: clamp(34px, 4vw, 52px)
}

.prod-hero .lead {
  color: var(--navy-text);
  max-width: 680px
}

.prod-body {
  padding: 40px 0 80px
}

.prod-body .wrap {
  display: flex;
  flex-direction: column;
  gap: 18px
}

.prod-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between
}

.prod-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px
}

.prod-cats button {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--field);
  background: var(--surface);
  font-weight: 600;
  cursor: pointer;
  color: var(--ink)
}

.prod-cats button[aria-pressed="true"] {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff
}

.prod-search {
  min-width: 260px
}

.prod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 22px
}

.prod-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden
}

.prod-card.is-out {
  opacity: .75
}

.prod-art {
  position: relative;
  aspect-ratio: 5/3;
  background: var(--accent-soft)
}

.prod-art img,
.prod-art .prod-ph {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block
}

.prod-flag {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px
}

.prod-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px 20px;
  flex: 1
}

.prod-cat {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent)
}

.prod-name {
  font-size: 19px;
  line-height: 1.3
}

.prod-desc {
  font-size: 15px;
  color: var(--ink-2)
}

.prod-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center
}

.prod-disp.disponible {
  background: var(--ok-soft);
  color: var(--ok)
}

.prod-disp.bajo_pedido {
  background: var(--amber-soft);
  color: var(--amber)
}

.prod-disp.agotado {
  background: var(--ground);
  color: var(--muted);
  border: 1px solid var(--line)
}

.prod-sku {
  font-size: 12px;
  color: var(--muted)
}

.prod-foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px
}

.prod-price {
  display: flex;
  flex-direction: column
}

.prod-price strong {
  font-family: var(--display);
  font-size: 22px
}

.prod-price span {
  font-size: 12px;
  color: var(--muted)
}

.prod-empty {
  grid-column: 1/-1;
  padding: 48px 20px;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--field);
  border-radius: 16px
}

.prod-note {
  margin-top: 8px
}

@media (max-width: 900px) {
  .prod-topnav a:not(.btn) {
    display: none
  }
}

/* Productos en el portal */
.prod-cell {
  display: flex;
  gap: 12px;
  align-items: center
}

.prod-thumb {
  width: 64px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--accent-soft);
  display: inline-block
}

.prod-cell-name {
  font-weight: 600
}

.prod-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px;
  align-items: start
}

.prod-preview {
  aspect-ratio: 5/3;
  border-radius: 12px;
  border: 1px dashed var(--field);
  background: var(--ground);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden
}

.prod-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover
}

.danger-btn {
  color: var(--danger);
  border-color: #E3A5A5
}

@media (max-width: 1080px) {
  .prod-form {
    grid-template-columns: 1fr
  }
}

.nav a,
.nav .btn {
  white-space: nowrap
}

@media (min-width: 901px) and (max-width: 1180px) {
  .brand-sub {
    display: none
  }

  .nav {
    gap: 16px;
    font-size: 15px
  }

  .nav .btn-sm {
    padding: 0 12px
  }
}

/* Certificaciones (debajo de marcas) */
.certs-section {
  padding-top: 24px;
}

.brands-section+.certs-section {
  padding-top: 8px;
}

.certs-section .section-head {
  margin-bottom: 28px;
}

/* 1. Nuevo contenedor que oculta el desbordamiento y aplica un suave difuminado en las orillas */
.cert-carousel {
  overflow: hidden;
  width: 100%;
  position: relative;
  mask-image: linear-gradient(to right, transparent, black 4%, black 96%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 4%, black 96%, transparent);
}

/* 2. Cambiamos grid por flex y añadimos la animación continua */
.cert-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  /* Cambiado de grid a flex */
  gap: 16px;
  width: max-content;
  animation: certs-scroll 90s linear infinite;
  /* Animación continua */
}

/* 3. Pausar la animación cuando el usuario coloca el cursor encima */
.cert-carousel:hover .cert-list,
.cert-list.paused {
  animation-play-state: paused;
}

/* 4. Ajustes en las tarjetas para que no se reduzcan */
.cert {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--soft);
  width: 320px;
  /* Ancho fijo para cada tarjeta */
  flex-shrink: 0;
  /* Evita que se compriman */
}

.cert-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.cert-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px;
}

.cert-txt {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

.cert-txt strong {
  font-family: var(--display);
  font-size: 16px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.cert-txt span {
  font-size: 14px;
  color: var(--muted);
}

.cert-link {
  font-size: 14px;
  font-weight: 600;
  align-self: flex-start;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}

/* 5. Regla Keyframes para lograr el bucle infinito */
@keyframes certs-scroll {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(calc(-50% - 8px));
    /* Desplaza exactamente la primera mitad cargada */
  }
}

/* Contador de visitas */
.visit-counter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid #243A52;
  border-radius: 999px;
  color: #C9D6E3
}

.visit-counter strong {
  color: #fff;
  font-variant-numeric: tabular-nums
}

/* Tienda: carrito y pedido */
.prod-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end
}

.cart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--field);
  border-radius: 10px;
  background: var(--surface);
  font-weight: 600;
  cursor: pointer;
  color: var(--ink)
}

.cart-count {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center
}

.cart-dialog {
  width: min(620px, calc(100vw - 24px));
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(15, 28, 43, .3)
}

.cart-dialog::backdrop {
  background: rgba(15, 28, 43, .45)
}

.cart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1
}

.cart-head h2 {
  font-size: 22px
}

.cart-body {
  padding: 18px 22px 24px
}

.cart-body h3 {
  font-size: 18px
}

.cart-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column
}

.cart-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line)
}

.ci-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0
}

.ci-name {
  font-weight: 600;
  overflow-wrap: anywhere
}

.ci-unit {
  font-size: 13px;
  color: var(--muted)
}

.ci-total {
  white-space: nowrap
}

.cart-empty {
  padding: 28px 0;
  text-align: center;
  color: var(--muted)
}

.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--field);
  border-radius: 10px;
  overflow: hidden
}

.qty button {
  width: 40px;
  height: 40px;
  border: none;
  background: var(--surface);
  font-size: 18px;
  cursor: pointer
}

.qty-n {
  min-width: 32px;
  text-align: center;
  font-weight: 600
}

.cart-totals {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 0
}

.tot-row {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  color: var(--ink-2)
}

.tot-row.total {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  padding-top: 8px;
  border-top: 1px solid var(--line)
}

.cart-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px
}

.mp-btn {
  background: #009EE3
}

.mp-btn:hover {
  background: #007EB5
}

.order-card {
  max-width: 560px
}

.order-card h1 {
  font-size: 28px
}

.order-badge {
  align-self: flex-start;
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong)
}

.order-badge.ok {
  background: var(--ok-soft);
  color: var(--ok)
}

.order-badge.err {
  background: var(--danger-soft);
  color: #8A1F1F
}

.order-badge.wait {
  background: var(--amber-soft);
  color: var(--amber)
}

@media (max-width: 640px) {
  .cart-item {
    grid-template-columns: 1fr auto
  }

  .ci-total {
    grid-column: 1/-1;
    text-align: right
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 60;
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--navy);
  color: #fff;
  font-size: 14px;
  box-shadow: 0 12px 30px rgba(15, 28, 43, .3)
}

.detail-row td {
  background: var(--soft)
}

.order-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 8px 32px;
  padding: 8px 0
}

.order-detail .cart-list,
.order-detail .cart-totals {
  grid-column: 1
}

.order-detail dl.meta {
  grid-column: 2;
  grid-row: 1/span 3
}

@media (max-width: 900px) {
  .order-detail {
    grid-template-columns: 1fr
  }

  .order-detail dl.meta {
    grid-column: 1;
    grid-row: auto
  }
}