:root {
  --bg: #f7f1ea;
  --surface: #ffffff;
  --surface-soft: #fbf7f1;
  --ink: #3b2a1e;
  --muted: #856f5b;
  --line: #ddc9b4;
  --accent: #a88663;
  --accent-dark: #886645;
  --sale: #d14d25;
  --shadow: 0 18px 38px rgba(92, 67, 45, 0.08);
  --bg-wash: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0));
  --dashboard-wash: linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0));
  --dashboard-radial: radial-gradient(circle at top left, rgba(179, 141, 105, 0.18), transparent 30%);
  --sidebar-surface: linear-gradient(180deg, #fffaf4, #f5eadf);
  --surface-strong: #ffffff;
  --surface-tint: #f8efe5;
  --surface-alt: #fffaf4;
  --hero-dot: rgba(255, 255, 255, 0.56);
  --hero-dot-active: #ffffff;
  --theme-toggle-shadow: 0 12px 28px rgba(92, 67, 45, 0.12);
  --input-bg: var(--surface);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #14110f;
  --surface: #1d1814;
  --surface-soft: #251f1a;
  --ink: #f4eadf;
  --muted: #c7b19a;
  --line: #574737;
  --accent: #c49a6b;
  --accent-dark: #ebc49d;
  --sale: #ff916f;
  --shadow: 0 18px 38px rgba(0, 0, 0, 0.34);
  --bg-wash: linear-gradient(180deg, rgba(14, 12, 11, 0.58), rgba(14, 12, 11, 0));
  --dashboard-wash: linear-gradient(180deg, rgba(14, 12, 11, 0.54), rgba(14, 12, 11, 0));
  --dashboard-radial: radial-gradient(circle at top left, rgba(196, 154, 107, 0.16), transparent 34%);
  --sidebar-surface: linear-gradient(180deg, #211a15, #17120f);
  --surface-strong: #241d18;
  --surface-tint: #2a211b;
  --surface-alt: #201914;
  --hero-dot: rgba(255, 255, 255, 0.28);
  --hero-dot-active: #fff8f0;
  --theme-toggle-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
  --input-bg: #221c17;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Nunito Sans", sans-serif;
  color: var(--ink);
  background:
    var(--bg-wash),
    var(--bg);
}

body.sidebar-open {
  overflow: hidden;
}

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

input,
textarea,
select {
  color: var(--ink);
  background: var(--input-bg);
  border-color: var(--line);
}

option {
  color: #2d2217;
  background: #ffffff;
}

:root[data-theme="dark"] select {
  color-scheme: dark;
}

:root[data-theme="dark"] option,
:root[data-theme="dark"] optgroup {
  color: var(--ink);
  background: #221c17;
}

input::placeholder,
textarea::placeholder {
  color: #9a8a7a;
}

:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder {
  color: #b39b85;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}

img {
  max-width: 100%;
}

.hidden {
  display: none !important;
}

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

.site-frame {
  width: min(1320px, calc(100% - 36px));
  margin: 0 auto;
  padding: 26px 0 54px;
  transition: padding-right 0.22s ease;
}

body.storefront-editing .site-frame {
  padding-right: min(460px, 42vw);
}

.dashboard-shell {
  width: min(1360px, calc(100% - 36px));
  margin: 0 auto;
  padding: 26px 0 54px;
}

.utility-header,
.utility-actions,
.header-branding,
.brand-lockup,
.hero-pills,
.dialog-header,
.quantity-row,
.product-price-row,
.product-heading,
.product-flags,
.inventory-card,
.order-card,
.form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.utility-header {
  justify-content: space-between;
  margin-bottom: 28px;
}

.header-branding {
  min-width: 250px;
}

.brand-home-link,
.brand-home-link:link,
.brand-home-link:visited,
.brand-home-link:hover,
.brand-home-link:active {
  display: inline-flex;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-lockup {
  gap: 16px;
  min-width: 250px;
}

.brand-lockup-compact {
  min-width: 0;
}

.brand-logo {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: linear-gradient(180deg, #b89572, #9e7954);
  color: #fff8f0;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.brand-logo-text {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.brand-logo-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-logo.has-image {
  background: var(--surface-strong);
}

.brand-logo-editable {
  cursor: pointer;
}

.brand-logo-edit-button {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: rgba(59, 42, 30, 0.82);
  color: #fff;
  display: grid;
  place-items: center;
  padding: 0;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease, background-color 0.18s ease;
}

.brand-logo-edit-button svg {
  width: 15px;
  height: 15px;
}

.brand-logo-editable:hover .brand-logo-edit-button,
.brand-logo-editable:focus-within .brand-logo-edit-button {
  opacity: 1;
  transform: translateY(0);
}

.brand-logo-editable:hover .brand-logo-edit-button {
  background: rgba(59, 42, 30, 0.92);
}

.brand-caption,
.section-tag,
.promo-label,
.hero-kicker {
  margin: 0 0 6px;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.74rem;
  font-weight: 800;
}

#store-name {
  font-size: clamp(1.85rem, 2vw, 2.4rem);
}

.search-shell {
  flex: 1;
  min-width: 220px;
  position: relative;
}

.search-shell input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 4px;
  height: 56px;
  padding: 0 66px 0 20px;
}

.search-shell input::placeholder {
  color: #9a8a7a;
}

.search-icon {
  position: absolute;
  inset: 0 0 0 auto;
  width: 54px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: white;
  font-size: 1.5rem;
  border-radius: 0 4px 4px 0;
}

.search-icon svg {
  width: 22px;
  height: 22px;
}

.utility-actions {
  justify-content: flex-end;
}

.hamburger-button,
.icon-button {
  display: inline-grid;
  place-items: center;
  padding: 0;
}

.hamburger-button {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  gap: 5px;
}

.icon-button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-alt);
}

