:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --panel: #ffffff;
  --ink: #18201c;
  --muted: #68726d;
  --line: #dfe4dd;
  --accent: #6b4350;
  --accent-2: #0f766e;
  --danger: #8d2f46;
  --badge: #3e2230;
  --soft: #f6f2ee;
  --warning: #a16207;
  --ok: #0f766e;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

body.auth-pending .app-shell,
body.is-logged-out .app-shell {
  display: none;
}

body.is-authenticated .login-screen {
  display: none;
}

.login-screen {
  align-items: center;
  background:
    linear-gradient(90deg, rgba(24, 32, 28, 0.72), rgba(24, 32, 28, 0.3)),
    url("/assets/login-bg.jpg") center / cover no-repeat;
  display: grid;
  min-height: 100vh;
  padding: 24px;
}

.login-panel {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(34, 34, 34, 0.08);
  display: grid;
  gap: 14px;
  justify-items: start;
  margin: 0 auto;
  max-width: 420px;
  padding: 32px;
  width: min(100%, 420px);
}

.brand-logo {
  background: #fff;
  border-radius: 8px;
  display: block;
  height: 48px;
  object-fit: contain;
  padding: 3px;
  width: 48px;
}

.login-logo {
  height: 112px;
  width: 112px;
}

.login-title-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.login-panel h1 {
  font-size: 32px;
  margin: 0;
}

.login-panel p {
  margin: 0;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  background: #19231f;
  color: #f8faf8;
  padding: 24px 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f5ede2;
  color: #7b2f3d;
  font-weight: 800;
}

.brand span:last-child {
  display: block;
  color: #b8c2bd;
  font-size: 13px;
  margin-top: 2px;
}

.env-badge {
  background: #eef2f0;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  padding: 5px 8px;
  text-transform: uppercase;
  width: fit-content;
}

.env-badge[data-env="prod"] {
  background: #f8edd2;
  border-color: #e6c56f;
  color: #7c2d12;
}

.env-badge[data-env="staging"] {
  background: #dff3ef;
  border-color: #9ad6cd;
  color: #0f766e;
}

.sidebar-env {
  margin-top: 5px;
}

.module-nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #dfe7e2;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.is-active {
  background: #2b3832;
  color: #ffffff;
}

.main {
  padding: 24px;
  min-width: 0;
}

.toolbar,
.screen,
.orders-list-panel,
.order-detail-panel,
.customers-list-panel,
.customer-detail-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 12px;
  padding: 14px;
  margin-bottom: 18px;
  align-items: end;
}

.toolbar div {
  display: grid;
  gap: 4px;
}

.toolbar div span {
  color: var(--muted);
  font-size: 13px;
}

label {
  display: grid;
  gap: 6px;
}

label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

input,
select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 10px;
  color: var(--ink);
  background: #fff;
}

button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 9px 14px;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  font-weight: 700;
}

button.secondary {
  background: #eef2f0;
  color: var(--ink);
  border-color: var(--line);
}

button.danger {
  background: var(--danger);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.screen {
  display: none;
  padding: 20px;
}

.screen.is-active {
  display: block;
}

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

.heading-side {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.brand .brand-logo + div {
  min-width: 0;
}

.auth-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.button-link {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  display: inline-flex;
  font-size: 14px;
  font-weight: 700;
  min-height: 40px;
  padding: 0 14px;
  text-decoration: none;
}

.mode-toggle {
  align-items: center;
  background: #fbfcfb;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: inline-grid;
  gap: 8px;
  grid-template-columns: auto 1fr;
  min-height: 40px;
  padding: 8px 10px;
}

.mode-toggle input {
  min-height: auto;
}

.mode-toggle select {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 28px;
  min-width: 132px;
  padding: 2px 8px;
}

.language-toggle {
  background: #fff;
}

.language-toggle select {
  min-width: 110px;
}

.mode-toggle span {
  color: var(--ink);
  font-size: 12px;
  white-space: nowrap;
}

body.is-public-role .screen-heading p,
body.is-public-role #customers-screen,
body.is-public-role #dashboard-screen,
body.is-public-role #order-editor {
  display: none;
}

body:not([data-view-mode="admin"]) #customers-screen,
body:not([data-view-mode="admin"]) #dashboard-screen {
  display: none;
}

h1 {
  margin: 0;
  font-size: 28px;
}

p {
  color: var(--muted);
  margin: 6px 0 0;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(92px, 1fr));
  gap: 8px;
  min-width: 360px;
}

.summary-strip div {
  background: var(--soft);
  border-radius: 8px;
  padding: 10px;
}

.summary-strip span {
  display: block;
  font-weight: 800;
}

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

.orders-layout,
.customers-layout,
.houses-layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 14px;
}

.catalog-controls {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr)) minmax(160px, 0.9fr);
  gap: 10px;
  margin-bottom: 14px;
}

.catalog-negative-toggle {
  min-height: 64px;
}

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

