:root {
  color-scheme: light;
  --ink: #151515;
  --muted: #6b6760;
  --paper: #f7f4ec;
  --white: #ffffff;
  --line: #ded7c9;
  --gold: #c8963d;
  --cyan: #009ade;
  --magenta: #e51658;
  --shadow: 0 18px 44px rgba(22, 22, 22, 0.10);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(0,154,222,0.10), transparent 26%),
    linear-gradient(225deg, rgba(229,22,88,0.08), transparent 28%),
    var(--paper);
}

a {
  color: inherit;
}

.page-shell {
  width: min(1240px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.site-header {
  padding: 22px 0;
}

.logo-link img {
  width: clamp(190px, 24vw, 360px);
  display: block;
  filter: drop-shadow(0 15px 25px rgba(0,0,0,0.18));
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.main-nav a,
.button,
button,
.chip,
.user-chip {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  padding: 0 14px;
  font-weight: 800;
  text-decoration: none;
}

.main-nav a,
.chip,
.user-chip {
  background: rgba(255,255,255,0.72);
  border: 1px solid var(--line);
}

.nav-item,
.admin-tab,
.quick-card {
  gap: 8px;
}

.nav-icon,
.quick-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(255,255,255,0.72);
  color: #16110b;
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.03em;
}

.nav-catalog,
.tab-families,
.quick-families {
  background: #e8f5ff;
  border-color: #9ed2f0;
  color: #07598a;
}

.nav-cart,
.tab-products,
.quick-products {
  background: #fff4cc;
  border-color: #f0cf68;
  color: #765000;
}

.nav-admin,
.tab-summary,
.tab-settings {
  background: #ece4ff;
  border-color: #c7b0f5;
  color: #56309b;
}

.nav-orders,
.tab-orders,
.quick-orders {
  background: #e4f7f4;
  border-color: #9bd8cf;
  color: #0b6b5d;
}

.nav-invoices,
.tab-invoices,
.tab-legal {
  background: #f7ead6;
  border-color: #ddb36e;
  color: #765000;
}

.nav-user,
.tab-clients,
.quick-clients,
.user-chip {
  background: #dff5e7;
  border-color: #9ed8b0;
  color: #155b31;
}

.nav-login,
.tab-company,
.tab-shipping {
  background: #eef0f4;
  border-color: #c8ced8;
  color: #333b48;
}

.nav-logout {
  background: #ffe0e4;
  border-color: #d8a0a7;
  color: #8c1230;
}

.nav-strong,
.button,
button {
  border: 0;
  color: #16110b;
  background: linear-gradient(180deg, #f7d78b, var(--gold));
  cursor: pointer;
}

.button-secondary {
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(255,255,255,0.82);
}

.danger-button {
  border: 1px solid #d8a0a7;
  color: #8c1230;
  background: #ffe0e4;
}

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

.cart-pill {
  margin-left: 7px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--magenta);
  color: white;
  font-size: 0.78rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.42fr);
  align-items: end;
  gap: clamp(24px, 5vw, 72px);
  padding: 24px 0 34px;
}

.eyebrow {
  margin: 0 0 10px;
  color: #8c6524;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.05;
}

h1 {
  max-width: 780px;
  font-size: clamp(2.15rem, 5.4vw, 5.2rem);
}

.panel-title {
  max-width: 100%;
  font-size: clamp(2rem, 3vw, 3.4rem);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.lead {
  max-width: 680px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(1.02rem, 1.8vw, 1.24rem);
  line-height: 1.55;
}

.price-mode {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.78);
  box-shadow: var(--shadow);
}

.credit-alert {
  display: grid;
  gap: 5px;
  margin: 14px 0;
  padding: 14px;
  border-radius: 8px;
  background: #fff1bf;
  border: 2px solid #d49a1c;
  color: #5f3b00;
  box-shadow: 0 14px 30px rgba(127, 83, 6, 0.16);
}

.credit-alert span {
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.credit-alert strong {
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1;
}

.credit-alert small {
  color: #6e4b10;
  font-weight: 800;
}

.compact-credit {
  max-width: 520px;
}

.cart-credit-alert {
  max-width: 760px;
}

.credit-lines {
  display: grid;
  gap: 6px;
  margin: 6px 0;
}

.credit-lines div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 7px;
  background: rgba(255,255,255,0.55);
}

.credit-lines b {
  font-size: 0.92rem;
}

.credit-lines em {
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.admin-credit {
  margin: 0;
}

.credit-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  background: #f2eee5;
  color: var(--muted);
  font-weight: 900;
}

.credit-pill.has-credit {
  background: #fff1bf;
  border: 1px solid #d49a1c;
  color: #5f3b00;
}

.login-help h2 {
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
}

.login-help p {
  max-width: 52ch;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.login-help p a {
  color: var(--ink);
  font-weight: 900;
  text-underline-offset: 3px;
}

.legal-copy {
  max-width: 920px;
  margin: 28px auto 50px;
}

.legal-copy h2 {
  margin-top: 24px;
  font-size: 1.25rem;
}

.legal-copy p {
  color: var(--muted);
  line-height: 1.65;
}

.maintenance-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.maintenance-panel {
  width: min(680px, 100%);
  text-align: center;
}

.maintenance-panel img {
  width: min(360px, 80%);
  margin: 0 auto 22px;
  display: block;
  filter: drop-shadow(0 15px 25px rgba(0,0,0,0.14));
}

.maintenance-panel p {
  color: var(--muted);
  line-height: 1.55;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

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

.table-actions form {
  margin: 0;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.inline-form select {
  min-width: 150px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #efe7da;
  color: #5e4520;
  font-weight: 900;
  border: 1px solid transparent;
  white-space: nowrap;
}

.status-pendiente,
.status-pendiente-pago,
.status-archivos-pendientes {
  background: #fff4cc;
  color: #765000;
  border-color: #f0cf68;
}

.status-pagado,
.status-archivos-recibidos {
  background: #dff5e7;
  color: #155b31;
  border-color: #9ed8b0;
}

.status-en-revision,
.status-subida-abierta {
  background: #dff1ff;
  color: #07598a;
  border-color: #95cbee;
}

.status-produccion {
  background: #ece4ff;
  color: #56309b;
  border-color: #c7b0f5;
}

.status-terminado {
  background: #e4f7f4;
  color: #0b6b5d;
  border-color: #9bd8cf;
}

.status-enviado {
  background: #d8f2dc;
  color: #166327;
  border-color: #87ca95;
}

.status-cancelado,
.status-subida-bloqueada {
  background: #ffe0e4;
  color: #8c1230;
  border-color: #d8a0a7;
}

.status-payment.status-pendiente,
.status-payment.status-pendiente-pago {
  background: #fff4cc;
  color: #765000;
}

.status-payment.status-cancelado {
  background: #ffe0e4;
  color: #8c1230;
}

.compact-panel {
  margin: 18px 0;
}

.compact-panel h2 {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 18px 0;
}

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

.card,
.panel {
  border: 1px solid var(--line);
  border-top: 5px solid var(--gold);
  border-radius: 8px;
  background: rgba(255,255,255,0.86);
  box-shadow: var(--shadow);
}

.panel:nth-of-type(3n + 1) {
  border-top-color: var(--cyan);
}

.panel:nth-of-type(3n + 2) {
  border-top-color: var(--magenta);
}

.panel:nth-of-type(3n + 3) {
  border-top-color: var(--gold);
}

.section-card {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--gold);
  border-radius: 8px;
  background: rgba(255,255,255,0.70);
}

.section-delivery {
  border-left-color: var(--cyan);
  background: rgba(0,154,222,0.08);
}

.section-files {
  border-left-color: var(--magenta);
  background: rgba(229,22,88,0.07);
}

.section-invoices {
  border-left-color: var(--gold);
  background: rgba(200,150,61,0.10);
}

.card {
  overflow: hidden;
}

.card img,
.product-main-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  background: #e9e3d6;
}

.product-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.product-gallery a {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.product-gallery img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  transition: transform 0.18s ease;
}

.product-gallery a:hover img {
  transform: scale(1.04);
}

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

.admin-image-tile {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.72);
}

.admin-image-tile img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 7px;
  background: #e9e3d6;
}