.hamburger-button span,
.icon-button span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: var(--ink);
}

.icon-button span:first-child {
  transform: rotate(45deg) translateY(4px);
}

.icon-button span:last-child {
  transform: rotate(-45deg) translateY(-4px);
}

.storefront-mode-toggle {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink);
  display: grid;
  place-items: center;
  box-shadow: 0 16px 34px rgba(59, 42, 30, 0.18);
  z-index: 42;
}

.floating-cart-toggle,
.floating-whatsapp-link {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--accent-dark);
  display: grid;
  place-items: center;
  box-shadow: 0 16px 34px rgba(59, 42, 30, 0.18);
  z-index: 38;
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  pointer-events: none;
  transition: transform 0.18s ease, opacity 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
  text-decoration: none;
}

.floating-cart-toggle.is-visible,
.floating-whatsapp-link.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.floating-whatsapp-link {
  bottom: 92px;
  color: #ffffff;
  background: linear-gradient(180deg, #25d366, #1ba851);
  border-color: rgba(255, 255, 255, 0.18);
}

.floating-cart-toggle.is-offset {
  bottom: 92px;
}

.floating-whatsapp-link.is-offset {
  bottom: 162px;
}

.floating-cart-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
}

.floating-cart-icon svg {
  width: 100%;
  height: 100%;
}

.floating-whatsapp-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
}

.floating-whatsapp-icon svg {
  width: 100%;
  height: 100%;
}

.floating-cart-count {
  position: absolute;
  top: -4px;
  right: -2px;
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
  box-shadow: 0 10px 20px rgba(59, 42, 30, 0.2);
}

.floating-cart-toggle:hover,
.floating-whatsapp-link:hover {
  transform: translateY(-1px);
}

.floating-cart-toggle.is-visible.is-offset:hover,
.floating-whatsapp-link.is-visible.is-offset:hover {
  transform: translateY(-1px);
}

.floating-cart-toggle.is-visible:hover,
.floating-whatsapp-link.is-visible:hover {
  opacity: 0.94;
}

.storefront-editing .floating-cart-toggle,
.storefront-editing .floating-whatsapp-link {
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px) scale(0.96);
}

.storefront-mode-toggle.is-editing {
  background: var(--accent);
  color: #fff;
}

.storefront-mode-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
}

.storefront-mode-icon svg {
  width: 100%;
  height: 100%;
}

.storefront-inline-editor {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(460px, 42vw);
  height: 100vh;
  display: grid;
  gap: 18px;
  padding: 22px;
  background: var(--sidebar-surface);
  border-left: 1px solid var(--line);
  box-shadow: -22px 0 38px rgba(59, 42, 30, 0.14);
  z-index: 41;
  overflow-y: auto;
}

.storefront-inline-head,
.storefront-inline-head-actions,
.storefront-inline-form,
.storefront-inline-footer {
  display: grid;
  gap: 14px;
}

.storefront-inline-form {
  padding-bottom: 28px;
}

.storefront-inline-head {
  padding-bottom: 6px;
}

.storefront-inline-head h3 {
  margin: 0;
}

.storefront-inline-head .muted-text,
.storefront-inline-feedback {
  margin: 0;
}

.storefront-inline-head-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.storefront-inline-footer {
  margin-top: 4px;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(59, 42, 30, 0.34);
  z-index: 39;
}

.site-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(340px, calc(100% - 42px));
  height: 100vh;
  transform: translateX(-100%);
  transition: transform 0.22s ease;
  z-index: 40;
  overflow: hidden;
}

.site-sidebar.is-open {
  transform: translateX(0);
}

.sidebar-panel {
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 22px;
  padding: 24px 20px;
  background: var(--sidebar-surface);
  border-right: 1px solid var(--line);
  box-shadow: 22px 0 40px rgba(59, 42, 30, 0.12);
  overflow: hidden;
}

.sidebar-head,
.dashboard-header,
.dashboard-titlebar,
.dashboard-header-actions,
.dashboard-user-chip,
.inventory-row,
.inventory-row-main,
.inventory-row-meta,
.sidebar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sidebar-head {
  justify-content: space-between;
  align-items: start;
}

.sidebar-nav {
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(132, 84, 43, 0.28) transparent;
  scrollbar-gutter: stable;
}

.sidebar-nav::-webkit-scrollbar {
  width: 8px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(132, 84, 43, 0.24);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.sidebar-nav:hover::-webkit-scrollbar-thumb {
  background: rgba(132, 84, 43, 0.4);
  border: 2px solid transparent;
  background-clip: padding-box;
}

:root[data-theme="dark"] .sidebar-nav {
  scrollbar-color: rgba(235, 196, 157, 0.3) transparent;
}

:root[data-theme="dark"] .sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(235, 196, 157, 0.24);
  border: 2px solid transparent;
  background-clip: padding-box;
}

:root[data-theme="dark"] .sidebar-nav:hover::-webkit-scrollbar-thumb {
  background: rgba(235, 196, 157, 0.38);
  border: 2px solid transparent;
  background-clip: padding-box;
}

.sidebar-backoffice-links {
  display: grid;
  gap: 10px;
}

.sidebar-backoffice-section {
  display: grid;
  gap: 10px;
}