.catalog-card {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.bottle-image-slot {
  width: 82px;
  min-height: 128px;
  border: 1px dashed #cbd5cf;
  border-radius: 8px;
  background: #f7f8f6;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.catalog-card-body {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.catalog-house-link,
.catalog-card-title span {
  display: block;
}

.catalog-house-link {
  background: transparent;
  border: 0;
  color: var(--accent);
  cursor: pointer;
  font-weight: 800;
  min-height: 0;
  padding: 0;
  text-align: left;
}

.catalog-house-link:hover {
  text-decoration: underline;
}

.catalog-card-title span {
  color: var(--muted);
  margin-top: 2px;
}

.catalog-fields {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.catalog-fields div {
  min-width: 0;
}

.catalog-fields dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.catalog-fields dd {
  margin: 3px 0 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.catalog-description {
  border-top: 1px solid rgba(21, 33, 28, 0.1);
  display: grid;
  gap: 5px;
  min-width: 0;
  padding-top: 8px;
}

.catalog-description-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.catalog-description-text {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.catalog-description.is-collapsed .catalog-description-text {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.catalog-description-toggle {
  background: transparent;
  border: 0;
  color: var(--accent);
  cursor: pointer;
  font-weight: 800;
  justify-self: start;
  min-height: 0;
  padding: 0;
}

.orders-list-panel,
.order-detail-panel,
.customers-list-panel,
.customer-detail-panel,
.houses-list-panel,
.house-detail-panel {
  padding: 14px;
  min-height: 520px;
}

.panel-controls {
  display: grid;
  grid-template-columns: 1fr 170px;
  gap: 10px;
  margin-bottom: 12px;
}

.panel-controls.single-control {
  grid-template-columns: 1fr;
}

.orders-list,
.customers-list,
.houses-list {
  display: grid;
  gap: 12px;
  max-height: 620px;
  overflow: auto;
}

.house-region-group {
  display: grid;
  gap: 8px;
}

.house-region-group h3 {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
  margin: 0;
  text-transform: uppercase;
}

.house-region-list {
  display: grid;
  gap: 8px;
}

.order-card,
.customer-card,
.house-card {
  width: 100%;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  text-align: left;
}

.house-card {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 58px minmax(0, 1fr);
}

.house-card img,
.house-card-placeholder {
  background: #f7f8f6;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: block;
  height: 58px;
  object-fit: cover;
  width: 58px;
}

.house-card small {
  color: var(--muted);
  display: block;
  margin-top: 3px;
}

.house-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(123, 47, 61, 0.16);
}

.house-detail {
  display: grid;
  gap: 18px;
}

.house-profile {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);
}

.house-profile h2 {
  margin: 0;
}

.house-title-row {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.house-title-row span {
  background: var(--soft);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 4px 8px;
}

.house-description {
  color: var(--ink);
  line-height: 1.62;
  white-space: pre-line;
}

.house-gallery {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
}

.house-gallery figure {
  background: #f7f8f6;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0;
  overflow: hidden;
}

.house-gallery img {
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: cover;
  width: 100%;
}

.house-gallery figcaption,
.house-gallery-empty,
.house-wines-header span {
  color: var(--muted);
  font-size: 12px;
}

.house-gallery figcaption {
  padding: 8px;
}

.house-wines-header {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
}

.house-wines-header h3 {
  margin: 0;
}

.house-catalog-list {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.order-status-open {
  background: #fff;
}

.order-status-paid-supplied {
  background: #d9f2df;
  border-color: #7fc58e;
}

.order-status-supplied-unpaid {
  background: #f2ad5f;
  border-color: #c96f1b;
}

.order-status-paid-unsupplied {
  background: #eadffd;
  border-color: #b698eb;
}

.order-card.is-selected,
.customer-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(123, 47, 61, 0.12);
}

.order-card strong,
.order-card span,
.customer-card strong,
.customer-card span {
  display: block;
}

.order-card .meta,
.customer-card .meta,
.detail-grid small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.status-row,
.money-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.pill {
  border-radius: 999px;
  padding: 4px 8px;
  background: #eef2f0;
  color: #3c4741;
  font-size: 12px;
  font-weight: 700;
}

.pill.ok {
  background: #dff3ef;
  color: var(--ok);
}

.pill.warning {
  background: #f8edd2;
  color: var(--warning);
}

.empty-state {
  min-height: 240px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.order-status-banner {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.detail-grid div,
.payment-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfb;
}

.detail-grid strong,
.payment-box strong {
  display: block;
  margin-top: 3px;
}

.line-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

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

.line-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover,
.clickable-row:focus {
  outline: none;
  filter: brightness(0.97);
}

.number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.placeholder-screen {
  min-height: 420px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr);
  gap: 14px;
}

.dashboard-widget {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  min-width: 0;
}

.dashboard-widget-wide {
  grid-column: 1 / -1;
}

.dashboard-widget h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.dashboard-widget-body {
  min-width: 0;
  overflow-x: auto;
}

.dashboard-table {
  min-width: 560px;
}

.dashboard-table tfoot th {
  border-top: 2px solid var(--line);
  border-bottom: 0;
  background: #fbfcfb;
}

.dashboard-mini-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.dashboard-mini-metrics div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 10px;
}

.dashboard-mini-metrics small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 3px;
}

.dashboard-mini-metrics strong {
  display: block;
}

.dashboard-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.dashboard-group + .dashboard-group {
  margin-top: 8px;
}

.dashboard-group summary {
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) repeat(4, minmax(110px, 1fr));
  gap: 10px;
  align-items: center;
  padding: 12px;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.dashboard-group summary::-webkit-details-marker {
  display: none;
}

.dashboard-group summary span:not(:first-child) {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.dashboard-group[open] summary {
  border-bottom: 1px solid var(--line);
  background: #fbfcfb;
}

.dashboard-empty {
  min-height: 160px;
}

.order-editor {
  border: 1px solid var(--line);
  background: #fbfcfb;
  border-radius: 8px;
  margin-top: 16px;
  padding: 16px;
}

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

.editor-header {
  margin-bottom: 14px;
}

.editor-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 10px;
}

.check-field {
  align-content: end;
  grid-template-columns: auto 1fr;
  align-items: center;
  min-height: 64px;
}

.check-field input {
  min-height: auto;
}

.line-editor-header {
  margin: 18px 0 10px;
}

.editor-lines {
  display: grid;
  gap: 8px;
}

.editor-line {
  display: grid;
  grid-template-columns: 76px 104px 1.35fr 112px 112px 82px 92px 92px 44px;
  gap: 8px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.line-catalog-type[readonly],
.line-region[readonly],
.line-wine-type[readonly] {
  background: #f5f7f5;
  color: var(--muted);
}

.editor-line.discount-line {
  grid-template-columns: 76px 1fr 120px 120px 44px;
}

.editor-line button {
  min-width: 40px;
  padding: 9px;
}

.line-move-actions {
  display: grid;
  gap: 4px;
  grid-template-columns: 1fr 1fr;
}

.line-move-actions button {
  min-width: 34px;
  padding: 8px 6px;
}

.editor-footer {
  margin-top: 14px;
}

.editor-message {
  color: var(--muted);
  min-height: 22px;
}

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

  .sidebar {
    padding: 14px;
  }

  .module-nav {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .toolbar,
  .orders-layout,
  .customers-layout,
  .houses-layout,
  .house-profile,
  .catalog-controls,
  .screen-heading,
  .dashboard-grid,
  .editor-grid,
  .editor-line,
  .editor-line.discount-line {
    grid-template-columns: 1fr;
    display: grid;
  }

  .order-editor {
    margin-left: -4px;
    margin-right: -4px;
  }

  .editor-line,
  .editor-line.discount-line {
    border-radius: 8px;
    gap: 10px;
    overflow-x: visible;
  }

  .line-move-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .editor-footer {
    background: rgba(251, 252, 251, 0.96);
    border-top: 1px solid var(--line);
    bottom: 0;
    margin: 14px -16px -16px;
    padding: 12px 16px;
    position: sticky;
    z-index: 5;
  }

  .heading-side {
    justify-items: stretch;
  }

  .action-row {
    justify-content: flex-start;
  }

  .summary-strip {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .main {
    padding: 12px;
  }

  .panel-controls,
  .detail-grid,
  .summary-strip,
  .catalog-list,
  .catalog-fields,
  .dashboard-mini-metrics {
    grid-template-columns: 1fr;
  }

  .catalog-card {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 8px;
    padding: 8px;
  }

  .bottle-image-slot {
    width: 56px;
    min-height: 88px;
    border-radius: 6px;
  }

  .catalog-card-body {
    gap: 7px;
  }

  .catalog-card-title strong {
    font-size: 14px;
    line-height: 1.2;
  }

  .catalog-card-title span {
    font-size: 13px;
    line-height: 1.25;
    margin-top: 1px;
  }

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

  .catalog-fields dt {
    font-size: 10px;
  }

  .catalog-fields dd {
    font-size: 12px;
    margin-top: 1px;
  }

  .catalog-description {
    padding-top: 7px;
  }

  .catalog-description-text {
    font-size: 12px;
    line-height: 1.4;
  }

  .catalog-description.is-collapsed .catalog-description-text {
    -webkit-line-clamp: 4;
  }

  .line-table {
    display: block;
    overflow-x: auto;
  }

  .order-detail-panel .detail-header {
    display: grid;
  }

  .order-detail-panel .detail-header .status-row {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
  }

  .order-detail-panel .line-table {
    display: grid;
    gap: 10px;
    overflow: visible;
  }

  .order-detail-panel .line-table thead {
    display: none;
  }

  .order-detail-panel .line-table tbody,
  .order-detail-panel .line-table tr {
    display: grid;
    gap: 8px;
  }

  .order-detail-panel .line-table tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    background: #fff;
  }

  .order-detail-panel .line-table td {
    border-bottom: 0;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(78px, 0.35fr) minmax(0, 1fr);
    padding: 0;
  }

  .order-detail-panel .line-table td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
  }

  .order-detail-panel .line-table .line-wine-cell {
    grid-template-columns: 1fr;
  }

  .order-detail-panel .line-table .line-wine-cell::before {
    margin-bottom: -2px;
  }

  .order-detail-panel .line-table .number {
    text-align: left;
  }

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

  .dashboard-group summary span:not(:first-child) {
    text-align: left;
  }
}

.order-detail-view.is-customer-view h3 {
  margin: 10px 0 8px;
}

.detail-actions {
  align-items: end;
  display: grid;
  gap: 8px;
  justify-items: end;
}

.order-presentation-toggle {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: 999px;
  display: flex;
  gap: 4px;
  padding: 3px;
}

.order-presentation-toggle button {
  border-radius: 999px;
  min-height: 30px;
  padding: 5px 10px;
}

.order-presentation-toggle button.is-active {
  background: var(--accent);
  color: #fff;
}

.autocomplete-field {
  position: relative;
}

.wine-autocomplete {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 34px rgba(21, 29, 24, 0.18);
  display: grid;
  left: 0;
  max-height: min(320px, 45vh);
  overflow-y: auto;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 30;
}

.wine-autocomplete button {
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  display: grid;
  gap: 2px;
  min-height: 0;
  padding: 9px 10px;
  text-align: left;
}

.wine-autocomplete button:hover,
.wine-autocomplete button:focus {
  background: var(--soft);
  outline: none;
}

.wine-autocomplete button span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: none;
}

@media (max-width: 760px) {
  #orders-screen > .screen-heading {
    align-items: stretch;
    gap: 8px;
  }

  #orders-screen > .screen-heading h1 {
    font-size: 22px;
    margin: 0;
  }

  #orders-screen > .screen-heading p {
    display: none;
  }

  #orders-screen .heading-side {
    gap: 8px;
  }

  #orders-screen .summary-strip {
    display: none;
  }

  #orders-screen .action-row {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #order-view-mode-wrap {
    grid-column: 1 / -1;
  }

  .orders-list-panel,
  .order-detail-panel {
    min-height: 0;
    padding: 10px;
  }

  .detail-header.order-status-banner {
    gap: 8px;
    margin-bottom: 10px;
    padding: 10px;
  }

  .detail-title h2 {
    font-size: 20px;
    line-height: 1.1;
    margin: 0 0 3px;
  }

  .detail-title p {
    margin: 0;
  }

  .detail-actions {
    justify-items: stretch;
  }

  .detail-actions .status-row {
    gap: 5px;
    margin-top: 0;
  }

  .order-presentation-toggle {
    border-radius: 10px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .order-summary-grid.detail-grid {
    gap: 6px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 10px;
  }

  .order-summary-grid.detail-grid div {
    padding: 7px 8px;
  }

  .order-summary-grid.detail-grid small {
    font-size: 10px;
    margin-top: 0;
  }

  .order-summary-grid.detail-grid strong {
    font-size: 14px;
    margin-top: 1px;
  }

  .order-detail-view.is-customer-view .order-line-table tr {
    gap: 5px;
    padding: 8px;
  }

  .order-detail-view.is-customer-view .order-line-table td {
    font-size: 13px;
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .order-detail-view.is-customer-view .order-line-table .line-wine-cell strong {
    font-size: 14px;
  }
}

.editor-title-copy {
  min-width: 0;
}

.editor-title-copy h2 {
  line-height: 1.12;
  margin: 0;
}

.editor-title-copy p {
  margin: 3px 0 0;
}

@media (max-width: 640px) {
  .order-editor {
    margin-top: 10px;
    padding: 10px;
  }

  .editor-header {
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
  }

  .editor-title-copy h2 {
    font-size: 18px;
  }

  .editor-title-copy p {
    color: var(--muted);
    font-size: 12px;
    max-width: 58vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #cancel-order-edit {
    min-height: 34px;
    padding: 7px 10px;
  }

  .line-editor-header {
    margin: 12px 0 8px;
  }

  .line-editor-header h3 {
    margin: 0;
  }

  .order-detail-panel .order-line-table tr,
  .order-detail-panel .line-table tr {
    gap: 4px;
    padding: 7px;
  }

  .order-detail-panel .order-line-table td,
  .order-detail-panel .line-table td {
    font-size: 12px;
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .order-detail-panel .line-table td::before {
    font-size: 10px;
  }

  .order-detail-panel .line-table .line-wine-cell strong {
    font-size: 13px;
    line-height: 1.2;
  }
}

.compact-meta-row {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  font-weight: 700;
  gap: 4px 8px;
  margin-top: 4px;
}

.compact-meta-row span {
  background: var(--soft);
  border-radius: 999px;
  padding: 3px 7px;
}

.customer-summary-compact {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 10px;
}

.customer-summary-compact span {
  background: #fbfcfb;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
}

.customer-summary-compact strong,
.customer-summary-compact small {
  display: block;
}

.customer-summary-compact small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.house-about {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.house-about summary {
  color: var(--accent);
  cursor: pointer;
  font-weight: 800;
}

.compact-wine-card {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: 46px minmax(0, 1fr);
  padding: 8px;
}

.compact-wine-card .bottle-image-slot {
  min-height: 70px;
  width: 46px;
}

.compact-wine-card-body {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.compact-wine-card-body strong,
.compact-wine-card-body span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-wine-card-body strong {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.compact-wine-card-body > span {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 640px) {
  #customers-screen .summary-strip,
  #houses-screen .summary-strip {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    width: 100%;
  }

  #customers-screen .summary-strip div,
  #houses-screen .summary-strip div {
    align-items: baseline;
    display: flex;
    flex: 1 0 auto;
    gap: 4px;
    padding: 6px 7px;
    white-space: nowrap;
  }

  #customers-screen .summary-strip span,
  #houses-screen .summary-strip span {
    display: inline;
    font-size: 14px;
  }

  #customers-screen .summary-strip small,
  #houses-screen .summary-strip small {
    font-size: 10px;
  }

  .customer-controls {
    grid-template-columns: 1fr 120px;
  }

  .customer-card,
  .house-card {
    padding: 8px;
  }

  .customer-card strong,
  .house-card strong {
    font-size: 14px;
  }

  .customer-summary-compact {
    gap: 5px;
    margin-bottom: 6px;
  }

  .customer-summary-compact span {
    padding: 5px 6px;
  }

  .customer-summary-compact strong {
    font-size: 13px;
  }

  .customer-summary-compact small {
    font-size: 9px;
  }

  .customer-detail-header {
    margin-bottom: 8px;
  }

  .customer-orders-table tr {
    gap: 4px;
    padding: 7px;
  }

  .house-detail {
    gap: 10px;
  }

  .house-about {
    padding: 8px;
  }

  .house-about .house-profile {
    gap: 10px;
    grid-template-columns: 1fr;
    margin-top: 8px;
  }

  .house-about .house-description {
    font-size: 13px;
    line-height: 1.45;
    margin: 6px 0 0;
  }

  .house-gallery {
    display: none;
  }

  .house-wines-header {
    gap: 4px;
  }

  .house-wines-header h3 {
    font-size: 17px;
  }

  .house-wines-header span {
    font-size: 11px;
  }

  .house-catalog-list {
    gap: 6px;
    grid-template-columns: 1fr;
  }

  .compact-wine-card {
    gap: 7px;
    grid-template-columns: 40px minmax(0, 1fr);
    padding: 7px;
  }

  .compact-wine-card .bottle-image-slot {
    min-height: 58px;
    width: 40px;
  }

  .compact-wine-card-body strong {
    font-size: 13px;
  }

  .compact-wine-card-body > span,
  .compact-wine-card .compact-meta-row {
    font-size: 11px;
  }
}

body:not([data-view-mode="admin"]) .catalog-negative-toggle,
body:not([data-view-mode="admin"]) #catalog-value,
body:not([data-view-mode="admin"]) #catalog-value + small {
  display: none;
}

