/* ==========================================================
   SAMÉA — sistema de diseño
   Paleta tomada del logotipo: rosa empolvado + oro rosa.
   ========================================================== */

:root {
  --bg: #fbf7f4;
  --surface: #ffffff;
  --blush: #f4e4df;
  --blush-deep: #ead0c8;
  --ink: #2b2226;
  --ink-soft: #4a3d42;
  --muted: #85747a;
  --gold: #a8715a;
  --gold-light: #c89a82;
  --line: #eadfda;
  --success: #3f7d5c;
  --warning: #b7792b;
  --danger: #b0473f;

  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;

  --radius: 4px;
  --radius-lg: 10px;
  --shadow-sm: 0 1px 2px rgba(43, 34, 38, 0.06);
  --shadow: 0 20px 50px rgba(43, 34, 38, 0.10);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --header-h: 76px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

body.no-scroll {
  overflow: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

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

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.1;
  margin: 0;
  letter-spacing: -0.01em;
}

.hidden {
  display: none !important;
}

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

.container {
  width: min(1200px, calc(100% - 2rem));
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 0.9rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}

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

/* ---------- Botones ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.95rem 1.8rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}

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

.btn-primary:hover {
  background: var(--gold);
}

.btn-ghost {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}

.btn-ghost:hover {
  background: var(--ink);
  color: #fff;
}

.btn-light {
  background: #fff;
  color: var(--ink);
}

.btn-light:hover {
  background: var(--blush);
}

.btn-block {
  width: 100%;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  position: relative;
  transition: background 0.2s var(--ease);
}

.icon-button:hover {
  background: var(--blush);
}

.icon-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.text-button {
  border: 0;
  background: none;
  padding: 0;
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.text-button:hover {
  color: var(--ink);
}

/* ---------- Cabecera ---------- */

.announcement {
  background: var(--ink);
  color: #f3e7e2;
  text-align: center;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.announcement p {
  margin: 0;
  padding: 0.6rem 1rem;
}

.announcement strong {
  color: var(--gold-light);
  font-weight: 600;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 247, 244, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: var(--header-h);
}

.menu-toggle {
  display: none;
}

.main-nav {
  display: flex;
  gap: 2rem;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.main-nav a {
  position: relative;
  white-space: nowrap;
  padding: 0.3rem 0;
}

.main-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}

.main-nav a:hover::after {
  transform: scaleX(1);
}

.wordmark {
  display: grid;
  justify-items: center;
  line-height: 1;
}

.wordmark-name {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  margin-right: -0.28em;
  color: var(--ink);
}

.wordmark-tag {
  margin-top: 0.35rem;
  font-size: 0.6rem;
  letter-spacing: 0.4em;
  margin-right: -0.4em;
  text-transform: uppercase;
  color: var(--gold);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
}

.auth-status {
  font-size: 0.82rem;
  color: var(--muted);
  margin-right: 0.3rem;
}

.auth-status strong {
  color: var(--ink);
  font-weight: 600;
}

.cart-count {
  position: absolute;
  top: 4px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--gold);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
}

/* ---------- Hero ---------- */

.hero {
  padding: 4.5rem 0 5rem;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 4rem;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.8rem, 5.5vw, 4.9rem);
}

.hero h1 em {
  font-style: italic;
  color: var(--gold);
}

.hero-lead {
  max-width: 30rem;
  margin: 1.5rem 0 2.2rem;
  font-size: 1.05rem;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.hero-stats {
  display: flex;
  gap: 3rem;
  margin: 3rem 0 0;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.hero-stats dt {
  font-family: var(--serif);
  font-size: 1.9rem;
  line-height: 1;
}

.hero-stats dd {
  margin: 0.4rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.hero-media {
  position: relative;
  margin: 0;
}

.hero-media::before {
  content: '';
  position: absolute;
  inset: 2rem -2rem -2rem 2rem;
  background: var(--blush);
  border-radius: var(--radius-lg);
  z-index: -1;
}

.hero-media img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius-lg);
}

.hero-media figcaption {
  position: absolute;
  left: 1.2rem;
  bottom: 1.2rem;
  padding: 0.55rem 0.9rem;
  background: rgba(255, 255, 255, 0.92);
  border-radius: var(--radius);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ---------- Franja de confianza ---------- */

.trust-strip {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.trust-grid div {
  display: grid;
  gap: 0.2rem;
  padding: 1.6rem 1.5rem;
  text-align: center;
}

.trust-grid div + div {
  border-left: 1px solid var(--line);
}

.trust-grid strong {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 500;
}

.trust-grid span {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ---------- Secciones ---------- */

.section {
  padding: 6rem 0;
}

.section-alt {
  background: var(--surface);
}

.section-head {
  margin-bottom: 3rem;
  text-align: center;
}

.section-head h2 {
  font-size: clamp(2.1rem, 3.6vw, 3rem);
}

.section-head-split {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  text-align: left;
}

/* ---------- Categorías ---------- */

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.category-card {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius-lg);
  aspect-ratio: 3 / 4;
  background: var(--blush);
}

.category-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease);
}

.category-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(43, 34, 38, 0.55));
}