.sidebar-backoffice-title {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.sidebar-link,
.secondary-link,
.button-link,
.sidebar-button-link {
  text-decoration: none;
  transition: opacity 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.sidebar-link:hover,
.secondary-link:hover,
.button-link:hover,
.sidebar-button-link:hover {
  opacity: 0.74;
}

.sidebar-link-active:hover,
.sidebar-link-current:hover,
.secondary-link-current:hover {
  opacity: 1;
}

.secondary-link-current {
  opacity: 1;
  color: var(--accent-dark);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.22em;
}

body.admin-static-nav .sidebar-nav .sidebar-link.hidden,
body.admin-static-nav .dashboard-header-actions .secondary-link.hidden {
  visibility: visible !important;
  opacity: 1 !important;
}

body.admin-static-nav .sidebar-nav .sidebar-link.hidden {
  display: block !important;
}

body.admin-static-nav .dashboard-header-actions .secondary-link.hidden {
  display: inline-flex !important;
  align-items: center;
}

.sidebar-link {
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--surface-alt);
  color: var(--ink);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar-link-active,
.sidebar-link-current {
  background: rgba(181, 145, 104, 0.18);
  border-color: #d8b998;
}

.sidebar-account {
  display: grid;
  gap: 14px;
  align-content: start;
}

.sidebar-user-card {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.sidebar-note {
  margin: 0;
  color: var(--muted);
}

.sidebar-user-card span {
  color: var(--muted);
  font-weight: 700;
}

.sidebar-actions {
  flex-direction: column;
  align-items: stretch;
}

.button-link,
.sidebar-button-link {
  display: grid;
  place-items: center;
  min-height: 44px;
}

.action-button {
  width: auto;
  min-width: 180px;
  padding: 0 18px;
}

.secondary-link {
  color: var(--accent-dark);
  font-weight: 800;
}

.user-access-button,
.topbar-link,
.cart-button,
.primary-button,
.secondary-button,
.link-button {
  border: 0;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, background-color 0.18s ease;
  background: transparent;
}

.user-access-button {
  min-width: 150px;
  text-align: left;
  background: transparent;
  color: var(--ink);
  padding: 6px 0 6px 18px;
  border-left: 1px solid var(--line);
  line-height: 1.15;
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-access-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--accent-dark);
  background: var(--surface-soft);
}

.user-access-icon svg {
  width: 22px;
  height: 22px;
}

.user-access-copy {
  display: grid;
  gap: 2px;
}

.user-access-kicker {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.user-access-button strong {
  font-size: 1.1rem;
}

.topbar-link {
  color: var(--accent-dark);
  font-weight: 800;
  padding: 8px 0;
}

.theme-toggle {
  width: auto;
  min-width: 0;
  padding: 0 14px;
  gap: 10px;
  justify-content: center;
  box-shadow: var(--theme-toggle-shadow);
}

.theme-toggle-icon {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
}

.theme-toggle-icon svg {
  width: 100%;
  height: 100%;
}

.theme-toggle-label {
  white-space: nowrap;
}

.cart-button {
  background: transparent;
  color: var(--ink);
  font-weight: 800;
  padding: 6px 0 6px 10px;
  font-size: 1.12rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cart-button-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--accent-dark);
  display: grid;
  place-items: center;
}

.cart-button-icon svg {
  width: 22px;
  height: 22px;
}

.cart-button-count {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.92rem;
}

.hero-banner,
.promo-card,
.side-card,
.product-card,
.cart-dialog {
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-banner {
  position: relative;
  min-height: 360px;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 28px;
  background:
    linear-gradient(90deg, rgba(58, 36, 15, 0.42), rgba(58, 36, 15, 0.06)),
    url("https://images.unsplash.com/photo-1513694203232-719a280e022f?auto=format&fit=crop&w=1600&q=80") center/cover;
}

.hero-overlay {
  max-width: 620px;
  padding: 42px;
  color: #fff9f3;
}

.hero-overlay h2 {
  font-size: clamp(2.6rem, 5.6vw, 4.8rem);
  max-width: 10ch;
  margin-bottom: 16px;
}

.hero-text {
  margin: 0 0 22px;
  max-width: 56ch;
  line-height: 1.55;
  color: rgba(255, 249, 243, 0.92);
}

.hero-pills {
  flex-wrap: wrap;
}

.hero-pills span {
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 700;
}

.hero-dots {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
}

.hero-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: var(--hero-dot);
  cursor: pointer;
}

.hero-dot.active {
  background: var(--hero-dot-active);
}

.promo-strip,
.catalog-shell,
.admin-summary,
.admin-grid,
.admin-products,
.admin-users,
.admin-orders,
.orders-list,
.cart-items,
.stack-form {
  display: grid;
  gap: 18px;
}

.promo-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 34px;
}

.promo-card {
  border: 1px solid var(--line);
  padding: 18px 20px;
  min-height: 126px;
}

.promo-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.18rem;
}

.promo-card span {
  color: var(--muted);
}