@media (max-width: 640px) {
  #catalog-screen .summary-strip {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    width: 100%;
  }

  #catalog-screen .summary-strip div {
    align-items: baseline;
    display: flex;
    flex: 1 0 auto;
    gap: 4px;
    padding: 6px 7px;
    white-space: nowrap;
  }

  #catalog-screen .summary-strip span {
    display: inline;
    font-size: 14px;
  }

  #catalog-screen .summary-strip small {
    font-size: 10px;
  }

  .toolbar .auth-actions {
    align-items: stretch;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbar .mode-toggle {
    justify-content: start;
  }
}

.compact-wine-description {
  color: var(--muted);
  display: -webkit-box;
  font-size: 12px;
  line-height: 1.35;
  margin: 2px 0 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

@media (max-width: 640px) {
  .customer-controls {
    gap: 6px;
    grid-template-columns: minmax(0, 1fr) minmax(84px, 96px);
  }

  .customer-controls label,
  .customer-controls input,
  .customer-controls select {
    min-width: 0;
  }

  .customer-controls label span {
    font-size: 10px;
  }

  .customer-controls select,
  .customer-controls input {
    padding-left: 8px;
    padding-right: 8px;
  }

  .compact-wine-description {
    font-size: 11px;
    -webkit-line-clamp: 2;
  }
}

.google-login-button {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  justify-content: center;
}

.google-icon {
  background: conic-gradient(from -45deg, #4285f4 0deg 90deg, #34a853 90deg 180deg, #fbbc05 180deg 270deg, #ea4335 270deg 360deg);
  border-radius: 50%;
  display: inline-block;
  height: 18px;
  position: relative;
  width: 18px;
}

.google-icon::before {
  background: #fff;
  border-radius: 50%;
  content: '';
  height: 8px;
  left: 5px;
  position: absolute;
  top: 5px;
  width: 8px;
}

.google-icon::after {
  background: #4285f4;
  content: '';
  height: 4px;
  position: absolute;
  right: 0;
  top: 7px;
  width: 9px;
}

#load-data[hidden] {
  display: none;
}

@media (min-width: 981px) {
  .toolbar {
    align-items: center;
    grid-template-columns: minmax(180px, 0.8fr) minmax(0, auto);
    padding: 10px 12px;
  }

  .toolbar > div:first-child {
    grid-template-columns: auto 1fr;
    gap: 4px 8px;
  }

  .toolbar > div:first-child strong,
  .toolbar > div:first-child span {
    align-self: baseline;
  }

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

  .auth-actions .mode-toggle {
    min-width: 132px;
  }
}

.google-login-button,
button.google-login-button {
  background: #fff;
  border-color: #dadce0;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.12);
  color: #3c4043;
  font-weight: 700;
}

.google-login-button:hover,
.google-login-button:focus-visible {
  background: #f8fafd;
  border-color: #c8d7f0;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.22);
}

.auth-actions .button-link,
#auth-logout.button-link {
  background: #f8faf8;
  border-color: var(--line);
  color: var(--ink);
}

