/* Shared root variables, reset, controls, and base components. */

:root {
  --bg: #090909;
  --app-bg-image: url("../img/sante-hero.jpg");
  --app-bg-overlay: linear-gradient(
    180deg,
    rgba(9, 9, 9, 0.88) 0%,
    rgba(9, 9, 9, 0.82) 48%,
    rgba(9, 9, 9, 0.9) 100%
  );
  --surface: #171514;
  --surface-strong: #211e1b;
  --surface-raised: #24211d;
  --control-bg: #0f0e0d;
  --control-muted-bg: #25221e;
  --control-border: #403931;
  --ink: #f8f5ee;
  --muted: #b9aea0;
  --border: #36312b;
  --accent: #18b7a6;
  --accent-dark: #12d6c2;
  --gold: #c69a4b;
  --danger: #ff6d5f;
  --pending: #d98b16;
  --accepted: #35a889;
  --card-top-border: #403931;
  --sticky-bg: #18b7a6;
  --sticky-ink: #ffffff;
  --qr-bg: #f8f8f5;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
  --card-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
  --radius: 8px;
}

:root[data-theme="light"] {
  --bg: #f4f1eb;
  --app-bg-overlay: linear-gradient(
    180deg,
    rgba(244, 241, 235, 0.88) 0%,
    rgba(255, 253, 248, 0.82) 48%,
    rgba(244, 241, 235, 0.9) 100%
  );
  --surface: #fffdf8;
  --surface-strong: #faf8f2;
  --surface-raised: #fffdf8;
  --control-bg: #ffffff;
  --control-muted-bg: #f5f7f5;
  --control-border: #ddd4c6;
  --ink: #181614;
  --muted: #746d63;
  --border: #ddd4c6;
  --accent: #0f9f92;
  --accent-dark: #08766d;
  --gold: #a36f1f;
  --danger: #b42318;
  --pending: #d98b16;
  --accepted: #1f7460;
  --card-top-border: #d8cbbc;
  --sticky-bg: #fffdf8;
  --sticky-ink: #181614;
  --qr-bg: #ffffff;
  --shadow: 0 18px 42px rgba(18, 15, 12, 0.16);
  --card-shadow: 0 10px 26px rgba(18, 15, 12, 0.1);
}

html[data-pending-i18n="1"] body {
  visibility: hidden;
}

* {
  box-sizing: border-box;
}

html,
body {
  font-size: 14px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    var(--app-bg-overlay),
    var(--app-bg-image) center / cover fixed no-repeat,
    var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
  color-scheme: dark;
}

:root[data-theme="light"] body {
  color-scheme: light;
}

a {
  color: inherit;
}

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

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 10px 16px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    background 0.15s ease,
    border 0.15s ease;
}

.button-icon,
.button .heroicon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.button.icon-only {
  width: 36px;
  min-width: 36px;
  padding-inline: 0;
}

.button.icon-only .heroicon {
  width: 17px;
  height: 17px;
}

.button:hover {
  transform: translateY(-1px);
}

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

.button.primary:hover {
  background: var(--accent-dark);
}

.button.secondary {
  background: var(--surface-raised);
  border-color: var(--border);
  color: var(--ink);
}

.button.secondary:hover {
  border-color: var(--control-border);
}

.button.accept {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-size: 1.1rem;
}

.button.danger {
  background: rgba(255, 109, 95, 0.12);
  border-color: rgba(255, 109, 95, 0.35);
  color: var(--danger);
}

.button.small {
  min-height: 36px;
  padding: 7px 12px;
  font-size: 0.9rem;
}

.button.small.icon-only {
  padding-inline: 0;
}

.button.full {
  width: 100%;
}

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

.text-button,
.text-link {
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  font-weight: 700;
  cursor: pointer;
}

.muted-label {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.brand-lockup,
.topbar-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-logo {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 50%;
  background: #050505;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.brand-logo-large {
  width: 106px;
  height: 106px;
  border-width: 3px;
}

.hero-brand {
  align-items: flex-start;
}

.preference-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

.topbar-actions .preference-controls,
.customer-tools .preference-controls {
  margin-top: 0;
}

.language-toggle,
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius);
  background: var(--surface-raised);
  color: var(--ink);
  padding: 7px 10px;
  font-weight: 800;
  position: relative;
  cursor: pointer;
}

.language-toggle span,
.theme-toggle span {
  font-size: 0.82rem;
  color: var(--muted);
}

.icon-control {
  min-width: 42px;
  justify-content: center;
}

.control-icon,
.theme-icon {
  display: inline-flex;
  color: var(--ink);
}

.control-icon svg,
.theme-icon svg,
.panel-nav-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.language-toggle-options {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 2px;
  border-radius: 6px;
  background: var(--control-bg);
}

.language-toggle-options span {
  min-width: 30px;
  padding: 3px 6px;
  border-radius: 4px;
  color: var(--muted);
  text-align: center;
}