.promo-card.accent {
  background: linear-gradient(135deg, #b38d69, #9c7653);
  border-color: transparent;
  color: #fff9f3;
}

.promo-card.accent .promo-label,
.promo-card.accent span {
  color: rgba(255, 249, 243, 0.82);
}

.catalog-shell {
  grid-template-columns: minmax(0, 1.65fr) 320px;
  align-items: start;
}

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

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

.section-heading h3,
.side-card h4 {
  font-size: 2rem;
}

.section-heading.tight {
  margin-bottom: 16px;
}

.link-button {
  background: transparent;
  color: var(--accent-dark);
  font-weight: 800;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: 14px;
  border: 0;
  background: transparent;
}

.product-card {
  position: relative;
  border: 1px solid var(--line);
  min-height: 100%;
}

.product-badge {
  position: absolute;
  top: 0;
  left: 0;
  background: var(--sale);
  color: #fff;
  padding: 6px 10px;
  font-size: 0.94rem;
  font-weight: 800;
  text-transform: uppercase;
}

.product-image-wrap {
  height: 255px;
  display: grid;
  place-items: center;
  padding: 26px 18px 8px;
}

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

.product-content {
  padding: 0 18px 18px;
}

.product-sku {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.95rem;
}

.product-price-row {
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}

.price {
  font-size: 2rem;
  color: var(--sale);
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
}

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

.product-heading {
  align-items: start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.product-heading h4 {
  font-size: 1.7rem;
  line-height: 1;
  max-width: 12ch;
}

.product-description {
  margin: 0 0 14px;
  line-height: 1.45;
  min-height: 44px;
}

.product-flags {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.product-flags span {
  background: var(--surface-soft);
  border: 1px solid #eaded2;
  color: var(--muted);
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

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

.primary-button,
.secondary-button {
  width: 100%;
  height: 44px;
  border-radius: 2px;
  font-weight: 800;
  text-transform: uppercase;
}

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

.secondary-button {
  background: var(--surface-soft);
  color: var(--ink);
  border: 1px solid var(--line);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.theme-toggle.secondary-button {
  width: auto;
  min-width: 0;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  gap: 10px;
  box-shadow: var(--theme-toggle-shadow);
  white-space: nowrap;
}

.side-card {
  border: 1px solid var(--line);
  padding: 22px;
  background: var(--surface-strong);
}

.products-toolbar-card {
  padding: 18px 22px;
}

.products-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) repeat(2, minmax(160px, 0.8fr));
  gap: 14px;
  align-items: end;
}

.sales-history-toolbar {
  grid-template-columns: minmax(240px, 1.5fr) repeat(4, minmax(130px, 0.75fr)) minmax(180px, 0.9fr);
}

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

.storefront-toolbar-paged {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.sales-toolbar-paged {
  grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(140px, 0.75fr));
}

.toolbar-field {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.toolbar-field-summary {
  align-content: end;
}

.toolbar-field-summary p {
  margin: 0;
}

.toolbar-field span {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

.product-editor-card {
  display: grid;
  gap: 22px;
  align-items: start;
  align-content: start;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.product-editor-card.is-editing {
  border-color: #c58037;
  background: linear-gradient(180deg, var(--surface-alt), var(--surface-tint));
  box-shadow: 0 18px 38px rgba(197, 128, 55, 0.12);
}

.discount-config-shell {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-soft), var(--surface-alt));
}

.discount-config-note {
  margin: 0;
}

.editor-mode-shell {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  grid-column: 1 / -1;
}

.editor-mode-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #f3e4d1;
  color: #84542b;
  border: 1px solid #d5b08a;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.editor-preview-shell {
  display: grid;
  gap: 14px;
  align-content: start;
}

.editor-preview-shell-side {
  position: static;
}

.products-read-shell,
.products-table-content {
  display: grid;
  gap: 18px;
}

.products-read-shell {
  position: sticky;
  top: 18px;
  align-self: start;
}

.products-table-page-shell {
  display: grid;
  gap: 18px;
}

.products-read-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  align-items: start;
}

.editor-preview-shell-side .preview-card {
  max-width: 460px;
}

.preview-card {
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface), var(--surface-alt));
  padding: 16px;
}

.preview-card-wide {
  max-width: 520px;
}

.product-editor-card .stack-form {
  align-content: start;
  gap: 16px;
}

.preview-image-wrap {
  height: 220px;
  background: var(--surface-tint);
  display: grid;
  place-items: center;
  overflow: hidden;
}

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

.preview-content {
  display: grid;
  gap: 12px;
}

.preview-category {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.preview-content h5 {
  margin: 0;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 2rem;
  text-transform: uppercase;
}

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

.preview-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.stack-form label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--ink);
  border-radius: 3px;
  padding: 12px 14px;
}

textarea {
  resize: vertical;
}

:root[data-theme="dark"] .toolbar-field select,
:root[data-theme="dark"] .toolbar-field input,
:root[data-theme="dark"] .toolbar-field textarea {
  background: var(--surface-strong);
  color: var(--ink);
  border-color: var(--line);
}

.inline-check {
  display: flex !important;
  align-items: center;
  gap: 10px;
}

.empty-state,
.muted-text {
  color: var(--muted);
}

.order-card,
.inventory-card {
  justify-content: space-between;
  align-items: start;
  border: 1px solid var(--line);
  padding: 14px 16px;
  background: var(--surface-soft);
}

.inventory-card {
  flex-wrap: wrap;
}

.inventory-actions,
.order-card-side,
.admin-order-side {
  display: grid;
  gap: 10px;
  justify-items: end;
}

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

.inventory-card .actions .secondary-button {
  width: auto;
  min-width: 104px;
  padding: 0 12px;
}

.products-table-shell {
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--surface);
}

.products-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: var(--surface);
}

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

