:root {
  --brand-blue: #064366;
  --brand-blue-dark: #05304c;
  --brand-cyan: #009fc4;
  --brand-green: #8cc63f;
  --brand-green-dark: #477f34;
  --action: #8cc63f;
  --action-dark: #477f34;
  --ink: #17222a;
  --muted: #77838c;
  --line: #e5ebef;
  --soft: #f5f7f8;
  --surface: #ffffff;
  --shadow: 0 8px 24px rgba(5, 48, 76, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* Evita que el header sticky tape el contenido al hacer scroll */
  scroll-padding-top: 160px;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--surface);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: white;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.top-strip {
  display: flex;
  justify-content: center;
  gap: 28px;
  min-height: 34px;
  padding: 8px 18px;
  color: white;
  background: var(--brand-green);
  font-size: 0.86rem;
  font-weight: 800;
}

.top-strip a {
  text-decoration: none;
}

.header-main {
  display: grid;
  grid-template-columns: 150px minmax(240px, 520px) auto;
  gap: 16px;
  align-items: center;
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  height: 52px;
  overflow: hidden;
  text-decoration: none;
}

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

.category-button,
.account-button,
.register-button,
.cart-button,
.primary-link,
.secondary-link,
.product-actions button,
.checkout-button,
.filters button,
.shop-sidebar button,
.icon-button {
  min-height: 38px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.category-button {
  display: none;
  padding: 0 18px;
  color: white;
  border: 0;
  background: var(--brand-green);
}

.header-search {
  position: relative;
  display: block;
}

.header-search span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.header-search::before {
  content: "";
  position: absolute;
  right: 17px;
  top: 50%;
  width: 14px;
  height: 14px;
  border: 2px solid var(--brand-blue);
  border-radius: 50%;
  transform: translateY(-58%);
}

.header-search::after {
  content: "";
  position: absolute;
  right: 13px;
  top: 28px;
  width: 9px;
  height: 2px;
  border-radius: 99px;
  background: var(--brand-blue);
  transform: rotate(45deg);
}

.header-search input {
  width: 100%;
  min-height: 42px;
  padding: 0 46px 0 16px;
  border: 1px solid #d5dfe5;
  border-radius: 8px;
  color: var(--ink);
  background: white;
}

.header-search input:focus {
  border-color: var(--brand-cyan);
  outline: 3px solid rgba(0, 159, 196, 0.14);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-button,
.register-button {
  padding: 0 14px;
  color: var(--brand-blue);
  border: 1px solid var(--line);
  background: white;
}

.register-button {
  color: white;
  border-color: var(--brand-blue);
  background: var(--brand-blue);
}

.cart-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 74px;
  padding: 0 12px;
  color: white;
  border: 0;
  background: var(--action-dark);
}

.cart-icon,
.mini-cart {
  display: inline-block;
  width: 22px;
  height: 22px;
  background: url("./public/cart.svg") center / contain no-repeat;
}

#cartCount {
  min-width: 20px;
  text-align: center;
}

.category-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 18px 12px;
  scrollbar-width: thin;
}

.category-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  white-space: nowrap;
  color: var(--brand-blue);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
}

.category-nav a.active {
  color: white;
  border-color: var(--brand-blue);
  background: var(--brand-blue);
}