.language-toggle[data-language="el"] [data-language-option="el"],
.language-toggle[data-language="en"] [data-language-option="en"] {
  background: var(--accent);
  color: #fff;
}

.theme-toggle {
  width: 42px;
  padding: 0;
  justify-content: center;
}

.theme-toggle input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.theme-icon-moon,
.theme-toggle input:checked ~ .theme-icon-sun {
  display: none;
}

.theme-toggle input:checked ~ .theme-icon-moon {
  display: inline-flex;
}

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

.field span {
  color: var(--muted);
  font-size: 0.86rem;
}

.field input,
.field textarea,
.field select,
.edit-row input,
.edit-row textarea,
.edit-row select {
  width: 100%;
  border: 1px solid var(--control-border);
  border-radius: var(--radius);
  background: var(--control-bg);
  color: var(--ink);
  padding: 10px 12px;
}

.field input::placeholder,
.field textarea::placeholder,
.edit-row input::placeholder,
.edit-row textarea::placeholder {
  color: #7f756a;
}

.field textarea,
.edit-row textarea {
  min-height: 82px;
  resize: vertical;
}

.field.compact input,
.field.compact textarea {
  padding: 8px 10px;
}

.check-field {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  min-height: 40px;
  border: 1px solid var(--control-border);
  border-radius: 999px;
  background: var(--control-muted-bg);
  color: var(--muted);
  padding: 6px 12px 6px 7px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

.check-field input[type="checkbox"] {
  position: relative;
  flex: 0 0 auto;
  width: 42px;
  height: 24px;
  margin: 0;
  border: 1px solid var(--control-border);
  border-radius: 999px;
  appearance: none;
  background: var(--control-bg);
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}

.check-field input[type="checkbox"]::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--muted);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  transition:
    transform 0.15s ease,
    background 0.15s ease;
}

.check-field input[type="checkbox"]:checked {
  border-color: var(--accent);
  background: var(--accent);
}

.check-field input[type="checkbox"]:checked::before {
  transform: translateX(18px);
  background: #fff;
}

.check-field:has(input[type="checkbox"]:checked) {
  border-color: var(--accent);
  background: var(--surface-raised);
  color: var(--ink);
  box-shadow: none;
}

:root[data-theme="light"] .check-field:has(input[type="checkbox"]:checked) {
  background: rgba(15, 159, 146, 0.08);
}

:root[data-theme="light"] .check-field input[type="checkbox"]:checked {
  background: var(--accent);
}

.check-field:has(input[type="checkbox"]:focus-visible) {
  outline: 2px solid color-mix(in srgb, var(--accent) 70%, #fff);
  outline-offset: 2px;
}

.form-message {
  min-height: 22px;
  margin: 0;
  color: var(--accent-dark);
  font-weight: 700;
}

.auto-save-message {
  min-height: 0;
}

.form-message.is-error,
.error-message {
  color: var(--danger);
}

.loading,
.empty-inline,
.cart-empty {
  color: var(--muted);
}

.empty-state {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(24px, 5vw, 48px);
}

.home-panel .muted-label,
.auth-card .muted-label,
.status-card .muted-label,
.topbar .muted-label,
.customer-header .muted-label {
  color: var(--gold);
}

:root[data-theme="light"] .auth-card .text-link {
  color: var(--accent-dark);
}

:root[data-theme="light"] .auth-card .field span {
  color: var(--muted);
}

.localized-en {
  display: none;
}

html[lang="en"] .localized-el {
  display: none;
}

html[lang="en"] .localized-en {
  display: inline;
}

.hero-logo-mark {
  display: grid;
  place-items: center;
  width: 148px;
  height: 148px;
  border: 3px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
  font-size: 5rem;
  font-weight: 900;
}

.section-heading {
  display: grid;
  gap: 10px;
  max-width: 680px;
  margin-bottom: 22px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.35rem);
  line-height: 1;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
}

.visit-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.visit-strip span {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  padding: 10px 14px;
  font-weight: 800;
}

.form-stack {
  display: grid;
  gap: 16px;
}

.auth-card .text-link {
  display: inline-block;
  margin-top: 16px;
  color: #f8f5ee;
}

.auth-card .field span {
  color: rgba(255, 255, 255, 0.76);
}

.table-chip,
.count-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #161616;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  padding: 7px 12px;
  font-weight: 800;
}

.accordion-indicator {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--control-border);
  border-radius: 999px;
  background: var(--control-muted-bg);
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 900;
  line-height: 1;
  transition:
    transform 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease;
}