.products-table th {
  background: var(--surface-tint);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.products-table tbody tr.is-editing {
  background: var(--surface-soft);
}

.table-product-cell,
.table-status-stack {
  display: grid;
  gap: 8px;
}

.table-product-cell small {
  color: var(--muted);
  line-height: 1.45;
}

.table-status-stack {
  justify-items: start;
}

.table-featured-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid #e2c48a;
  background: #fff1cd;
  color: #8c611a;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

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

.small-button {
  width: auto;
  min-width: 92px;
  padding: 0 14px;
}

.table-empty {
  text-align: center;
  color: var(--muted);
}

:root[data-theme="dark"] .products-table-shell {
  background: #1c1713;
}

:root[data-theme="dark"] .products-table {
  background: #1c1713;
}

:root[data-theme="dark"] .products-table th {
  background: #2a211b;
  color: var(--accent-dark);
}

:root[data-theme="dark"] .products-table td {
  background: #1c1713;
  color: var(--ink);
}

:root[data-theme="dark"] .products-table tbody tr:hover td {
  background: #221c17;
}

:root[data-theme="dark"] .products-table tbody tr.is-editing td {
  background: #2a211b;
}

:root[data-theme="dark"] .table-product-cell small,
:root[data-theme="dark"] .table-empty {
  color: var(--muted);
}

.table-toolbar,
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pagination-bar-compact {
  flex-wrap: wrap;
}

.pagination-shell {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.pagination-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.pagination-number {
  min-width: 42px;
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.pagination-number:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.pagination-number.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.pagination-number[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.pagination-ellipsis {
  padding: 0 4px;
  color: var(--muted);
  font-weight: 800;
}

:root[data-theme="dark"] .pagination-number {
  background: var(--surface-strong);
  color: var(--ink);
}

:root[data-theme="dark"] .pagination-number:hover {
  background: var(--surface-alt);
  color: var(--accent-dark);
}

:root[data-theme="dark"] .pagination-number.is-active {
  background: var(--accent);
  color: #17120f;
}

.product-list-card {
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.product-list-card.is-editing {
  border-color: #c58037;
  background: #fff5e8;
}

.product-list-main {
  display: grid;
  gap: 6px;
  max-width: 55ch;
}

.product-list-main small {
  color: var(--muted);
  line-height: 1.5;
}

.admin-section {
  margin-top: 32px;
}

.admin-summary {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 18px;
}

.summary-card {
  background: linear-gradient(180deg, var(--surface), var(--surface-alt));
  border: 1px solid var(--line);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.summary-card strong {
  display: block;
  margin: 10px 0 6px;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 2rem;
}

.summary-label {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.76rem;
  font-weight: 800;
}

.summary-card small {
  color: var(--muted);
}

:root[data-theme="dark"] .product-editor-card.is-editing {
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
}

:root[data-theme="dark"] .discount-config-shell,
:root[data-theme="dark"] .preview-card,
:root[data-theme="dark"] .settings-group,
:root[data-theme="dark"] .settings-brand-preview,
:root[data-theme="dark"] .settings-footer-preview,
:root[data-theme="dark"] .hero-slide-item,
:root[data-theme="dark"] .image-editor-canvas-wrap {
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.2);
}

:root[data-theme="dark"] .editor-mode-badge {
  background: #3a2a1d;
  color: #f3d4ae;
  border-color: #8a6747;
}

:root[data-theme="dark"] .summary-card {
  background: linear-gradient(180deg, #2a211b, #201914);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
}

:root[data-theme="dark"] .summary-card strong {
  color: var(--ink);
}

:root[data-theme="dark"] .summary-label {
  color: var(--accent-dark);
}

.admin-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-bottom: 18px;
}

.admin-grid-expanded {
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
}

.cart-dialog {
  width: min(580px, calc(100% - 24px));
  border: 1px solid var(--line);
  padding: 24px;
  position: fixed;
  inset: 0;
  margin: auto;
  max-height: min(86vh, calc(100dvh - 32px));
  overflow: auto;
}

.shopping-cart-dialog {
  padding-top: 42px;
  padding-right: 86px;
}

.auth-dialog {
  position: relative;
  width: min(520px, calc(100% - 24px));
  padding-top: 28px;
  padding-right: 88px;
}

.orders-dialog {
  width: min(720px, calc(100% - 24px));
  padding-top: 28px;
  padding-right: 88px;
}

.cart-dialog::backdrop {
  background: rgba(59, 42, 30, 0.5);
}

.dialog-header-auth {
  justify-content: flex-start;
  align-items: start;
  margin-bottom: 18px;
}

.dialog-icon-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 1;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.dialog-icon-close span {
  position: absolute;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: var(--ink);
}

.dialog-icon-close span:first-child {
  transform: rotate(45deg);
}

.dialog-icon-close span:last-child {
  transform: rotate(-45deg);
}

.cart-item {
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.cart-item-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  margin-bottom: 8px;
}

.cart-item:last-child {
  border-bottom: 0;
}

.quantity-row {
  flex-wrap: wrap;
  margin-top: 10px;
}

.quantity-row .secondary-button {
  width: auto;
  min-width: 42px;
  padding: 0 14px;
}

.account-summary {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  padding: 16px;
}

.account-summary p {
  margin: 0 0 10px;
}

.account-summary p:last-child {
  margin-bottom: 0;
}

.status-badge,
.stock-pill,
.profit-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.status-pendiente {
  background: #fff4dd;
  color: #9a6400;
  border-color: #eed79e;
}

.status-pagado {
  background: #e8f6ea;
  color: #2d7a3d;
  border-color: #b7ddbf;
}

.status-anulado {
  background: #fde9e5;
  color: #a5492f;
  border-color: #efc0b4;
}

.status-enviado {
  background: #e7f1fb;
  color: #1f5d93;
  border-color: #b9d2eb;
}

.status-entregado {
  background: #ece8fb;
  color: #5a3ea3;
  border-color: #cec2f2;
}

.status-cancelado {
  background: #fdeaea;
  color: #a43838;
  border-color: #efc0c0;
}

.stock-ok {
  background: #edf7ed;
  color: #2d7a3d;
  border-color: #bfdcc2;
}

.profit-pill-profit {
  background: #edf7ed;
  color: #2d7a3d;
  border-color: #bfdcc2;
}

.profit-pill-low {
  background: #fff3df;
  color: #9b6400;
  border-color: #ead3a0;
}

.profit-pill-loss {
  background: #fde9e5;
  color: #b34b30;
  border-color: #f0c5b9;
}

.profit-pill-neutral {
  background: #f4efe8;
  color: var(--muted);
  border-color: var(--line);
}

.stock-low {
  background: #fff3df;
  color: #9b6400;
  border-color: #ead3a0;
}

.stock-empty {
  background: #fde9e5;
  color: #b34b30;
  border-color: #f0c5b9;
}

.auth-actions {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.auth-section-head {
  display: grid;
  gap: 6px;
}

.auth-section-head-register {
  margin-top: 18px;
}

.auth-form-title {
  font-size: 1.8rem;
}

.auth-divider {
  margin: 28px 0 34px;
  border: 0;
  border-top: 1px solid var(--line);
}

.empty-products {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 30px 22px;
}

.user-card,
.admin-order-card {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  padding: 16px;
}

.inventory-row {
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  padding: 16px;
}

.inventory-row-main,
.inventory-row-meta {
  flex-wrap: wrap;
}

.inventory-row-main span {
  color: var(--muted);
  font-weight: 700;
}

.inventory-row-meta {
  justify-content: flex-end;
}

.inventory-toolbar {
  align-items: start;
}

.inventory-mode-note {
  max-width: 46ch;
}

.dashboard-grid.inventory-sales-grid {
  grid-template-columns: minmax(0, 1.85fr) minmax(320px, 0.78fr);
}

.inventory-stock-form {
  display: grid;
  gap: 14px;
  flex: 1 1 520px;
  width: 100%;
}

.inventory-pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.inventory-chip-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.preview-cost-note {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

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

.sales-catalog-grid,
.sales-cart-list,
.sales-history-list,
.sales-ranking-list {
  display: grid;
  gap: 16px;
}

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

.sale-product-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  text-align: left;
  color: inherit;
  cursor: pointer;
}

.sale-product-card.is-selected {
  border-color: #c58037;
  box-shadow: 0 12px 28px rgba(197, 128, 55, 0.12);
}

.sale-product-card:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.sale-product-card:disabled:hover {
  transform: none;
}

.sale-product-media {
  display: block;
  height: 168px;
  overflow: hidden;
  background: var(--surface-tint);
}

.sale-product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sale-product-body,
.sale-product-topline,
.sale-product-actions,
.sale-line,
.sale-line-copy,
.sale-line-actions,
.sales-total-card,
.sale-history-total {
  display: grid;
  gap: 10px;
}

.sale-product-topline {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.sale-product-topline small {
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sale-product-actions {
  align-items: center;
}

.sale-product-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  padding: 0 16px;
}

.sale-product-selected {
  color: var(--accent-dark);
  font-size: 0.84rem;
  font-weight: 800;
}

.sale-product-selected-muted {
  color: var(--muted);
  font-weight: 700;
}

.sales-cart-card {
  align-content: start;
  position: sticky;
  top: 18px;
  max-width: 380px;
  justify-self: end;
  width: 100%;
}

.sale-line {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  padding: 14px;
}

.sale-line-copy span,
.sale-line-copy small {
  color: var(--muted);
}

.sale-line-copy > small:not(.sale-line-summary) {
  display: none;
}

.sale-line-summary {
  color: var(--ink);
  font-weight: 700;
}

.sale-line-editor {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}

.sale-line-editor.has-financial-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sale-inline-field {
  display: grid;
  gap: 6px;
}

.sale-inline-field span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sale-money-input {
  width: 100%;
  min-width: 0;
  text-align: left;
  font-weight: 800;
}

.sale-line-actions {
  grid-template-columns: repeat(4, auto);
  align-items: center;
  justify-content: start;
}

.sale-quantity-input {
  width: 76px;
  min-width: 76px;
  text-align: center;
  font-weight: 800;
  padding-inline: 10px;
}

.sales-total-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-strong), var(--surface-tint));
  padding: 16px;
}

.sales-total-card strong {
  font-size: 2rem;
  line-height: 1;
}

.sale-history-card {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  padding: 16px;
  display: grid;
  gap: 14px;
}

.sale-history-total {
  justify-items: end;
}

.cash-close-card,
.sales-ranking-item,
.sales-ranking-copy {
  display: grid;
  gap: 12px;
}

.cash-close-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-strong), var(--surface-tint));
  padding: 16px;
}

.cash-close-card strong {
  font-size: 2rem;
  line-height: 1;
}

.sales-ranking-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  padding: 14px;
}