.hero {
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: 24px;
  align-items: stretch;
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 18px 18px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 310px;
  padding: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #eef8d8, #ffffff);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand-green-dark);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  color: var(--brand-blue-dark);
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-copy p:not(.eyebrow) {
  max-width: 500px;
  margin: 14px 0 0;
  color: #4f606b;
  font-size: 1rem;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.primary-link,
.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 138px;
  padding: 0 16px;
  text-decoration: none;
}

.primary-link {
  color: white;
  background: var(--brand-blue);
}

.secondary-link {
  color: var(--brand-blue);
  border: 1px solid var(--line);
  background: white;
}

.hero-image {
  display: block;
  overflow: hidden;
  height: 310px;
  min-height: 310px;
  border-radius: 8px;
  background: var(--soft);
  box-shadow: var(--shadow);
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 68%;
}

.category-tiles,
.catalog-section,
.category-page-head {
  max-width: 1180px;
  margin: 0 auto;
  padding-right: 18px;
  padding-left: 18px;
}

.category-page-head {
  padding-top: 34px;
  padding-bottom: 10px;
}

.category-page-head h1 {
  max-width: 760px;
}

.category-page-head p:not(.eyebrow) {
  max-width: 640px;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.category-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  padding-top: 16px;
  padding-bottom: 24px;
}

.category-tiles a {
  display: grid;
  gap: 6px;
  min-height: 88px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
  text-decoration: none;
}

.category-tiles span {
  color: var(--brand-blue);
  font-size: 1rem;
  font-weight: 900;
}

.category-tiles strong {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.catalog-section {
  padding-top: 18px;
  padding-bottom: 64px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.section-heading h2 {
  margin: 0;
  color: var(--brand-blue-dark);
  font-size: clamp(1.55rem, 2.6vw, 2rem);
}

.catalog-count {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.filters {
  display: none;
}

.product-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.visual-category-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.visual-category-nav a,
.view-toggle button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--brand-blue);
  background: white;
  font-size: 0.86rem;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(5, 48, 76, 0.05);
}

.visual-category-nav a:hover,
.visual-category-nav a:focus-visible {
  border-color: var(--brand-green);
  outline: none;
}

.view-toggle {
  display: inline-flex;
  overflow: hidden;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.view-toggle button {
  min-width: 74px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
}

.view-toggle button.active {
  color: white;
  background: var(--brand-blue);
}

.catalog-layout.home-featured-layout {
  grid-template-columns: 1fr;
}

.catalog-layout {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 16px;
  align-items: start;
}

.shop-sidebar {
  position: sticky;
  top: 146px;
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.shop-sidebar button,
.shop-sidebar a {
  display: inline-flex;
  align-items: center;
  width: 100%;
  padding: 0 14px;
  color: var(--ink);
  border: 0;
  border-radius: 0;
  background: white;
  text-align: left;
  text-decoration: none;
}

.shop-sidebar button.active,
.shop-sidebar a.active {
  color: white;
  background: var(--brand-blue);
}

.sidebar-back-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand-blue) !important;
  background: var(--bg) !important;
}

.sidebar-sep {
  border: none;
  border-top: 1px solid var(--line);
  margin: 0;
  background: white;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 14px;
}

.catalog-grid.compact-view {
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
}

.product-card {
  display: grid;
  overflow: hidden;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 4px 18px rgba(5, 48, 76, 0.06);
}

.compact-view .product-card {
  grid-template-columns: 104px 1fr;
}

.compact-view .product-image {
  aspect-ratio: auto;
  min-height: 136px;
}

.compact-view .product-card h3 {
  min-height: auto;
}

.product-image {
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 0.86;
  max-height: 220px;
  overflow: hidden;
  padding: 10px;
  background: white;
}

.product-image img {
  width: 100%;
  height: 100%;
  max-height: 200px;
  object-fit: contain;
}

.product-image .placeholder-image {
  width: 78%;
  height: auto;
  max-height: 72%;
  opacity: 0.78;
}

.product-body {
  display: grid;
  gap: 9px;
  padding: 12px;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  color: var(--brand-blue);
  background: #eaf5f8;
  font-size: 0.68rem;
  font-weight: 800;
}

.chip.tax {
  color: #527011;
  background: #eef8d8;
}

.product-card h3 {
  min-height: 42px;
  margin: 0;
  color: #05090c;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.28;
}

.variant-label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.variant-label select,
.cart-summary input {
  width: 100%;
  min-height: 36px;
  border: 1px solid #d5dfe5;
  border-radius: 8px;
  background: white;
  color: var(--ink);
}

.variant-label select {
  padding: 0 8px;
}

.cart-summary input {
  padding: 0 10px;
}

.product-actions {
  display: grid;
  gap: 8px;
}

.price {
  color: var(--brand-blue);
  font-size: 1rem;
}

.product-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  color: white;
  border: 0;
  background: var(--action-dark);
}

.product-actions button.out-of-stock,
.product-actions button:disabled {
  background: #bbb;
  color: #fff;
  cursor: not-allowed;
  opacity: 0.75;
}

.mini-cart {
  width: 18px;
  height: 18px;
}

.cart-panel {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
}

.cart-panel.open {
  display: block;
}

.cart-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 48, 76, 0.42);
}