.quantity-controls {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  width: 152px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.icon-button {
  height: 40px;
  border: 0;
  background: var(--control-muted-bg);
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 900;
  cursor: pointer;
}

.quantity-value {
  text-align: center;
  font-weight: 800;
}

.topbar-actions > .button {
  order: 1;
}

.topbar-actions > .preference-controls {
  order: 2;
  flex-wrap: nowrap;
}

.topbar .button.secondary {
  background: var(--surface-raised);
  color: var(--ink);
  border-color: var(--border);
}

.topbar-title .brand-logo {
  width: 48px;
  height: 48px;
}

.panel-sidebar-brand .muted-label {
  margin-bottom: 2px;
}

.panel-page .topbar-title .brand-logo {
  display: none;
}

.orders-grid {
  display: grid;
  gap: 14px;
}

.editor-panel {
  display: grid;
  gap: 16px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--card-shadow);
  padding: 16px;
}

#categoryList {
  gap: 8px;
}

.image-upload-control {
  position: relative;
  width: 100%;
  min-height: 36px;
  padding: 7px 8px;
  cursor: pointer;
}

.image-upload-control input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.row-actions {
  display: flex;
  gap: 6px;
  align-items: end;
}

.category-row .field,
.category-row .check-field,
.category-row .row-actions {
  grid-column: auto;
}

.category-row .field {
  gap: 4px;
  min-width: 0;
}

.category-row .field span {
  font-size: 0.78rem;
}

.category-row .field input {
  min-height: 36px;
  padding: 7px 10px;
}

.category-row .check-field {
  justify-content: center;
  min-width: 0;
  min-height: 36px;
}

.category-row .check-field,
.category-row .row-actions {
  grid-row: 2;
}

.category-row .check-field {
  grid-column: 1 / 2;
  justify-self: start;
}

.category-row .button.small {
  min-height: 36px;
  width: 100%;
  min-width: 0;
  padding: 7px 6px;
}

.admin-item-fields > .button {
  width: 100%;
}

:root[data-theme="light"] .button.secondary {
  background: var(--surface-raised);
  border-color: var(--border);
  color: var(--ink);
}

:root[data-theme="light"] .button.danger {
  background: #fff2ef;
  border-color: #f0b8af;
  color: var(--danger);
}

:root[data-theme="light"] .field input,
:root[data-theme="light"] .field textarea,
:root[data-theme="light"] .field select,
:root[data-theme="light"] .edit-row input,
:root[data-theme="light"] .edit-row textarea,
:root[data-theme="light"] .edit-row select {
  background: var(--control-bg);
  color: var(--ink);
}

:root[data-theme="light"] .language-toggle,
:root[data-theme="light"] .theme-toggle {
  background: var(--surface-raised);
  border-color: var(--border);
}

:root[data-theme="light"] .table-chip,
:root[data-theme="light"] .count-chip {
  background: #fffdf8;
  border-color: var(--border);
  color: var(--accent-dark);
}

:root[data-theme="light"] .topbar .button.secondary {
  background: var(--surface-raised);
  color: var(--ink);
}

:root[data-theme="light"] .icon-button {
  background: var(--control-muted-bg);
}

@media (min-width: 880px) and (max-width: 1279px) {
  .category-row .check-field {
    grid-column: 1 / 2;
    grid-row: 2;
    justify-self: start;
  }

  .admin-item-fields .check-field {
    justify-content: flex-start;
    width: 100%;
  }
}

@media (max-width: 879px) {
  .topbar .button,
  .language-toggle,
  .theme-toggle {
    min-height: 38px;
  }

  .topbar .button {
    padding: 8px 12px;
  }

  .topbar-actions > .preference-controls {
    min-width: 0;
  }

  .button.danger.panel-mobile-logout {
    display: inline-flex;
    align-self: center;
    margin-left: auto;
    min-height: 38px;
    border-color: var(--danger);
    background: var(--danger);
    color: #fff;
    white-space: nowrap;
  }

  .button.danger.panel-mobile-logout:hover {
    border-color: color-mix(in srgb, var(--danger) 82%, #000);
    background: color-mix(in srgb, var(--danger) 82%, #000);
  }

  :root[data-theme="light"] .button.danger.panel-mobile-logout {
    color: #fff;
  }

  .category-row .field,
  .category-row .check-field,
  .category-row .row-actions,
  .admin-item-main {
    grid-column: 1 / -1;
    grid-row: auto;
  }
}

@media (max-width: 540px) {
  .menu-item-direct .button {
    grid-column: 2;
    grid-row: 2;
    align-self: end;
    justify-self: end;
    min-width: 86px;
    min-height: 40px;
    padding-inline: 12px;
  }

  .table-chip {
    display: none;
  }

  .button.danger.panel-mobile-logout {
    width: 42px;
    padding-inline: 10px;
  }

  .topbar-actions .preference-controls {
    gap: 6px;
  }

  .admin-sound-toggle,
  .language-toggle {
    padding-inline: 8px;
  }

  .language-toggle {
    gap: 6px;
  }

  .language-toggle-options span {
    min-width: 28px;
    padding-inline: 5px;
  }
}