.sales-ranking-copy {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.sales-ranking-copy small {
  color: var(--muted);
}

.sales-ranking-index {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  font-weight: 800;
  color: var(--accent-dark);
}

.inventory-row-readonly .inventory-row-meta-static {
  flex-direction: column;
  align-items: end;
}

.dashboard-body {
  background:
    var(--dashboard-radial),
    var(--dashboard-wash),
    var(--bg);
}

.dashboard-header {
  justify-content: space-between;
  margin-bottom: 28px;
}

.dashboard-titlebar,
.dashboard-header-actions {
  flex-wrap: wrap;
}

.dashboard-titlebar h1 {
  font-size: clamp(2.2rem, 4vw, 3.5rem);
}

.dashboard-user-chip {
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.dashboard-main,
.dashboard-section,
.dashboard-grid {
  display: grid;
  gap: 22px;
}

.dashboard-grid {
  align-items: start;
}

.dashboard-hero {
  display: grid;
  gap: 24px;
  padding: 28px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-strong), var(--surface-alt));
  box-shadow: var(--shadow);
}

.dashboard-copy {
  margin: 12px 0 0;
  max-width: 70ch;
  color: var(--muted);
  line-height: 1.6;
}

.product-page-main {
  display: grid;
  gap: 26px;
}

.detail-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-weight: 700;
}

.detail-breadcrumbs a {
  color: var(--accent-dark);
  text-decoration: none;
}

.product-detail-shell {
  display: grid;
}

.product-detail-card {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(0, 1.05fr);
  gap: 28px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 24px;
}

.detail-media {
  min-height: 420px;
  background: linear-gradient(180deg, var(--surface-alt), var(--surface-tint));
  display: grid;
  place-items: center;
  padding: 24px;
}

.detail-media img {
  width: 100%;
  height: 100%;
  max-height: 520px;
  object-fit: contain;
}

.detail-copy {
  display: grid;
  gap: 18px;
  align-content: start;
}

.detail-copy h2 {
  font-size: clamp(2.4rem, 5vw, 4rem);
}

.detail-description {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  max-width: 58ch;
}

.detail-price-row,
.detail-flags,
.detail-purchase-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.detail-price-row,
.detail-flags {
  flex-wrap: wrap;
}

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

.detail-highlight-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.detail-highlight-card strong {
  font-size: 1.2rem;
}