.cart-drawer {
  position: absolute;
  inset: 0 0 0 auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(100%, 460px);
  background: white;
  box-shadow: -12px 0 38px rgba(5, 48, 76, 0.2);
}

.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.cart-head h2 {
  margin: 0;
}

.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  background: white;
}

.cart-items {
  overflow: auto;
  padding: 14px 20px;
}

.empty-cart {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.cart-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.cart-item h3 {
  margin: 0 0 4px;
  color: var(--brand-blue-dark);
  font-size: 0.95rem;
}

.cart-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.quantity-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.quantity-controls button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-weight: 900;
}

.cart-summary {
  display: grid;
  gap: 12px;
  max-height: 52vh;
  overflow: auto;
  padding: 16px 20px 20px;
  border-top: 1px solid var(--line);
  background: #fbfdfe;
}

.cart-summary > div:not(.customer-fields) {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.total-row {
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 1.12rem;
}

.cart-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.customer-fields {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.customer-fields label,
.cart-summary label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

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

.payment-field select {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid #d5dfe5;
  border-radius: 8px;
  background: white;
  color: var(--ink);
}

.customer-fields label:nth-child(1),
.customer-fields label:nth-child(4),
.customer-fields label:nth-child(5) {
  grid-column: 1 / -1;
}

.checkout-button {
  width: 100%;
  color: white;
  border: 0;
  background: var(--action-dark);
}

.checkout-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.whatsapp-float {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 25;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #25d366 url("./public/whatsapp.svg") center / 35px 35px no-repeat;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.whatsapp-float::before {
  content: none;
}

.whatsapp-float::after {
  content: none;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  padding: 30px max(18px, calc((100vw - 1180px) / 2 + 18px));
  color: white;
  background: var(--brand-blue-dark);
}

.modal-panel {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
}

.modal-panel.open {
  display: block;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 48, 76, 0.42);
}

.modal-card {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  gap: 16px;
  width: min(94vw, 720px);
  max-height: 88vh;
  overflow: auto;
  padding: 22px;
  border-radius: 8px;
  background: white;
  box-shadow: 0 24px 70px rgba(5, 48, 76, 0.28);
  transform: translate(-50%, -50%);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.modal-head h2 {
  margin: 0;
}

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

.account-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

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

.account-grid input,
.account-grid select {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid #d5dfe5;
  border-radius: 8px;
  background: white;
  color: var(--ink);
}

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

.social-signin button,
.text-button {
  min-height: 42px;
  border: 1px solid #dadce0;
  border-radius: 8px;
  color: #3c4043;
  background: white;
  font-weight: 600;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  padding: 0 12px;
}

.social-signin button:not([disabled]):hover {
  background: #f8f9fa;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.social-signin button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Logo de Facebook inline */
.social-signin button[data-provider="facebook"]::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%231877F2' d='M24 12.073C24 5.405 18.627 0 12 0S0 5.405 0 12.073C0 18.1 4.388 23.094 10.125 24v-8.437H7.078v-3.49h3.047V9.41c0-3.025 1.792-4.697 4.533-4.697 1.312 0 2.686.236 2.686.236v2.97h-1.513c-1.491 0-1.956.93-1.956 1.885v2.268h3.328l-.532 3.49h-2.796V24C19.612 23.094 24 18.1 24 12.073z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  flex-shrink: 0;
}

/* Logo de Google inline */
.social-signin button[data-provider="google"]::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%23EA4335' d='M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z'/%3E%3Cpath fill='%234285F4' d='M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z'/%3E%3Cpath fill='%23FBBC05' d='M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z'/%3E%3Cpath fill='%2334A853' d='M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  flex-shrink: 0;
}

.text-button {
  cursor: pointer;
}

.form-note,
.contact-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.order-status {
  min-height: 22px;
  color: var(--brand-blue);
  font-weight: 800;
}

.contact-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  color: white;
  background: var(--action-dark);
  font-weight: 900;
  text-decoration: none;
}