.auth-actions .button-link:hover,
#auth-logout.button-link:hover {
  background: #eef2f0;
  color: var(--accent);
}

@media (min-width: 981px) {
  .toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
    margin-bottom: 12px;
    min-height: 0;
    padding: 8px 10px;
  }

  .toolbar > div:first-child {
    align-items: baseline;
    display: flex;
    gap: 8px;
    min-width: 0;
  }

  .toolbar > div:first-child strong {
    flex: 0 0 auto;
  }

  .toolbar > div:first-child span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .toolbar input,
  .toolbar select,
  .toolbar button,
  .toolbar .button-link {
    min-height: 32px;
    padding-bottom: 5px;
    padding-top: 5px;
  }

  .toolbar label {
    align-items: center;
    display: flex;
    gap: 6px;
  }

  .toolbar label span {
    font-size: 11px;
  }

  .auth-actions {
    align-items: center;
    flex-wrap: nowrap;
  }

  .auth-actions .mode-toggle {
    min-width: 0;
  }
}

@media (min-width: 641px) {
  .toolbar {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 8px 10px;
  }

  .toolbar > div:first-child {
    align-items: baseline;
    display: flex;
    flex: 1 1 auto;
    gap: 8px;
    min-width: 180px;
  }

  .toolbar > div:first-child strong,
  .toolbar > div:first-child span {
    line-height: 1.2;
  }

  .toolbar > div:first-child span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .toolbar .auth-actions {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 7px;
    justify-content: flex-end;
  }

  .toolbar .mode-toggle {
    align-items: center;
    display: inline-flex;
    gap: 5px;
  }

  .toolbar .mode-toggle span {
    font-size: 10px;
    line-height: 1;
  }

  .toolbar select,
  .toolbar button,
  .toolbar .button-link {
    min-height: 30px;
    padding: 4px 8px;
  }

  .toolbar select {
    max-width: 132px;
  }

  .toolbar .google-login-button {
    padding-left: 9px;
    padding-right: 10px;
  }
}