.admin-image-tile span {
  color: var(--muted);
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}

.card-body {
  padding: 16px;
}

.card-body p {
  color: var(--muted);
  line-height: 1.45;
}

.product-meta {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  background: #fff6dd;
  border: 1px solid #edc66e;
  color: #6f4b0d !important;
  font-size: 0.88rem;
  font-weight: 700;
}

.cart-production-time {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  margin-top: 6px;
  padding: 5px 8px;
  border-radius: 6px;
  background: #fff6dd;
  border: 1px solid #edc66e;
  color: #6f4b0d;
  font-weight: 800;
}

.design-option {
  padding: 12px;
  border-radius: 7px;
  background: #eef8f6;
  border: 1px solid #8bd5ca;
}

.design-option span {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
}

.price-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.price {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 6px;
  background: #101010;
  color: white;
  font-weight: 900;
}

.price.pvd {
  background: var(--cyan);
}

.product-info-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  margin: 16px 0 4px;
  padding: 10px 12px;
  border-radius: 7px;
  background: #fff6dd;
  border: 1px solid #edc66e;
  color: #5e3f08;
}

.info-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.product-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.85fr) minmax(0, 1fr);
  gap: clamp(22px, 4vw, 52px);
  padding: 28px 0 50px;
}

.product-copy,
.panel {
  padding: clamp(18px, 3vw, 28px);
}

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

.filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
  margin: 14px 0 18px;
  padding: 14px;
  border-radius: 8px;
  background: #f8f4ec;
  border: 1px solid var(--line);
}

.filter-bar p {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.field {
  display: grid;
  gap: 7px;
}

.field.full {
  grid-column: 1 / -1;
}

label {
  color: #4f4a43;
  font-size: 0.92rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cfc6b8;
  border-radius: 7px;
  padding: 9px 11px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

input[type="checkbox"] {
  width: auto;
  min-height: auto;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.legal-editor {
  min-height: 520px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  line-height: 1.55;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
}

.option-editor {
  display: grid;
  gap: 12px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.64);
}

.checkbox-field {
  display: flex;
  align-items: center;
}

small {
  color: var(--muted);
  line-height: 1.4;
}

.image-preview {
  align-items: start;
}

.image-preview img {
  width: min(260px, 100%);
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e9e3d6;
}

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

th {
  background: #efe7da;
  font-size: 0.88rem;
  text-transform: uppercase;
}

.notice {
  margin: 16px 0;
  padding: 12px 14px;
  border-radius: 7px;
  font-weight: 800;
}

.notice-ok {
  background: #dff5e7;
  color: #155b31;
}

.notice-error {
  background: #ffe0e4;
  color: #8c1230;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}

.admin-tabs a {
  padding: 10px 14px;
  border-radius: 7px;
  border: 1px solid var(--line);
  font-weight: 900;
  text-decoration: none;
}

.quick-card {
  display: grid;
  gap: 8px;
  text-decoration: none;
  min-height: 145px;
  align-content: start;
}

.quick-card h2 {
  font-size: clamp(2.2rem, 4vw, 3.6rem);
}

.quick-link {
  color: currentColor;
  font-weight: 900;
}

.site-footer {
  flex-wrap: wrap;
  padding: 28px 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.site-footer a {
  color: var(--ink);
  font-weight: 800;
}

.footer-link-button {
  min-height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
}

.cookie-banner {
  position: fixed;
  inset: auto 16px 16px;
  z-index: 50;
}

.cookie-panel {
  width: min(920px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.97);
  box-shadow: 0 24px 70px rgba(20,20,20,0.2);
}

.cookie-panel h2 {
  margin-bottom: 8px;
}

.cookie-panel p {
  margin: 0 0 8px;
  color: var(--muted);
  line-height: 1.45;
}

.cookie-options {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
}

.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 860px) {
  .site-header,
  .hero,
  .product-layout {
    grid-template-columns: 1fr;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .main-nav {
    justify-content: flex-start;
  }

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

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

  .cookie-panel {
    grid-template-columns: 1fr;
  }

  .cookie-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .page-shell {
    width: min(100% - 24px, 1240px);
  }

  .family-grid,
  .product-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

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

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

  h1 {
    font-size: clamp(2rem, 12vw, 3rem);
  }
}