.detail-highlight-card span {
  color: var(--muted);
  line-height: 1.5;
}

.detail-purchase-row {
  align-items: end;
}

.detail-quantity-field {
  min-width: 160px;
}

.site-footer {
  margin-top: 36px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 239, 229, 0.96));
  box-shadow: var(--shadow);
  padding: 24px;
}

:root[data-theme="dark"] .site-footer {
  background: linear-gradient(180deg, rgba(34, 27, 22, 0.96), rgba(23, 18, 15, 0.98));
}

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

.footer-line {
  margin: 0 0 12px;
}

.footer-links {
  display: grid;
  gap: 10px;
}

.footer-links a {
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 800;
}

:root[data-theme="dark"] .site-footer .section-tag,
:root[data-theme="dark"] .site-footer .muted-text,
:root[data-theme="dark"] .site-footer .footer-line,
:root[data-theme="dark"] .site-footer strong,
:root[data-theme="dark"] .site-footer span {
  color: var(--ink);
}

:root[data-theme="dark"] .site-footer .section-tag,
:root[data-theme="dark"] .site-footer .footer-links a {
  color: var(--accent-dark);
}

.dashboard-grid {
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
}

.settings-grid {
  grid-template-columns: minmax(340px, 0.95fr) minmax(360px, 1.05fr);
}

.settings-editor-card,
.settings-preview-card,
.settings-footer-preview,
.settings-brand-preview {
  display: grid;
  gap: 18px;
}

.settings-editor-card {
  align-content: start;
  max-height: none;
  overflow: visible;
}

.settings-preview-card {
  align-content: start;
  position: sticky;
  top: 18px;
  max-height: none;
  overflow: visible;
}

.settings-group {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface), var(--surface-tint));
}

.settings-group-head {
  display: grid;
  gap: 6px;
}

.settings-group-head h5,
.settings-brand-preview h5,
.settings-footer-preview h5,
.settings-hero-preview h5 {
  margin: 0;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.85rem;
  line-height: 1;
  text-transform: uppercase;
  color: var(--ink);
}

.settings-brand-preview {
  padding: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface), var(--surface-tint));
}

.settings-brand-preview .brand-caption {
  margin-bottom: 8px;
}

.settings-hero-preview {
  position: relative;
  min-height: 320px;
  border: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(58, 36, 15, 0.42), rgba(58, 36, 15, 0.06)),
    url("https://images.unsplash.com/photo-1513694203232-719a280e022f?auto=format&fit=crop&w=1600&q=80") center/cover;
  color: #fff9f3;
  overflow: hidden;
}

.settings-hero-overlay {
  display: grid;
  align-content: end;
  gap: 14px;
  min-height: 100%;
  padding: 24px;
}

.settings-hero-overlay .hero-text {
  margin: 0;
  max-width: 54ch;
}

.settings-preview-pills {
  gap: 10px;
}

.settings-preview-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.settings-preview-strip .promo-card {
  min-height: 0;
}

.settings-preview-dots {
  left: 24px;
  right: auto;
  bottom: 18px;
  transform: none;
}

.hero-slides-editor {
  display: grid;
  gap: 14px;
}

.hero-slide-item {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface), var(--surface-alt));
}

.hero-slide-item.is-active {
  border-color: #c58037;
  box-shadow: 0 12px 28px rgba(197, 128, 55, 0.12);
}

.hero-slide-thumb {
  min-height: 110px;
  border-radius: 4px;
  background-color: var(--surface-tint);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  border: 1px solid var(--line);
}

.hero-slide-fields {
  display: grid;
  gap: 12px;
}

.hero-slide-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

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

.hero-slide-actions .secondary-button {
  width: auto;
  min-width: 110px;
  padding: 0 16px;
}

.settings-footer-preview {
  padding: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface), var(--surface-tint));
}

.settings-footer-copy {
  display: grid;
  gap: 10px;
}

.settings-footer-copy p {
  margin: 0;
}

.settings-preview-section {
  scroll-margin-top: 24px;
  transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.settings-preview-section.is-active {
  border-color: rgba(197, 128, 55, 0.7);
  box-shadow: 0 16px 36px rgba(197, 128, 55, 0.16);
  transform: translateY(-2px);
}

.image-editor-dialog {
  width: min(920px, calc(100% - 32px));
}

.image-editor-shell {
  display: grid;
  gap: 18px;
}

.image-editor-canvas-wrap {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface), var(--surface-tint));
  padding: 14px;
}

#product-image-canvas {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  background: var(--surface-tint);
  cursor: grab;
}

#product-image-canvas:active {
  cursor: grabbing;
}

.image-editor-controls {
  display: grid;
  gap: 14px;
}

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

.permission-toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.permission-check {
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--surface-alt);
}

.permission-check input {
  accent-color: var(--accent);
}

.roles-card-list,
.stats-detail-list {
  display: grid;
  gap: 14px;
}

.account-item-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface), var(--surface-alt));
}

.account-item-card p {
  margin: 0;
}

.account-item-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
}

.account-item-head div {
  display: grid;
  gap: 6px;
}

.account-item-head > div span {
  color: var(--muted);
}

.account-empty-state {
  display: grid;
  gap: 8px;
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.account-empty-state p {
  margin: 0;
  color: var(--muted);
}

.role-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface), var(--surface-alt));
}

.role-card-system {
  background: linear-gradient(180deg, var(--surface-soft), var(--surface-alt));
}