.category-card:hover img {
  transform: scale(1.05);
}

.category-label {
  position: absolute;
  left: 1.5rem;
  right: 1.5rem;
  bottom: 1.4rem;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  color: #fff;
}

.category-label strong {
  font-family: var(--serif);
  font-size: 1.8rem;
  font-weight: 500;
}

.category-label small {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ---------- Productos ---------- */

.filter-tabs {
  display: flex;
  gap: 1.8rem;
  border-bottom: 1px solid var(--line);
}

.filter-tab {
  border: 0;
  background: none;
  padding: 0 0 0.8rem;
  margin-bottom: -1px;
  border-bottom: 1px solid transparent;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
}

.filter-tab:hover {
  color: var(--ink);
}

.filter-tab.active {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem 1.75rem;
}

.product-media {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--blush);
  aspect-ratio: 3 / 4;
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease);
}

.product-card:hover .product-media img {
  transform: scale(1.04);
}

.badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  padding: 0.35rem 0.7rem;
  background: #fff;
  border-radius: var(--radius);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.quick-add {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  padding: 0.9rem;
  border: 0;
  border-radius: var(--radius);
  background: rgba(43, 34, 38, 0.92);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), background 0.2s;
}

.quick-add:hover {
  background: var(--gold);
}

.product-card:hover .quick-add,
.quick-add:focus-visible {
  opacity: 1;
  transform: none;
}

.product-body {
  padding-top: 1.1rem;
}

.product-body h3 {
  font-size: 1.35rem;
}

.product-body p {
  margin: 0.4rem 0 0.7rem;
  font-size: 0.86rem;
  color: var(--muted);
}

.price {
  font-weight: 600;
  font-size: 0.95rem;
}

/* ---------- Total Looks ---------- */

.looks {
  background: var(--ink);
  color: #f3e7e2;
}

.looks-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 4rem;
}

.looks-media img {
  width: 100%;
  height: 560px;
  object-fit: cover;
  object-position: center 30%;
}

.looks-copy {
  padding: 4rem 0;
  max-width: 28rem;
}

.looks-copy .eyebrow {
  color: var(--gold-light);
}

.looks-copy h2 {
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  color: #fff;
}

.looks-copy p {
  margin: 1.3rem 0 2.2rem;
  color: #cbbcb6;
}

/* ---------- Historia de marca ---------- */

.story-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 5rem;
  align-items: center;
}

.story-logo {
  width: 100%;
  border-radius: var(--radius-lg);
}

.story-copy h2 {
  font-size: clamp(2.1rem, 3.6vw, 3rem);
}

.story-copy > p {
  margin: 1.3rem 0 1.8rem;
  color: var(--muted);
}

.story-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.9rem;
}

.story-points li {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
}

.story-points li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
}

/* ---------- Comentarios ---------- */

.comments-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 4rem;
  align-items: start;
}

.comments-grid h2 {
  font-size: clamp(2.1rem, 3.6vw, 3rem);
}

.comment-form {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
  justify-items: start;
}

.comment-form .form-field {
  width: 100%;
}

.form-field textarea {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font: inherit;
  resize: vertical;
}

.form-field textarea:focus {
  outline: none;
  border-color: var(--ink);
}

.comment-form .btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  max-height: 460px;
  overflow-y: auto;
}

.comment {
  padding: 1.2rem 1.4rem;
  background: var(--bg);
  border-left: 2px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  overflow-wrap: anywhere;
}

.comment p {
  margin: 0 0 0.7rem;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-style: italic;
  line-height: 1.5;
}

.comment footer {
  font-size: 0.78rem;
  color: var(--muted);
}

.comment footer strong {
  color: var(--ink);
  font-weight: 600;
}