.contact-action.secondary {
  color: var(--brand-blue);
  border: 1px solid var(--line);
  background: white;
}

.checkout-card {
  width: min(94vw, 620px);
}

.checkout-lines {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
}

.checkout-lines article,
.checkout-summary div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.checkout-lines span,
.checkout-summary span {
  color: var(--ink);
  font-weight: 800;
}

.checkout-lines small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.checkout-summary {
  display: grid;
  gap: 0;
}

.checkout-summary .total-row {
  border-top: 1px solid var(--line);
  font-size: 1.08rem;
}

.site-footer div {
  display: grid;
  gap: 6px;
}

.site-footer span,
.site-footer a {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
}

.orders-admin {
  display: grid;
  gap: 24px;
  width: min(1180px, calc(100% - 32px));
  margin: 32px auto 64px;
}

.orders-tools,
.orders-kpis {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 210px 210px auto;
  gap: 12px;
  align-items: end;
}

.orders-tools label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.orders-tools input,
.orders-tools select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--brand-blue);
  background: white;
  font: inherit;
  font-weight: 800;
  text-transform: none;
}

.orders-kpis {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.orders-kpis article {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow-soft);
}

.orders-kpis span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.orders-kpis strong {
  color: var(--brand-blue);
  font-size: 1.3rem;
}

.orders-table-wrap,
.order-detail {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow-soft);
}

.orders-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

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

.orders-table th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.order-link {
  min-height: auto;
  padding: 0;
  border: 0;
  color: var(--brand-blue);
  background: transparent;
  font-weight: 900;
  text-decoration: underline;
}

.order-action {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--brand-blue);
  background: white;
  font-weight: 900;
}

.chip.danger {
  color: #8a1f11;
  background: #ffe8e4;
}

.order-detail {
  display: grid;
  gap: 18px;
  padding: 20px;
}

.order-detail-actions {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  gap: 12px;
  align-items: end;
  padding-top: 4px;
}

.order-detail-actions label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.order-detail-actions select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--brand-blue);
  background: white;
  font: inherit;
  font-weight: 800;
  text-transform: none;
}

.order-action-status {
  grid-column: 1 / -1;
  color: var(--muted);
  font-weight: 800;
}

.order-detail[hidden] {
  display: none;
}

@media (max-width: 940px) {
  .header-main {
    grid-template-columns: 140px 1fr auto;
  }

  .category-button {
    display: none;
  }

  .header-search {
    grid-column: 1 / -1;
    grid-row: 2;
  }

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

  .hero-copy,
  .hero-image {
    min-height: 260px;
  }

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

  .catalog-layout {
    grid-template-columns: 1fr;
  }

  .shop-sidebar {
    position: static;
    display: flex;
    overflow-x: auto;
  }

  .shop-sidebar button {
    min-width: 132px;
    text-align: center;
  }

  .product-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .view-toggle {
    width: max-content;
  }

  .orders-tools,
  .orders-kpis,
  .order-detail-actions {
    grid-template-columns: 1fr;
  }
}

@media print {
  .site-header,
  .section-heading,
  .orders-tools,
  .orders-kpis,
  .orders-table-wrap,
  .order-detail-actions,
  #closeOrderDetail {
    display: none !important;
  }

  .orders-admin {
    width: 100%;
    margin: 0;
  }

  .order-detail {
    display: grid !important;
    border: 0;
    box-shadow: none;
    padding: 0;
  }
}