.role-permission-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stats-toolbar {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.auth-helper-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.confirm-dialog-head {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.compact-dialog {
  width: min(420px, calc(100% - 24px));
}

.logo-dialog {
  width: min(520px, calc(100% - 24px));
}

.logo-preview-shell {
  display: grid;
  gap: 14px;
  align-items: start;
}

.brand-logo-preview {
  width: 96px;
  height: 96px;
}

.logo-dialog .form-actions {
  flex-wrap: wrap;
}

.logo-dialog .form-actions .primary-button,
.logo-dialog .form-actions .secondary-button {
  width: auto;
  min-width: 140px;
  padding: 0 18px;
}

.confirm-dialog .form-actions {
  flex-wrap: wrap;
}

.confirm-dialog .form-actions .primary-button,
.confirm-dialog .form-actions .secondary-button {
  width: auto;
  min-width: 140px;
  padding: 0 18px;
}

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 10px;
  z-index: 60;
  pointer-events: none;
}

.toast {
  min-width: 240px;
  max-width: 360px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  background: #edf7ed;
  border-color: #bfdcc2;
  color: #2d7a3d;
}

.toast-error {
  background: #fde9e5;
  border-color: #f0c5b9;
  color: #b34b30;
}

.toast-info {
  background: #e7f1fb;
  border-color: #b9d2eb;
  color: #1f5d93;
}

.current-user {
  outline: 2px solid rgba(168, 134, 99, 0.22);
}

.inline-form {
  display: grid;
  gap: 10px;
}

.user-card {
  display: grid;
  gap: 14px;
}

.admin-order-card {
  display: grid;
  gap: 14px;
}

.admin-order-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.order-items-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.order-items-preview span {
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface), var(--surface-alt));
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 700;
}

:root[data-theme="dark"] .order-items-preview span {
  background: linear-gradient(180deg, #2a211b, #201914);
  color: var(--ink);
  border-color: #6a5542;
}

.user-access-button:hover,
.topbar-link:hover,
.cart-button:hover,
.floating-cart-toggle:hover,
.floating-whatsapp-link:hover,
.primary-button:hover,
.secondary-button:hover,
.link-button:hover {
  transform: translateY(-1px);
}

.hamburger-button:hover,
.icon-button:hover,
.dialog-icon-close:hover {
  background: rgba(255, 255, 255, 0.7);
}

@media (max-width: 1120px) {
  .catalog-shell {
    grid-template-columns: 1fr;
  }

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

  .editor-preview-shell,
  .editor-preview-shell-side {
    position: static;
  }

  .products-read-split {
    grid-template-columns: 1fr;
  }

  .products-read-shell {
    position: static;
  }

  .storefront-toolbar,
  .product-detail-card,
  .detail-highlights {
    grid-template-columns: 1fr;
  }

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

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

  .settings-grid,
  .roles-dashboard-grid,
  .stats-dashboard-grid,
  .settings-preview-strip {
    grid-template-columns: 1fr;
  }

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

  .products-toolbar {
    grid-template-columns: 1fr;
  }

  .dashboard-grid.inventory-sales-grid {
    grid-template-columns: 1fr;
  }

  .sales-insights-grid {
    grid-template-columns: 1fr;
  }

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

  .products-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

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

  .product-card:nth-child(4n) {
    border-right: 1px solid var(--line);
  }
}

@media (max-width: 840px) {
  .site-frame {
    width: min(100%, calc(100% - 24px));
    padding-top: 18px;
  }

  body.storefront-editing .site-frame {
    padding-right: 0;
  }

  .dashboard-shell {
    width: min(100%, calc(100% - 24px));
    padding-top: 18px;
  }

  .utility-header,
  .promo-strip,
  .right-column {
    grid-template-columns: 1fr;
  }

  .utility-header,
  .utility-actions,
  .header-branding,
  .dashboard-header {
    flex-direction: column;
    align-items: stretch;
  }

  .utility-actions {
    gap: 8px;
  }

  .user-access-button {
    border-left: 0;
    padding-left: 0;
  }

  .theme-toggle-label {
    display: none;
  }

  .theme-toggle.secondary-button {
    padding-inline: 12px;
  }

  .dashboard-header-actions {
    justify-content: space-between;
  }

  .action-button {
    width: 100%;
  }

  .table-toolbar,
  .pagination-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .sale-line-actions {
    grid-template-columns: repeat(2, auto);
  }

  .sale-line-editor.has-financial-fields {
    grid-template-columns: 1fr;
  }

  .sales-cart-card {
    position: static;
  }

  .settings-editor-card,
  .settings-preview-card {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .storefront-inline-editor {
    width: 100vw;
    padding: 18px 14px 22px;
  }

  .floating-cart-toggle,
  .floating-whatsapp-link,
  .storefront-mode-toggle {
    right: 14px;
    bottom: 14px;
  }

  .floating-cart-toggle.is-offset {
    bottom: 82px;
  }

  .floating-whatsapp-link {
    bottom: 82px;
  }

  .floating-whatsapp-link.is-offset {
    bottom: 150px;
  }

  .detail-purchase-row {
    flex-direction: column;
    align-items: stretch;
  }

  .toast-region {
    left: 12px;
    right: 12px;
  }

  .toast {
    min-width: 0;
    max-width: none;
  }

  .hero-overlay {
    padding: 28px 22px 56px;
  }

  .promo-strip {
    display: grid;
  }

  .settings-group {
    padding: 16px;
  }

  .products-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .inventory-pricing-grid {
    grid-template-columns: 1fr;
  }

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

.product-card {
    border-right: 1px solid var(--line);
  }
}

@media (max-width: 560px) {
  .brand-lockup {
    min-width: 0;
  }

  .hero-overlay h2 {
    max-width: none;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .admin-order-head {
    flex-direction: column;
  }

  .inventory-actions,
  .order-card-side,
  .admin-order-side,
  .inventory-row-meta {
    justify-items: start;
  }

  .inventory-row,
  .inventory-row-main,
  .inventory-row-meta,
  .dashboard-user-chip {
    align-items: start;
    flex-direction: column;
  }

  .product-actions {
    grid-template-columns: 1fr;
  }

  .right-column {
    grid-template-columns: 1fr;
  }
}