.comment-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  width: 100%;
}

.form-field select {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font: inherit;
}

.form-field select:focus {
  outline: none;
  border-color: var(--ink);
}

.comment-empty {
  padding: 1.2rem 0;
  color: var(--muted);
}

@media (max-width: 560px) {
  .comment-form-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .comments-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

/* ---------- Newsletter ---------- */

.newsletter {
  background: var(--blush);
  padding: 4rem 0;
}

.newsletter-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.newsletter h2 {
  font-size: 2.2rem;
}

.newsletter p {
  margin: 0.4rem 0 0;
  color: var(--ink-soft);
}

.newsletter-form {
  display: flex;
  flex: 0 1 460px;
}

.newsletter-form input {
  flex: 1;
  min-width: 0;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--ink);
  border-right: 0;
  border-radius: var(--radius) 0 0 var(--radius);
  background: #fff;
}

.newsletter-form .btn {
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* ---------- Footer ---------- */

.site-footer {
  padding: 4.5rem 0 2rem;
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(2, 1fr);
  gap: 2.5rem;
}

.footer-brand .wordmark-name {
  font-size: 1.7rem;
}

.footer-brand p {
  max-width: 18rem;
  margin: 0.9rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-grid h3 {
  margin-bottom: 1rem;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.footer-grid div > a,
.footer-grid div > span {
  display: block;
  margin-bottom: 0.55rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.footer-grid a:hover {
  color: var(--ink);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--muted);
}

/* ---------- Formularios ---------- */

.form-field {
  display: grid;
  gap: 0.35rem;
}

.form-field span {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.form-field input {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  transition: border-color 0.2s;
}

.form-field input:focus {
  outline: none;
  border-color: var(--ink);
}

/* ---------- Carrito (panel lateral) ---------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(43, 34, 38, 0.45);
  animation: fade 0.3s var(--ease);
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  width: min(440px, 100%);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  box-shadow: var(--shadow);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.4s var(--ease), visibility 0.4s;
}

.drawer.open {
  transform: none;
  visibility: visible;
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--line);
}

.drawer-head h2 {
  font-size: 1.7rem;
}

.shipping-progress {
  padding: 1rem 1.5rem;
  background: var(--blush);
  font-size: 0.82rem;
}

.shipping-progress p {
  margin: 0 0 0.6rem;
}

.progress-track {
  height: 3px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: var(--gold);
  transition: width 0.4s var(--ease);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.2rem 1.5rem;
}

.cart-items {
  display: grid;
  gap: 1.2rem;
}

.cart-empty {
  display: grid;
  justify-items: center;
  gap: 1rem;
  padding: 3rem 0;
  color: var(--muted);
}

.cart-item {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 1rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--line);
}

.cart-item img {
  width: 84px;
  height: 108px;
  object-fit: cover;
  border-radius: var(--radius);
}

.cart-item-details h4 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 500;
}

.cart-item-price {
  font-size: 0.86rem;
  color: var(--muted);
}

.cart-item-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.8rem;
}

.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.qty button {
  width: 32px;
  height: 32px;
  border: 0;
  background: none;
  cursor: pointer;
}

.qty span {
  min-width: 24px;
  text-align: center;
  font-size: 0.86rem;
}



.drawer-foot {
  padding: 1.2rem 1.5rem 1.5rem;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
}

.total-row strong {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 500;
}

.fine-print {
  margin: 0.7rem 0 0;
  text-align: center;
  font-size: 0.74rem;
  color: var(--muted);
}

/* ---------- Modal de cuenta ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  place-items: center;
  padding: 1rem;
  background: rgba(43, 34, 38, 0.45);
}

.modal.open {
  display: grid;
  animation: fade 0.3s var(--ease);
}

.modal-panel {
  position: relative;
  width: min(440px, 100%);
  padding: 2.5rem 2rem 2rem;
  background: var(--bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.modal-close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
}

.modal-brand {
  margin: 0 0 1.6rem;
  text-align: center;
  font-size: 1.6rem;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 1.6rem;
  border-bottom: 1px solid var(--line);
}

.auth-tab {
  padding: 0 0 0.8rem;
  margin-bottom: -1px;
  border: 0;
  border-bottom: 1px solid transparent;
  background: none;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
}

.auth-tab.active {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.auth-form {
  display: grid;
  gap: 1rem;
}

.auth-form .btn {
  margin-top: 0.5rem;
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  z-index: 90;
  max-width: calc(100% - 2rem);
  padding: 0.9rem 1.4rem;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  font-size: 0.86rem;
  box-shadow: var(--shadow);
  transform: translate(-50%, 150%);
  opacity: 0;
  transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
  pointer-events: none;
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------- Responsive tienda ---------- */

@media (max-width: 960px) {
  .hero-grid,
  .looks-grid,
  .story-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .hero-media::before {
    inset: 1.2rem -1rem -1rem 1.2rem;
  }

  .looks-grid {
    gap: 0;
  }

  .looks-media img {
    height: 420px;
  }

  .looks-copy {
    padding: 3rem 0 3.5rem;
  }

  .story-logo {
    max-width: 380px;
    margin: 0 auto;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .trust-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .trust-grid div:nth-child(3) {
    border-left: 0;
  }

  .trust-grid div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 1080px) {
  .menu-toggle {
    display: inline-grid;
    justify-self: start;
  }

  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 1rem 1rem;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 24px rgba(43, 34, 38, 0.06);
    display: none;
  }

  .main-nav.open {
    display: flex;
  }

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

  .main-nav a:last-child {
    border-bottom: 0;
  }

  .main-nav a::after {
    display: none;
  }
}

@media (max-width: 820px) {
  :root {
    --header-h: 64px;
  }

  .wordmark-name {
    font-size: 1.5rem;
  }

  .wordmark-tag {
    display: none;
  }

  .auth-status {
    display: none;
  }

  .section {
    padding: 4rem 0;
  }

  .hero {
    padding: 2.5rem 0 4rem;
  }

  .category-grid {
    grid-template-columns: 1fr;
  }

  .category-card {
    aspect-ratio: 16 / 10;
  }
}

@media (max-width: 560px) {
  .product-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem 0.9rem;
  }

  .product-body h3 {
    font-size: 1.1rem;
  }

  .product-body p {
    display: none;
  }

  .quick-add {
    opacity: 1;
    transform: none;
    left: 0.5rem;
    right: 0.5rem;
    bottom: 0.5rem;
    padding: 0.7rem 0.4rem;
    font-size: 0.64rem;
  }

  .filter-tabs {
    gap: 1.2rem;
    overflow-x: auto;
    width: 100%;
    scrollbar-width: none;
  }

  .filter-tab {
    white-space: nowrap;
  }

  .hero-stats {
    gap: 2rem;
  }

  .trust-grid {
    grid-template-columns: 1fr;
  }

  .trust-grid div + div {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .newsletter-form {
    flex-basis: 100%;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================
   Panel de administración
   ========================================================== */

.admin {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 2rem 1.2rem;
  background: var(--ink);
  color: #d9ccc7;
}

.admin-sidebar .wordmark {
  justify-items: start;
  padding: 0 0.8rem 2rem;
}

.admin-sidebar .wordmark-name {
  color: #fff;
  font-size: 1.6rem;
}

.admin-sidebar .wordmark-tag {
  color: var(--gold-light);
}

.admin-nav {
  display: grid;
  gap: 0.2rem;
}

.admin-nav a {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.75rem 0.8rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  transition: background 0.2s, color 0.2s;
}

.admin-nav a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.admin-nav a.active {
  background: rgba(200, 154, 130, 0.16);
  color: #fff;
}

.admin-nav svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-sidebar-foot {
  margin-top: auto;
  padding: 0 0.8rem;
  font-size: 0.78rem;
  color: #9d8d88;
}

.admin-main {
  padding: 2rem 2.5rem 3rem;
  min-width: 0;
}

.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.admin-topbar h1 {
  font-size: 2.4rem;
}

.admin-topbar p {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
  margin-bottom: 1.5rem;
}

.kpi {
  padding: 1.4rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.kpi span {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.kpi strong {
  display: block;
  margin-top: 0.6rem;
  font-family: var(--serif);
  font-size: 2.2rem;
  font-weight: 500;
  line-height: 1;
}

.kpi small {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.admin-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1.5rem;
}

.panel {
  padding: 1.6rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  min-width: 0;
}

.panel-wide {
  grid-column: 1 / -1;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1.2rem;
}

.panel-head h2 {
  font-size: 1.5rem;
}

.panel-head span {
  font-size: 0.78rem;
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
}

.orders-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.orders-table th {
  padding: 0 0.8rem 0.8rem;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.orders-table td {
  padding: 1rem 0.8rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.orders-table tr:last-child td {
  border-bottom: 0;
}

.orders-table td:last-child,
.orders-table th:last-child {
  text-align: right;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-ok { color: var(--success); background: rgba(63, 125, 92, 0.1); }
.status-progress { color: var(--gold); background: rgba(168, 113, 90, 0.12); }
.status-warn { color: var(--warning); background: rgba(183, 121, 43, 0.12); }

.inventory-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.1rem;
}

.inventory-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  margin-bottom: 0.45rem;
}

.inventory-row strong {
  font-weight: 600;
}

.inventory-row .low {
  color: var(--danger);
}

.stock-track {
  height: 4px;
  background: var(--blush);
  border-radius: 999px;
  overflow: hidden;
}

.stock-bar {
  height: 100%;
  background: var(--gold);
}

.stock-bar.low {
  background: var(--danger);
}

@media (max-width: 1100px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .admin {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    overflow-x: auto;
  }

  .admin-sidebar .wordmark {
    padding: 0;
  }

  .admin-sidebar .wordmark-tag,
  .admin-sidebar-foot {
    display: none;
  }

  .admin-nav {
    display: flex;
  }

  .admin-nav a {
    white-space: nowrap;
  }

  .admin-main {
    padding: 1.5rem 1rem 2.5rem;
  }

}

@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Moderación ---------- */

.admin-login {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  max-width: 520px;
}

.admin-login .form-field {
  flex: 1;
  min-width: 200px;
}

.moderation-list {
  list-style: none;
  margin: 0 0 1.2rem;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.moderation-item {
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow-wrap: anywhere;
}

.moderation-item.is-pending {
  border-color: var(--gold-light);
  background: #fffaf7;
}

.moderation-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.moderation-item small {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.moderation-item p {
  margin: 0.8rem 0 1rem;
  font-size: 0.92rem;
}

.moderation-actions {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.moderation-actions .btn {
  padding: 0.6rem 1.1rem;
  font-size: 0.7rem;
}

.admin-session {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.88rem;
  color: var(--success);
}

.orders-table a {
  color: var(--gold);
}

/* ---------- Recuperación y consentimiento ---------- */

.auth-title {
  font-size: 1.6rem;
  text-align: center;
}

.auth-help {
  margin: -0.3rem 0 0.2rem;
  font-size: 0.86rem;
  color: var(--muted);
  text-align: center;
}

.auth-switch {
  justify-self: center;
}

.check-field {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
  cursor: pointer;
}

.check-field input {
  margin-top: 0.2rem;
  accent-color: var(--ink);
}

.check-field a,
.fine-print a,
.legal a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- Página legal ---------- */

.legal {
  max-width: 760px;
  padding: 4rem 0 5rem;
}

.legal h1 {
  font-size: clamp(2.2rem, 4vw, 3.2rem);
}

.legal .updated {
  margin: 0.6rem 0 2.5rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.legal h2 {
  margin: 2.4rem 0 0.8rem;
  font-size: 1.6rem;
}

.legal p,
.legal li {
  color: var(--ink-soft);
}

.legal ul {
  padding-left: 1.2rem;
}

.legal li + li {
  margin-top: 0.4rem;
}

.legal .placeholder {
  background: var(--blush);
  padding: 0 0.3rem;
  border-radius: 3px;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

/* ---------- Precios, tallas y promociones ---------- */

.badges {
  position: absolute;
  top: 1rem;
  left: 1rem;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.badges .badge {
  position: static;
}

.badge-sale {
  background: var(--danger);
  color: #fff;
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.price-sale {
  color: var(--danger);
}

.price-old {
  font-size: 0.84rem;
  color: var(--muted);
  text-decoration: line-through;
}

.sizes-line {
  margin: -0.3rem 0 0.6rem !important;
  font-size: 0.76rem !important;
  letter-spacing: 0.06em;
}

.quick-add.is-disabled {
  display: block;
  text-align: center;
  opacity: 1;
  transform: none;
  background: rgba(133, 116, 122, 0.9);
  cursor: default;
}

.size-picker {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.96);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: fade 0.2s var(--ease);
}

.size-picker > span {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.size-picker > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.size-picker button {
  min-width: 42px;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.size-picker button:hover {
  background: var(--ink);
  color: #fff;
}

.cart-item-placeholder {
  width: 84px;
  height: 108px;
  border-radius: var(--radius);
  background: var(--blush);
}

.promo-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.promo-form input {
  flex: 1;
  min-width: 0;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  text-transform: uppercase;
}

.promo-form input:focus {
  outline: none;
  border-color: var(--ink);
}

.promo-form .btn {
  padding: 0.7rem 1rem;
}

.promo-status {
  margin: 0 0 0.4rem;
  min-height: 1em;
  font-size: 0.78rem;
}

.promo-status.is-ok {
  color: var(--success);
}

.promo-status.is-error {
  color: var(--danger);
}

#removePromo {
  margin-bottom: 0.6rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.discount-row {
  color: var(--success);
}

.total-row {
  margin-top: 0.4rem;
}

@media (max-width: 560px) {
  .size-picker {
    left: 0.5rem;
    right: 0.5rem;
    bottom: 0.5rem;
    padding: 0.6rem;
  }

  .size-picker button {
    min-width: 36px;
    padding: 0.4rem;
  }
}

/* ---------- Panel: catálogo y promociones ---------- */

.btn-small {
  padding: 0.6rem 1.1rem;
  font-size: 0.7rem;
}

.admin-form {
  margin-bottom: 1.6rem;
  padding: 1.4rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.admin-form h3 {
  margin-bottom: 1.1rem;
  font-size: 1.35rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  align-items: end;
}

.form-grid .span-2 {
  grid-column: span 2;
}

.form-grid .form-field textarea,
.form-grid .form-field select {
  width: 100%;
}

.form-grid .form-field:has(textarea) {
  grid-column: 1 / -1;
}

.price-preview {
  grid-column: span 3;
  margin: 0;
  font-size: 0.84rem;
  color: var(--gold);
  font-weight: 500;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-top: 1.3rem;
}

.catalog-table td {
  vertical-align: middle;
}

.catalog-product {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.catalog-product img,
.thumb-empty {
  width: 44px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--blush);
  flex-shrink: 0;
}

.catalog-product small,
.muted-line {
  display: block;
  font-size: 0.76rem;
  color: var(--muted);
}

.catalog-table td.low {
  color: var(--danger);
  font-weight: 600;
}

.promo-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.04em;
}

@media (max-width: 1100px) {
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .price-preview {
    grid-column: 1 / -1;
  }
}

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

  .form-grid .span-2 {
    grid-column: auto;
  }
}

.header-actions a.text-button {
  margin-right: 0.3rem;
}

.newsletter-note {
  flex-basis: 100%;
  margin: -0.8rem 0 0;
  text-align: right;
}

/* En pantallas táctiles no hay "hover": el botón de añadir siempre visible. */
@media (hover: none) {
  .quick-add {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 820px) {
  .newsletter-note {
    text-align: left;
    margin-top: 0;
  }
}

/* Sin sesión solo se ve el acceso: se ocultan los enlaces a secciones protegidas. */
body.is-locked .admin-nav a[href^="#"] {
  display: none;
}

.panel-head-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* ---------- Checkout ---------- */

.checkout,
.order-page {
  padding: 3rem 0 5rem;
}

.checkout h1,
.order-page h1 {
  font-size: clamp(2.2rem, 4vw, 3rem);
  margin-bottom: 2rem;
}

.checkout-empty {
  display: grid;
  justify-items: start;
  gap: 1rem;
  color: var(--muted);
}

.checkout-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.checkout-block {
  padding: 1.6rem;
  margin-bottom: 1.4rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.checkout-block h2,
.checkout-summary h2,
.order-page .panel h2 {
  margin-bottom: 1.1rem;
  font-size: 1.45rem;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-grid-2 .span-all {
  grid-column: 1 / -1;
}

.shipping-note {
  margin: 1rem 0 0;
  font-size: 0.86rem;
  color: var(--gold);
}

.shipping-note.is-error {
  color: var(--danger);
}

.pay-options {
  display: grid;
  gap: 0.8rem;
}

.pay-option {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color 0.2s;
}

.pay-option:has(input:checked) {
  border-color: var(--ink);
  background: var(--bg);
}

.pay-option input {
  margin-top: 0.3rem;
  accent-color: var(--ink);
}

.pay-option span {
  display: grid;
  gap: 0.2rem;
}

.pay-option small {
  color: var(--muted);
  font-size: 0.8rem;
}

.checkout-summary {
  position: sticky;
  top: calc(var(--header-h) + 1rem);
  padding: 1.6rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.summary-lines {
  list-style: none;
  margin: 0 0 1.2rem;
  padding: 0;
  display: grid;
  gap: 0.9rem;
}

.summary-lines li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.8rem;
  align-items: center;
  font-size: 0.88rem;
}

.summary-lines li > div {
  display: grid;
}

.summary-lines img {
  width: 48px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius);
}

.summary-lines small {
  color: var(--muted);
  font-size: 0.78rem;
}

.checkout-summary .btn-block {
  margin-top: 1.1rem;
}

/* ---------- Seguimiento de pedido ---------- */

.order-page h1 {
  margin-bottom: 0.6rem;
}

.order-status-line {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin: 0 0 2rem;
  color: var(--ink-soft);
}

.status-cancel {
  color: var(--muted);
  background: rgba(133, 116, 122, 0.12);
}

.order-steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin: 0 0 2rem;
  padding: 0;
  counter-reset: step;
}

.order-steps li {
  position: relative;
  padding-top: 1.6rem;
  font-size: 0.78rem;
  text-align: center;
  color: var(--muted);
}

.order-steps li::before {
  content: '';
  position: absolute;
  top: 0.35rem;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--line);
}

.order-steps li::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  border-radius: 50%;
  background: var(--line);
}

.order-steps li.done,
.order-steps li.current {
  color: var(--ink);
}

.order-steps li.done::before,
.order-steps li.done::after,
.order-steps li.current::after {
  background: var(--gold);
}

.order-steps li.current {
  font-weight: 600;
}

.notice {
  margin-bottom: 1.6rem;
  padding: 1.3rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.notice h2 {
  margin-bottom: 0.6rem;
  font-size: 1.35rem;
}

.notice p {
  margin: 0 0 0.8rem;
}

.notice-pay {
  border-color: var(--gold-light);
  background: #fffaf7;
}

.notice-ok {
  border-color: rgba(63, 125, 92, 0.35);
}

.notice pre {
  margin: 0;
  padding: 1rem;
  background: var(--blush);
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 0.92rem;
  white-space: pre-wrap;
}

.order-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.address {
  margin: 0 0 0.6rem;
  white-space: pre-line;
}

.history-title {
  margin-top: 1.6rem;
}

.order-history {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.9rem;
  font-size: 0.86rem;
}

.order-history li {
  padding-left: 1rem;
  border-left: 2px solid var(--line);
}

.order-history small {
  display: block;
  color: var(--muted);
}

.order-history p {
  margin: 0.2rem 0 0;
  color: var(--ink-soft);
}

.my-orders {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.8rem;
}

.my-orders a {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.my-orders a:hover {
  border-color: var(--ink);
}

.my-orders small {
  color: var(--muted);
}

.lookup {
  max-width: 560px;
}

.lookup > p {
  color: var(--muted);
}

.lookup-form {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
  justify-items: start;
}

.lookup-form .form-field {
  width: 100%;
}

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

  .checkout-summary {
    position: static;
  }
}

@media (max-width: 560px) {
  .form-grid-2 {
    grid-template-columns: 1fr;
  }

  .order-steps li {
    font-size: 0.66rem;
  }

  .my-orders a {
    grid-template-columns: 1fr auto;
  }
}

/* ---------- Panel: pedidos y envíos ---------- */

.kpi-grid {
  grid-template-columns: repeat(3, 1fr);
}

.compact-select {
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font-size: 0.82rem;
}

.catalog-table tr.is-selected td {
  background: var(--bg);
}

.muted-line.low,
.coverage-note.low {
  color: var(--danger);
}

.order-detail {
  margin-top: 1.5rem;
  padding: 1.4rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.order-detail-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.order-detail-head h3 {
  font-size: 1.45rem;
}

.order-detail-head .text-button {
  margin-left: auto;
}

.order-detail-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
}

.order-detail h4 {
  margin: 1.2rem 0 0.7rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.order-detail h4:first-child {
  margin-top: 0;
}

.address-box {
  margin: 0 0 0.4rem;
  padding: 0.9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 0.88rem;
  white-space: pre-wrap;
}

.order-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem 1.2rem;
  margin: 1.2rem 0;
}

.order-actions p {
  flex-basis: 100%;
  margin: 0;
  font-size: 0.86rem;
}

.danger-link {
  color: var(--danger);
}

.ship-form {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  justify-items: start;
}

.ship-form h4 {
  margin: 0;
}

.ship-form .form-field,
.ship-form select {
  width: 100%;
}

.ship-form select {
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.order-detail textarea {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  margin-bottom: 0.6rem;
}

.coverage-note {
  margin: -0.4rem 0 1.2rem;
  font-size: 0.86rem;
  color: var(--success);
}

.states-cell small {
  max-width: 360px;
  white-space: normal;
}

.states-picker {
  margin: 1.2rem 0 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.states-picker legend {
  padding: 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

#statesPicker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.5rem 1rem;
}

#statesPicker .is-taken span {
  color: var(--muted);
}

@media (max-width: 900px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .order-detail-grid {
    grid-template-columns: 1fr;
  }
}

.payments-form {
  display: grid;
  gap: 1.4rem;
  justify-items: start;
}

.payments-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  width: 100%;
}

.payments-grid h3 {
  margin-bottom: 0.9rem;
  font-size: 1.3rem;
}

.payments-grid .form-field,
.payments-grid textarea {
  width: 100%;
}

.payments-grid textarea {
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
}

.toggle-row {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  padding: 0.9rem 1rem;
  margin-bottom: 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  cursor: pointer;
}

.toggle-row input {
  margin-top: 0.25rem;
  accent-color: var(--ink);
}

.toggle-row span {
  display: grid;
  gap: 0.2rem;
}

.toggle-row small {
  color: var(--muted);
  font-size: 0.8rem;
}

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

/* ---------- Panel: WhatsApp ---------- */

.nav-badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  margin-left: auto;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--gold);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 600;
}

.wa-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1rem;
  min-height: 420px;
}

.wa-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 560px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.wa-item {
  display: grid;
  gap: 0.3rem;
  width: 100%;
  padding: 0.8rem 0.9rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  text-align: left;
  cursor: pointer;
}

.wa-item:hover,
.wa-item.is-active {
  background: var(--bg);
}

.wa-item-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.wa-item-head small,
.wa-preview {
  color: var(--muted);
  font-size: 0.76rem;
}

.wa-preview {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wa-item-tags {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.wa-item-tags .nav-badge {
  margin-left: 0;
}

.wa-thread {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg);
  min-width: 0;
}

.wa-thread > .comment-empty {
  margin: auto;
}

.wa-thread-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.wa-thread-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.wa-messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 420px;
  overflow-y: auto;
  padding: 1rem;
}

.wa-bubble {
  max-width: 80%;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-lg);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.wa-bubble p {
  margin: 0 0 0.3rem;
  white-space: pre-wrap;
}

.wa-bubble small {
  font-size: 0.7rem;
  color: var(--muted);
}

.wa-customer {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
}

.wa-bot,
.wa-staff {
  align-self: flex-end;
  background: var(--blush);
}

.wa-staff {
  background: #e7efe9;
}

.wa-reply {
  display: flex;
  gap: 0.6rem;
  padding: 0.8rem;
  border-top: 1px solid var(--line);
}

.wa-reply textarea {
  flex: 1;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  resize: vertical;
}

@media (max-width: 900px) {
  .wa-layout {
    grid-template-columns: 1fr;
  }

  .wa-list {
    max-height: 260px;
  }
}

.wa-connection {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.8rem 1rem;
  align-items: center;
  margin-bottom: 1.2rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg);
}

.wa-connection > div:first-child {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.wa-connection-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.wa-qr {
  grid-column: 1 / -1;
  display: flex;
  gap: 1.2rem;
  align-items: center;
  flex-wrap: wrap;
}

.wa-qr img {
  width: 220px;
  height: 220px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  image-rendering: pixelated;
}

.wa-qr p {
  flex: 1;
  min-width: 220px;
  margin: 0;
  font-size: 0.88rem;
}

/* ---------- WhatsApp de atención ---------- */
.wa-float {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 55;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1.1rem 0.7rem 0.8rem;
  background: #25d366;
  color: #fff;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.wa-float:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22); }
.wa-float:focus-visible { outline: 3px solid var(--ink, #2b2226); outline-offset: 3px; }
@media (max-width: 640px) {
  .wa-float { right: 1rem; bottom: 1rem; padding: 0.8rem; }
  .wa-float span { display: none; }
}
@media print { .wa-float { display: none; } }
.wa-support-line { display: inline-flex; align-items: center; gap: 0.35rem; }
[hidden] { display: none !important; }
.wa-support-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem; margin: 0.75rem 0 1rem; }
.wa-support-form .form-field { flex: 1 1 260px; margin: 0; }