.bundles-list {
  display: grid;
  gap: 14px;
}

.bundle-page-note {
  align-items: center;
  background: #fbfcfb;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  line-height: 1.45;
  margin-bottom: 14px;
  padding: 10px 12px;
}

.bundle-page-note .bundle-whatsapp-link {
  font-size: 13px;
  gap: 6px;
  min-height: 30px;
  padding: 4px 10px;
}

.bundle-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.bundle-card.is-linked {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.18), 0 14px 34px rgba(24, 32, 28, 0.08);
}

.bundle-card-media {
  align-items: center;
  aspect-ratio: 16 / 9;
  background: #f7f8f6;
  border: 1px dashed #cbd5cf;
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  font-weight: 800;
  justify-content: center;
  max-width: 520px;
  min-height: 0;
  overflow: hidden;
  position: relative;
  text-transform: uppercase;
  width: min(100%, 520px);
}

.bundle-card-media img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.bundle-cover-caption {
  align-items: end;
  background: linear-gradient(180deg, rgba(24, 32, 28, 0), rgba(24, 32, 28, 0.78));
  bottom: 0;
  color: #fff;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  left: 0;
  padding: 18px;
  position: absolute;
  right: 0;
  text-transform: none;
}

.bundle-cover-caption h2,
.bundle-cover-caption p {
  margin: 0;
}