@media (max-width: 620px) {
  .top-strip {
    justify-content: space-between;
    gap: 12px;
    font-size: 0.76rem;
  }

  .header-main {
    grid-template-columns: 116px 1fr;
    gap: 10px;
    padding: 10px 14px;
  }

  .brand {
    height: 44px;
  }

  .brand img {
    width: 112px;
    max-height: 44px;
  }

  .nav-actions {
    justify-content: end;
    gap: 6px;
  }

  .account-button,
  .register-button {
    padding: 0 9px;
    font-size: 0.82rem;
  }

  .cart-button {
    min-width: 58px;
    padding: 0 9px;
  }

  .category-nav {
    padding-right: 14px;
    padding-left: 14px;
  }

  .hero,
  .category-tiles,
  .catalog-section {
    padding-right: 14px;
    padding-left: 14px;
  }

  .hero-copy {
    min-height: auto;
    padding: 22px;
  }

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

  .category-tiles,
  .customer-fields,
  .account-grid,
  .social-signin,
  .site-footer {
    grid-template-columns: 1fr;
  }

  .compact-view .product-card {
    grid-template-columns: 1fr;
  }

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

  .product-body {
    padding: 10px;
  }

  .customer-fields label:nth-child(n) {
    grid-column: auto;
  }

  .account-grid .full {
    grid-column: auto;
  }
}

/* Botón cerrar sesión */
.logout-button {
  background: white !important;
  color: #c0392b !important;
  border: 1px solid #e0b0ad !important;
  font-weight: 700;
}
.logout-button:hover {
  background: #fdf0ef !important;
}

/* Pantallas muy estrechas: Samsung Z Flip y similares (<= 430px) */
@media (max-width: 430px) {
  /* Ocultar top-strip para ganar altura de header */
  .top-strip {
    display: none;
  }

  /* Header más compacto */
  .header-main {
    grid-template-columns: 100px 1fr;
    gap: 8px;
    padding: 8px 10px;
  }

  .brand {
    height: 38px;
  }

  .brand img {
    width: 96px;
    max-height: 38px;
  }

  .account-button,
  .register-button {
    padding: 0 7px;
    font-size: 0.78rem;
    min-height: 34px;
  }

  .cart-button {
    min-width: 48px;
    padding: 0 7px;
    min-height: 34px;
  }

  .category-nav {
    padding: 0 10px 8px;
    gap: 6px;
  }

  .category-nav a {
    min-height: 30px;
    padding: 0 10px;
    font-size: 0.82rem;
  }

  /* Imágenes de producto: altura máxima más conservadora */
  .product-image {
    max-height: 170px;
  }

  .product-image img {
    max-height: 150px;
  }

  /* Catálogo: 2 columnas más estrechas */
  .catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .product-body {
    padding: 8px;
  }

  /* scroll-padding ajustado para header reducido */
  html {
    scroll-padding-top: 110px;
  }
}

/* MercadoPago return banner */
.mp-return-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 500;
  position: sticky;
  top: 0;
  z-index: 200;
}
.mp-return-banner button {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  opacity: 0.7;
  flex-shrink: 0;
}
.mp-return-banner button:hover { opacity: 1; }
.mp-return-success { background: #d4edda; color: #155724; }
.mp-return-pending { background: #fff3cd; color: #856404; }
.mp-return-failure { background: #f8d7da; color: #721c24; }

/* Paginación panel de pedidos */
.orders-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  padding: 20px 0 8px;
}

.page-btn {
  padding: 6px 12px;
  border: 1px solid var(--brand-blue, #1a5fa8);
  border-radius: 6px;
  background: transparent;
  color: var(--brand-blue, #1a5fa8);
  cursor: pointer;
  font-size: .85rem;
  line-height: 1;
  transition: background .15s, color .15s;
}

.page-btn:hover:not(:disabled) {
  background: var(--brand-blue, #1a5fa8);
  color: #fff;
}

.page-btn--active {
  background: var(--brand-blue, #1a5fa8);
  color: #fff;
  font-weight: 700;
}

.page-btn:disabled {
  opacity: .4;
  cursor: default;
}