.bundle-cover-caption h2 {
  color: #fff;
  font-size: 22px;
  line-height: 1.1;
}

.bundle-cover-caption p {
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
  margin-top: 4px;
}

.bundle-cover-caption .bundle-add-cart {
  background: #fff;
  border-color: #fff;
  color: var(--accent);
}

.bundle-cover-actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.bundle-cover-actions button {
  white-space: nowrap;
}

.bundle-cover-caption .bundle-share-button {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.78);
  color: #fff;
}

.bundle-cover-caption .bundle-share-button:hover {
  background: rgba(255, 255, 255, 0.24);
}

.bundle-card-body {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.bundle-card-header {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.bundle-card-header h2 {
  font-size: 24px;
  line-height: 1.15;
  margin: 0;
}

.bundle-card-header p,
.bundle-copy p {
  color: var(--muted);
  margin: 4px 0 0;
}

.bundle-add-cart,
.bundle-share-button {
  flex: 0 0 auto;
}

.bundle-copy,
.bundle-wines {
  border-top: 1px solid rgba(21, 33, 28, 0.1);
  display: grid;
  gap: 8px;
  padding-top: 10px;
}

.bundle-copy h3,
.bundle-wines h3 {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0;
  margin: 0;
  text-transform: uppercase;
}

.bundle-copy p {
  line-height: 1.45;
  white-space: pre-line;
}

.bundle-wine-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 8px;
}

.bundle-wine-line {
  grid-template-columns: 46px minmax(0, 1fr);
}

.bundle-wine-line .bottle-image-slot {
  min-height: 70px;
  width: 46px;
}

.bundle-message {
  min-height: 18px;
}

.delivery-policy {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  max-width: 780px;
  padding: 18px;
}

.delivery-policy h2,
.delivery-policy p {
  margin: 0;
}

.delivery-policy p {
  color: var(--muted);
  line-height: 1.55;
}

.delivery-policy ol {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 22px;
}

.delivery-policy ul {
  color: var(--muted);
  display: grid;
  gap: 4px;
  margin: 6px 0 0;
  padding-left: 18px;
}

html[dir="rtl"] .delivery-policy ol,
html[dir="rtl"] .delivery-policy ul {
  padding-left: 0;
  padding-right: 22px;
}

html[dir="rtl"] .bundle-wine-price {
  text-align: left;
}

.shopping-cart-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  margin-top: 18px;
  padding: 18px;
}

.cart-lines {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.cart-line {
  align-items: center;
  background: #f8faf9;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
}

.catalog-add-cart,
.house-add-cart {
  margin-top: 10px;
}


.cart-icon-button {
  align-items: center;
  display: inline-flex;
  gap: 6px;
}

#cart-count-badge {
  align-items: center;
  background: var(--badge);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 11px;
  justify-content: center;
  line-height: 1;
  min-height: 18px;
  min-width: 18px;
  padding: 2px 5px;
}

.whatsapp-icon-link {
  align-items: center;
  background: #25d366;
  border-color: #25d366;
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 18px;
  font-weight: 700;
  justify-content: center;
  min-height: 36px;
  min-width: 36px;
  padding: 0;
}

.whatsapp-icon-link::before {
  background: currentColor;
  content: "";
  display: inline-block;
  height: 18px;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.04 2C6.58 2 2.13 6.34 2.13 11.67c0 1.7.46 3.36 1.34 4.82L2 22l5.67-1.44a10.12 10.12 0 0 0 4.37.99c5.46 0 9.9-4.34 9.9-9.68C21.94 6.34 17.5 2 12.04 2Zm0 17.9c-1.42 0-2.8-.36-4.02-1.05l-.29-.16-3.33.85.86-3.16-.19-.31a8.03 8.03 0 0 1-1.26-4.4c0-4.42 3.69-8.02 8.23-8.02s8.23 3.6 8.23 8.02c0 4.62-3.69 8.23-8.23 8.23Zm4.51-6.01c-.25-.12-1.47-.71-1.7-.79-.23-.08-.4-.12-.56.12-.17.24-.65.79-.8.95-.15.16-.29.18-.54.06-.25-.12-1.05-.38-2-1.2-.74-.65-1.24-1.45-1.39-1.7-.14-.24-.02-.38.11-.5.11-.11.25-.29.37-.43.12-.14.17-.24.25-.4.08-.16.04-.3-.02-.42-.06-.12-.56-1.32-.77-1.81-.2-.47-.41-.41-.56-.42h-.48c-.17 0-.44.06-.67.3-.23.24-.88.84-.88 2.05s.9 2.38 1.02 2.54c.12.16 1.76 2.63 4.27 3.69.6.25 1.06.4 1.42.52.6.19 1.15.16 1.58.1.48-.07 1.47-.59 1.68-1.15.21-.57.21-1.05.15-1.15-.06-.1-.23-.16-.48-.28Z'/%3E%3C/svg%3E") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.04 2C6.58 2 2.13 6.34 2.13 11.67c0 1.7.46 3.36 1.34 4.82L2 22l5.67-1.44a10.12 10.12 0 0 0 4.37.99c5.46 0 9.9-4.34 9.9-9.68C21.94 6.34 17.5 2 12.04 2Zm0 17.9c-1.42 0-2.8-.36-4.02-1.05l-.29-.16-3.33.85.86-3.16-.19-.31a8.03 8.03 0 0 1-1.26-4.4c0-4.42 3.69-8.02 8.23-8.02s8.23 3.6 8.23 8.02c0 4.62-3.69 8.23-8.23 8.23Zm4.51-6.01c-.25-.12-1.47-.71-1.7-.79-.23-.08-.4-.12-.56.12-.17.24-.65.79-.8.95-.15.16-.29.18-.54.06-.25-.12-1.05-.38-2-1.2-.74-.65-1.24-1.45-1.39-1.7-.14-.24-.02-.38.11-.5.11-.11.25-.29.37-.43.12-.14.17-.24.25-.4.08-.16.04-.3-.02-.42-.06-.12-.56-1.32-.77-1.81-.2-.47-.41-.41-.56-.42h-.48c-.17 0-.44.06-.67.3-.23.24-.88.84-.88 2.05s.9 2.38 1.02 2.54c.12.16 1.76 2.63 4.27 3.69.6.25 1.06.4 1.42.52.6.19 1.15.16 1.58.1.48-.07 1.47-.59 1.68-1.15.21-.57.21-1.05.15-1.15-.06-.1-.23-.16-.48-.28Z'/%3E%3C/svg%3E") center / contain no-repeat;
  width: 18px;
}

.whatsapp-icon-link > span[aria-hidden="true"] {
  display: none;
}

.whatsapp-icon-link:hover {
  background: #1ebe5d;
  border-color: #1ebe5d;
  color: #fff;
}

.module-nav #cart-count-badge {
  margin-left: auto;
}

.cart-total-grid {
  margin: 12px 0 16px;
}

.cart-line.compact-wine-card {
  align-items: stretch;
  display: grid;
  grid-template-columns: minmax(56px, 72px) minmax(0, 1fr);
  justify-content: initial;
  gap: 12px;
}

.cart-line .compact-wine-card-body {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.cart-line-header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
}

.cart-line-house {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.cart-line .compact-meta-row {
  color: var(--muted);
  margin-top: 8px;
}

.cart-line-actions button.secondary {
  background: #f3f4f2;
  color: var(--ink);
  border-color: var(--line);
}

.cart-line-actions button.danger {
  background: var(--danger);
  color: #fff;
}

.shopping-cart-panel.is-submitting .cart-lines,
.shopping-cart-panel.is-submitting label {
  opacity: 0.72;
}

.cart-submit[disabled] {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  justify-content: center;
}

.button-spinner {
  animation: cart-spin 0.8s linear infinite;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  display: inline-block;
  height: 14px;
  width: 14px;
}

.cart-progress-message {
  min-height: 20px;
}

@keyframes cart-spin {
  to {
    transform: rotate(360deg);
  }
}

html[dir="rtl"] .app-shell,
html[dir="rtl"] .toolbar,
html[dir="rtl"] .screen,
html[dir="rtl"] .sidebar {
  direction: rtl;
}

html[dir="rtl"] .app-shell {
  grid-template-columns: minmax(0, 1fr) 248px;
}

html[dir="rtl"] .sidebar {
  grid-column: 2;
  grid-row: 1;
}

html[dir="rtl"] .main {
  grid-column: 1;
  grid-row: 1;
}

html[dir="rtl"] .auth-actions,
html[dir="rtl"] .module-nav,
html[dir="rtl"] .cart-line-actions {
  direction: rtl;
}

html[dir="rtl"] input,
html[dir="rtl"] select,
html[dir="rtl"] textarea {
  text-align: right;
}

#cart-count-badge,
.cart-line-count,
.compact-meta-row,
#cart-mobile,
input[type="tel"] {
  direction: ltr;
  unicode-bidi: isolate;
}

html[dir="rtl"] #cart-mobile,
html[dir="rtl"] input[type="tel"] {
  text-align: left;
}

.cart-line-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.cart-line-actions button {
  min-height: 32px;
  padding: 5px 10px;
}

.cart-line-count {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 800;
  min-width: 32px;
  padding: 5px 10px;
  text-align: center;
}

.cart-line .compact-wine-card-body strong,
.cart-line .compact-wine-card-body span,
.catalog-card,
.compact-wine-card {
  unicode-bidi: isolate;
}

html[dir="rtl"] .module-nav #cart-count-badge {
  margin-left: 0;
  margin-right: auto;
}

@media (max-width: 980px) {
  html[dir="rtl"] .app-shell {
    grid-template-columns: 1fr;
  }

  html[dir="rtl"] .sidebar,
  html[dir="rtl"] .main {
    grid-column: 1;
  }
}

.cart-count-badge {
  align-items: center;
  background: var(--badge);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 11px;
  justify-content: center;
  line-height: 1;
  min-height: 18px;
  min-width: 18px;
  padding: 2px 5px;
}

.toolbar-cart-button {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .app-shell {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
  }

  .main {
    display: contents;
    padding: 0;
  }

  .toolbar {
    border-radius: 0;
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    grid-row: 1;
    margin: 0;
    overflow-x: auto;
    padding: 6px 8px;
    position: sticky;
    scrollbar-width: none;
    top: 0;
    z-index: 30;
  }

  .toolbar::-webkit-scrollbar {
    display: none;
  }

  .toolbar > div:first-child {
    display: none;
  }

  .toolbar .auth-actions {
    align-items: center;
    display: flex;
    flex: 1 0 auto;
    flex-wrap: nowrap;
    gap: 6px;
    min-width: 0;
    width: 100%;
  }

  .toolbar .mode-toggle {
    flex: 0 1 auto;
    min-height: 32px;
    padding: 4px 6px;
  }

  .toolbar .mode-toggle span {
    display: none;
  }

  .toolbar select,
  .toolbar button,
  .toolbar .button-link {
    flex: 0 1 auto;
    min-height: 32px;
    padding: 4px 8px;
  }

  .language-toggle select {
    min-width: 64px;
    width: 74px;
  }

  #order-view-mode {
    min-width: 86px;
    width: 96px;
  }

  #auth-logout.button-link {
    min-width: 0;
    padding-left: 9px;
    padding-right: 9px;
  }

  #order-view-mode-wrap[hidden],
  #auth-login[hidden],
  #auth-logout[hidden],
  #toolbar-cart-toggle[hidden] {
    display: none;
  }

  .whatsapp-icon-link {
    border-radius: 999px;
    font-size: 13px;
    gap: 4px;
    min-width: 0;
    padding: 4px 8px;
  }

  .whatsapp-icon-link span[data-i18n="contact"] {
    display: none;
  }

  .sidebar {
    border-radius: 0;
    grid-row: 2;
    padding: 6px 8px;
  }

  .brand {
    display: none;
  }

  .module-nav {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .module-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    align-items: center;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 13px;
    justify-content: center;
    min-height: 34px;
    min-width: 72px;
    padding: 6px 8px;
    text-align: center;
  }

  .module-nav #cart-count-badge {
    margin-left: 4px;
  }

  .screen {
    border-left: 0;
    border-radius: 0;
    border-right: 0;
    grid-row: 3;
    margin: 0;
  }

  .bundle-card {
    border-left: 0;
    border-radius: 0;
    border-right: 0;
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
    padding-left: 10px;
    padding-right: 10px;
  }

  .bundle-card-media {
    aspect-ratio: 4 / 3;
    border-left: 0;
    border-radius: 0;
    border-right: 0;
    margin-left: -30px;
    margin-right: -30px;
    max-width: 100vw;
    min-height: 0;
    width: calc(100% + 60px);
  }

  .bundle-cover-caption {
    align-items: stretch;
    display: grid;
    padding: 12px;
  }

  .bundle-cover-caption h2 {
    font-size: 20px;
  }

  .bundle-cover-actions {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
    width: 100%;
  }

  .bundle-add-cart,
  .bundle-share-button {
    width: 100%;
  }

  .bundle-wine-list {
    grid-template-columns: 1fr;
  }

  .bundle-wine-line {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .bundle-wine-line .bottle-image-slot {
    min-height: 64px;
    width: 48px;
  }

  .delivery-policy {
    border-left: 0;
    border-radius: 0;
    border-right: 0;
    margin-left: -12px;
    margin-right: -12px;
  }

  html[dir="rtl"] .app-shell,
  html[dir="rtl"] .sidebar,
  html[dir="rtl"] .main,
  html[dir="rtl"] .toolbar,
  html[dir="rtl"] .screen {
    grid-column: 1;
  }

  html[dir="rtl"] .toolbar {
    grid-row: 1;
  }

  html[dir="rtl"] .sidebar {
    grid-row: 2;
  }

  html[dir="rtl"] .screen {
    grid-row: 3;
  }

  html[dir="rtl"] .toolbar,
  html[dir="rtl"] .sidebar,
  html[dir="rtl"] .screen {
    direction: rtl;
  }

  .houses-list-panel,
  .house-detail-panel {
    min-height: 0;
    padding: 10px;
  }

  .houses-list {
    max-height: 34vh;
  }

  .house-catalog-list {
    display: grid;
    min-width: 0;
    width: 100%;
  }

  .shopping-cart-panel {
    border-left: 0;
    border-radius: 0;
    border-right: 0;
    margin-top: 0;
    padding: 10px;
  }

  .shopping-cart-panel .detail-header {
    margin-bottom: 8px;
  }

  .shopping-cart-panel .detail-header h2 {
    font-size: 20px;
    margin: 0;
  }

  .shopping-cart-panel .detail-header p {
    font-size: 12px;
    margin-top: 2px;
  }

  .cart-total-grid.detail-grid {
    display: flex;
    gap: 5px;
    margin: 8px 0 10px;
    overflow-x: auto;
  }

  .cart-total-grid.detail-grid div {
    flex: 1 0 auto;
    min-width: 88px;
    padding: 6px 7px;
  }

  .cart-total-grid.detail-grid small {
    font-size: 10px;
  }

  .cart-total-grid.detail-grid strong {
    font-size: 14px;
  }

  .cart-lines {
    gap: 7px;
    margin: 8px 0;
  }

  .cart-line.compact-wine-card {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 7px;
    padding: 7px;
  }

  .cart-line-actions {
    gap: 5px;
  }

  .cart-line-actions button {
    min-height: 30px;
    padding: 4px 8px;
  }
}
