:root {
  --primary: #796AEE;
  --primary-dark: #5b4bd6;
  --primary-soft: #f0efff;
  --primary-ghost: rgba(121, 106, 238, .11);

  --secondary: #6655e3;
  --secondary-dark: #4b3fc4;

  --bg: #f5f7fb;
  --bg-soft: #fbfcff;
  --panel: #ffffff;

  --text: #172033;
  --text-soft: #344054;
  --muted: #697386;
  --muted-light: #8a94a6;

  --border: #e7e9f3;
  --border-strong: #d5d9ea;

  --danger: #d93025;
  --danger-soft: #fdeeee;

  --ok: #188038;
  --ok-soft: #eaf7ee;

  --warning: #b7791f;
  --warning-soft: #fff8e6;

  --dark: #101828;

  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-sm: 0 4px 14px rgba(16, 24, 40, .06);
  --shadow-md: 0 12px 34px rgba(16, 24, 40, .08);
  --shadow-lg: 0 24px 68px rgba(16, 24, 40, .13);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 30px;

  --transition: 170ms ease;
}

/* =========================================================
   BASE
========================================================= */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background:
    radial-gradient(circle at 0 0, rgba(121, 106, 238, .14), transparent 34%),
    radial-gradient(circle at 100% 0, rgba(102, 85, 227, .10), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, var(--bg-soft) 140px, var(--bg) 520px);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  border: 0;
}

img {
  max-width: 100%;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

::selection {
  background: var(--primary);
  color: #fff;
}

/* =========================================================
   LAYOUT GENERALE
========================================================= */

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px;
}

.narrow {
  max-width: 760px;
}

.hidden {
  display: none !important;
}

.mt {
  margin-top: 14px;
}

.mb {
  margin-bottom: 14px;
}

.muted {
  color: var(--muted);
}

strong {
  font-weight: 900;
}

h1,
h2,
h3 {
  color: var(--text);
  letter-spacing: -.035em;
}

h1 {
  margin: 10px 0 8px;
}

h2 {
  margin: 0 0 14px;
  font-size: 23px;
}

h3 {
  margin: 0 0 8px;
}

p {
  margin-top: 0;
}

/* =========================================================
   TOPBAR / NAVBAR
========================================================= */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .91);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(231, 233, 243, .86);
  box-shadow: var(--shadow-xs);
}

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

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 950;
  color: var(--primary);
  font-size: 25px;
  letter-spacing: -.045em;
  white-space: nowrap;
}

.logo::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 5px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 6px 18px rgba(121, 106, 238, .35);
}

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

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

.nav .pill,
.main-nav .pill {
  font-weight: 850;
  transition:
    background var(--transition),
    color var(--transition),
    border-color var(--transition),
    transform var(--transition),
    box-shadow var(--transition);
}

.nav .pill:hover,
.main-nav .pill:hover {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: #d8dbff;
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(16, 24, 40, .06);
}

/* =========================================================
   HERO / LANDING
========================================================= */

.hero {
  padding: 58px 0 46px;
}

.hero h1 {
  max-width: 920px;
  font-size: clamp(36px, 6vw, 60px);
  line-height: 1.02;
  margin: 14px 0;
  letter-spacing: -.058em;
}

.hero p {
  font-size: 19px;
  color: var(--muted);
  max-width: 840px;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #deddfd;
  background: linear-gradient(135deg, var(--primary-soft), #fff);
  color: var(--secondary-dark);
  border-radius: 999px;
  padding: 8px 13px;
  font-weight: 900;
  font-size: 13px;
  box-shadow: var(--shadow-xs);
}

.kicker::before {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--primary);
  border-radius: 999px;
}

/* =========================================================
   CARD / GRIGLIE
========================================================= */

.card {
  background: rgba(255, 255, 255, .97);
  border: 1px solid rgba(231, 233, 243, .94);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.card-pad {
  padding: 24px;
}

.card h2,
.card h3 {
  letter-spacing: -.025em;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 24px;
  align-items: start;
}

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

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

.features {
  margin: 34px 0;
}

.feature {
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    border-color var(--transition);
}

.feature:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: #d8dcf4;
}

.feature h3 {
  margin: 0 0 8px;
}

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

/* =========================================================
   BOTTONI / PILLS
========================================================= */

.btn {
  border-radius: 13px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  padding: 12px 17px;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    background var(--transition),
    border-color var(--transition),
    opacity var(--transition);
  box-shadow: 0 10px 24px rgba(121, 106, 238, .24);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(121, 106, 238, .31);
}

.btn:active {
  transform: translateY(0);
}

.btn.secondary {
  background: var(--dark);
  box-shadow: 0 8px 20px rgba(16, 24, 40, .18);
}

.btn.ghost {
  background: #fff;
  color: var(--primary);
  border: 1px solid #d8dbeb;
  box-shadow: none;
}

.btn.ghost:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 22px rgba(16, 24, 40, .06);
}

.btn.danger {
  background: var(--danger);
  box-shadow: 0 8px 20px rgba(217, 48, 37, .18);
}

.btn.small {
  padding: 8px 12px;
  min-height: 34px;
  border-radius: 10px;
  font-size: 13px;
}

.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #e0e3ee;
  border-radius: 999px;
  padding: 7px 12px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

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

/* =========================================================
   FORM
========================================================= */

label {
  display: block;
  font-size: 13px;
  font-weight: 900;
  color: #344054;
  margin: 14px 0 6px;
}

input,
textarea,
select {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid #d9deea;
  border-radius: 13px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition:
    border-color var(--transition),
    box-shadow var(--transition),
    background var(--transition);
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(121, 106, 238, .13);
}

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

input[type="color"] {
  padding: 5px;
  height: 46px;
  cursor: pointer;
}

input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
  accent-color: var(--primary);
}

/* =========================================================
   NOTICE / MESSAGGI
========================================================= */

.notice {
  padding: 13px 15px;
  border-radius: 14px;
  background: #eef3ff;
  color: #24427b;
  border: 1px solid #dbe6ff;
  font-weight: 700;
}

.notice.ok {
  background: var(--ok-soft);
  color: #0f612b;
  border-color: #ccebd5;
}

.notice.err {
  background: var(--danger-soft);
  color: #8a1f17;
  border-color: #f6cbc8;
}

.notice.warn {
  background: var(--warning-soft);
  color: #7a4a00;
  border-color: #ffe3a3;
}

/* =========================================================
   TABELLE
========================================================= */

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
}

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

.table th,
.table td {
  padding: 14px 15px;
  border-bottom: 1px solid #edf0f7;
  text-align: left;
  vertical-align: top;
}

.table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fbfcff;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: .045em;
}

.table tr:hover td {
  background: #fbfcff;
}

.table tr:last-child td {
  border-bottom: 0;
}

/* =========================================================
   DASHBOARD / SIDEBAR
========================================================= */

.layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  min-height: calc(100vh - 76px);
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(255, 255, 255, .94)),
    var(--panel);
  border-right: 1px solid var(--border);
  padding: 24px;
  position: sticky;
  top: 76px;
  height: calc(100vh - 76px);
}

.main {
  padding: 26px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 26px;
}

.sidebar-nav a,
.sidebar-nav button {
  text-align: left;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 12px;
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
  transition:
    border-color var(--transition),
    background var(--transition),
    transform var(--transition),
    box-shadow var(--transition);
}

.sidebar-nav a:hover,
.sidebar-nav button:hover {
  border-color: #c9cdf2;
  background: #fbfcff;
  transform: translateX(2px);
  box-shadow: var(--shadow-xs);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.stat::after {
  content: "";
  position: absolute;
  right: -24px;
  bottom: -28px;
  width: 90px;
  height: 90px;
  background: rgba(121, 106, 238, .08);
  border-radius: 999px;
}

.stat strong {
  font-size: 31px;
  line-height: 1;
  letter-spacing: -.04em;
}

/* =========================================================
   PANNELLO COMMERCIALE / MERCHANT
========================================================= */

.merchant-shop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 18px 20px;
  border: 1px solid rgba(231, 233, 243, .92);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 96% 10%, rgba(121, 106, 238, .12), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, .98), rgba(250, 251, 255, .94));
  box-shadow: var(--shadow-sm);
}

.merchant-shop-title {
  min-width: 0;
}

.merchant-shop-title h1 {
  font-size: clamp(30px, 4vw, 44px);
  margin: 12px 0 4px;
}

.merchant-shop-logo-card {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 158px;
  height: 158px;
  min-width: 158px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 30px;
  box-shadow: var(--shadow-md);
}

.merchant-shop-logo {
  width: 134px;
  height: 134px;
  border: 0;
  border-radius: 24px;
  object-fit: contain;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.product-image-preview,
.image-preview,
.logo-preview {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  padding: 10px;
  box-shadow: var(--shadow-xs);
}

.product-image-preview img,
.image-preview img,
.logo-preview img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: 12px;
  background: #f2f4f8;
}

.product-thumb,
.product-thumb-img,
.table-product-image {
  width: 58px;
  height: 58px;
  min-width: 58px;
  border-radius: 13px;
  object-fit: cover;
  background: #eef0f6;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.product-thumb-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-light);
  font-size: 11px;
  font-weight: 900;
}

.product-cell,
.product-info-cell {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.product-cell > div,
.product-info-cell > div {
  min-width: 0;
}

.order-fulfillment {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 190px;
}

.order-type-badge {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 950;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
}

.order-fulfillment.delivery .order-type-badge {
  background: var(--primary-soft);
  color: var(--secondary-dark);
  border-color: #deddfd;
}

.order-fulfillment.pickup .order-type-badge {
  background: var(--ok-soft);
  color: #0f612b;
  border-color: #ccebd5;
}

.order-fulfillment.unknown .order-type-badge {
  background: var(--warning-soft);
  color: #7a4a00;
  border-color: #ffe3a3;
}

.order-address {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
  white-space: pre-wrap;
}

.order-payment-method {
  margin-top: 8px;
}

.order-payment-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.25;
}

.order-payment-badge.stripe {
  border-color: #a9dfb7;
  background: #eaf8ee;
  color: #12612b;
}

.order-payment-badge.manual {
  border-color: #d9dce5;
  background: #f5f6f9;
  color: #555c6b;
}

.order-notes,
.order-note,
.notes-cell {
  white-space: pre-wrap;
  min-width: 180px;
  max-width: 280px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.order-notes.empty,
.order-note.empty,
.notes-cell.empty {
  color: var(--muted-light);
  font-style: italic;
}

.product-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.section-heading p {
  margin-bottom: 0;
}

.category-manager-card {
  border-color: rgba(121, 106, 238, .16);
  background:
    radial-gradient(circle at 96% 0, rgba(121, 106, 238, .08), transparent 30%),
    rgba(255, 255, 255, .97);
}

.category-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
  margin-top: 12px;
}

.category-form-actions {
  padding-bottom: 0;
  align-items: flex-end;
}

.category-table {
  min-width: 620px;
}

.category-pill-active {
  background: var(--ok-soft);
  color: #0f612b;
  border-color: #ccebd5;
}

.category-pill-hidden {
  background: var(--warning-soft);
  color: #7a4a00;
  border-color: #ffe3a3;
}

.category-order-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.category-order-number {
  min-width: 38px;
  justify-content: center;
  color: var(--primary);
  border-color: #d8dbff;
  background: var(--primary-soft);
}

.category-order-actions {
  gap: 6px;
}

.category-order-actions .btn:disabled {
  opacity: .38;
}

@media (max-width: 680px) {
  .category-form {
    grid-template-columns: 1fr;
  }

  .category-form-actions .btn {
    width: 100%;
  }
}

/* =========================================================
   MIAPP v58 - Store mobile, menu attività e conferma ordine
========================================================= */

.store-menu-shortcut {
  display: none;
}

.mobile-nav-store-brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.mobile-nav-store-logo {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border));
  border-radius: 12px;
  background: #fff;
  object-fit: contain;
}

.mobile-nav-store-brand .mobile-nav-drawer-title {
  overflow: hidden;
  color: var(--primary-dark);
  text-overflow: ellipsis;
  white-space: nowrap;
}

#store-info,
#daily-offer-section,
#store-products-section,
#store-cart,
#store-map-section {
  scroll-margin-top: 92px;
}

.store-footer {
  margin-top: 30px;
  padding: 20px 12px 8px;
  border-top: 1px solid color-mix(in srgb, var(--primary) 14%, var(--border));
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.store-footer a {
  color: var(--primary);
  font-weight: 900;
}

.order-honeypot {
  position: fixed !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.mobile-cart-summary {
  display: none;
}

.order-success-card {
  margin-top: 16px;
  padding: 20px;
  border: 2px solid color-mix(in srgb, var(--ok) 46%, var(--border));
  border-radius: 18px;
  background: var(--ok-soft);
  color: var(--text);
  box-shadow: var(--shadow-md);
}

.order-success-card h3 {
  margin: 0 0 6px;
  color: var(--ok);
}

.order-success-code {
  margin: 12px 0;
  font-size: 14px;
}

.order-success-items {
  margin: 12px 0;
  padding-left: 20px;
}

.order-success-total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid color-mix(in srgb, var(--ok) 28%, var(--border));
}

.cart-total-note {
  margin: 6px 0 0;
  text-align: right;
  font-size: 12px;
}

@media (max-width: 760px) {
  .mobile-nav-links .store-menu-shortcut {
    display: flex;
  }

  body.store-page.has-mobile-cart-summary {
    padding-bottom: calc(92px + env(safe-area-inset-bottom));
  }

  .mobile-cart-summary {
    position: fixed;
    z-index: 150;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 66px;
    padding: 11px 18px;
    border: 1px solid color-mix(in srgb, var(--primary) 38%, transparent);
    border-radius: 18px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    box-shadow: 0 18px 42px rgba(16, 24, 40, .26);
    text-align: left;
    cursor: pointer;
  }

  .mobile-cart-summary > span {
    display: grid;
    gap: 1px;
  }

  .mobile-cart-summary small {
    color: rgba(255, 255, 255, .86);
  }

  .mobile-cart-summary:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
  }

  .store-footer {
    margin-top: 22px;
    padding-bottom: 2px;
  }
}


/* =========================================================
   MIAPP v29 - Mappa attività
========================================================= */

.map-manager-card,
.store-map-section {
  border-color: rgba(121, 106, 238, .16);
  background:
    radial-gradient(circle at 96% 0, rgba(121, 106, 238, .08), transparent 30%),
    rgba(255, 255, 255, .97);
}

.map-form {
  margin-top: 12px;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 10px;
  font-weight: 900;
  color: var(--text-soft);
}

.checkbox-row input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.store-map,
.merchant-map-preview iframe {
  display: block;
  width: 100%;
  min-height: 320px;
  border: 0;
  border-radius: 18px;
  background: #eef0f6;
  box-shadow: var(--shadow-sm);
}

.store-map-section {
  margin-bottom: 24px;
}

.store-map-section .store-map {
  margin-top: 14px;
}

.merchant-map-preview {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 10px;
  background: #fff;
  box-shadow: var(--shadow-xs);
}

@media (max-width: 680px) {
  .store-map,
  .merchant-map-preview iframe {
    min-height: 260px;
    border-radius: 16px;
  }
}

/* =========================================================
   STORE PUBBLICO
========================================================= */

.store-hero {
  padding: 44px 0 34px;
}

.store-hero .brand {
  align-items: center;
  gap: 28px;
}

.store-logo {
  width: 78px;
  height: 78px;
  border-radius: 20px;
  object-fit: cover;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.store-logo.store-logo-large {
  width: 150px;
  height: 150px;
  min-width: 150px;
  border-radius: 28px;
  object-fit: contain;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

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

.product {
  overflow: hidden;
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    border-color var(--transition);
}

.product:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: #d8dcf4;
}

.product img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: #eceef5;
  display: block;
}

.product h3 {
  margin: 12px 0 4px;
  font-size: 18px;
  letter-spacing: -.02em;
}

.product .desc {
  min-height: 44px;
}

.price {
  font-weight: 950;
  font-size: 19px;
  color: var(--dark);
}

/* =========================================================
   CARRELLO
========================================================= */

.cart {
  position: sticky;
  top: 96px;
  border-color: #dadff1;
}

.cart h2 {
  margin-top: 0;
}

.cart-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 1px solid #edf0f7;
  padding: 12px 0;
}

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

/* =========================================================
   QR / AUTH
========================================================= */

.qr {
  width: 180px;
  height: 180px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--border);
  padding: 8px;
  box-shadow: var(--shadow-sm);
}

.auth-box {
  max-width: 520px;
  margin: 40px auto;
}

/* =========================================================
   TEMI FUTURI PER TIPO ATTIVITÀ
========================================================= */

.theme-pizzeria {
  --primary: #e4572e;
  --secondary: #c23b22;
  --primary-soft: #fff0ea;
}

.theme-bar {
  --primary: #8b5e34;
  --secondary: #5d3a1a;
  --primary-soft: #fff4e8;
}

.theme-panificio {
  --primary: #c27a2c;
  --secondary: #8a4f16;
  --primary-soft: #fff6e8;
}

.theme-profumeria {
  --primary: #c56aa0;
  --secondary: #9b3f77;
  --primary-soft: #fff0f8;
}

.theme-farmacia {
  --primary: #178a62;
  --secondary: #0d6b4a;
  --primary-soft: #eaf8f2;
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1100px) {
  .products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .grid,
  .grid-2,
  .layout {
    grid-template-columns: 1fr;
  }

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

  .sidebar {
    position: relative;
    top: auto;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .main {
    padding: 20px;
  }

  .cart {
    position: relative;
    top: auto;
  }

  .hero {
    padding: 42px 0 30px;
  }

  .hero p {
    font-size: 17px;
  }
}

@media (max-width: 680px) {
  .wrap {
    padding: 16px;
  }

  .topbar .brand {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav,
  .main-nav {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .nav .pill,
  .main-nav .pill {
    justify-content: center;
    text-align: center;
  }

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

  .card-pad {
    padding: 18px;
  }

  .actions {
    align-items: stretch;
  }

  .actions .btn,
  .actions .pill,
  .actions a {
    justify-content: center;
  }

  .merchant-shop-header {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 18px;
  }

  .merchant-shop-logo-card {
    width: 116px;
    height: 116px;
    min-width: 116px;
    border-radius: 24px;
    padding: 10px;
  }

  .merchant-shop-logo {
    width: 96px;
    height: 96px;
    border-radius: 20px;
  }

  .order-fulfillment,
  .order-notes {
    min-width: 220px;
  }

  .store-hero .brand {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 18px;
  }

  .store-logo {
    width: 68px;
    height: 68px;
  }

  .store-logo.store-logo-large {
    width: 112px;
    height: 112px;
    min-width: 112px;
    border-radius: 24px;
    padding: 10px;
  }

  .product-cell,
  .product-info-cell {
    gap: 10px;
  }

  .product-thumb,
  .product-thumb-img,
  .table-product-image {
    width: 50px;
    height: 50px;
    min-width: 50px;
  }

  .table {
    min-width: 760px;
  }
}

@media (max-width: 420px) {
  .btn {
    width: 100%;
  }

  .hero h1 {
    font-size: 32px;
  }

  .pill {
    font-size: 12px;
  }

  .nav,
  .main-nav {
    grid-template-columns: 1fr;
  }
}


/* =========================================================
   MIAPP v29 - Posizione mappa in fondo e CTA migliorata
========================================================= */

.field-help {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.45;
}

.store-map-section-bottom {
  margin-top: 28px;
  margin-bottom: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 100% 0, rgba(121, 106, 238, .13), transparent 32%),
    linear-gradient(135deg, rgba(255, 255, 255, .99), rgba(248, 249, 255, .96));
}

.store-map-heading {
  align-items: center;
}

.store-map-heading h2 {
  margin: 12px 0 6px;
}

.map-open-btn {
  margin-left: auto;
  white-space: nowrap;
  min-width: fit-content;
  box-shadow: 0 12px 28px rgba(121, 106, 238, .25);
}

.store-map-shell {
  margin-top: 18px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.store-map-section-bottom .store-map {
  margin-top: 0;
  min-height: 360px;
  border-radius: 18px;
  box-shadow: none;
}

@media (max-width: 760px) {
  .store-map-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .map-open-btn {
    width: 100%;
    margin-left: 0;
  }

  .store-map-section-bottom .store-map {
    min-height: 280px;
  }
}

/* =========================================================
   MIAPP v32 - Identità attività e leggibilità pannello
========================================================= */

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

#merchant-message:not(:empty) {
  margin: 0 0 18px;
}

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--primary) 24%, white);
  border-radius: 999px;
  padding: 5px 10px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.identity-manager-card {
  overflow: hidden;
  border-color: color-mix(in srgb, var(--primary) 24%, var(--border));
  background:
    radial-gradient(circle at 100% 0, var(--primary-ghost), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, .99), rgba(250, 251, 255, .96));
}

.identity-heading {
  align-items: center;
}

.identity-heading h2 {
  margin: 10px 0 7px;
}

.identity-theme-preview {
  --identity-primary: var(--primary);
  --identity-secondary: var(--secondary);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 11px;
  background: rgba(255, 255, 255, .92);
  color: var(--text-soft);
  box-shadow: var(--shadow-xs);
  font-size: 12px;
  font-weight: 850;
}

.identity-theme-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(16, 24, 40, .13);
}

.identity-theme-dot-primary {
  background: var(--identity-primary);
}

.identity-theme-dot-secondary {
  background: var(--identity-secondary);
  margin-left: -11px;
}

.identity-form {
  margin-top: 18px;
}

.identity-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr);
  gap: 24px;
  align-items: start;
}

.identity-fields {
  min-width: 0;
}

.identity-color-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 8px;
}

.color-input-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
}

.color-input-row input[type="color"] {
  width: 52px;
  min-width: 52px;
  height: 46px;
  padding: 4px;
  border-radius: 12px;
  box-shadow: var(--shadow-xs);
}

.color-hex-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.identity-logo-area {
  min-width: 0;
}

.identity-logo-preview {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 174px;
  border: 1px dashed color-mix(in srgb, var(--primary) 34%, var(--border));
  border-radius: 22px;
  padding: 16px;
  background:
    linear-gradient(135deg, var(--primary-soft), rgba(255, 255, 255, .96));
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.identity-logo-preview img {
  display: block;
  width: min(170px, 100%);
  height: 138px;
  object-fit: contain;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.logo-upload-control {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 13px;
  background: #fff;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), transform var(--transition), box-shadow var(--transition);
}

.logo-upload-control:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  transform: translateY(-1px);
  box-shadow: var(--shadow-xs);
}

.logo-upload-title {
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 950;
}

.logo-upload-file-name {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-actions {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid color-mix(in srgb, var(--primary) 12%, var(--border));
}

.table td .actions {
  min-width: max-content;
}

@media (max-width: 900px) {
  .identity-main-grid {
    grid-template-columns: 1fr;
  }

  .identity-logo-area {
    max-width: 460px;
  }
}

@media (max-width: 680px) {
  .identity-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .identity-theme-preview {
    width: fit-content;
  }

  .identity-color-grid {
    grid-template-columns: 1fr;
  }

  .identity-logo-area {
    max-width: none;
  }

  .identity-actions .btn {
    width: 100%;
  }

  .section-eyebrow {
    font-size: 10px;
  }
}



/* =========================================================
   MIAPP v33 - Mobile foundation & navigation drawer
   Desktop keeps the existing horizontal navigation. On phone/tablet the
   standalone mobile-nav.js controller converts the same menu into a drawer.
========================================================= */

html {
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 62%, white);
  outline-offset: 3px;
}

.mobile-nav-toggle,
.mobile-nav-layer {
  display: none;
}

@media (max-width: 760px) {
  body.mobile-nav-open {
    overflow: hidden;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 80;
  }

  .topbar .wrap.brand {
    min-height: 64px;
    padding: 12px 16px;
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }

  .topbar .logo {
    font-size: 23px;
  }

  .topbar .logo::before {
    width: 13px;
    height: 13px;
  }

  .topbar .main-nav {
    display: none !important;
  }

  .mobile-nav-toggle {
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    margin-left: auto;
    border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border));
    border-radius: 14px;
    background: rgba(255, 255, 255, .96);
    color: var(--text);
    box-shadow: var(--shadow-xs);
    cursor: pointer;
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition), background var(--transition);
  }

  .mobile-nav-toggle:hover,
  .mobile-nav-toggle:focus-visible {
    border-color: var(--primary);
    background: var(--primary-soft);
    box-shadow: var(--shadow-sm);
  }

  .mobile-nav-toggle:active {
    transform: scale(.96);
  }

  .mobile-nav-toggle-icon,
  .mobile-nav-toggle-icon::before,
  .mobile-nav-toggle-icon::after {
    display: block;
    width: 21px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform 180ms ease, opacity 180ms ease;
  }

  .mobile-nav-toggle-icon {
    position: relative;
  }

  .mobile-nav-toggle-icon::before,
  .mobile-nav-toggle-icon::after {
    content: "";
    position: absolute;
    left: 0;
  }

  .mobile-nav-toggle-icon::before {
    top: -7px;
  }

  .mobile-nav-toggle-icon::after {
    top: 7px;
  }

  .mobile-nav-toggle[aria-expanded="true"] .mobile-nav-toggle-icon {
    background: transparent;
  }

  .mobile-nav-toggle[aria-expanded="true"] .mobile-nav-toggle-icon::before {
    transform: translateY(7px) rotate(45deg);
  }

  .mobile-nav-toggle[aria-expanded="true"] .mobile-nav-toggle-icon::after {
    transform: translateY(-7px) rotate(-45deg);
  }

  .mobile-nav-layer {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1000;
    visibility: hidden;
    pointer-events: none;
  }

  .mobile-nav-layer.is-open {
    visibility: visible;
    pointer-events: auto;
  }

  .mobile-nav-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(16, 24, 40, .52);
    opacity: 0;
    transition: opacity 220ms ease;
    cursor: pointer;
  }

  .mobile-nav-layer.is-open .mobile-nav-backdrop {
    opacity: 1;
  }

  .mobile-nav-drawer {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    width: min(86vw, 360px);
    height: 100%;
    padding: 18px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-left: 1px solid rgba(255, 255, 255, .72);
    background:
      radial-gradient(circle at 100% 0, var(--primary-ghost), transparent 34%),
      linear-gradient(160deg, #fff, #f8f9ff);
    box-shadow: -18px 0 52px rgba(16, 24, 40, .22);
    transform: translateX(105%);
    transition: transform 260ms cubic-bezier(.2, .8, .2, 1);
  }

  .mobile-nav-layer.is-open .mobile-nav-drawer {
    transform: translateX(0);
  }

  .mobile-nav-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 2px 0 18px;
    border-bottom: 1px solid var(--border);
  }

  .mobile-nav-drawer-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-size: 22px;
    font-weight: 950;
    letter-spacing: -.04em;
  }

  .mobile-nav-drawer-title::before {
    content: "";
    width: 13px;
    height: 13px;
    border-radius: 5px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 6px 16px var(--primary-ghost);
  }

  .mobile-nav-close {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: #fff;
    color: var(--text-soft);
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    transition: background var(--transition), border-color var(--transition), transform var(--transition);
  }

  .mobile-nav-close:hover,
  .mobile-nav-close:focus-visible {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary-dark);
  }

  .mobile-nav-close:active {
    transform: scale(.95);
  }

  .mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 20px 0;
  }

  .mobile-nav-links .pill {
    display: flex;
    width: 100%;
    min-height: 50px;
    justify-content: flex-start;
    padding: 13px 15px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: #fff;
    color: var(--text);
    font-size: 15px;
    font-weight: 900;
    white-space: normal;
    box-shadow: var(--shadow-xs);
  }

  .mobile-nav-links .pill:hover,
  .mobile-nav-links .pill:focus-visible {
    border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
    background: var(--primary-soft);
    color: var(--primary-dark);
    transform: none;
    box-shadow: var(--shadow-sm);
  }

  .mobile-nav-links .pill.hidden {
    display: none !important;
  }

  .mobile-nav-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
  }

  .wrap {
    padding: 16px;
  }

  main.wrap {
    padding-top: 18px;
    padding-bottom: 28px;
  }

  .hero {
    padding: 30px 0 24px;
  }

  .hero h1 {
    font-size: clamp(31px, 9vw, 43px);
    line-height: 1.05;
    letter-spacing: -.052em;
  }

  .hero p {
    font-size: 16px;
    line-height: 1.58;
  }

  h2 {
    font-size: 21px;
  }

  .grid,
  .grid-2,
  .grid-3,
  .identity-main-grid,
  .identity-color-grid {
    grid-template-columns: 1fr;
  }

  .grid {
    gap: 16px;
  }

  .grid-2,
  .grid-3 {
    gap: 14px;
  }

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

  .product .card-pad {
    padding: 14px;
  }

  .product img {
    height: 148px;
  }

  .product h3 {
    font-size: 17px;
  }

  .product .brand {
    align-items: flex-start;
    gap: 9px;
  }

  .product .brand .btn {
    min-height: 40px;
    padding: 10px 12px;
  }

  .card-pad {
    padding: 17px;
  }

  .card {
    border-radius: 18px;
  }

  label,
  .field-help {
    line-height: 1.45;
  }

  input,
  textarea,
  select {
    min-height: 46px;
    font-size: 16px;
  }

  textarea {
    min-height: 94px;
  }

  .actions {
    gap: 8px;
  }

  .actions .btn,
  .actions .pill,
  .actions a {
    min-height: 42px;
  }

  .store-hero {
    padding: 24px 0 18px;
  }

  .store-hero .brand,
  .merchant-shop-header {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 16px;
  }

  .store-logo.store-logo-large {
    width: 106px;
    height: 106px;
    min-width: 106px;
    border-radius: 22px;
  }

  .merchant-shop-header {
    padding: 16px;
  }

  .merchant-shop-logo-card {
    width: 104px;
    height: 104px;
    min-width: 104px;
    border-radius: 22px;
  }

  .merchant-shop-logo {
    width: 84px;
    height: 84px;
    border-radius: 18px;
  }

  .layout {
    display: block;
    min-height: auto;
  }

  .sidebar {
    position: static;
    display: flex;
    align-items: center;
    gap: 10px;
    height: auto;
    padding: 12px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, .92);
  }

  .sidebar .logo {
    display: none;
  }

  .sidebar .muted {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
  }

  .sidebar-nav {
    flex: 0 0 auto;
    flex-direction: row;
    gap: 7px;
    margin: 0;
  }

  .sidebar-nav a,
  .sidebar-nav button {
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 11px;
    font-size: 12px;
    white-space: nowrap;
  }

  .sidebar-nav button:hover {
    transform: none;
  }

  .main {
    padding: 16px;
  }

  .table-wrap {
    position: relative;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 15px;
  }

  .table {
    min-width: 650px;
    font-size: 13px;
  }

  .table th,
  .table td {
    padding: 11px 12px;
  }

  .table th {
    font-size: 11px;
  }

  .table td .actions {
    flex-wrap: nowrap;
  }

  .table td .btn.small {
    white-space: nowrap;
  }

  #category-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 5px;
    scroll-snap-type: x proximity;
  }

  #category-filters .btn {
    flex: 0 0 auto;
    white-space: nowrap;
    scroll-snap-align: start;
  }

  .cart {
    position: static;
  }

  .cart .brand {
    align-items: center;
  }

  .cart-row {
    gap: 10px;
  }

  .cart-row > .btn {
    flex: 0 0 auto;
  }

  .store-map-section-bottom,
  .map-manager-card,
  .identity-manager-card,
  .activity-settings-card,
  .category-manager-card {
    border-radius: 18px;
  }

  .store-map-section-bottom .store-map {
    min-height: 250px;
  }

  .merchant-map-preview iframe {
    min-height: 240px;
  }

  .identity-logo-preview {
    min-height: 145px;
  }

  .identity-actions,
  .map-form .actions,
  #product-form .actions {
    align-items: stretch;
  }

  .identity-actions .btn,
  .map-form .actions .btn,
  #product-form .actions .btn,
  .category-form-actions .btn {
    width: 100%;
  }

  .qr {
    width: min(180px, 100%);
    height: auto;
  }
}

@media (max-width: 480px) {
  .products {
    grid-template-columns: 1fr;
  }

  .product img {
    height: 190px;
  }

  .actions:not(.category-order-actions) .btn,
  .actions:not(.category-order-actions) a.btn {
    width: 100%;
  }

  .actions .pill {
    width: 100%;
    justify-content: center;
  }

  .sidebar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .sidebar .muted {
    flex-basis: 100%;
  }

  .sidebar-nav {
    width: 100%;
  }

  .sidebar-nav button,
  .sidebar-nav a {
    flex: 1 1 auto;
    text-align: center;
  }

  .table {
    min-width: 600px;
  }

  .mobile-nav-drawer {
    width: min(92vw, 360px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}


/* =========================================================
   MIAPP v34 - Pannello unico dati attività
========================================================= */
.activity-settings-card {
  overflow: hidden;
  border-color: color-mix(in srgb, var(--primary) 25%, var(--border));
  background:
    radial-gradient(circle at 100% 0, var(--primary-ghost), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, .99), rgba(250, 251, 255, .96));
}

.activity-settings-header {
  align-items: center;
  padding-bottom: 20px;
}

.activity-settings-header h2 {
  margin: 10px 0 7px;
}

.activity-settings-section {
  padding: 24px 0 0;
}

.activity-settings-section + .activity-settings-section {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid color-mix(in srgb, var(--primary) 15%, var(--border));
}

.activity-settings-section .section-heading {
  align-items: center;
}

.activity-settings-section h3 {
  margin: 10px 0 7px;
  font-size: 20px;
}

.activity-settings-section .identity-form,
.activity-settings-section .map-form {
  margin-top: 18px;
}

.activity-settings-section .identity-theme-preview {
  flex: 0 0 auto;
}

.activity-settings-section .merchant-map-preview {
  margin-bottom: 0;
}

@media (max-width: 760px) {
  .activity-settings-card {
    border-radius: 18px;
  }

  .activity-settings-header,
  .activity-settings-section .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .activity-settings-section {
    padding-top: 20px;
  }

  .activity-settings-section + .activity-settings-section {
    margin-top: 22px;
    padding-top: 22px;
  }
}


/* =========================================================
   MIAPP v35 - Dati attività affiancati su desktop
========================================================= */
.activity-settings-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 22px;
}

.activity-settings-columns .activity-settings-section {
  min-width: 0;
  margin: 0;
  padding: 20px;
  border: 1px solid color-mix(in srgb, var(--primary) 15%, var(--border));
  border-radius: 20px;
  background: rgba(255, 255, 255, .74);
}

.activity-settings-columns .activity-settings-section + .activity-settings-section {
  margin-top: 0;
  padding-top: 20px;
  border-top: 1px solid color-mix(in srgb, var(--primary) 15%, var(--border));
}

.activity-settings-columns .activity-settings-section .section-heading {
  align-items: flex-start;
}

.activity-settings-columns .identity-form,
.activity-settings-columns .map-form {
  margin-top: 16px;
}

.activity-settings-columns .merchant-map-preview {
  margin-top: 16px;
}

@media (min-width: 1080px) {
  .activity-settings-columns {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
  }

  .activity-settings-columns .activity-settings-section {
    height: 100%;
  }

  .activity-settings-columns .identity-main-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .activity-settings-columns .identity-logo-area {
    max-width: none;
  }

  .activity-settings-columns .identity-logo-preview {
    min-height: 156px;
  }

  .activity-settings-columns .grid-2 {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .activity-settings-columns .map-form .grid-2 + .grid-2 {
    margin-top: 0;
  }
}

@media (max-width: 1079px) {
  .activity-settings-columns .activity-settings-section {
    padding: 20px;
  }
}

@media (max-width: 680px) {
  .activity-settings-columns {
    gap: 16px;
    margin-top: 18px;
  }

  .activity-settings-columns .activity-settings-section {
    padding: 16px;
    border-radius: 16px;
  }
}


/* =========================================================
   MIAPP v36 - Immagini prodotto da file + correzioni mobile
========================================================= */

.product-upload-control {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  margin-top: 10px;
  border: 1px dashed color-mix(in srgb, var(--primary) 36%, var(--border));
  border-radius: 15px;
  padding: 13px 14px;
  background:
    linear-gradient(135deg, var(--primary-soft), rgba(255, 255, 255, .96));
  cursor: pointer;
  transition:
    border-color var(--transition),
    background var(--transition),
    transform var(--transition),
    box-shadow var(--transition);
}

.product-upload-control:hover,
.product-upload-control:focus-within {
  border-color: var(--primary);
  background: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-xs);
}

.product-upload-title {
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 950;
}

.product-upload-file-name {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-image-preview {
  min-height: 0;
  overflow: hidden;
  padding: 12px;
  background:
    radial-gradient(circle at 100% 0, var(--primary-ghost), transparent 42%),
    #fff;
}

.product-image-preview-label {
  margin: 0 0 10px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-image-preview img {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  border-radius: 14px;
  background: #f4f6fb;
}

#product-form .product-upload-control {
  margin-bottom: 2px;
}

@media (max-width: 760px) {
  #product-form .actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  #product-form .actions .btn {
    width: 100%;
  }

  .product-upload-control {
    min-height: 74px;
    justify-content: center;
    padding: 14px;
  }

  .product-image-preview {
    padding: 10px;
    border-radius: 15px;
  }

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

  .product-cell {
    min-width: 230px;
  }

  .product-thumb,
  .product-thumb-img,
  .table-product-image {
    width: 52px;
    height: 52px;
    min-width: 52px;
  }

  #products-table td:last-child .actions {
    display: grid;
    grid-template-columns: 1fr;
    min-width: 110px;
  }

  #products-table td:last-child .actions .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .product-upload-title {
    font-size: 14px;
  }

  .product-upload-file-name {
    white-space: normal;
    line-height: 1.35;
  }

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

  .merchant-shop-header .kicker {
    max-width: 100%;
  }

  .merchant-shop-title h1 {
    overflow-wrap: anywhere;
  }
}


/* =========================================================
   MIAPP v37 - Store pubblico: correzione layout mobile/tablet
   Regole mirate: non alterano merchant, builder o admin.
========================================================= */

.store-page,
.store-page * {
  min-width: 0;
}

.store-page .store-wrap {
  width: min(1180px, 100%);
}

.store-page .store-hero {
  padding: 26px 0 28px;
}

.store-page .store-brand-banner {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 240px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
  border-radius: 28px;
  background:
    radial-gradient(circle at 12% 20%, var(--primary-ghost), transparent 34%),
    linear-gradient(135deg, #fcfcff, var(--primary-soft));
  box-shadow: var(--shadow-md);
}

.store-page .store-logo-backdrop {
  position: absolute;
  z-index: -3;
  inset: -28px;
  display: block;
  width: calc(100% + 56px);
  height: calc(100% + 56px);
  max-width: none;
  object-fit: cover;
  opacity: .25;
  filter: blur(22px) saturate(1.2);
  transform: scale(1.12);
}

.store-page .store-brand-banner::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .70), rgba(255, 255, 255, .34)),
    linear-gradient(90deg, var(--primary-ghost), transparent 62%);
}

.store-page .store-brand-banner::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -54px;
  bottom: -76px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: var(--primary-ghost);
}

.store-page .store-logo-frame {
  display: grid;
  place-items: center;
  width: min(220px, 56vw);
  aspect-ratio: 1;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .84);
  border-radius: 30px;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 18px 42px rgba(16, 24, 40, .18);
  backdrop-filter: blur(12px);
}

.store-page .store-logo {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
  border-radius: 21px;
}

.store-page .store-hero-copy {
  max-width: 820px;
  padding: 22px 2px 0;
}

.store-page .store-hero-copy h1 {
  overflow-wrap: anywhere;
}

.store-page .store-hero-copy p {
  max-width: 760px;
  overflow-wrap: anywhere;
}

.store-page .store-order-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 390px);
  gap: 24px;
  align-items: start;
}

.store-page .store-products-column,
.store-page #products {
  min-width: 0;
}

.store-page .category-filter-scroll {
  flex-wrap: nowrap;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 2px 1px 10px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.store-page .category-filter-scroll .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.store-page .products {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.store-page .product-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.store-page .product-media {
  width: 100%;
  overflow: hidden;
  background: #edf0f8;
}

.store-page .product-card .product-media img {
  display: block;
  width: 100%;
  height: 188px;
  max-width: none;
  object-fit: cover;
  transition: transform var(--transition);
}

.store-page .product-card:hover .product-media img {
  transform: scale(1.025);
}

.store-page .product-card-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}

.store-page .product-card h3,
.store-page .product-card .desc {
  overflow-wrap: anywhere;
}

.store-page .product-card .desc {
  flex: 1 1 auto;
  min-height: 0;
}

.store-page .product-card-footer {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.store-page .product-card .price {
  display: inline-flex;
  flex: 1 0 auto;
  min-width: max-content;
  line-height: 1.08;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}

.store-page .product-add-button {
  flex: 0 0 auto;
  margin-left: auto;
  min-width: 108px;
}

.store-page .cart {
  position: sticky;
  top: 94px;
  min-width: 0;
  overflow: hidden;
}

.store-page .cart-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.store-page .cart-total-row strong:last-child {
  overflow-wrap: anywhere;
  text-align: right;
}

.store-page .cart-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.store-page .cart-row-main {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.store-page .cart-row-main strong,
.store-page .cart-row-main small {
  overflow-wrap: anywhere;
}

.store-page .cart-quantity-controls {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 4px;
}

.store-page .cart-quantity-controls .btn {
  width: 34px;
  min-width: 34px;
  padding: 7px;
}

.store-page .cart-remove-button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.store-page .order-form {
  min-width: 0;
}

.store-page .order-field {
  min-width: 0;
}

.store-page .delivery-address-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(120px, .7fr);
  gap: 10px;
}

.store-page .delivery-address-grid > div {
  min-width: 0;
}

@media (max-width: 680px) {
  .store-page .delivery-address-grid {
    grid-template-columns: 1fr;
  }
}

.store-page .address-verification-actions {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

.store-page .address-verification-actions .btn {
  width: fit-content;
}

.store-page #delivery-address-status {
  margin: 0;
  font-size: .84rem;
  line-height: 1.35;
}

.store-page #delivery-address-status[data-tone="ok"] { color: var(--ok); }
.store-page #delivery-address-status[data-tone="err"] { color: var(--danger); }
.store-page #delivery-address-status[data-tone="warn"] { color: #a15c00; }

.store-page .order-push-optin {
  display: grid;
  gap: 10px;
}

.store-page .order-push-optin .btn {
  width: 100%;
}

.store-page .order-push-optin .muted {
  margin: 0;
}

.store-page .order-actions {
  display: grid;
  grid-template-columns: 1fr;
  width: 100%;
}

.store-page .order-actions .btn {
  width: 100%;
}

.store-page .store-map-section-bottom {
  margin-top: 30px;
}

@media (max-width: 1100px) {
  .store-page .store-order-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .store-page .products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .store-page .cart {
    position: static;
  }
}

@media (max-width: 760px) {
  .store-page .store-wrap {
    padding-right: 16px;
    padding-left: 16px;
  }

  .store-page .store-hero {
    padding-top: 18px;
  }

  .store-page .store-brand-banner {
    min-height: 208px;
    border-radius: 22px;
  }

  .store-page .store-logo-frame {
    width: min(176px, 58vw);
    padding: 11px;
    border-radius: 24px;
  }

  .store-page .store-logo {
    border-radius: 16px;
  }

  .store-page .store-hero-copy {
    padding-top: 18px;
  }

  .store-page .store-hero-copy h1 {
    font-size: clamp(30px, 9vw, 42px);
    line-height: 1.04;
  }

  .store-page .store-order-layout {
    gap: 16px;
  }

  .store-page .products {
    gap: 12px;
  }

  .store-page .product-card .product-media img {
    height: 168px;
  }

  .store-page .product-card .card-pad {
    padding: 14px;
  }

  .store-page .product-card-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .store-page .product-add-button {
    width: 100%;
  }

  .store-page .cart {
    border-radius: 18px;
  }

  .store-page .cart-row {
    flex-wrap: wrap;
  }

  .store-page .cart-row-main {
    width: 100%;
  }

  .store-page .cart-remove-button {
    width: 100%;
  }

  .store-page .store-map-heading {
    gap: 14px;
  }

  .store-page .map-open-btn {
    width: 100%;
    white-space: normal;
  }
}

@media (max-width: 640px) {
  .store-page .products {
    grid-template-columns: minmax(0, 1fr);
  }

  .store-page .product-card .product-media img {
    height: min(58vw, 230px);
  }
}

@media (max-width: 420px) {
  .store-page .store-wrap {
    padding-right: 13px;
    padding-left: 13px;
  }

  .store-page .store-brand-banner {
    min-height: 184px;
    border-radius: 19px;
  }

  .store-page .store-logo-frame {
    width: min(154px, 58vw);
    border-radius: 20px;
  }

  .store-page .cart-quantity-controls {
    width: 100%;
  }

  .store-page .cart-quantity-controls .pill {
    flex: 1 1 auto;
    justify-content: center;
  }
}


/* =========================================================
   MIAPP v38 - Fascia immagine attività adattata
   L'immagine riempie l'intera fascia, senza riquadro centrale.
========================================================= */
.store-page .store-brand-banner {
  min-height: clamp(230px, 37vw, 420px);
  background: #eef0f8;
}

.store-page .store-logo-backdrop {
  display: none;
}

.store-page .store-logo-frame {
  position: absolute;
  inset: 0;
  display: block;
  width: auto;
  height: auto;
  aspect-ratio: auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: inherit;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.store-page .store-logo {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
  border-radius: inherit;
}

.store-page .store-brand-banner::before {
  z-index: 1;
  background: linear-gradient(90deg, rgba(16, 24, 40, .13), rgba(16, 24, 40, .02) 55%, rgba(16, 24, 40, .10));
  pointer-events: none;
}

.store-page .store-brand-banner::after {
  z-index: 2;
  opacity: .16;
  pointer-events: none;
}

@media (max-width: 760px) {
  .store-page .store-brand-banner {
    min-height: clamp(210px, 62vw, 330px);
    border-radius: 22px;
  }

  .store-page .store-logo-frame,
  .store-page .store-logo {
    border-radius: inherit;
  }
}

@media (max-width: 420px) {
  .store-page .store-brand-banner {
    min-height: clamp(190px, 64vw, 270px);
    border-radius: 19px;
  }
}


/* =========================================================
   MIAPP v39 - Offerta del giorno
========================================================= */
.daily-offer-manager-card {
  border-color: color-mix(in srgb, var(--primary) 28%, var(--border));
  background:
    radial-gradient(circle at 96% 0, var(--primary-ghost), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, .99), rgba(250, 251, 255, .96));
}

.daily-offer-heading {
  align-items: center;
}

.daily-offer-heading h2 {
  margin: 10px 0 7px;
}

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

.daily-offer-summary {
  margin: 0;
}

.daily-offer-limit-pill,
.cart-offer-badge,
.daily-offer-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  font-weight: 900;
}

.daily-offer-limit-pill {
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--primary) 26%, var(--border));
  padding: 7px 10px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 12px;
}

.daily-offer-form {
  margin-top: 18px;
}

.daily-offer-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.daily-offer-list-empty,
.daily-offer-list-item {
  border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border));
  border-radius: 18px;
  background: rgba(255, 255, 255, .9);
  padding: 15px 16px;
}

.daily-offer-list-item.is-selected {
  border-color: color-mix(in srgb, var(--primary) 48%, var(--border));
  box-shadow: 0 0 0 1px var(--primary-soft);
}

.daily-offer-list-head,
.daily-offer-list-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.daily-offer-list-head {
  align-items: flex-start;
}

.daily-offer-list-head p,
.daily-offer-list-meta,
.daily-offer-editor-label {
  margin: 6px 0 0;
}

.daily-offer-list-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 900;
}

.daily-offer-list-status.is-active {
  background: var(--ok-soft);
  color: #0f612b;
}

.daily-offer-list-status.is-inactive {
  background: var(--warning-soft);
  color: #7a4a00;
}

.daily-offer-list-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 12px;
}

.daily-offer-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 40px;
  margin: 0 0 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 900;
}

.daily-offer-status::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: currentColor;
}

.daily-offer-status.is-active {
  border-color: #ccebd5;
  background: var(--ok-soft);
  color: #0f612b;
}

.daily-offer-status.is-inactive {
  border-color: #ffe3a3;
  background: var(--warning-soft);
  color: #7a4a00;
}

.daily-offer-visibility-button.is-active {
  border-color: #f1c7c2;
  background: var(--danger-soft);
  color: #8a1f17;
}

.daily-offer-visibility-button.is-active:hover {
  border-color: var(--danger);
  background: #fbe2df;
}

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

.daily-offer-field-wide {
  grid-column: 1 / -1;
}

.daily-offer-items {
  display: grid;
  gap: 10px;
}

.daily-offer-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 92%, var(--primary) 8%);
}

.daily-offer-item-quantity {
  display: grid;
  gap: 6px;
}

.daily-offer-item-quantity span {
  font-size: 0.8rem;
  color: var(--muted);
}

.daily-offer-add-item {
  margin-top: 10px;
}

.cart-offer-contents {
  display: block;
  margin-top: 4px;
}

.daily-offer-product-hint {
  margin: 14px 0 0;
  border-left: 3px solid var(--primary);
  padding: 9px 0 9px 12px;
  background: linear-gradient(90deg, var(--primary-soft), transparent);
  font-size: 13px;
  line-height: 1.45;
}

.daily-offer-actions {
  padding-top: 4px;
}

.store-page .daily-offer-section {
  margin: 0 0 26px;
}

.store-page .daily-offer-grid {
  display: grid;
  gap: 16px;
}

.store-page .daily-offer-card {
  display: grid;
  grid-template-columns: minmax(220px, .78fr) minmax(0, 1.22fr);
  overflow: hidden;
  border-color: color-mix(in srgb, var(--primary) 28%, var(--border));
  background:
    radial-gradient(circle at 96% 10%, var(--primary-ghost), transparent 32%),
    linear-gradient(135deg, rgba(255, 255, 255, .99), rgba(250, 251, 255, .97));
}

.store-page .daily-offer-media {
  min-height: 238px;
  overflow: hidden;
  background: #edf0f8;
}

.store-page .daily-offer-media img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

.store-page .daily-offer-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 26px;
}

.store-page .daily-offer-badge {
  border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--border));
  padding: 6px 10px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 12px;
}

.store-page .daily-offer-card h2 {
  margin: 13px 0 7px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.store-page .daily-offer-description,
.store-page .daily-offer-product-name {
  overflow-wrap: anywhere;
}

.store-page .daily-offer-description {
  margin-bottom: 8px;
}

.store-page .daily-offer-product-name {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 850;
}

.store-page .daily-offer-price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin-top: 16px;
}

.store-page .daily-offer-price {
  color: var(--primary-dark);
  font-size: clamp(27px, 4vw, 36px);
  letter-spacing: -.04em;
}

.store-page .daily-offer-original-price {
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}

.store-page .daily-offer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: auto;
  padding-top: 20px;
}

.store-page .daily-offer-validity {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.store-page .daily-offer-add-button {
  flex: 0 0 auto;
  min-width: 168px;
}

.store-page .daily-offer-list-cards {
  display: grid;
  gap: 14px;
}

.store-page .daily-offer-list-card {
  display: grid;
  grid-template-columns: minmax(120px, .42fr) minmax(0, .58fr);
  overflow: hidden;
  border-color: color-mix(in srgb, var(--primary) 20%, var(--border));
  background: rgba(255, 255, 255, .96);
}

.store-page .daily-offer-list-card-media {
  min-height: 124px;
  background: #edf0f8;
}

.store-page .daily-offer-list-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.store-page .daily-offer-list-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px;
}

.store-page .daily-offer-list-card-body h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.store-page .daily-offer-list-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
}

.store-page .cart-offer-badge {
  margin-top: 2px;
  border: 1px solid color-mix(in srgb, var(--primary) 26%, var(--border));
  padding: 3px 7px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 10px;
  line-height: 1.25;
}

@media (max-width: 760px) {
  .daily-offer-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .daily-offer-limit-pill {
    width: fit-content;
  }

  .daily-offer-toolbar,
  .daily-offer-list-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .daily-offer-list-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .daily-offer-list-actions .btn,
  .daily-offer-toolbar .btn {
    width: 100%;
  }

  .daily-offer-form-grid {
    grid-template-columns: 1fr;
  }

  .daily-offer-field-wide {
    grid-column: auto;
  }

  .daily-offer-item-row {
    grid-template-columns: 1fr;
  }

  .daily-offer-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .daily-offer-actions .btn {
    width: 100%;
  }

  .store-page .daily-offer-section {
    margin-bottom: 18px;
  }

  .store-page .daily-offer-card {
    grid-template-columns: 1fr;
  }

  .store-page .daily-offer-list-card {
    grid-template-columns: 1fr;
  }

  .store-page .daily-offer-media {
    min-height: min(58vw, 250px);
  }

  .store-page .daily-offer-list-card-media {
    min-height: min(44vw, 170px);
  }

  .store-page .daily-offer-body {
    padding: 19px;
  }

  .store-page .daily-offer-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .store-page .daily-offer-add-button {
    width: 100%;
  }

  .store-page .daily-offer-list-card-footer {
    align-items: stretch;
    flex-direction: column;
  }
}


/* =========================================================
   MIAPP v40 - Navigazione pannello e leggibilità multi-dispositivo
   Sidebar con scorciatoie; immagini e blocchi merchant più leggibili.
========================================================= */

html {
  scroll-padding-top: 104px;
}

#merchant-orders,
#merchant-products,
#merchant-categories,
#merchant-daily-offer,
#merchant-activity-settings {
  scroll-margin-top: 104px;
}

/* ---- Sidebar desktop ---- */

.merchant-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.merchant-sidebar #merchant-email {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.45;
}

.sidebar-navigation {
  min-width: 0;
  margin-top: 4px;
}

.sidebar-navigation-label {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.sidebar-shortcuts {
  gap: 7px;
  margin-top: 0;
}

.sidebar-shortcuts a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--text-soft);
  line-height: 1.3;
}

.sidebar-shortcut-mark {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 58%, white);
  box-shadow: 0 0 0 4px var(--primary-ghost);
}

.sidebar-shortcuts a:hover,
.sidebar-shortcuts a:focus-visible {
  color: var(--primary-dark);
}

.sidebar-shortcuts a:hover .sidebar-shortcut-mark,
.sidebar-shortcuts a:focus-visible .sidebar-shortcut-mark {
  background: var(--primary);
}

.sidebar-utility {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.sidebar-logout {
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 12px;
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
  transition:
    border-color var(--transition),
    background var(--transition),
    transform var(--transition),
    box-shadow var(--transition);
}

.sidebar-logout:hover,
.sidebar-logout:focus-visible {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--border));
  background: var(--danger-soft);
  color: #8a1f17;
  transform: translateX(2px);
  box-shadow: var(--shadow-xs);
}

.sidebar-support {
  margin-bottom: 8px;
  border-color: color-mix(in srgb, var(--primary) 32%, var(--border));
  color: var(--primary-dark);
}

.sidebar-support:hover,
.sidebar-support:focus-visible {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
}

/* ---- Sezioni e immagini merchant ---- */

.merchant-orders-card,
.merchant-product-list-card,
.category-manager-card,
.daily-offer-manager-card,
.activity-settings-card {
  scroll-margin-top: 104px;
}

.merchant-orders-card,
.merchant-product-list-card,
.category-manager-card,
.daily-offer-manager-card {
  overflow: clip;
}

.merchant-orders-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.orders-realtime-status {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted, #64748b);
}

.orders-realtime-status[data-state='connected'] {
  color: #16803c;
}

.orders-realtime-status[data-state='reconnecting'],
.orders-realtime-status[data-state='offline'] {
  color: #9a6700;
}

#orders-table tr.is-realtime-new td {
  animation: merchant-order-arrival 8s ease-out both;
}

@keyframes merchant-order-arrival {
  0%, 40% { background-color: #dcfce7; }
  100% { background-color: transparent; }
}

.merchant-product-modifiers-card {
  scroll-margin-top: 104px;
}

.modifier-groups-editor,
.product-modifier-dialog-groups {
  display: grid;
  gap: 16px;
}

.modifier-group-editor,
.product-modifier-group {
  border: 1px solid var(--border, #dbe3ef);
  border-radius: 14px;
  padding: 16px;
  background: var(--surface-soft, #f8fafc);
}

.modifier-group-editor.is-inactive {
  opacity: .7;
}

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

.modifier-options-editor {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.modifier-option-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px auto;
  gap: 8px;
  align-items: center;
}

.modifier-option-editor .checkbox-label,
.modifier-group-editor .checkbox-label {
  margin: 0;
  white-space: nowrap;
}

.product-modifier-dialog {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: end center;
  padding: 16px;
}

.product-modifier-dialog.hidden {
  display: none;
}

.product-modifier-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .52);
}

.product-modifier-card {
  position: relative;
  width: min(100%, 560px);
  max-height: min(86vh, 760px);
  overflow: auto;
  border-radius: 20px;
  padding: 22px;
  background: #fff;
  box-shadow: 0 24px 64px rgba(15, 23, 42, .28);
}

.product-modifier-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: transparent;
  font-size: 1.6rem;
  cursor: pointer;
}

.product-modifier-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border, #e2e8f0);
}

.product-modifier-option label {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
}

.product-modifier-dialog-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border, #dbe3ef);
}

.cart-modifiers {
  display: grid;
  gap: 2px;
  margin-top: 4px;
}

.cart-modifier-exclusion::before {
  content: '− ';
}

.product-ingredients-summary { margin: 0 0 12px; font-size: .86rem; color: var(--muted, #657084); }
.ingredient-form { display: grid; grid-template-columns: minmax(180px, 1fr) 180px auto; gap: 12px; align-items: end; }
.ingredient-form .actions { margin: 0; }
.ingredients-list, .product-recipe-editor { display: grid; gap: 9px; }
.ingredient-row, .recipe-ingredient-row { border: 1px solid var(--border, #dbe3ef); border-radius: 12px; padding: 11px; display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.ingredient-row > div, .recipe-ingredient-name { display: grid; gap: 3px; min-width: 0; }
.ingredient-row.is-inactive, .recipe-ingredient-row.is-inactive { opacity: .62; }
.recipe-ingredient-row { display: grid; grid-template-columns: minmax(150px, 1fr) auto auto auto 130px; }
.recipe-price-label { display: grid; gap: 4px; font-size: .82rem; }
.recipe-assistant { border: 1px dashed var(--border, #dbe3ef); border-radius: 12px; padding: 12px; }
.recipe-assistant textarea { min-height: 70px; }

@media (max-width: 760px) {
  .ingredient-form, .recipe-ingredient-row { grid-template-columns: 1fr; }
  .ingredient-row { align-items: flex-start; }
}

@media (max-width: 640px) {
  .modifier-group-editor-grid,
  .modifier-option-editor {
    grid-template-columns: 1fr;
  }

  .product-modifier-dialog {
    padding: 0;
  }

  .product-modifier-card {
    width: 100%;
    max-height: 90vh;
    border-radius: 20px 20px 0 0;
  }
}

.merchant-products-grid {
  align-items: stretch;
}

.merchant-products-grid > .card {
  min-width: 0;
}

.merchant-product-form-card,
.merchant-qr-card {
  min-height: 100%;
}

.merchant-qr-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.merchant-qr-card h2,
.merchant-qr-card p {
  width: 100%;
}

.merchant-qr-card .qr {
  width: min(224px, 100%);
  height: auto;
  aspect-ratio: 1;
  margin: 4px auto 18px;
  object-fit: contain;
}

.merchant-qr-card .actions {
  justify-content: center;
  width: 100%;
  margin-top: auto;
}

.merchant-shop-header {
  overflow: hidden;
}

.merchant-shop-logo-card {
  width: 172px;
  height: 172px;
  min-width: 172px;
  padding: 14px;
  background:
    radial-gradient(circle at 30% 20%, var(--primary-soft), transparent 66%),
    #fff;
}

.merchant-shop-logo {
  width: 100%;
  height: 100%;
  border-radius: 22px;
  object-fit: contain;
}

.product-image-preview {
  display: grid;
  place-items: center;
  min-height: 212px;
}

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

.identity-logo-preview {
  min-height: 188px;
}

.identity-logo-preview img {
  width: min(210px, 100%);
  height: 152px;
}

.merchant-map-preview {
  overflow: hidden;
}

.merchant-map-preview iframe {
  width: 100%;
  min-height: 310px;
  aspect-ratio: 16 / 10;
}

.activity-settings-columns .activity-settings-section {
  box-shadow: var(--shadow-xs);
}

@media (min-width: 1080px) {
  .activity-settings-columns .activity-settings-section {
    height: auto;
  }

  .merchant-product-form-card,
  .merchant-qr-card {
    min-height: 100%;
  }
}

/* ---- Tablet: shortcut bar compatta, contenuto a larghezza piena ---- */

@media (min-width: 761px) and (max-width: 1079px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .merchant-sidebar {
    position: sticky;
    top: 76px;
    z-index: 35;
    display: grid;
    grid-template-columns: auto minmax(150px, .62fr) minmax(0, 1.8fr) auto;
    align-items: center;
    gap: 14px;
    height: auto;
    min-height: 70px;
    max-height: none;
    overflow: visible;
    padding: 12px 22px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, .96);
    box-shadow: var(--shadow-xs);
  }

  .merchant-sidebar .logo {
    font-size: 23px;
  }

  .merchant-sidebar #merchant-email {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar-navigation {
    margin: 0;
    min-width: 0;
  }

  .sidebar-navigation-label {
    display: none;
  }

  .sidebar-shortcuts {
    flex-direction: row;
    flex-wrap: nowrap;
    width: 100%;
    margin: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: 2px 1px 4px;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar-shortcuts a {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 9px 11px;
    white-space: nowrap;
  }

  .sidebar-utility {
    margin: 0;
    padding: 0;
    border: 0;
  }

  .sidebar-logout {
    width: auto;
    min-height: 40px;
    padding: 9px 12px;
    white-space: nowrap;
  }

  .main {
    padding: 22px;
  }

  .merchant-shop-logo-card {
    width: 150px;
    height: 150px;
    min-width: 150px;
  }

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

/* ---- Telefono: scorciatoie sempre accessibili senza creare colonne strette ---- */

@media (max-width: 760px) {
  .merchant-sidebar {
    display: block;
    height: auto;
    max-height: none;
    overflow: visible;
    padding: 12px 16px 14px;
  }

  .merchant-sidebar #merchant-email {
    display: block;
    width: 100%;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
  }

  .sidebar-navigation {
    margin-top: 10px;
  }

  .sidebar-navigation-label {
    display: none;
  }

  .sidebar-shortcuts {
    flex-direction: row;
    flex-wrap: nowrap;
    width: 100%;
    margin: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: 2px 1px 7px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .sidebar-shortcuts a {
    flex: 0 0 auto;
    min-height: 39px;
    padding: 8px 11px;
    font-size: 12px;
    white-space: nowrap;
  }

  .sidebar-shortcut-mark {
    width: 7px;
    height: 7px;
  }

  .sidebar-utility {
    margin-top: 4px;
    padding-top: 0;
    border-top: 0;
  }

  .sidebar-logout {
    width: 100%;
    min-height: 42px;
    text-align: center;
  }

  .sidebar-logout:hover {
    transform: none;
  }

  .merchant-shop-logo-card {
    width: 138px;
    height: 138px;
    min-width: 138px;
    padding: 12px;
  }

  .merchant-shop-logo {
    border-radius: 18px;
  }

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

  .merchant-qr-card {
    align-items: stretch;
    text-align: left;
  }

  .merchant-qr-card .qr {
    align-self: center;
    width: min(212px, 100%);
  }

  .merchant-qr-card .actions {
    align-items: stretch;
  }

  .merchant-qr-card .actions .btn {
    width: 100%;
  }

  .product-image-preview {
    min-height: 172px;
  }

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

  .identity-logo-preview {
    min-height: 154px;
  }

  .identity-logo-preview img {
    width: min(180px, 100%);
    height: 132px;
  }

  .merchant-map-preview iframe {
    min-height: 244px;
  }
}

@media (max-width: 480px) {
  .merchant-shop-logo-card {
    width: 122px;
    height: 122px;
    min-width: 122px;
  }

  .merchant-qr-card .qr {
    width: min(196px, 100%);
  }

  .sidebar-shortcuts a {
    min-height: 38px;
    padding: 8px 10px;
    font-size: 11px;
  }

  .product-image-preview {
    min-height: 146px;
    padding: 10px;
  }

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

  .merchant-map-preview iframe {
    min-height: 220px;
  }
}


/* =========================================================
   MIAPP v41 - Stato offerta con un solo pulsante
========================================================= */
.daily-offer-visibility-button {
  min-width: 182px;
}

@media (max-width: 760px) {
  .daily-offer-status {
    width: 100%;
    justify-content: center;
  }

  .daily-offer-visibility-button {
    min-width: 0;
  }
}


/* =========================================================
   MIAPP v42 - Correzione modifica e attivazione offerta
========================================================= */
.daily-offer-actions {
  align-items: center;
}

.daily-offer-action-help {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 760px) {
  .daily-offer-action-help {
    text-align: center;
  }
}


/* =========================================================
   MIAPP v45 - Sistema template selezionabile
   Tre template iniziali: classico, moderno, elegante dark.
   Le anteprime sono CSS: leggere, accessibili e responsive.
========================================================= */

.template-picker,
.activity-template-section {
  min-width: 0;
}

.template-picker-heading,
.template-settings-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.template-picker-heading h2,
.template-settings-heading h3 {
  margin: 10px 0 7px;
}

.template-picker-heading p,
.template-settings-heading p {
  margin-bottom: 0;
}

.template-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.template-choice-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 100%;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, .92);
  color: var(--text);
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.template-choice-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--primary) 42%, var(--border));
  box-shadow: var(--shadow-sm);
}

.template-choice-card.is-selected {
  border-color: var(--primary);
  background: linear-gradient(145deg, var(--primary-soft), rgba(255, 255, 255, .96));
  box-shadow: 0 0 0 3px var(--primary-ghost), var(--shadow-sm);
}

.template-choice-card:has(.template-choice-input:focus-visible) {
  outline: 3px solid color-mix(in srgb, var(--primary) 56%, white);
  outline-offset: 3px;
}

.template-choice-input {
  position: absolute !important;
  width: 1px !important;
  min-width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
}

.template-choice-preview {
  display: grid;
  grid-template-rows: 15px 1fr 28px;
  gap: 8px;
  width: 100%;
  min-height: 118px;
  padding: 10px;
  overflow: hidden;
  border: 1px solid rgba(16, 24, 40, .10);
  border-radius: 13px;
}

.template-preview-bar,
.template-preview-hero,
.template-preview-cards,
.template-preview-cards i {
  display: block;
}

.template-preview-bar {
  width: 43%;
  border-radius: 999px;
}

.template-preview-hero {
  border-radius: 10px;
}

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

.template-preview-cards i {
  min-width: 0;
  border-radius: 7px;
}

.template-preview-classic {
  background: linear-gradient(140deg, #ffffff, #f0efff);
}

.template-preview-classic .template-preview-bar {
  background: #796aee;
}

.template-preview-classic .template-preview-hero {
  background: linear-gradient(135deg, #e9e6ff, #ffffff);
}

.template-preview-classic .template-preview-cards i {
  background: #ffffff;
  border: 1px solid #e7e9f3;
}

.template-preview-modern {
  background:
    radial-gradient(circle at 80% 22%, rgba(38, 196, 184, .45), transparent 30%),
    linear-gradient(140deg, #684ce8, #3a8dff 65%, #52d8c9);
}

.template-preview-modern .template-preview-bar {
  background: rgba(255, 255, 255, .92);
}

.template-preview-modern .template-preview-hero {
  background: linear-gradient(135deg, rgba(255,255,255,.65), rgba(255,255,255,.14));
  border: 1px solid rgba(255,255,255,.34);
}

.template-preview-modern .template-preview-cards i {
  background: rgba(255, 255, 255, .9);
}

.template-preview-dark {
  background: linear-gradient(145deg, #0d0e12, #23252e);
  border-color: #644c26;
}

.template-preview-dark .template-preview-bar {
  background: #d5ae6d;
}

.template-preview-dark .template-preview-hero {
  background: linear-gradient(135deg, #3a3023, #1b1c21);
  border: 1px solid rgba(213, 174, 109, .48);
}

.template-preview-dark .template-preview-cards i {
  background: #22242c;
  border: 1px solid rgba(213, 174, 109, .24);
}

.template-choice-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.template-choice-copy strong {
  color: inherit;
  font-size: 14px;
  line-height: 1.25;
}

.template-choice-copy small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.template-current-label {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
  border-radius: 999px;
  padding: 7px 10px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
  text-align: center;
}

.template-form {
  margin-top: 16px;
}

.template-form .template-choice-grid {
  margin-top: 0;
}

.template-form-help {
  margin: 11px 0 0;
  font-size: 12px;
  line-height: 1.45;
}

.template-actions {
  margin-top: 16px;
}

/* ---- Moderno colorato: rilievi più morbidi e vivaci ---- */
body.template-modern-color {
  background:
    radial-gradient(circle at 0 0, rgba(92, 77, 235, .22), transparent 28%),
    radial-gradient(circle at 100% 12%, rgba(48, 201, 183, .17), transparent 24%),
    linear-gradient(180deg, #fbfbff, #f1f5ff 58%, #f8fbff);
}

body.template-modern-color .topbar {
  border-bottom-color: color-mix(in srgb, var(--primary) 18%, var(--border));
  background: rgba(255, 255, 255, .88);
}

body.template-modern-color .card,
body.template-modern-color .store-brand-banner,
body.template-modern-color .activity-settings-columns .activity-settings-section {
  border-radius: 24px;
}

body.template-modern-color .card {
  border-color: color-mix(in srgb, var(--primary) 19%, var(--border));
  box-shadow: 0 14px 36px rgba(61, 71, 147, .10);
}

body.template-modern-color .store-brand-banner {
  background:
    radial-gradient(circle at 86% 20%, color-mix(in srgb, var(--secondary) 26%, transparent), transparent 28%),
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 10%, #fff), #fff 62%);
}

body.template-modern-color .product-card,
body.template-modern-color .daily-offer-card {
  border-color: color-mix(in srgb, var(--primary) 24%, var(--border));
}

body.template-modern-color .btn {
  border-radius: 15px;
}

/* ---- Elegante dark: contrasto alto per store, merchant e stampa QR ---- */
body.template-elegant-dark {
  background:
    radial-gradient(circle at 0 0, rgba(201, 162, 91, .11), transparent 28%),
    radial-gradient(circle at 100% 12%, rgba(132, 91, 45, .13), transparent 24%),
    linear-gradient(180deg, #101116, #15161b 58%, #101116);
  color: #f7f0e6;
}

body.template-elegant-dark .topbar,
body.template-elegant-dark .sidebar {
  background: rgba(17, 18, 23, .95);
  border-color: rgba(213, 174, 109, .24);
}

body.template-elegant-dark .topbar {
  box-shadow: 0 1px 0 rgba(213, 174, 109, .12);
}

body.template-elegant-dark .logo,
body.template-elegant-dark .section-eyebrow,
body.template-elegant-dark .kicker,
body.template-elegant-dark .price,
body.template-elegant-dark .daily-offer-price,
body.template-elegant-dark .cart-total-row strong:last-child {
  color: #e3c181;
}

body.template-elegant-dark .logo::before {
  background: linear-gradient(135deg, #e3c181, #8e6938);
  box-shadow: 0 6px 18px rgba(213, 174, 109, .28);
}

body.template-elegant-dark h1,
body.template-elegant-dark h2,
body.template-elegant-dark h3,
body.template-elegant-dark strong,
body.template-elegant-dark label,
body.template-elegant-dark .sidebar-shortcuts a,
body.template-elegant-dark .sidebar-logout,
body.template-elegant-dark .store-type {
  color: #fff8eb;
}

body.template-elegant-dark h1,
body.template-elegant-dark h2,
body.template-elegant-dark h3,
body.template-elegant-dark .store-hero-copy h1 {
  font-family: Georgia, 'Times New Roman', serif;
  letter-spacing: -.026em;
}

body.template-elegant-dark .muted,
body.template-elegant-dark .field-help,
body.template-elegant-dark .template-choice-copy small,
body.template-elegant-dark .daily-offer-action-help,
body.template-elegant-dark .sidebar-navigation-label {
  color: #cbbfb0;
}

body.template-elegant-dark .nav .pill,
body.template-elegant-dark .main-nav .pill,
body.template-elegant-dark .pill,
body.template-elegant-dark .identity-theme-preview,
body.template-elegant-dark .template-current-label {
  border-color: rgba(213, 174, 109, .28);
  background: #1d1e25;
  color: #ead0a0;
}

body.template-elegant-dark .nav .pill:hover,
body.template-elegant-dark .main-nav .pill:hover,
body.template-elegant-dark .pill:hover {
  border-color: #d5ae6d;
  background: #26262e;
  color: #fff3d6;
}

body.template-elegant-dark .card,
body.template-elegant-dark .activity-settings-card,
body.template-elegant-dark .activity-settings-columns .activity-settings-section,
body.template-elegant-dark .table-wrap,
body.template-elegant-dark .merchant-map-preview,
body.template-elegant-dark .store-map-shell,
body.template-elegant-dark .store-brand-banner,
body.template-elegant-dark .template-choice-card {
  border-color: rgba(213, 174, 109, .24);
  background: linear-gradient(145deg, rgba(30, 31, 38, .98), rgba(20, 21, 27, .98));
  box-shadow: 0 14px 38px rgba(0, 0, 0, .22);
}

body.template-elegant-dark .merchant-shop-header {
  border-color: rgba(213, 174, 109, .26);
  background:
    radial-gradient(circle at 95% 8%, rgba(213, 174, 109, .13), transparent 32%),
    linear-gradient(135deg, #1b1c22, #131419);
}

body.template-elegant-dark .merchant-shop-logo-card,
body.template-elegant-dark .store-logo-frame,
body.template-elegant-dark .identity-logo-preview,
body.template-elegant-dark .product-image-preview,
body.template-elegant-dark .qr-wrap {
  border-color: rgba(213, 174, 109, .28);
  background: #202128;
}

body.template-elegant-dark input,
body.template-elegant-dark textarea,
body.template-elegant-dark select {
  border-color: rgba(213, 174, 109, .30);
  background: #111217;
  color: #fff8eb;
}

body.template-elegant-dark input::placeholder,
body.template-elegant-dark textarea::placeholder {
  color: #988f83;
}

body.template-elegant-dark input:focus,
body.template-elegant-dark textarea:focus,
body.template-elegant-dark select:focus {
  border-color: #d5ae6d;
  box-shadow: 0 0 0 4px rgba(213, 174, 109, .16);
}

body.template-elegant-dark .btn {
  background: linear-gradient(135deg, #e3c181, #a77b3c);
  color: #1a1309;
  box-shadow: 0 10px 24px rgba(168, 122, 56, .20);
}

body.template-elegant-dark .btn.ghost,
body.template-elegant-dark .sidebar-logout,
body.template-elegant-dark .sidebar-nav a {
  border-color: rgba(213, 174, 109, .28);
  background: #1b1c22;
  color: #f1d7a8;
}

body.template-elegant-dark .btn.ghost:hover,
body.template-elegant-dark .sidebar-logout:hover,
body.template-elegant-dark .sidebar-nav a:hover {
  border-color: #d5ae6d;
  background: #27272f;
  color: #fff3d6;
}

body.template-elegant-dark .table,
body.template-elegant-dark .table th,
body.template-elegant-dark .table td,
body.template-elegant-dark .table-wrap {
  color: #f7f0e6;
}

body.template-elegant-dark .table th,
body.template-elegant-dark .table tr:hover td {
  background: #202128;
}

body.template-elegant-dark .table td,
body.template-elegant-dark .table th,
body.template-elegant-dark hr,
body.template-elegant-dark .cart-row {
  border-color: rgba(213, 174, 109, .15);
}

body.template-elegant-dark .store-brand-banner::before {
  background:
    linear-gradient(135deg, rgba(16, 17, 22, .82), rgba(16, 17, 22, .38)),
    linear-gradient(90deg, rgba(213, 174, 109, .16), transparent 64%);
}

body.template-elegant-dark .store-brand-banner::after {
  background: rgba(213, 174, 109, .14);
}

body.template-elegant-dark .store-logo-frame {
  background: rgba(20, 21, 27, .84);
  border-color: rgba(213, 174, 109, .36);
}

body.template-elegant-dark .product-media {
  background: #23242b;
}

body.template-elegant-dark .daily-offer-card {
  border-color: rgba(213, 174, 109, .34);
}

body.template-elegant-dark .daily-offer-badge,
body.template-elegant-dark .cart-offer-badge,
body.template-elegant-dark .order-type-badge {
  border-color: rgba(213, 174, 109, .34);
  background: rgba(213, 174, 109, .13);
  color: #f0d39f;
}

body.template-elegant-dark .notice {
  border-color: rgba(213, 174, 109, .24);
  background: #1d2027;
  color: #e7d6bb;
}

body.template-elegant-dark .notice.ok {
  border-color: rgba(94, 190, 123, .38);
  background: #14251a;
  color: #c7ebce;
}

body.template-elegant-dark .notice.err {
  border-color: rgba(220, 99, 90, .44);
  background: #2b1718;
  color: #ffc8c3;
}

body.template-elegant-dark .notice.warn {
  border-color: rgba(213, 174, 109, .38);
  background: #2c2518;
  color: #ffe1a9;
}

body.template-elegant-dark .template-choice-card.is-selected {
  border-color: #d5ae6d;
  background: linear-gradient(145deg, #29241d, #1d1e24);
  box-shadow: 0 0 0 3px rgba(213, 174, 109, .13), var(--shadow-sm);
}

body.template-elegant-dark .sidebar-shortcut-mark {
  background: #d5ae6d;
  box-shadow: 0 0 0 4px rgba(213, 174, 109, .12);
}

@media (max-width: 760px) {
  .template-picker-heading,
  .template-settings-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .template-choice-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .template-choice-card {
    display: grid;
    grid-template-columns: minmax(120px, .72fr) minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-height: 0;
  }

  .template-choice-preview {
    min-height: 92px;
  }

  .template-current-label {
    width: 100%;
    justify-content: center;
  }

  .template-actions .btn {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .template-choice-card {
    grid-template-columns: 1fr;
  }

  .template-choice-preview {
    min-height: 105px;
  }
}


/* =========================================================
   MIAPP v46 - Cambio template su comando dedicato
   Il Builder resta il punto di scelta iniziale. Nel pannello la scelta
   viene aperta soltanto tramite una finestra separata e leggibile.
========================================================= */

.activity-template-summary {
  margin-bottom: 22px;
  border-color: color-mix(in srgb, var(--primary) 18%, var(--border));
  background:
    radial-gradient(circle at 100% 0, var(--primary-ghost), transparent 42%),
    linear-gradient(135deg, rgba(255, 255, 255, .99), rgba(250, 251, 255, .96));
}

.template-summary-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.template-summary-content h3 {
  margin: 10px 0 7px;
}

.template-summary-content p {
  margin-bottom: 0;
}

.template-summary-actions {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.template-dialog-open {
  overflow: hidden;
}

.template-dialog {
  position: fixed;
  z-index: 1200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
}

.template-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 24, 40, .60);
  backdrop-filter: blur(5px);
}

.template-dialog-card {
  position: relative;
  z-index: 1;
  width: min(980px, 100%);
  max-height: min(860px, calc(100vh - 44px));
  overflow: auto;
  border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border));
  border-radius: 24px;
  padding: 24px;
  background: linear-gradient(145deg, #ffffff, #f9faff);
  color: var(--text);
  box-shadow: 0 28px 84px rgba(16, 24, 40, .32);
}

.template-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.template-dialog-header h2 {
  margin: 10px 0 7px;
}

.template-dialog-header p {
  max-width: 690px;
  margin-bottom: 0;
}

.template-dialog-close {
  display: inline-grid;
  width: 42px;
  height: 42px;
  min-width: 42px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: #fff;
  color: var(--text-soft);
  cursor: pointer;
  font-size: 27px;
  line-height: 1;
  transition: border-color var(--transition), background var(--transition), color var(--transition), transform var(--transition);
}

.template-dialog-close:hover,
.template-dialog-close:focus-visible {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.template-dialog-close:active {
  transform: scale(.96);
}

.template-dialog .template-form {
  margin-top: 18px;
}

.cross-sell-form { margin-top: 18px; }
.cross-sell-source { margin: 0 0 14px; font-weight: 800; color: var(--text); }
.cross-sell-options { display: grid; gap: 9px; max-height: min(48vh, 420px); overflow: auto; padding-right: 4px; }
.cross-sell-option { display: flex; align-items: center; gap: 11px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; }
.cross-sell-option:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.cross-sell-option input { width: 18px; height: 18px; flex: 0 0 auto; }
.cross-sell-option-copy { display: grid; gap: 2px; }
.cross-sell-option-copy small { color: var(--muted); }

body.template-elegant-dark .activity-template-summary,
body.template-elegant-dark .template-dialog-card {
  border-color: rgba(213, 174, 109, .30);
  background:
    radial-gradient(circle at 94% 3%, rgba(213, 174, 109, .12), transparent 34%),
    linear-gradient(145deg, #202128, #121318);
  color: #f7f0e6;
}

body.template-elegant-dark .template-dialog-header {
  border-color: rgba(213, 174, 109, .18);
}

body.template-elegant-dark .template-dialog-close {
  border-color: rgba(213, 174, 109, .28);
  background: #1a1b21;
  color: #f1d7a8;
}

body.template-elegant-dark .template-dialog-close:hover,
body.template-elegant-dark .template-dialog-close:focus-visible {
  border-color: #d5ae6d;
  background: #292a32;
  color: #fff3d6;
}

@media (max-width: 760px) {
  .activity-template-summary {
    margin-bottom: 18px;
  }

  .template-summary-content,
  .template-summary-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .template-summary-actions {
    width: 100%;
  }

  .template-summary-actions .btn {
    width: 100%;
  }

  .template-dialog {
    align-items: end;
    padding: 0;
  }

  .template-dialog-card {
    width: 100%;
    max-height: min(88vh, 760px);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 24px 24px 0 0;
    padding: 18px 16px 22px;
  }

  .template-dialog-header {
    gap: 12px;
    padding-bottom: 15px;
  }

  .template-dialog-header h2 {
    font-size: 23px;
  }

  .template-dialog .template-choice-grid {
    grid-template-columns: 1fr;
  }

  .template-dialog .template-choice-card {
    grid-template-columns: minmax(116px, .72fr) minmax(0, 1fr);
  }

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

  .template-dialog .template-actions .btn {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .template-dialog .template-choice-card {
    grid-template-columns: 1fr;
  }
}


/* =========================================================
   MIAPP v48 - Template raffinati e pannello compatto
   Correzione v47: nessun layout a card per ordini/prodotti/categorie.
   Le tabelle restano il riferimento operativo; il template cambia solo
   colori, bordi, spaziature e accenti.
========================================================= */

/* Pannello commerciante: più denso, ma mai compresso o difficile da leggere. */
#merchant-app .main {
  padding: 20px;
}

#merchant-app .merchant-shop-header {
  gap: 18px;
  padding: 15px 18px;
  border-radius: 20px;
}

#merchant-app .merchant-shop-title h1 {
  margin: 9px 0 3px;
  font-size: clamp(27px, 3.4vw, 38px);
}

#merchant-app .merchant-shop-logo-card {
  width: 118px;
  height: 118px;
  min-width: 118px;
  padding: 9px;
  border-radius: 20px;
}

#merchant-app .merchant-shop-logo {
  width: 98px;
  height: 98px;
  border-radius: 15px;
}

#merchant-app .card-pad {
  padding: 18px;
}

#merchant-app .card {
  border-radius: 16px;
}

#merchant-app .grid-2 {
  gap: 14px;
}

#merchant-app h2 {
  margin-bottom: 10px;
  font-size: 20px;
}

#merchant-app h3 {
  margin-bottom: 6px;
}

#merchant-app .table th,
#merchant-app .table td {
  padding: 11px 12px;
}

#merchant-app .table th {
  font-size: 11px;
}

#merchant-app .table-wrap {
  border-radius: 12px;
}

#merchant-app .product-thumb,
#merchant-app .product-thumb-img,
#merchant-app .table-product-image {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 10px;
}

#merchant-app .product-cell,
#merchant-app .product-info-cell {
  gap: 10px;
}

#merchant-app .qr {
  width: 150px;
  height: 150px;
  border-radius: 12px;
}

#merchant-app .sidebar {
  padding: 18px;
}

#merchant-app .sidebar-nav a,
#merchant-app .sidebar-logout {
  border-radius: 11px;
  padding: 10px 11px;
}

#merchant-app .sidebar-navigation-label {
  margin-bottom: 7px;
}

#merchant-app .activity-template-summary {
  margin-bottom: 16px;
}

#merchant-app .daily-offer-manager-card,
#merchant-app .category-manager-card,
#merchant-app .activity-settings-card {
  border-radius: 16px;
}

/* Le card nella scelta del template restano piccole: sono un selettore, non una dashboard. */
.template-choice-grid {
  gap: 10px;
  margin-top: 14px;
}

.template-choice-card {
  gap: 9px;
  padding: 10px;
  border-radius: 14px;
}

.template-choice-preview {
  grid-template-rows: 12px 1fr 22px;
  gap: 6px;
  min-height: 86px;
  padding: 8px;
  border-radius: 10px;
}

.template-choice-copy strong {
  font-size: 13px;
}

.template-choice-copy small {
  font-size: 11px;
  line-height: 1.35;
}

/* Moderno soft: stessa struttura, solo accenti più freschi e bordi appena colorati. */
body.template-modern-color {
  background:
    radial-gradient(circle at 0 0, rgba(90, 122, 238, .12), transparent 30%),
    radial-gradient(circle at 100% 10%, rgba(70, 194, 180, .10), transparent 26%),
    linear-gradient(180deg, #ffffff, #f6f9ff 60%, #f7f9fd);
}

body.template-modern-color .card,
body.template-modern-color .activity-settings-columns .activity-settings-section,
body.template-modern-color .store-brand-banner {
  border-color: color-mix(in srgb, var(--primary) 16%, var(--border));
  box-shadow: 0 9px 24px rgba(61, 71, 147, .07);
}

body.template-modern-color .card,
body.template-modern-color .store-brand-banner {
  border-radius: 18px;
}

body.template-modern-color .btn {
  border-radius: 11px;
}

body.template-modern-color .sidebar-shortcut-mark {
  box-shadow: 0 0 0 3px var(--primary-ghost);
}

/* Elegante caldo: variante luminosa e sobria. L'ID resta "elegant-dark" per compatibilità dei dati già salvati. */
body.template-elegant-dark {
  background:
    radial-gradient(circle at 0 0, rgba(184, 137, 74, .10), transparent 30%),
    linear-gradient(180deg, #fffdf9 0%, #faf7f1 56%, #f7f3ec 100%);
  color: #352f27;
}

body.template-elegant-dark .topbar,
body.template-elegant-dark .sidebar {
  background: rgba(255, 253, 249, .94);
  border-color: #eadfce;
  box-shadow: 0 1px 0 rgba(119, 84, 39, .06);
}

body.template-elegant-dark .logo,
body.template-elegant-dark .section-eyebrow,
body.template-elegant-dark .kicker,
body.template-elegant-dark .price,
body.template-elegant-dark .daily-offer-price,
body.template-elegant-dark .cart-total-row strong:last-child {
  color: #8b5d24;
}

body.template-elegant-dark .logo::before {
  background: linear-gradient(135deg, #b17b3e, #715024);
  box-shadow: 0 5px 14px rgba(135, 92, 38, .20);
}

body.template-elegant-dark h1,
body.template-elegant-dark h2,
body.template-elegant-dark h3,
body.template-elegant-dark strong,
body.template-elegant-dark label,
body.template-elegant-dark .sidebar-shortcuts a,
body.template-elegant-dark .sidebar-logout,
body.template-elegant-dark .store-type {
  color: #352f27;
}

body.template-elegant-dark h1,
body.template-elegant-dark h2,
body.template-elegant-dark h3,
body.template-elegant-dark .store-hero-copy h1 {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  letter-spacing: -.032em;
}

body.template-elegant-dark .muted,
body.template-elegant-dark .field-help,
body.template-elegant-dark .template-choice-copy small,
body.template-elegant-dark .daily-offer-action-help,
body.template-elegant-dark .sidebar-navigation-label {
  color: #766d61;
}

body.template-elegant-dark .nav .pill,
body.template-elegant-dark .main-nav .pill,
body.template-elegant-dark .pill,
body.template-elegant-dark .identity-theme-preview,
body.template-elegant-dark .template-current-label {
  border-color: #e7dac7;
  background: #fffaf2;
  color: #7b5527;
}

body.template-elegant-dark .card,
body.template-elegant-dark .activity-settings-card,
body.template-elegant-dark .activity-settings-columns .activity-settings-section,
body.template-elegant-dark .table-wrap,
body.template-elegant-dark .merchant-map-preview,
body.template-elegant-dark .store-map-shell,
body.template-elegant-dark .store-brand-banner,
body.template-elegant-dark .template-choice-card {
  border-color: #eadfce;
  background: rgba(255, 253, 249, .98);
  box-shadow: 0 9px 24px rgba(92, 64, 28, .07);
}

body.template-elegant-dark .merchant-shop-header {
  border-color: #eadfce;
  background:
    radial-gradient(circle at 95% 8%, rgba(184, 137, 74, .12), transparent 32%),
    linear-gradient(135deg, #fffdf9, #faf5ec);
}

body.template-elegant-dark .merchant-shop-logo-card,
body.template-elegant-dark .store-logo-frame,
body.template-elegant-dark .identity-logo-preview,
body.template-elegant-dark .product-image-preview,
body.template-elegant-dark .qr-wrap {
  border-color: #eadfce;
  background: #fffaf2;
}

body.template-elegant-dark input,
body.template-elegant-dark textarea,
body.template-elegant-dark select {
  border-color: #e4d8c7;
  background: #fffefa;
  color: #352f27;
}

body.template-elegant-dark input::placeholder,
body.template-elegant-dark textarea::placeholder {
  color: #998f84;
}

body.template-elegant-dark input:focus,
body.template-elegant-dark textarea:focus,
body.template-elegant-dark select:focus {
  border-color: #aa773c;
  box-shadow: 0 0 0 4px rgba(170, 119, 60, .13);
}

body.template-elegant-dark .btn {
  background: linear-gradient(135deg, #9e6b32, #725025);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(127, 85, 37, .18);
}

body.template-elegant-dark .btn.ghost,
body.template-elegant-dark .sidebar-logout,
body.template-elegant-dark .sidebar-nav a {
  border-color: #e4d8c7;
  background: #fffdf9;
  color: #6f4d27;
}

body.template-elegant-dark .btn.ghost:hover,
body.template-elegant-dark .sidebar-logout:hover,
body.template-elegant-dark .sidebar-nav a:hover {
  border-color: #aa773c;
  background: #fff5e7;
  color: #5d3f1f;
}

body.template-elegant-dark .table,
body.template-elegant-dark .table th,
body.template-elegant-dark .table td,
body.template-elegant-dark .table-wrap {
  color: #352f27;
}

body.template-elegant-dark .table th,
body.template-elegant-dark .table tr:hover td {
  background: #fffaf3;
}

body.template-elegant-dark .table td,
body.template-elegant-dark .table th,
body.template-elegant-dark hr,
body.template-elegant-dark .cart-row {
  border-color: #eee4d7;
}

body.template-elegant-dark .daily-offer-badge,
body.template-elegant-dark .cart-offer-badge,
body.template-elegant-dark .order-type-badge {
  border-color: #ead8bc;
  background: #fff2dc;
  color: #805524;
}

body.template-elegant-dark .notice {
  border-color: #eadfce;
  background: #fff7ec;
  color: #6a4b28;
}

body.template-elegant-dark .notice.ok {
  border-color: #cce6d4;
  background: #eff9f1;
  color: #22633a;
}

body.template-elegant-dark .notice.err {
  border-color: #f0c9c2;
  background: #fff0ee;
  color: #8a2c24;
}

body.template-elegant-dark .notice.warn {
  border-color: #efd8a8;
  background: #fff7e6;
  color: #77501c;
}

body.template-elegant-dark .template-choice-card.is-selected {
  border-color: #a9783f;
  background: linear-gradient(145deg, #fff4e4, #fffdf9);
  box-shadow: 0 0 0 3px rgba(169, 120, 63, .10), var(--shadow-sm);
}

body.template-elegant-dark .sidebar-shortcut-mark {
  background: #a9783f;
  box-shadow: 0 0 0 3px rgba(169, 120, 63, .11);
}

@media (max-width: 960px) {
  #merchant-app .main {
    padding: 16px;
  }
}

@media (max-width: 680px) {
  #merchant-app .merchant-shop-header {
    padding: 14px;
    gap: 14px;
  }

  #merchant-app .merchant-shop-logo-card {
    width: 94px;
    height: 94px;
    min-width: 94px;
    border-radius: 16px;
  }

  #merchant-app .merchant-shop-logo {
    width: 76px;
    height: 76px;
    border-radius: 12px;
  }

  #merchant-app .card-pad {
    padding: 15px;
  }

  #merchant-app .table th,
  #merchant-app .table td {
    padding: 10px 11px;
  }

  #merchant-app .qr {
    width: 132px;
    height: 132px;
  }

  .template-choice-card,
  .template-dialog .template-choice-card {
    grid-template-columns: 102px minmax(0, 1fr);
    gap: 10px;
  }

  .template-choice-preview {
    min-height: 74px;
  }
}

@media (max-width: 420px) {
  .template-choice-card,
  .template-dialog .template-choice-card {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   MIAPP v49 - Template con layout controllato
   Obiettivo: differenze visibili nell'organizzazione dei blocchi,
   senza cambiare funzioni, tabelle o proporzioni operative.
========================================================= */

/* Le tre miniature ora rappresentano una disposizione, non soltanto un colore. */
.template-preview-classic {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 12px minmax(34px, 1fr) 22px;
}

.template-preview-modern {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, .85fr);
  grid-template-rows: 12px minmax(52px, 1fr);
}

.template-preview-modern .template-preview-bar {
  grid-column: 1 / -1;
}

.template-preview-modern .template-preview-hero {
  grid-column: 1;
  grid-row: 2;
}

.template-preview-modern .template-preview-cards {
  grid-column: 2;
  grid-row: 2;
  grid-template-columns: 1fr;
  grid-template-rows: repeat(3, minmax(0, 1fr));
}

.template-preview-dark {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  grid-template-rows: 12px 28px minmax(28px, 1fr);
}

.template-preview-dark .template-preview-bar {
  grid-column: 1 / -1;
}

.template-preview-dark .template-preview-hero {
  grid-column: 1 / -1;
  grid-row: 2;
}

.template-preview-dark .template-preview-cards {
  grid-column: 1 / -1;
  grid-row: 3;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
}

.template-preview-dark .template-preview-cards i:last-child {
  display: none;
}

/* Il selettore della web app diventa una barra compatta sulle varianti a layout. */
@media (min-width: 900px) {
  body.template-modern-color .merchant-shop-switcher,
  body.template-elegant-dark .merchant-shop-switcher {
    display: grid;
    grid-template-columns: minmax(150px, .48fr) minmax(240px, 1fr) auto;
    align-items: end;
    gap: 12px;
  }

  body.template-modern-color .merchant-shop-switcher label,
  body.template-elegant-dark .merchant-shop-switcher label {
    margin: 0 0 7px;
  }

  body.template-modern-color .merchant-shop-switcher .actions,
  body.template-elegant-dark .merchant-shop-switcher .actions {
    margin: 0;
    justify-content: flex-end;
  }
}

/* I due layout alternativi entrano solo quando il desktop ha spazio reale.
   Tablet e telefoni mantengono la sequenza lineare per non comprimere le tabelle. */
@media (min-width: 1280px) {
  body.template-modern-color #shop-panel,
  body.template-elegant-dark #shop-panel {
    display: grid;
    align-items: start;
    gap: 14px;
  }

  body.template-modern-color #shop-panel > .mt,
  body.template-elegant-dark #shop-panel > .mt {
    margin-top: 0;
  }

  body.template-modern-color #merchant-orders,
  body.template-elegant-dark #merchant-orders,
  body.template-modern-color #merchant-products,
  body.template-elegant-dark #merchant-products,
  body.template-modern-color .merchant-product-list-card,
  body.template-elegant-dark .merchant-product-list-card,
  body.template-modern-color #merchant-activity-settings,
  body.template-elegant-dark #merchant-activity-settings {
    grid-column: 1 / -1;
  }

  /* Catalogo compatto: modulo prodotto e QR in una fascia stretta;
     categorie e offerta condividono una seconda fascia proporzionata. */
  body.template-modern-color #shop-panel {
    grid-template-columns: minmax(620px, 1.5fr) minmax(280px, .72fr);
  }

  body.template-modern-color #merchant-products {
    grid-template-columns: minmax(0, 1.48fr) minmax(240px, .52fr);
    gap: 14px;
  }

  body.template-modern-color .merchant-qr-card {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    align-items: center;
    gap: 10px 12px;
    text-align: left;
  }

  body.template-modern-color .merchant-qr-card h2,
  body.template-modern-color .merchant-qr-card .actions {
    grid-column: 1 / -1;
  }

  body.template-modern-color .merchant-qr-card .qr {
    grid-column: 1;
    grid-row: 2;
    width: 104px;
    height: 104px;
    margin: 0;
  }

  body.template-modern-color .merchant-qr-card p {
    grid-column: 2;
    grid-row: 2;
    margin: 0;
  }

  body.template-modern-color #merchant-categories {
    grid-column: 1;
  }

  body.template-modern-color #merchant-daily-offer {
    grid-column: 2;
  }

  body.template-modern-color #merchant-daily-offer .daily-offer-form-grid,
  body.template-modern-color #merchant-daily-offer .daily-offer-preview-card {
    grid-template-columns: 1fr;
  }

  body.template-modern-color #merchant-daily-offer .daily-offer-field-wide {
    grid-column: auto;
  }

  /* Pannelli bilanciati: gli strumenti restano affiancati ma più simmetrici;
     categorie e offerta hanno la stessa altezza visiva e lettura in coppia. */
  body.template-elegant-dark #shop-panel {
    grid-template-columns: minmax(620px, 1.14fr) minmax(300px, .86fr);
  }

  body.template-elegant-dark #merchant-products {
    grid-template-columns: minmax(0, .92fr) minmax(300px, 1.08fr);
    gap: 14px;
  }

  body.template-elegant-dark .merchant-qr-card {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    align-items: center;
    gap: 11px 14px;
    text-align: left;
  }

  body.template-elegant-dark .merchant-qr-card h2,
  body.template-elegant-dark .merchant-qr-card .actions {
    grid-column: 1 / -1;
  }

  body.template-elegant-dark .merchant-qr-card .qr {
    grid-column: 1;
    grid-row: 2;
    width: 128px;
    height: 128px;
    margin: 0;
  }

  body.template-elegant-dark .merchant-qr-card p {
    grid-column: 2;
    grid-row: 2;
    margin: 0;
  }

  body.template-elegant-dark #merchant-categories {
    grid-column: 1;
  }

  body.template-elegant-dark #merchant-daily-offer {
    grid-column: 2;
  }

  body.template-elegant-dark #merchant-daily-offer .daily-offer-form-grid,
  body.template-elegant-dark #merchant-daily-offer .daily-offer-preview-card {
    grid-template-columns: 1fr;
  }

  body.template-elegant-dark #merchant-daily-offer .daily-offer-field-wide {
    grid-column: auto;
  }
}

/* Store: piccole differenze strutturali senza toccare carrello, ordine o prodotti. */
@media (min-width: 1120px) {
  body.store-page.template-modern-color .store-order-layout {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 350px);
    gap: 18px;
  }

  body.store-page.template-modern-color .products {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }

  body.store-page.template-elegant-dark .store-order-layout {
    grid-template-columns: minmax(0, 1fr) minmax(350px, 410px);
    gap: 28px;
  }

  body.store-page.template-elegant-dark .products {
    gap: 18px;
  }
}

@media (max-width: 1279px) {
  body.template-modern-color #shop-panel,
  body.template-elegant-dark #shop-panel {
    display: block;
  }

  body.template-modern-color #shop-panel > .mt,
  body.template-elegant-dark #shop-panel > .mt {
    margin-top: 14px;
  }
}

@media (max-width: 899px) {
  body.template-modern-color .merchant-shop-switcher,
  body.template-elegant-dark .merchant-shop-switcher {
    display: block;
  }
}

@media (max-width: 680px) {
  .template-preview-modern,
  .template-preview-dark {
    grid-template-columns: 1fr;
    grid-template-rows: 12px minmax(34px, 1fr) 22px;
  }

  .template-preview-modern .template-preview-bar,
  .template-preview-dark .template-preview-bar,
  .template-preview-modern .template-preview-hero,
  .template-preview-dark .template-preview-hero,
  .template-preview-modern .template-preview-cards,
  .template-preview-dark .template-preview-cards {
    grid-column: auto;
  }

  .template-preview-modern .template-preview-hero,
  .template-preview-dark .template-preview-hero {
    grid-row: 2;
  }

  .template-preview-modern .template-preview-cards,
  .template-preview-dark .template-preview-cards {
    grid-row: 3;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: 1fr;
  }

  .template-preview-dark .template-preview-cards i:last-child {
    display: block;
  }
}

/* =========================================================
   MIAPP v50 — Tre template Store reali
   I tre ID Supabase restano invariati per non richiedere migrazioni:
   classic-minimal = Fresco e moderno
   modern-color   = Caldo e accogliente
   elegant-dark   = Elegante e minimal
========================================================= */

/* ---- Anteprime selettore: rappresentano il layout reale dello store ---- */
.template-preview-classic {
  background:
    radial-gradient(circle at 82% 24%, rgba(51, 132, 57, .20), transparent 28%),
    linear-gradient(145deg, #f9fffa, #eff8ec);
}
.template-preview-classic .template-preview-bar { background: #2f6a33; }
.template-preview-classic .template-preview-hero { background: linear-gradient(135deg, #dfeeda, #fff); }
.template-preview-classic .template-preview-cards i { background: #fff; border: 1px solid #d9e8d4; }

.template-preview-modern {
  background: linear-gradient(145deg, #fff8ec, #f4e4c4);
}
.template-preview-modern .template-preview-bar { background: #9b5a18; }
.template-preview-modern .template-preview-hero { background: linear-gradient(135deg, #f6d9a5, #fff7e9); border-color: #e7c990; }
.template-preview-modern .template-preview-cards { grid-template-columns: 1fr; gap: 4px; }
.template-preview-modern .template-preview-cards i { background: #fffaf1; border: 1px solid #ead3aa; }

.template-preview-dark {
  background: linear-gradient(145deg, #fcfbff, #eeeaff);
  border-color: #ddd5fa;
}
.template-preview-dark .template-preview-bar { background: #6b45c7; }
.template-preview-dark .template-preview-hero { background: linear-gradient(135deg, #f4f1ff, #fff); border-color: #ddd5fa; }
.template-preview-dark .template-preview-cards { grid-template-columns: 1fr; gap: 4px; }
.template-preview-dark .template-preview-cards i { background: #fff; border: 1px solid #e5def7; }

/* ---- 1. Fresco e moderno: hero ampio, griglia prodotto, CTA viva ---- */
body.store-page.template-classic-minimal {
  background:
    radial-gradient(circle at 5% 0, color-mix(in srgb, var(--primary) 12%, transparent), transparent 25%),
    linear-gradient(180deg, #fbfffb 0, #f2f7ef 55%, #f8fbf8 100%);
}

body.store-page.template-classic-minimal .store-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
  gap: 26px;
  align-items: center;
  padding-top: 30px;
}

body.store-page.template-classic-minimal .store-brand-banner {
  order: 2;
  min-height: 286px;
  border-radius: 30px;
}

body.store-page.template-classic-minimal .store-hero-copy {
  order: 1;
  padding: 10px 0;
}

body.store-page.template-classic-minimal .store-hero-copy h1 {
  max-width: 12ch;
  font-size: clamp(36px, 4vw, 58px);
  line-height: .98;
}

body.store-page.template-classic-minimal .category-filter-scroll {
  margin: 0 0 16px;
  padding-bottom: 6px;
}

body.store-page.template-classic-minimal .category-filter-scroll .btn {
  border-radius: 999px;
}

body.store-page.template-classic-minimal .product-card {
  border-radius: 20px;
}

body.store-page.template-classic-minimal .product-card .product-media img {
  height: 174px;
}

body.store-page.template-classic-minimal .daily-offer-card {
  border-radius: 24px;
}

/* ---- 2. Caldo e accogliente: apertura centrata, catalogo editoriale in elenco ---- */
body.store-page.template-modern-color {
  background:
    radial-gradient(circle at 10% 4%, rgba(166, 99, 25, .14), transparent 25%),
    linear-gradient(180deg, #fffaf1 0, #f7ecd8 56%, #fff9f0 100%);
  color: #3f2b17;
}

body.store-page.template-modern-color .topbar {
  background: rgba(255, 250, 241, .92);
  border-bottom-color: rgba(157, 99, 27, .18);
}

body.store-page.template-modern-color .logo,
body.store-page.template-modern-color .price,
body.store-page.template-modern-color .daily-offer-price,
body.store-page.template-modern-color .cart-total-row strong:last-child {
  color: #9b5a18;
}

body.store-page.template-modern-color .store-hero {
  padding-top: 24px;
  text-align: center;
}

body.store-page.template-modern-color .store-brand-banner {
  min-height: 238px;
  border-radius: 26px 26px 18px 18px;
  background:
    radial-gradient(circle at 84% 20%, rgba(185, 117, 34, .23), transparent 28%),
    linear-gradient(145deg, #fff8ec, #f4dfbc);
}

body.store-page.template-modern-color .store-brand-banner::before {
  background:
    linear-gradient(135deg, rgba(255, 250, 241, .46), rgba(116, 62, 13, .08)),
    linear-gradient(90deg, rgba(165, 91, 17, .14), transparent 68%);
}

body.store-page.template-modern-color .store-logo-frame {
  width: min(170px, 46vw);
  border-radius: 50%;
  background: rgba(255, 252, 245, .88);
  border-color: rgba(163, 94, 20, .25);
}

body.store-page.template-modern-color .store-logo {
  border-radius: 50%;
}

body.store-page.template-modern-color .store-hero-copy {
  max-width: 720px;
  margin: 0 auto;
  padding-top: 18px;
}

body.store-page.template-modern-color .store-hero-copy h1 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(34px, 4.2vw, 54px);
  letter-spacing: -.04em;
}

body.store-page.template-modern-color .daily-offer-card {
  border-radius: 22px;
  border-color: rgba(160, 92, 20, .22);
  background: linear-gradient(135deg, #fff9ef, #f9e7c6);
}

body.store-page.template-modern-color .category-filter-scroll {
  justify-content: center;
  gap: 10px;
  margin: 4px 0 18px;
}

body.store-page.template-modern-color .category-filter-scroll .btn {
  min-height: 46px;
  padding-inline: 17px;
  border-radius: 999px;
  background: #fffaf2;
  color: #704011;
  border-color: rgba(157, 90, 24, .19);
  box-shadow: none;
}

body.store-page.template-modern-color .category-filter-scroll .btn:not(.ghost) {
  background: linear-gradient(135deg, #a95d19, #7f4010);
  color: #fffaf2;
}

body.store-page.template-modern-color .products {
  grid-template-columns: 1fr;
  gap: 11px;
}

body.store-page.template-modern-color .product-card {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  align-items: stretch;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 252, 246, .94);
  box-shadow: 0 8px 20px rgba(108, 65, 22, .07);
}

body.store-page.template-modern-color .product-card .product-media {
  height: 100%;
}

body.store-page.template-modern-color .product-card .product-media img {
  height: 100%;
  min-height: 124px;
}

body.store-page.template-modern-color .product-card-body {
  padding: 15px 16px;
}

body.store-page.template-modern-color .product-card h3 {
  margin: 0 0 3px;
  font-size: 17px;
}

body.store-page.template-modern-color .product-card .desc {
  margin: 0;
  font-size: 13px;
}

body.store-page.template-modern-color .product-card-footer {
  margin-top: 12px;
}

body.store-page.template-modern-color .product-add-button,
body.store-page.template-modern-color .btn {
  background: linear-gradient(135deg, #ab621b, #81430f);
  box-shadow: 0 8px 18px rgba(136, 72, 15, .18);
}

body.store-page.template-modern-color .btn.ghost,
body.store-page.template-modern-color .nav .pill,
body.store-page.template-modern-color .main-nav .pill {
  background: #fffaf2;
  color: #8a4f15;
  border-color: rgba(157, 90, 24, .22);
  box-shadow: none;
}

body.store-page.template-modern-color .cart {
  border-radius: 20px;
  border-color: rgba(157, 90, 24, .19);
  background: #fffaf2;
}

/* ---- 3. Elegante e minimal: testata ridotta, catalogo lineare, superficie chiara ---- */
body.store-page.template-elegant-dark {
  background: linear-gradient(180deg, #fcfbff 0, #f5f2ff 58%, #faf9ff 100%);
  color: #252237;
}

body.store-page.template-elegant-dark .topbar {
  background: rgba(255, 255, 255, .92);
  border-color: #e4dff3;
  box-shadow: 0 1px 0 rgba(91, 69, 165, .06);
}

body.store-page.template-elegant-dark .logo,
body.store-page.template-elegant-dark .kicker,
body.store-page.template-elegant-dark .price,
body.store-page.template-elegant-dark .daily-offer-price,
body.store-page.template-elegant-dark .cart-total-row strong:last-child {
  color: #6b45c7;
}

body.store-page.template-elegant-dark h1,
body.store-page.template-elegant-dark h2,
body.store-page.template-elegant-dark h3,
body.store-page.template-elegant-dark strong,
body.store-page.template-elegant-dark label,
body.store-page.template-elegant-dark .store-type {
  color: #252237;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.store-page.template-elegant-dark .muted,
body.store-page.template-elegant-dark .field-help {
  color: #716d82;
}

body.store-page.template-elegant-dark .nav .pill,
body.store-page.template-elegant-dark .main-nav .pill,
body.store-page.template-elegant-dark .pill {
  background: #fff;
  color: #5d3db4;
  border-color: #e2dcf5;
}

body.store-page.template-elegant-dark .store-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  padding: 30px 0 22px;
  border-bottom: 1px solid #e5e0f3;
}

body.store-page.template-elegant-dark .store-brand-banner {
  width: 118px;
  min-height: 118px;
  border-radius: 24px;
  background: linear-gradient(145deg, #f5f1ff, #fff);
  box-shadow: none;
}

body.store-page.template-elegant-dark .store-brand-banner::before,
body.store-page.template-elegant-dark .store-brand-banner::after,
body.store-page.template-elegant-dark .store-logo-backdrop {
  display: none;
}

body.store-page.template-elegant-dark .store-logo-frame {
  width: 86px;
  padding: 8px;
  border-radius: 20px;
  background: #fff;
  border-color: #e1daf7;
  box-shadow: 0 8px 18px rgba(68, 44, 128, .10);
}

body.store-page.template-elegant-dark .store-logo {
  border-radius: 14px;
}

body.store-page.template-elegant-dark .store-hero-copy {
  max-width: none;
  padding: 0;
}

body.store-page.template-elegant-dark .store-hero-copy h1 {
  max-width: none;
  margin: 10px 0 4px;
  font-size: clamp(30px, 4vw, 46px);
}

body.store-page.template-elegant-dark .daily-offer-card {
  border-radius: 18px;
  border-color: #e0d9f4;
  background: linear-gradient(135deg, #fbfaff, #f3efff);
  box-shadow: 0 8px 24px rgba(74, 49, 140, .08);
}

body.store-page.template-elegant-dark .category-filter-scroll {
  gap: 0;
  margin: 2px 0 16px;
  border-bottom: 1px solid #e5e0f3;
}

body.store-page.template-elegant-dark .category-filter-scroll .btn {
  min-height: 42px;
  padding: 8px 14px 11px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #6f6883;
  box-shadow: none;
}

body.store-page.template-elegant-dark .category-filter-scroll .btn:not(.ghost) {
  color: #5f3fc0;
  border-bottom-color: #6b45c7;
  background: transparent;
}

body.store-page.template-elegant-dark .products {
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid #ebe7f5;
}

body.store-page.template-elegant-dark .product-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  border: 0;
  border-bottom: 1px solid #e9e5f3;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body.store-page.template-elegant-dark .product-card:hover {
  transform: none;
  background: rgba(255, 255, 255, .72);
  box-shadow: none;
}

body.store-page.template-elegant-dark .product-card .product-media {
  align-self: center;
  padding: 10px 0;
  background: transparent;
}

body.store-page.template-elegant-dark .product-card .product-media img {
  width: 78px;
  height: 78px;
  border-radius: 14px;
  border: 1px solid #e4def1;
}

body.store-page.template-elegant-dark .product-card-body {
  padding: 14px 0 14px 4px;
}

body.store-page.template-elegant-dark .product-card h3 {
  margin: 0 0 3px;
  font-size: 16px;
}

body.store-page.template-elegant-dark .product-card .desc {
  margin: 0;
  font-size: 13px;
}

body.store-page.template-elegant-dark .product-card-footer {
  margin-top: 8px;
}

body.store-page.template-elegant-dark .product-add-button,
body.store-page.template-elegant-dark .btn {
  background: linear-gradient(135deg, #7650d1, #5c38ae);
  color: #fff;
  box-shadow: 0 8px 18px rgba(95, 61, 181, .18);
}

body.store-page.template-elegant-dark .btn.ghost {
  background: #fff;
  color: #603db8;
  border-color: #dfd8f3;
  box-shadow: none;
}

body.store-page.template-elegant-dark .cart,
body.store-page.template-elegant-dark .card {
  border-color: #e1dbf3;
  background: #fff;
  box-shadow: 0 10px 26px rgba(68, 46, 120, .07);
}

body.store-page.template-elegant-dark .cart-row,
body.store-page.template-elegant-dark hr {
  border-color: #ebe7f5;
}

body.store-page.template-elegant-dark input,
body.store-page.template-elegant-dark textarea,
body.store-page.template-elegant-dark select {
  background: #fff;
  color: #252237;
  border-color: #ded7ee;
}

body.store-page.template-elegant-dark .notice {
  background: #f7f5ff;
  border-color: #dfd8f3;
  color: #49397a;
}


/* Logo assente: il titolo occupa sempre tutta la larghezza disponibile. */
body.store-page.template-classic-minimal:not(.store-has-logo) .store-hero,
body.store-page.template-elegant-dark:not(.store-has-logo) .store-hero {
  grid-template-columns: minmax(0, 1fr);
}

body.store-page.template-classic-minimal:not(.store-has-logo) .store-hero-copy,
body.store-page.template-elegant-dark:not(.store-has-logo) .store-hero-copy {
  max-width: 760px;
}

@media (min-width: 1000px) {
  body.store-page.template-modern-color .store-order-layout {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 350px);
    gap: 28px;
  }

  body.store-page.template-elegant-dark .store-order-layout {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
    gap: 34px;
  }
}

@media (max-width: 899px) {
  body.store-page.template-classic-minimal .store-hero,
  body.store-page.template-elegant-dark .store-hero {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  body.store-page.template-classic-minimal .store-brand-banner,
  body.store-page.template-elegant-dark .store-brand-banner {
    order: 0;
    width: 100%;
  }

  body.store-page.template-classic-minimal .store-hero-copy,
  body.store-page.template-elegant-dark .store-hero-copy {
    order: 0;
  }

  body.store-page.template-elegant-dark .store-brand-banner {
    min-height: 132px;
  }
}

@media (max-width: 680px) {
  body.store-page.template-classic-minimal .store-hero-copy h1 {
    max-width: none;
    font-size: 38px;
  }

  body.store-page.template-modern-color .store-hero {
    text-align: left;
  }

  body.store-page.template-modern-color .store-hero-copy {
    margin: 0;
  }

  body.store-page.template-modern-color .category-filter-scroll {
    justify-content: flex-start;
  }

  body.store-page.template-modern-color .product-card {
    grid-template-columns: 104px minmax(0, 1fr);
  }

  body.store-page.template-modern-color .product-card .product-media img {
    min-height: 108px;
  }

  body.store-page.template-elegant-dark .store-brand-banner {
    min-height: 106px;
  }

  body.store-page.template-elegant-dark .store-logo-frame {
    width: 72px;
    border-radius: 18px;
  }

  body.store-page.template-elegant-dark .category-filter-scroll .btn {
    padding-inline: 12px;
  }

  body.store-page.template-elegant-dark .product-card {
    grid-template-columns: 80px minmax(0, 1fr);
  }

  body.store-page.template-elegant-dark .product-card .product-media img {
    width: 66px;
    height: 66px;
    border-radius: 12px;
  }

  body.store-page.template-elegant-dark .product-add-button {
    min-width: 92px;
    padding: 9px 11px;
  }
}


/* =========================================================
   MIAPP v51 — Template Food immersivo + sfondo personalizzabile
========================================================= */

.template-preview-food {
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(0, .68fr);
  grid-template-rows: 12px minmax(52px, 1fr);
  overflow: hidden;
  background:
    radial-gradient(circle at 76% 22%, rgba(255, 191, 98, .48), transparent 20%),
    linear-gradient(145deg, #29170d, #7b3417 58%, #e16222);
}

.template-preview-food .template-preview-bar {
  grid-column: 1 / -1;
  background: #24130b;
}

.template-preview-food .template-preview-hero {
  grid-column: 1;
  grid-row: 2;
  border-color: rgba(255, 230, 184, .40);
  background: linear-gradient(135deg, rgba(255, 210, 127, .84), rgba(124, 46, 20, .36));
}

.template-preview-food .template-preview-cards {
  grid-column: 2;
  grid-row: 2;
  grid-template-columns: 1fr;
  grid-template-rows: repeat(3, minmax(0, 1fr));
}

.template-preview-food .template-preview-cards i {
  border-color: rgba(255, 222, 167, .40);
  background: rgba(255, 248, 236, .90);
}

.store-background-manager {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid color-mix(in srgb, var(--primary) 15%, var(--border));
}

.store-background-manager-heading h4 {
  margin: 8px 0 6px;
  font-size: 16px;
  letter-spacing: -.015em;
}

.store-background-manager-heading p {
  max-width: 720px;
  margin-bottom: 0;
}

.store-background-upload-grid {
  display: grid;
  grid-template-columns: minmax(180px, .86fr) minmax(0, 1.14fr);
  gap: 16px;
  align-items: stretch;
  margin-top: 14px;
}

.store-background-preview {
  display: grid;
  place-items: center;
  min-height: 144px;
  overflow: hidden;
  border: 1px dashed color-mix(in srgb, var(--primary) 30%, var(--border));
  border-radius: 16px;
  background:
    linear-gradient(135deg, var(--primary-ghost), rgba(255, 255, 255, .92)),
    #fff;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}

.store-background-preview img {
  display: block;
  width: 100%;
  height: 144px;
  object-fit: cover;
}

.store-background-upload-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 10px;
}

.store-background-upload-actions .logo-upload-control {
  width: 100%;
  margin: 0;
}

.store-custom-background-layer {
  display: none;
}

/* Nuovo template: hero fotografico per attività food. Gli elementi di ordine
   restano identici, cambia soltanto il modo in cui vengono presentati. */
body.store-page.template-food-premium {
  background:
    radial-gradient(circle at 8% 0, rgba(220, 115, 46, .16), transparent 26%),
    linear-gradient(180deg, #fff9f0 0, #f7eee1 55%, #fffaf4 100%);
  color: #2c1b10;
}

body.store-page.template-food-premium .topbar {
  background: rgba(255, 250, 244, .92);
  border-bottom-color: rgba(117, 61, 29, .16);
}

body.store-page.template-food-premium .logo,
body.store-page.template-food-premium .price,
body.store-page.template-food-premium .daily-offer-price,
body.store-page.template-food-premium .cart-total-row strong:last-child {
  color: #b74720;
}

body.store-page.template-food-premium .store-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(132px, 184px);
  gap: 28px;
  align-items: center;
  min-height: 322px;
  margin-top: 26px;
  padding: 42px;
  overflow: hidden;
  border: 1px solid rgba(113, 55, 22, .20);
  border-radius: 30px;
  background:
    radial-gradient(circle at 84% 20%, rgba(255, 199, 102, .42), transparent 24%),
    linear-gradient(135deg, #2e170d 0%, #703019 52%, #b54b20 100%);
  box-shadow: 0 20px 46px rgba(87, 44, 18, .16);
}

body.store-page.template-food-premium .store-custom-background-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  background: #3a1d10;
}

body.store-page.template-food-premium .store-custom-background-layer img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .84;
}

body.store-page.template-food-premium .store-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(28, 14, 8, .90) 0%, rgba(34, 16, 8, .72) 48%, rgba(34, 16, 8, .24) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, .04), rgba(0, 0, 0, .28));
}

body.store-page.template-food-premium .store-hero-copy,
body.store-page.template-food-premium .store-brand-banner {
  position: relative;
  z-index: 2;
}

body.store-page.template-food-premium .store-hero-copy {
  grid-column: 1;
  grid-row: 1;
  max-width: 680px;
}

body.store-page.template-food-premium .store-hero-copy h1,
body.store-page.template-food-premium .store-hero-copy .muted {
  color: #fffaf4;
}

body.store-page.template-food-premium .store-hero-copy h1 {
  max-width: 13ch;
  margin: 14px 0 10px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(38px, 5vw, 64px);
  line-height: .96;
  letter-spacing: -.05em;
}

body.store-page.template-food-premium .store-hero-copy .muted {
  max-width: 56ch;
  opacity: .90;
}

body.store-page.template-food-premium .store-hero-copy .kicker {
  border-color: rgba(255, 235, 202, .42);
  background: rgba(255, 250, 242, .14);
  color: #fff3df;
  box-shadow: none;
}

body.store-page.template-food-premium .store-hero-copy .kicker::before {
  background: #f7bd62;
}

body.store-page.template-food-premium .store-brand-banner {
  grid-column: 2;
  grid-row: 1;
  min-height: 0;
  width: min(166px, 100%);
  aspect-ratio: 1;
  justify-self: end;
  overflow: visible;
  border: 1px solid rgba(255, 240, 214, .42);
  border-radius: 50%;
  background: rgba(255, 248, 236, .94);
  box-shadow: 0 14px 34px rgba(16, 8, 4, .30);
}

body.store-page.template-food-premium .store-brand-banner::before,
body.store-page.template-food-premium .store-brand-banner::after,
body.store-page.template-food-premium .store-logo-backdrop {
  display: none;
}

body.store-page.template-food-premium .store-logo-frame {
  width: 100%;
  height: 100%;
  padding: 14px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
}

body.store-page.template-food-premium .store-logo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: contain;
  background: transparent;
}

body.store-page.template-food-premium:not(.store-has-logo) .store-hero {
  grid-template-columns: minmax(0, 1fr);
}

body.store-page.template-food-premium:not(.store-has-logo) .store-hero-copy {
  grid-column: 1;
  max-width: 720px;
}

body.store-page.template-food-premium .daily-offer-section {
  margin-top: 20px;
}

body.store-page.template-food-premium .daily-offer-card {
  overflow: hidden;
  border-color: rgba(151, 71, 28, .24);
  border-radius: 22px;
  background: linear-gradient(135deg, #fffaf1, #fde7c6);
  box-shadow: 0 14px 30px rgba(106, 52, 21, .11);
}

body.store-page.template-food-premium .category-filter-scroll {
  margin: 2px 0 18px;
  padding: 8px;
  border: 1px solid rgba(150, 75, 28, .18);
  border-radius: 18px;
  background: rgba(255, 250, 244, .92);
  box-shadow: 0 8px 22px rgba(95, 47, 21, .06);
}

body.store-page.template-food-premium .category-filter-scroll .btn {
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #70401e;
  box-shadow: none;
}

body.store-page.template-food-premium .category-filter-scroll .btn:not(.ghost) {
  background: linear-gradient(135deg, #dc4c22, #a72e18);
  color: #fffaf2;
  box-shadow: 0 8px 18px rgba(171, 49, 22, .22);
}

body.store-page.template-food-premium .products {
  gap: 16px;
}

body.store-page.template-food-premium .product-card {
  border-color: rgba(134, 67, 27, .16);
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(74, 39, 19, .08);
}

body.store-page.template-food-premium .product-card .product-media img {
  height: 188px;
}

body.store-page.template-food-premium .product-add-button,
body.store-page.template-food-premium .btn {
  background: linear-gradient(135deg, #dd4b22, #ac2e18);
  color: #fff;
  box-shadow: 0 9px 19px rgba(174, 48, 21, .21);
}

body.store-page.template-food-premium .btn.ghost,
body.store-page.template-food-premium .nav .pill,
body.store-page.template-food-premium .main-nav .pill {
  background: #fffaf4;
  color: #9d371c;
  border-color: rgba(147, 67, 24, .20);
  box-shadow: none;
}

body.store-page.template-food-premium .cart {
  border-color: rgba(146, 72, 30, .20);
  background: rgba(255, 252, 247, .96);
  box-shadow: 0 16px 34px rgba(83, 43, 20, .12);
}

body.store-page.template-food-premium .store-map-section-bottom {
  border-color: rgba(146, 72, 30, .18);
  background: linear-gradient(135deg, #fffaf4, #f7e4c7);
}

@media (min-width: 1000px) {
  body.store-page.template-food-premium .store-order-layout {
    grid-template-columns: minmax(0, 1fr) minmax(308px, 362px);
    gap: 26px;
  }
}

@media (max-width: 760px) {
  .store-background-upload-grid {
    grid-template-columns: 1fr;
  }

  .store-background-preview,
  .store-background-preview img {
    min-height: 174px;
    height: 174px;
  }
}

@media (max-width: 760px) {
  body.store-page.template-food-premium .store-hero {
    grid-template-columns: 1fr;
    min-height: 350px;
    margin-top: 16px;
    padding: 28px 22px;
    border-radius: 24px;
  }

  body.store-page.template-food-premium .store-hero::before {
    background:
      linear-gradient(180deg, rgba(28, 14, 8, .34) 0%, rgba(28, 14, 8, .88) 60%, rgba(28, 14, 8, .94) 100%);
  }

  body.store-page.template-food-premium .store-brand-banner {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    justify-self: end;
    width: 82px;
  }

  body.store-page.template-food-premium .store-hero-copy {
    grid-column: 1;
    grid-row: 1;
    align-self: end;
  }

  body.store-page.template-food-premium .store-hero-copy h1 {
    max-width: 11ch;
    font-size: clamp(36px, 11vw, 50px);
  }

  body.store-page.template-food-premium .category-filter-scroll {
    margin-top: 14px;
    border-radius: 15px;
  }

  body.store-page.template-food-premium .category-filter-scroll .btn {
    min-width: max-content;
    padding-inline: 14px;
  }

  body.store-page.template-food-premium .product-card .product-media img {
    height: 170px;
  }
}

@media (max-width: 680px) {
  .template-preview-food {
    grid-template-columns: 1fr;
    grid-template-rows: 12px minmax(34px, 1fr) 22px;
  }

  .template-preview-food .template-preview-bar,
  .template-preview-food .template-preview-hero,
  .template-preview-food .template-preview-cards {
    grid-column: auto;
  }

  .template-preview-food .template-preview-hero {
    grid-row: 2;
  }

  .template-preview-food .template-preview-cards {
    grid-row: 3;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: 1fr;
  }
}


/* =========================================================
   MIAPP v52 — Food vetrina
   Secondo template food: replica le proporzioni del modello approvato
   senza alterare i flussi di prodotti, carrello o ordine.
========================================================= */

.food-showcase-only {
  display: none;
}

.template-preview-food-showcase {
  background:
    linear-gradient(150deg, rgba(59, 22, 13, .16), rgba(246, 133, 62, .35)),
    linear-gradient(130deg, #30150e, #e35224 58%, #f6bd71);
}

.template-preview-food-showcase .template-preview-bar {
  background: rgba(255, 249, 239, .92);
}

.template-preview-food-showcase .template-preview-hero {
  min-height: 42%;
  background:
    radial-gradient(circle at 72% 45%, rgba(255, 234, 187, .9), transparent 0 22%),
    linear-gradient(90deg, rgba(43, 18, 11, .9), rgba(66, 25, 16, .32));
}

.template-preview-food-showcase .template-preview-cards i {
  background: rgba(255, 250, 243, .95);
  border-color: rgba(157, 57, 28, .25);
}

body.store-page.template-food-showcase {
  --food-showcase-ink: #2a160f;
  --food-showcase-paper: #fffaf3;
  --food-showcase-surface: rgba(255, 253, 249, .97);
  --food-showcase-border: rgba(112, 59, 37, .16);
  --food-showcase-accent: #c84424;
  --food-showcase-accent-dark: #942b18;
  --food-showcase-shadow: 0 18px 44px rgba(65, 28, 14, .15);
  background:
    radial-gradient(circle at 5% 0, rgba(246, 152, 70, .2), transparent 32%),
    radial-gradient(circle at 95% 25%, rgba(161, 55, 24, .13), transparent 28%),
    #f8f0e7;
  color: var(--food-showcase-ink);
}

body.store-page.template-food-showcase .topbar {
  position: relative;
  background: rgba(255, 252, 246, .96);
  border-bottom-color: rgba(116, 64, 37, .13);
}

body.store-page.template-food-showcase .topbar .wrap {
  max-width: 1380px;
}

body.store-page.template-food-showcase .logo {
  color: #7e2d19;
}

body.store-page.template-food-showcase .logo::before {
  background: linear-gradient(135deg, #a9361d, #ee8b3b);
  box-shadow: 0 6px 18px rgba(159, 49, 22, .26);
}

body.store-page.template-food-showcase .store-wrap {
  max-width: 1380px;
  padding-top: 22px;
  padding-bottom: 44px;
}

body.store-page.template-food-showcase .store-hero {
  position: relative;
  isolation: isolate;
  min-height: 352px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  margin: 0;
  padding: 30px;
  border: 1px solid rgba(86, 36, 19, .18);
  border-radius: 30px;
  background:
    radial-gradient(circle at 78% 46%, rgba(255, 222, 159, .95), transparent 0 18%),
    linear-gradient(100deg, #2c130c 0%, #68301d 46%, #e57b33 100%);
  box-shadow: 0 22px 54px rgba(83, 33, 16, .20);
}

body.store-page.template-food-showcase .store-custom-background-layer,
body.store-page.template-food-showcase .store-custom-background-layer img {
  position: absolute;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
}

body.store-page.template-food-showcase .store-custom-background-layer img {
  display: block;
  object-fit: cover;
  object-position: center;
  filter: saturate(1.08) contrast(1.04);
}

body.store-page.template-food-showcase .store-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(28, 12, 7, .9) 0%, rgba(40, 16, 10, .7) 42%, rgba(44, 17, 10, .1) 76%),
    linear-gradient(0deg, rgba(26, 11, 7, .42), transparent 44%);
}

body.store-page.template-food-showcase .store-brand-banner {
  position: absolute;
  top: 28px;
  left: 30px;
  z-index: 2;
  display: block;
  width: 92px;
  height: 92px;
  padding: 7px;
  overflow: hidden;
  border: 1px solid rgba(255, 246, 232, .55);
  border-radius: 50%;
  background: rgba(255, 252, 246, .97);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .24);
}

body.store-page.template-food-showcase .store-brand-banner::before,
body.store-page.template-food-showcase .store-brand-banner::after,
body.store-page.template-food-showcase .store-logo-backdrop {
  display: none;
}

body.store-page.template-food-showcase .store-logo-frame,
body.store-page.template-food-showcase .store-logo {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  object-fit: contain;
}

body.store-page.template-food-showcase .store-hero-copy {
  position: relative;
  z-index: 1;
  width: min(590px, 58%);
  padding-top: 84px;
  color: #fff9f1;
}

body.store-page.template-food-showcase:not(.store-has-logo) .store-hero-copy {
  padding-top: 0;
}

body.store-page.template-food-showcase .store-hero-copy .kicker {
  border-color: rgba(255, 231, 193, .28);
  background: rgba(255, 252, 246, .13);
  color: #fff1d8;
  box-shadow: none;
}

body.store-page.template-food-showcase .store-hero-copy .kicker::before {
  background: #f6bc72;
}

body.store-page.template-food-showcase .store-hero-copy h1 {
  max-width: 540px;
  margin: 12px 0 8px;
  color: #fffaf4;
  font-size: clamp(34px, 4.3vw, 60px);
  line-height: .98;
  letter-spacing: -.055em;
  text-wrap: balance;
}

body.store-page.template-food-showcase .store-hero-copy .muted {
  max-width: 520px;
  color: rgba(255, 246, 235, .89);
  font-size: 16px;
}

body.store-page.template-food-showcase .food-showcase-only {
  display: flex;
}

body.store-page.template-food-showcase .store-service-badges {
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 13px;
}

body.store-page.template-food-showcase .store-service-badge {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 239, 214, .2);
  border-radius: 999px;
  background: rgba(20, 9, 5, .28);
  color: #fff4e5;
  font-size: 12px;
  font-weight: 850;
}

body.store-page.template-food-showcase .store-hero-actions {
  margin-top: 16px;
}

body.store-page.template-food-showcase .store-menu-cta {
  min-width: 148px;
  border-radius: 12px;
  background: linear-gradient(135deg, #e2562d, #b52f19);
  box-shadow: 0 12px 24px rgba(18, 6, 2, .25);
}

body.store-page.template-food-showcase .store-order-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 22px;
  align-items: start;
  margin-top: -28px;
  position: relative;
  z-index: 4;
}

body.store-page.template-food-showcase .store-products-column {
  min-width: 0;
  padding: 0 18px 0 18px;
}

body.store-page.template-food-showcase .category-filter-scroll {
  width: fit-content;
  max-width: 100%;
  min-height: 64px;
  margin: 0 0 18px;
  padding: 10px;
  gap: 8px;
  overflow-x: auto;
  flex-wrap: nowrap;
  border: 1px solid rgba(116, 54, 30, .13);
  border-radius: 18px;
  background: rgba(255, 253, 249, .98);
  box-shadow: 0 12px 28px rgba(61, 24, 12, .12);
  scrollbar-width: thin;
}

body.store-page.template-food-showcase .category-filter-scroll .btn {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 9px 15px;
  border-radius: 12px;
  font-size: 13px;
}

body.store-page.template-food-showcase .category-filter-scroll .btn:not(.ghost) {
  background: linear-gradient(135deg, #d64a25, #a82c17);
  box-shadow: none;
}

body.store-page.template-food-showcase .products {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}

body.store-page.template-food-showcase .product-card {
  overflow: hidden;
  border-color: rgba(111, 53, 30, .15);
  border-radius: 17px;
  background: var(--food-showcase-surface);
  box-shadow: 0 9px 20px rgba(72, 31, 15, .11);
}

body.store-page.template-food-showcase .product-card:hover {
  border-color: rgba(187, 63, 29, .35);
  box-shadow: 0 16px 28px rgba(72, 31, 15, .16);
}

body.store-page.template-food-showcase .product-card .product-media img {
  height: 156px;
  object-fit: cover;
}

body.store-page.template-food-showcase .product-card-body {
  padding: 12px;
}

body.store-page.template-food-showcase .product-card h3 {
  font-size: 15px;
  margin-bottom: 3px;
}

body.store-page.template-food-showcase .product-card .desc {
  min-height: 36px;
  margin-bottom: 9px;
  font-size: 12px;
  line-height: 1.35;
}

body.store-page.template-food-showcase .product-card-footer {
  gap: 8px;
}

body.store-page.template-food-showcase .product-card .price,
body.store-page.template-food-showcase .daily-offer-price,
body.store-page.template-food-showcase .cart-total-row strong:last-child {
  color: #aa321c;
}

body.store-page.template-food-showcase .product-add-button {
  min-width: 0;
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 10px;
  background: linear-gradient(135deg, #dd5027, #b63019);
  box-shadow: none;
  font-size: 12px;
}

body.store-page.template-food-showcase .food-showcase-side-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  padding: 0 18px 0 0;
}

body.store-page.template-food-showcase .daily-offer-section {
  margin: 0;
}

body.store-page.template-food-showcase .daily-offer-card,
body.store-page.template-food-showcase .cart {
  border-color: rgba(115, 54, 30, .15);
  border-radius: 18px;
  background: rgba(255, 253, 249, .98);
  box-shadow: var(--food-showcase-shadow);
}

body.store-page.template-food-showcase .daily-offer-card {
  grid-template-columns: 132px minmax(0, 1fr);
}

body.store-page.template-food-showcase .daily-offer-media img {
  height: 100%;
  min-height: 170px;
}

body.store-page.template-food-showcase .daily-offer-body {
  padding: 15px;
}

body.store-page.template-food-showcase .daily-offer-body h2 {
  font-size: 19px;
  margin-bottom: 5px;
}

body.store-page.template-food-showcase .daily-offer-product-name,
body.store-page.template-food-showcase .daily-offer-description {
  font-size: 13px;
}

body.store-page.template-food-showcase .daily-offer-footer {
  gap: 10px;
}

body.store-page.template-food-showcase .daily-offer-add-button {
  width: 100%;
  min-height: 38px;
  padding: 9px 11px;
  border-radius: 10px;
  background: linear-gradient(135deg, #de4f26, #b82e18);
  box-shadow: none;
}

body.store-page.template-food-showcase .cart {
  position: sticky;
  top: 18px;
  padding: 18px;
}

body.store-page.template-food-showcase .cart h2 {
  font-size: 20px;
}

body.store-page.template-food-showcase .cart-row {
  padding: 10px 0;
}

body.store-page.template-food-showcase .cart-quantity-controls .btn,
body.store-page.template-food-showcase .cart-remove-button {
  min-height: 30px;
  padding: 5px 8px;
  border-radius: 9px;
}

body.store-page.template-food-showcase .cart .btn:not(.ghost) {
  background: linear-gradient(135deg, #db4d26, #ad2d18);
  box-shadow: none;
}

body.store-page.template-food-showcase .cart .btn.ghost {
  border-color: rgba(151, 67, 37, .25);
  color: #a3311b;
}

body.store-page.template-food-showcase .store-map-section-bottom {
  margin-top: 24px;
  border-color: rgba(115, 54, 30, .14);
  border-radius: 22px;
  background: rgba(255, 253, 249, .95);
  box-shadow: var(--food-showcase-shadow);
}

body.store-page.template-food-showcase .store-map-shell {
  border-color: rgba(115, 54, 30, .13);
}

@media (max-width: 1120px) {
  body.store-page.template-food-showcase .store-order-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
  }

  body.store-page.template-food-showcase .products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.store-page.template-food-showcase .product-card .product-media img {
    height: 170px;
  }
}

@media (max-width: 860px) {
  body.store-page.template-food-showcase .store-hero {
    min-height: 326px;
    padding: 24px;
  }

  body.store-page.template-food-showcase .store-order-layout {
    grid-template-columns: 1fr;
    margin-top: -18px;
  }

  body.store-page.template-food-showcase .store-products-column,
  body.store-page.template-food-showcase .food-showcase-side-column {
    padding: 0 12px;
  }

  body.store-page.template-food-showcase .food-showcase-side-column {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, .9fr);
    align-items: start;
  }

  body.store-page.template-food-showcase .cart {
    position: relative;
    top: auto;
  }
}

@media (max-width: 640px) {
  body.store-page.template-food-showcase .store-wrap {
    padding: 12px 12px 28px;
  }

  body.store-page.template-food-showcase .store-hero {
    min-height: 410px;
    align-items: flex-end;
    padding: 18px;
    border-radius: 24px;
  }

  body.store-page.template-food-showcase .store-hero::after {
    background:
      linear-gradient(0deg, rgba(24, 10, 6, .88) 0%, rgba(27, 10, 6, .55) 54%, rgba(24, 10, 6, .08) 100%),
      linear-gradient(90deg, rgba(27, 10, 6, .46), transparent 90%);
  }

  body.store-page.template-food-showcase .store-brand-banner {
    top: 18px;
    left: 18px;
    width: 72px;
    height: 72px;
  }

  body.store-page.template-food-showcase .store-hero-copy {
    width: 100%;
    padding-top: 82px;
  }

  body.store-page.template-food-showcase .store-hero-copy h1 {
    font-size: clamp(34px, 10vw, 46px);
  }

  body.store-page.template-food-showcase .store-hero-copy .muted {
    font-size: 14px;
  }

  body.store-page.template-food-showcase .store-service-badges {
    gap: 6px;
  }

  body.store-page.template-food-showcase .store-service-badge {
    min-height: 28px;
    padding: 5px 8px;
    font-size: 11px;
  }

  body.store-page.template-food-showcase .store-order-layout {
    margin-top: -14px;
    gap: 16px;
  }

  body.store-page.template-food-showcase .store-products-column,
  body.store-page.template-food-showcase .food-showcase-side-column {
    padding: 0 8px;
  }

  body.store-page.template-food-showcase .category-filter-scroll {
    width: 100%;
    min-height: 58px;
    margin-bottom: 14px;
    border-radius: 16px;
  }

  body.store-page.template-food-showcase .category-filter-scroll .btn {
    min-height: 38px;
    padding: 8px 12px;
    font-size: 12px;
  }

  body.store-page.template-food-showcase .products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  body.store-page.template-food-showcase .product-card {
    border-radius: 14px;
  }

  body.store-page.template-food-showcase .product-card .product-media img {
    height: 116px;
  }

  body.store-page.template-food-showcase .product-card-body {
    padding: 10px;
  }

  body.store-page.template-food-showcase .product-card h3 {
    font-size: 13px;
  }

  body.store-page.template-food-showcase .product-card .desc {
    min-height: 32px;
    margin-bottom: 7px;
    font-size: 11px;
  }

  body.store-page.template-food-showcase .product-card-footer {
    align-items: stretch;
    flex-direction: column;
  }

  body.store-page.template-food-showcase .product-card .price {
    font-size: 16px;
  }

  body.store-page.template-food-showcase .product-add-button {
    width: 100%;
    min-height: 34px;
    padding: 7px 8px;
    font-size: 11px;
  }

  body.store-page.template-food-showcase .food-showcase-side-column {
    display: flex;
    gap: 14px;
  }

  body.store-page.template-food-showcase .daily-offer-card {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  body.store-page.template-food-showcase .daily-offer-media img {
    min-height: 156px;
  }

  body.store-page.template-food-showcase .daily-offer-body {
    padding: 12px;
  }

  body.store-page.template-food-showcase .daily-offer-body h2 {
    font-size: 17px;
  }

  body.store-page.template-food-showcase .daily-offer-validity {
    font-size: 11px;
  }

  body.store-page.template-food-showcase .cart {
    padding: 16px;
  }

  body.store-page.template-food-showcase .store-map-section-bottom {
    margin: 20px 8px 0;
    border-radius: 18px;
  }
}

@media (max-width: 380px) {
  body.store-page.template-food-showcase .products {
    grid-template-columns: 1fr;
  }

  body.store-page.template-food-showcase .product-card .product-media img {
    height: 170px;
  }
}


/* =========================================================
   MIAPP v53 — Template affidabili e colori del commerciante
   Regola: ogni template modifica disposizione/forma dei blocchi;
   il colore primario e secondario arrivano sempre da shops.
========================================================= */

/* Il selettore template deve essere esplicito e cliccabile anche con input radio visivamente nascosti. */
.template-dialog .template-choice-grid,
.builder-template-picker .template-choice-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  align-items: stretch;
}

.template-choice-card {
  min-height: 100%;
  outline: 0;
}

.template-choice-card .template-choice-state {
  display: none;
  align-self: flex-start;
  margin-top: auto;
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--border));
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.template-choice-card.is-selected {
  border: 2px solid var(--primary) !important;
  background: linear-gradient(145deg, var(--primary-soft), #fff) !important;
  box-shadow: 0 0 0 4px var(--primary-ghost), var(--shadow-sm) !important;
}

.template-choice-card.is-selected .template-choice-state:not([hidden]) {
  display: inline-flex;
}

.template-choice-card.is-selected .template-choice-preview {
  border-color: color-mix(in srgb, var(--primary) 46%, var(--border));
}

.template-choice-card:focus-within {
  outline: 3px solid var(--primary-ghost);
  outline-offset: 2px;
}

.template-dialog-notice {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--bg-soft);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 750;
}

.template-dialog-notice.info {
  border-color: color-mix(in srgb, var(--primary) 24%, var(--border));
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.template-dialog-notice.ok {
  border-color: #ccebd5;
  background: var(--ok-soft);
  color: #0f612b;
}

.template-dialog-notice.err {
  border-color: #f6cbc8;
  background: var(--danger-soft);
  color: #8a1f17;
}

/* Isolamento: il template non influenza più il pannello commerciante. */
#merchant-app {
  color: var(--text);
}

/* Le vecchie classi business-type definivano --primary e sovrascrivevano il
   colore scelto dal commerciante. In v53 non vengono più aggiunte da JS;
   questo fallback le neutralizza anche in caso di cache vecchia. */
.store-page.theme-pizzeria,
.store-page.theme-bar,
.store-page.theme-panificio,
.store-page.theme-profumeria,
.store-page.theme-farmacia,
.store-page.theme-alimentari,
.store-page.theme-ristorante,
.store-page.theme-negozio_generico {
  --primary: inherit;
}

/* Superfici e comandi usano sempre i colori scelti nel pannello Identità. */
body.store-page.template-classic-minimal,
body.store-page.template-modern-color,
body.store-page.template-elegant-dark,
body.store-page.template-food-premium,
body.store-page.template-food-showcase {
  color: var(--text) !important;
  background: var(--bg) !important;
}

body.store-page.template-classic-minimal .topbar,
body.store-page.template-modern-color .topbar,
body.store-page.template-elegant-dark .topbar,
body.store-page.template-food-premium .topbar,
body.store-page.template-food-showcase .topbar {
  background: rgba(255, 255, 255, .92) !important;
  border-bottom-color: color-mix(in srgb, var(--primary) 16%, var(--border)) !important;
}

body.store-page.template-classic-minimal .logo,
body.store-page.template-modern-color .logo,
body.store-page.template-elegant-dark .logo,
body.store-page.template-food-premium .logo,
body.store-page.template-food-showcase .logo,
body.store-page.template-classic-minimal .price,
body.store-page.template-modern-color .price,
body.store-page.template-elegant-dark .price,
body.store-page.template-food-premium .price,
body.store-page.template-food-showcase .price,
body.store-page.template-classic-minimal .daily-offer-price,
body.store-page.template-modern-color .daily-offer-price,
body.store-page.template-elegant-dark .daily-offer-price,
body.store-page.template-food-premium .daily-offer-price,
body.store-page.template-food-showcase .daily-offer-price,
body.store-page.template-classic-minimal .cart-total-row strong:last-child,
body.store-page.template-modern-color .cart-total-row strong:last-child,
body.store-page.template-elegant-dark .cart-total-row strong:last-child,
body.store-page.template-food-premium .cart-total-row strong:last-child,
body.store-page.template-food-showcase .cart-total-row strong:last-child {
  color: var(--primary) !important;
}

body.store-page.template-classic-minimal .logo::before,
body.store-page.template-modern-color .logo::before,
body.store-page.template-elegant-dark .logo::before,
body.store-page.template-food-premium .logo::before,
body.store-page.template-food-showcase .logo::before {
  background: linear-gradient(135deg, var(--primary), var(--secondary)) !important;
  box-shadow: 0 6px 18px var(--primary-ghost) !important;
}

body.store-page.template-classic-minimal .btn,
body.store-page.template-modern-color .btn,
body.store-page.template-elegant-dark .btn,
body.store-page.template-food-premium .btn,
body.store-page.template-food-showcase .btn,
body.store-page.template-classic-minimal .product-add-button,
body.store-page.template-modern-color .product-add-button,
body.store-page.template-elegant-dark .product-add-button,
body.store-page.template-food-premium .product-add-button,
body.store-page.template-food-showcase .product-add-button,
body.store-page.template-food-showcase .store-menu-cta,
body.store-page.template-food-showcase .daily-offer-add-button {
  background: linear-gradient(135deg, var(--primary), var(--secondary)) !important;
  color: #fff !important;
}

body.store-page.template-classic-minimal .btn.ghost,
body.store-page.template-modern-color .btn.ghost,
body.store-page.template-elegant-dark .btn.ghost,
body.store-page.template-food-premium .btn.ghost,
body.store-page.template-food-showcase .btn.ghost,
body.store-page.template-classic-minimal .nav .pill,
body.store-page.template-modern-color .nav .pill,
body.store-page.template-elegant-dark .nav .pill,
body.store-page.template-food-premium .nav .pill,
body.store-page.template-food-showcase .nav .pill {
  border-color: color-mix(in srgb, var(--primary) 22%, var(--border)) !important;
  background: #fff !important;
  color: var(--primary) !important;
}

body.store-page.template-elegant-dark h1,
body.store-page.template-elegant-dark h2,
body.store-page.template-elegant-dark h3,
body.store-page.template-elegant-dark strong,
body.store-page.template-elegant-dark label,
body.store-page.template-elegant-dark .muted,
body.store-page.template-elegant-dark .field-help,
body.store-page.template-elegant-dark .table,
body.store-page.template-elegant-dark .table th,
body.store-page.template-elegant-dark .table td {
  color: var(--text) !important;
}

body.store-page.template-elegant-dark .muted,
body.store-page.template-elegant-dark .field-help {
  color: var(--muted) !important;
}

body.store-page.template-elegant-dark .card,
body.store-page.template-elegant-dark .cart,
body.store-page.template-elegant-dark .table-wrap,
body.store-page.template-elegant-dark .store-map-section-bottom,
body.store-page.template-elegant-dark .store-brand-banner {
  border-color: var(--border) !important;
  background: var(--panel) !important;
  box-shadow: var(--shadow-md) !important;
}

body.store-page.template-elegant-dark input,
body.store-page.template-elegant-dark textarea,
body.store-page.template-elegant-dark select {
  border-color: var(--border-strong) !important;
  background: #fff !important;
  color: var(--text) !important;
}

/* Template 1: griglia standard. */
body.store-page.template-classic-minimal .store-order-layout {
  gap: 22px;
}

/* Template 2: catalogo editoriale, con prodotti compatti in elenco su desktop. */
@media (min-width: 820px) {
  body.store-page.template-modern-color .products {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  body.store-page.template-modern-color .product-card {
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr);
    overflow: hidden;
  }

  body.store-page.template-modern-color .product-card .product-media img {
    width: 100%;
    height: 100%;
    min-height: 144px;
    object-fit: cover;
  }

  body.store-page.template-modern-color .product-card-body {
    padding: 14px;
  }
}

/* Template 3: catalogo essenziale a righe, nessuna colorazione predefinita. */
body.store-page.template-elegant-dark .products {
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid var(--border);
}

body.store-page.template-elegant-dark .product-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
}

body.store-page.template-elegant-dark .product-card .product-media {
  align-self: center;
  padding: 10px 0;
  background: transparent;
}

body.store-page.template-elegant-dark .product-card .product-media img {
  width: 78px;
  height: 78px;
  border: 1px solid var(--border);
  border-radius: 14px;
}

body.store-page.template-elegant-dark .product-card-body {
  padding: 14px 0 14px 4px;
}

/* Template Food immersivo: foto ampia, testo sempre leggibile, colori CTA dell'attività. */
body.store-page.template-food-premium .store-hero {
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 24%, #1d1511), color-mix(in srgb, var(--secondary) 28%, #29140e)) !important;
  border-color: color-mix(in srgb, var(--primary) 26%, var(--border)) !important;
}

body.store-page.template-food-premium .store-hero-copy h1,
body.store-page.template-food-premium .store-hero-copy .muted {
  color: #fff !important;
}

body.store-page.template-food-premium .store-hero-copy .kicker {
  border-color: color-mix(in srgb, var(--primary) 46%, rgba(255,255,255,.32)) !important;
  background: color-mix(in srgb, var(--primary) 24%, rgba(0,0,0,.12)) !important;
  color: #fff !important;
}

body.store-page.template-food-premium .store-hero-copy .kicker::before {
  background: var(--primary) !important;
}

/* Template Food vetrina: stessa struttura approvata, ma palette sempre personalizzata. */
body.store-page.template-food-showcase {
  --food-showcase-ink: var(--text);
  --food-showcase-paper: var(--bg-soft);
  --food-showcase-surface: var(--panel);
  --food-showcase-border: color-mix(in srgb, var(--primary) 18%, var(--border));
  --food-showcase-accent: var(--primary);
  --food-showcase-accent-dark: var(--primary-dark);
  --food-showcase-shadow: var(--shadow-md);
}

body.store-page.template-food-showcase .store-hero {
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 24%, #1d1511), color-mix(in srgb, var(--secondary) 28%, #29140e)) !important;
  border-color: color-mix(in srgb, var(--primary) 30%, var(--border)) !important;
}

body.store-page.template-food-showcase .store-hero::after {
  background: linear-gradient(90deg, rgba(20, 12, 9, .89) 0%, rgba(20, 12, 9, .67) 44%, rgba(20, 12, 9, .16) 78%), linear-gradient(0deg, rgba(0, 0, 0, .34), transparent 44%) !important;
}

body.store-page.template-food-showcase .store-hero-copy h1,
body.store-page.template-food-showcase .store-hero-copy .muted {
  color: #fff !important;
}

body.store-page.template-food-showcase .store-hero-copy .kicker,
body.store-page.template-food-showcase .store-service-badge {
  border-color: color-mix(in srgb, var(--primary) 38%, rgba(255,255,255,.22)) !important;
  background: color-mix(in srgb, var(--primary) 18%, rgba(0,0,0,.18)) !important;
  color: #fff !important;
}

body.store-page.template-food-showcase .store-hero-copy .kicker::before {
  background: var(--primary) !important;
}

body.store-page.template-food-showcase .category-filter-scroll,
body.store-page.template-food-showcase .product-card,
body.store-page.template-food-showcase .daily-offer-card,
body.store-page.template-food-showcase .cart,
body.store-page.template-food-showcase .store-map-section-bottom {
  border-color: color-mix(in srgb, var(--primary) 18%, var(--border)) !important;
  background: var(--panel) !important;
  box-shadow: var(--shadow-md) !important;
}

body.store-page.template-food-showcase .category-filter-scroll .btn:not(.ghost),
body.store-page.template-food-showcase .cart .btn:not(.ghost) {
  background: linear-gradient(135deg, var(--primary), var(--secondary)) !important;
}

body.store-page.template-food-showcase .cart .btn.ghost {
  color: var(--primary) !important;
  border-color: color-mix(in srgb, var(--primary) 24%, var(--border)) !important;
}

@media (max-width: 760px) {
  .template-dialog .template-choice-grid,
  .builder-template-picker .template-choice-grid {
    grid-template-columns: 1fr;
  }

  .template-choice-card {
    min-height: 0;
  }
}


/* =========================================================
   MIAPP v54 - PWA MULTI-NEGOZIO
========================================================= */

.pwa-install-area {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.pwa-install-button {
  min-width: 164px;
}

.pwa-install-status {
  margin: 0;
  max-width: 420px;
  font-size: 13px;
  line-height: 1.45;
}

.pwa-install-guide {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: grid;
  place-items: center;
  padding: 22px;
}

.pwa-install-guide-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 24, 40, .58);
  backdrop-filter: blur(3px);
}

.pwa-install-guide-card {
  position: relative;
  width: min(100%, 470px);
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 24px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 28px 72px rgba(16, 24, 40, .28);
}

.pwa-install-guide-card h2 {
  margin: 10px 38px 12px 0;
}

.pwa-install-guide-text {
  color: var(--text-soft);
}

.pwa-install-guide-text ol {
  margin: 0;
  padding-left: 22px;
}

.pwa-install-guide-text li + li {
  margin-top: 10px;
}

.pwa-install-guide-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #fff;
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.pwa-install-guide-close:hover {
  border-color: var(--primary);
  color: var(--primary);
}

@media (max-width: 680px) {
  .pwa-install-area {
    align-items: stretch;
  }

  .pwa-install-button {
    width: 100%;
  }

  .pwa-install-status {
    max-width: none;
  }

  .pwa-install-guide {
    align-items: end;
    padding: 0;
  }

  .pwa-install-guide-card {
    width: 100%;
    border-radius: 24px 24px 0 0;
    padding: 24px 20px 30px;
  }
}

/* =========================================================
   MIAPP v69 - Template store distinti e preview piu leggibili
========================================================= */

body.store-page.template-classic-minimal,
body.store-page.template-modern-color,
body.store-page.template-elegant-dark,
body.store-page.template-food-premium,
body.store-page.template-food-showcase {
  --template-ink: var(--text);
  --template-muted: var(--muted);
  --template-border: color-mix(in srgb, var(--primary) 14%, var(--border));
  --template-surface: var(--panel);
  --template-soft: color-mix(in srgb, var(--primary) 7%, #ffffff);
  --template-shadow: 0 16px 38px rgba(16, 24, 40, .08);
  background: var(--template-page-bg) !important;
  color: var(--template-ink) !important;
}

body.store-page.template-classic-minimal {
  --template-page-bg: linear-gradient(180deg, #f8fbff 0%, #eef6f3 44%, #fbfcff 100%);
  --template-surface: rgba(255, 255, 255, .96);
  --template-soft: color-mix(in srgb, var(--primary) 8%, #eef8f4);
  --template-border: color-mix(in srgb, var(--primary) 14%, #dbe7e2);
  --template-shadow: 0 14px 34px rgba(24, 64, 72, .08);
}

body.store-page.template-modern-color {
  --template-page-bg: linear-gradient(180deg, #ffffff 0%, color-mix(in srgb, var(--secondary) 8%, #f5f7fb) 42%, #f7f8fc 100%);
  --template-surface: rgba(255, 255, 255, .97);
  --template-soft: color-mix(in srgb, var(--secondary) 10%, #ffffff);
  --template-border: color-mix(in srgb, var(--secondary) 18%, var(--border));
  --template-shadow: 0 18px 42px rgba(28, 42, 78, .10);
}

body.store-page.template-elegant-dark {
  --template-page-bg: linear-gradient(180deg, #10131d 0%, #171b28 45%, #f4f1eb 45%, #fbfaf6 100%);
  --template-ink: #151923;
  --template-muted: #667085;
  --template-surface: #fffdfa;
  --template-soft: #f3efe7;
  --template-border: #ded6c8;
  --template-shadow: 0 18px 44px rgba(16, 19, 29, .12);
}

body.store-page.template-food-premium {
  --template-page-bg: linear-gradient(180deg, #fff7ed 0%, color-mix(in srgb, var(--primary) 10%, #f8ead8) 52%, #fffaf4 100%);
  --template-surface: rgba(255, 252, 247, .97);
  --template-soft: color-mix(in srgb, var(--primary) 10%, #fff4e6);
  --template-border: color-mix(in srgb, var(--primary) 22%, #ead9c4);
  --template-shadow: 0 18px 40px rgba(90, 45, 20, .13);
}

body.store-page.template-food-showcase {
  --template-page-bg: linear-gradient(180deg, #1f120d 0%, #332016 270px, #f8efe6 270px, #fffaf4 100%);
  --template-surface: rgba(255, 253, 249, .98);
  --template-soft: #fff4e6;
  --template-border: color-mix(in srgb, var(--primary) 24%, #e6d5c6);
  --template-shadow: 0 20px 46px rgba(69, 33, 18, .14);
}

body.store-page.template-classic-minimal .topbar,
body.store-page.template-modern-color .topbar,
body.store-page.template-elegant-dark .topbar,
body.store-page.template-food-premium .topbar,
body.store-page.template-food-showcase .topbar {
  background: color-mix(in srgb, var(--template-surface) 92%, transparent) !important;
  border-bottom-color: var(--template-border) !important;
}

body.store-page.template-classic-minimal .store-brand-banner,
body.store-page.template-modern-color .store-brand-banner,
body.store-page.template-elegant-dark .store-brand-banner,
body.store-page.template-food-premium .store-brand-banner,
body.store-page.template-food-showcase .store-brand-banner,
body.store-page.template-classic-minimal .product-card,
body.store-page.template-modern-color .product-card,
body.store-page.template-elegant-dark .product-card,
body.store-page.template-food-premium .product-card,
body.store-page.template-food-showcase .product-card,
body.store-page.template-classic-minimal .daily-offer-card,
body.store-page.template-modern-color .daily-offer-card,
body.store-page.template-elegant-dark .daily-offer-card,
body.store-page.template-food-premium .daily-offer-card,
body.store-page.template-food-showcase .daily-offer-card,
body.store-page.template-classic-minimal .cart,
body.store-page.template-modern-color .cart,
body.store-page.template-elegant-dark .cart,
body.store-page.template-food-premium .cart,
body.store-page.template-food-showcase .cart,
body.store-page.template-classic-minimal .store-map-section-bottom,
body.store-page.template-modern-color .store-map-section-bottom,
body.store-page.template-elegant-dark .store-map-section-bottom,
body.store-page.template-food-premium .store-map-section-bottom,
body.store-page.template-food-showcase .store-map-section-bottom {
  border-color: var(--template-border) !important;
  background: var(--template-surface) !important;
  box-shadow: var(--template-shadow) !important;
}

body.store-page.template-classic-minimal .btn,
body.store-page.template-modern-color .btn,
body.store-page.template-elegant-dark .btn,
body.store-page.template-food-premium .btn,
body.store-page.template-food-showcase .btn,
body.store-page.template-classic-minimal .product-add-button,
body.store-page.template-modern-color .product-add-button,
body.store-page.template-elegant-dark .product-add-button,
body.store-page.template-food-premium .product-add-button,
body.store-page.template-food-showcase .product-add-button,
body.store-page.template-food-showcase .store-menu-cta,
body.store-page.template-food-showcase .daily-offer-add-button {
  color: var(--primary-contrast, #fff) !important;
  background: linear-gradient(135deg, var(--primary), var(--secondary)) !important;
  box-shadow: 0 10px 22px color-mix(in srgb, var(--primary) 22%, transparent) !important;
}

body.store-page.template-classic-minimal .btn.ghost,
body.store-page.template-modern-color .btn.ghost,
body.store-page.template-elegant-dark .btn.ghost,
body.store-page.template-food-premium .btn.ghost,
body.store-page.template-food-showcase .btn.ghost,
body.store-page.template-classic-minimal .nav .pill,
body.store-page.template-modern-color .nav .pill,
body.store-page.template-elegant-dark .nav .pill,
body.store-page.template-food-premium .nav .pill,
body.store-page.template-food-showcase .nav .pill {
  color: var(--primary) !important;
  border-color: color-mix(in srgb, var(--primary) 24%, var(--template-border)) !important;
  background: color-mix(in srgb, var(--primary) 5%, #ffffff) !important;
  box-shadow: none !important;
}

body.store-page.template-classic-minimal .store-hero {
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, .95fr);
  gap: 30px;
  align-items: center;
}

body.store-page.template-classic-minimal .store-brand-banner {
  min-height: 312px;
  border-radius: 26px;
  background:
    radial-gradient(circle at 82% 18%, color-mix(in srgb, var(--secondary) 20%, transparent), transparent 27%),
    linear-gradient(135deg, #ffffff, var(--template-soft)) !important;
}

body.store-page.template-classic-minimal .store-hero-copy h1 {
  max-width: 13ch;
  font-size: clamp(36px, 4.3vw, 62px);
  line-height: 1;
}

body.store-page.template-classic-minimal .product-card {
  border-radius: 18px;
}

body.store-page.template-classic-minimal .category-filter-scroll .btn {
  border-radius: 999px;
}

body.store-page.template-modern-color .store-hero {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(300px, 1.08fr);
  gap: 28px;
  align-items: center;
  padding-top: 34px;
}

body.store-page.template-modern-color .store-hero-copy {
  order: 2;
  padding: 0;
}

body.store-page.template-modern-color .store-brand-banner {
  order: 1;
  min-height: 340px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 12%, #ffffff), color-mix(in srgb, var(--secondary) 10%, #f3f6ff)) !important;
}

body.store-page.template-modern-color .store-hero-copy h1 {
  max-width: 15ch;
  font-size: clamp(36px, 4.2vw, 58px);
  line-height: 1.02;
}

body.store-page.template-modern-color .category-filter-scroll {
  justify-content: flex-start;
  padding: 8px;
  border: 1px solid var(--template-border);
  border-radius: 8px;
  background: var(--template-surface);
  box-shadow: var(--template-shadow);
}

body.store-page.template-modern-color .category-filter-scroll .btn,
body.store-page.template-modern-color .product-card,
body.store-page.template-modern-color .cart {
  border-radius: 8px;
}

@media (min-width: 820px) {
  body.store-page.template-modern-color .products {
    grid-template-columns: 1fr;
  }

  body.store-page.template-modern-color .product-card {
    grid-template-columns: 148px minmax(0, 1fr);
  }
}

body.store-page.template-elegant-dark .topbar {
  background: rgba(17, 20, 30, .92) !important;
  border-bottom-color: rgba(255, 255, 255, .10) !important;
}

body.store-page.template-elegant-dark .topbar .logo,
body.store-page.template-elegant-dark .topbar .pill {
  color: #fff7eb !important;
}

body.store-page.template-elegant-dark .topbar .pill {
  border-color: rgba(255, 255, 255, .16) !important;
  background: rgba(255, 255, 255, .08) !important;
}

body.store-page.template-elegant-dark .store-hero {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  padding: 34px 0 38px;
  border-bottom: 0;
}

body.store-page.template-elegant-dark .store-hero-copy h1,
body.store-page.template-elegant-dark .store-hero-copy .muted,
body.store-page.template-elegant-dark .store-hero-copy .kicker {
  color: #fff7eb !important;
}

body.store-page.template-elegant-dark .store-hero-copy .kicker {
  border-color: rgba(255, 247, 235, .22);
  background: rgba(255, 255, 255, .08);
}

body.store-page.template-elegant-dark .store-brand-banner {
  width: 132px;
  min-height: 132px;
  border-radius: 50%;
  background: #fffdfa !important;
}

body.store-page.template-elegant-dark .store-logo-frame {
  width: 98px;
  border-radius: 50%;
}

body.store-page.template-elegant-dark .store-logo {
  border-radius: 50%;
}

body.store-page.template-elegant-dark .category-filter-scroll {
  border-bottom: 1px solid var(--template-border);
}

body.store-page.template-elegant-dark .product-card {
  grid-template-columns: 92px minmax(0, 1fr);
  border-bottom-color: var(--template-border);
}

body.store-page.template-elegant-dark .product-card .product-media img {
  width: 74px;
  height: 74px;
  border-radius: 50%;
}

body.store-page.template-food-premium .store-hero,
body.store-page.template-food-showcase .store-hero {
  color: #fff !important;
  background:
    linear-gradient(90deg, rgba(16, 10, 7, .88), rgba(16, 10, 7, .48)),
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 36%, #1d120c), color-mix(in srgb, var(--secondary) 34%, #2b160e)) !important;
}

body.store-page.template-food-premium .store-hero-copy h1,
body.store-page.template-food-premium .store-hero-copy .muted,
body.store-page.template-food-showcase .store-hero-copy h1,
body.store-page.template-food-showcase .store-hero-copy .muted {
  color: #fffaf4 !important;
}

body.store-page.template-food-premium .category-filter-scroll,
body.store-page.template-food-showcase .category-filter-scroll {
  border: 1px solid var(--template-border);
  background: var(--template-surface) !important;
  box-shadow: var(--template-shadow);
}

body.store-page.template-food-premium .product-card,
body.store-page.template-food-premium .daily-offer-card {
  border-radius: 16px;
}

body.store-page.template-food-premium .daily-offer-card {
  background:
    linear-gradient(135deg, var(--template-surface), color-mix(in srgb, var(--primary) 9%, #fff1dc)) !important;
}

body.store-page.template-food-showcase .store-hero {
  min-height: 372px;
  border-radius: 22px;
}

body.store-page.template-food-showcase .store-order-layout {
  gap: 24px;
}

body.store-page.template-food-showcase .product-card {
  border-radius: 10px;
}

body.store-page.template-food-showcase .category-filter-scroll {
  border-radius: 10px;
}

body.store-page.template-food-showcase .food-showcase-side-column {
  gap: 18px;
}

/* La scelta dello sfondo deve restare stabile: l'hover non deve mai
   ricalcolare il numero di card per riga. */
.template-choice-card {
  box-sizing: border-box;
}

.template-choice-card:hover {
  transform: none;
}

@media (max-width: 900px) {
  .template-dialog .template-choice-grid,
  .builder-template-picker .template-choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .template-dialog .template-choice-grid,
  .builder-template-picker .template-choice-grid {
    grid-template-columns: 1fr;
  }
}

/* La testata grande dello Store è stata rimossa su desktop e mobile. */
body.store-page #store-info.store-hero {
  display: none !important;
}

/* =========================================================
   Slider di testata separato dal logo attività
   L'immagine riempie la fascia; il logo resta un elemento autonomo.
========================================================= */
.merchant-shop-header {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.merchant-header-slider {
  position: absolute;
  z-index: -2;
  inset: 0;
}

.merchant-header-slider img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.merchant-shop-header.has-header-slider {
  min-height: 220px;
  padding: 30px 34px;
  border-color: color-mix(in srgb, var(--primary) 30%, transparent);
  background: #172117;
  box-shadow: 0 18px 42px rgba(16, 25, 16, .18);
}

.merchant-shop-header.has-header-slider::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 16, 10, .82) 0%, rgba(10, 16, 10, .58) 55%, rgba(10, 16, 10, .30) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, .08), rgba(0, 0, 0, .34));
}

.merchant-shop-header.has-header-slider .merchant-shop-title,
.merchant-shop-header.has-header-slider .merchant-shop-logo-card {
  position: relative;
  z-index: 1;
}

.merchant-shop-header.has-header-slider .merchant-shop-title h1,
.merchant-shop-header.has-header-slider .merchant-shop-title .muted {
  color: #fff !important;
  text-shadow: 0 2px 16px rgba(0, 0, 0, .26);
}

.merchant-shop-header.has-header-slider .merchant-shop-title .kicker {
  border-color: rgba(255, 255, 255, .38);
  background: rgba(255, 255, 255, .91);
  color: var(--primary-dark);
  backdrop-filter: blur(8px);
}

.merchant-shop-header.has-header-slider .merchant-shop-logo-card {
  flex: 0 0 auto;
  border-color: rgba(255, 255, 255, .74);
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 16px 34px rgba(0, 0, 0, .22);
}

body.store-page.store-has-header-slider #store-info.store-hero,
body.store-page.store-has-header-slider.template-food-premium #store-info.store-hero {
  position: relative;
  isolation: isolate;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 220px) !important;
  grid-template-areas: "copy logo";
  align-items: center;
  gap: 34px;
  min-height: 330px;
  margin: 24px 32px 0;
  padding: 42px 44px;
  overflow: hidden;
  border-radius: 26px;
  background: #142014 !important;
  box-shadow: 0 18px 42px rgba(18, 28, 18, .20);
}

body.store-page.store-has-header-slider #store-info.store-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(13, 15, 11, .88) 0%, rgba(13, 15, 11, .66) 54%, rgba(13, 15, 11, .35) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, .06), rgba(0, 0, 0, .30));
  pointer-events: none;
}

body.store-page.store-has-header-slider .store-header-slider {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: inherit;
  background: transparent;
  box-shadow: none;
}

body.store-page.store-has-header-slider .store-header-slider img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  border-radius: 0;
}

body.store-page.store-has-header-slider #store-info.store-hero .store-hero-copy {
  grid-area: copy;
  position: relative;
  z-index: 2;
  max-width: 720px;
}

body.store-page.store-has-header-slider #store-info.store-hero .store-brand-banner {
  grid-area: logo;
  position: relative;
  z-index: 2;
  inset: auto;
  width: min(100%, 190px);
  height: auto;
  min-height: 0;
  aspect-ratio: 1;
  justify-self: end;
  padding: 12px;
  overflow: hidden;
  border: 5px solid rgba(255, 255, 255, .86);
  border-radius: 50%;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 16px 36px rgba(0, 0, 0, .24);
}

body.store-page.store-has-header-slider #store-info.store-hero .store-brand-banner::before,
body.store-page.store-has-header-slider #store-info.store-hero .store-brand-banner::after,
body.store-page.store-has-header-slider #store-info.store-hero .store-logo-backdrop {
  display: none;
}

body.store-page.store-has-header-slider #store-info.store-hero .store-logo-frame {
  position: relative;
  inset: auto;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: inherit;
  background: transparent;
}

body.store-page.store-has-header-slider #store-info.store-hero .store-logo {
  width: 100%;
  height: 100%;
  max-width: 100%;
  display: block;
  padding: 0;
  object-fit: contain;
  object-position: center;
  border-radius: inherit;
}

@media (max-width: 760px) {
  .merchant-shop-header.has-header-slider {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 92px;
    align-items: center;
    gap: 16px;
    min-height: 210px;
    padding: 24px 20px;
  }

  .merchant-shop-header.has-header-slider .merchant-shop-logo-card {
    width: 92px;
    min-width: 92px;
    height: 92px;
    padding: 8px;
    border-radius: 22px;
  }

  .merchant-shop-header.has-header-slider .merchant-shop-logo {
    width: 74px;
    height: 74px;
    border-radius: 16px;
  }

  body.store-page.store-has-header-slider #store-info.store-hero,
  body.store-page.store-has-header-slider.template-food-premium #store-info.store-hero {
    grid-template-columns: minmax(0, 1fr) 108px !important;
    gap: 16px;
    min-height: 250px;
    margin: 14px 14px 0;
    padding: 26px 22px;
    border-radius: 21px;
  }

  body.store-page.store-has-header-slider #store-info.store-hero .store-brand-banner {
    width: 104px;
    padding: 7px;
    border-width: 3px;
  }
}

@media (max-width: 440px) {
  .merchant-shop-header.has-header-slider {
    grid-template-columns: minmax(0, 1fr) 76px;
    min-height: 190px;
    padding: 20px 16px;
  }

  .merchant-shop-header.has-header-slider .merchant-shop-title h1 {
    font-size: 27px;
  }

  .merchant-shop-header.has-header-slider .merchant-shop-logo-card {
    width: 76px;
    min-width: 76px;
    height: 76px;
    padding: 6px;
    border-radius: 18px;
  }

  .merchant-shop-header.has-header-slider .merchant-shop-logo {
    width: 62px;
    height: 62px;
    border-radius: 13px;
  }

  body.store-page.store-has-header-slider #store-info.store-hero,
  body.store-page.store-has-header-slider.template-food-premium #store-info.store-hero {
    grid-template-columns: minmax(0, 1fr) 82px !important;
    gap: 10px;
    min-height: 222px;
    padding: 22px 17px;
  }

  body.store-page.store-has-header-slider #store-info.store-hero h1 {
    font-size: clamp(31px, 10vw, 42px) !important;
  }

  body.store-page.store-has-header-slider #store-info.store-hero .store-brand-banner {
    width: 80px;
    padding: 5px;
  }
}

/* Immagine di testata facoltativa: una sola fascia elegante, condivisa da
   Store e pannello Merchant, senza riattivare i vecchi sfondi di pagina. */
body.store-page.store-has-header-slider #store-info.store-hero {
  position: relative;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 290px);
  align-items: center;
  gap: 30px;
  min-height: 300px;
  margin: 24px 32px 0;
  padding: 38px 42px;
  overflow: hidden;
  border: 0;
  border-radius: 26px;
  background:
    radial-gradient(circle at 100% 0, color-mix(in srgb, var(--secondary) 42%, transparent), transparent 40%),
    linear-gradient(118deg, color-mix(in srgb, var(--primary) 82%, #15120f), color-mix(in srgb, var(--primary) 46%, #10160d));
  box-shadow: 0 18px 42px color-mix(in srgb, var(--primary) 24%, transparent);
}

body.store-page.store-has-header-slider #store-info.store-hero .store-hero-copy {
  position: relative;
  z-index: 2;
  min-width: 0;
}

body.store-page.store-has-header-slider #store-info.store-hero .kicker,
body.store-page.store-has-header-slider #store-info.store-hero h1,
body.store-page.store-has-header-slider #store-info.store-hero .muted,
body.store-page.store-has-header-slider #store-info.store-hero .pwa-install-status {
  color: #fffaf4 !important;
}

body.store-page.store-has-header-slider #store-info.store-hero h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 5vw, 66px) !important;
  line-height: .94;
}

body.store-page.store-has-header-slider .store-header-slider {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: min(100%, 230px);
  aspect-ratio: 1;
  justify-self: end;
  padding: 10px;
  overflow: hidden;
  border: 5px solid rgba(255, 250, 244, .9);
  border-radius: 50%;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 15px 32px rgba(0, 0, 0, .22);
}

body.store-page.store-has-header-slider .store-header-slider img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
  border-radius: inherit;
}

.merchant-shop-logo-card:has(.merchant-shop-logo[src*="store-backgrounds"]) {
  border-color: color-mix(in srgb, var(--primary) 23%, var(--border));
  background: linear-gradient(145deg, #fff, var(--primary-soft));
}

@media (max-width: 900px) {
  body.store-page.store-has-header-slider #store-info.store-hero {
    grid-template-columns: minmax(0, 1fr) 154px;
    min-height: 252px;
    margin: 14px 14px 0;
    padding: 28px 24px;
    gap: 18px;
    border-radius: 21px;
  }

  body.store-page.store-has-header-slider .store-header-slider {
    width: 142px;
    padding: 7px;
    border-width: 4px;
  }
}

@media (max-width: 560px) {
  body.store-page.store-has-header-slider #store-info.store-hero {
    grid-template-columns: minmax(0, 1fr) 104px;
    min-height: 212px;
    padding: 23px 18px;
    gap: 12px;
  }

  body.store-page.store-has-header-slider #store-info.store-hero h1 {
    font-size: clamp(32px, 10vw, 44px) !important;
  }

  body.store-page.store-has-header-slider .store-header-slider {
    width: 96px;
    padding: 5px;
    border-width: 3px;
  }
}

/* Logo MIApp nella navigazione piattaforma. */
.logo.logo-image {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 146px;
  min-width: 146px;
  height: 48px;
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
  background: transparent;
}

.miapp-brand-logo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.logo.logo-image::before {
  display: none;
}

.merchant-dashboard-qr {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  align-items: center;
  gap: 10px 18px;
  margin-top: 14px;
  text-align: left;
}

.merchant-dashboard-qr h3,
.merchant-dashboard-qr .actions {
  grid-column: 1 / -1;
  width: 100%;
}

.merchant-dashboard-qr .qr {
  grid-column: 1;
  grid-row: 2;
  width: 126px;
  height: 126px;
  margin: 0;
}

.merchant-dashboard-qr p {
  grid-column: 2;
  grid-row: 2;
  margin: 0;
}

/* Scheda dettaglio prodotto: la card resta essenziale, il contenuto completo
   è disponibile con un tocco o un clic. */
.product-preview-dialog {
  position: fixed;
  z-index: 220;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
}

.product-preview-dialog.hidden {
  display: none;
}

.product-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 17, 12, .58);
  backdrop-filter: blur(5px);
}

.product-preview-card {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  display: grid;
  grid-template-columns: minmax(230px, .9fr) minmax(0, 1.1fr);
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--primary) 18%, #e9e7e1);
  border-radius: 24px;
  background: #fffdf9;
  box-shadow: 0 26px 70px rgba(0, 0, 0, .3);
}

.product-preview-close {
  position: absolute;
  z-index: 2;
  top: 13px;
  right: 13px;
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: #252a23;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .14);
  font-size: 25px;
  line-height: 1;
}

.product-preview-media {
  min-height: 330px;
  display: grid;
  place-items: center;
  padding: 18px;
  background: #f5eee4;
}

.product-preview-media img {
  width: 100%;
  height: 100%;
  max-height: 330px;
  display: block;
  object-fit: contain;
  object-position: center;
  border-radius: 17px;
}

.product-preview-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 42px 30px 26px;
}

.product-preview-category {
  color: var(--primary);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.product-preview-copy h2 {
  margin: 10px 0 12px;
  color: #1d211b;
  font-size: clamp(26px, 3.4vw, 38px);
  line-height: 1.02;
}

.product-preview-copy > p {
  margin: 0;
  line-height: 1.65;
}

.product-preview-ingredients {
  margin-top: 16px !important;
  padding: 12px 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--primary) 8%, #fff);
  color: #454a42;
  font-size: 13px;
}

.product-preview-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: auto;
  padding-top: 25px;
}

.product-preview-footer strong {
  color: #171b15;
  font-size: 23px;
}

body.product-preview-dialog-open {
  overflow: hidden;
}

@media (max-width: 620px) {
  .logo.logo-image {
    width: 116px;
    min-width: 116px;
    height: 42px;
    border-radius: 12px;
  }

  .merchant-dashboard-qr {
    grid-template-columns: 98px minmax(0, 1fr);
  }

  .merchant-dashboard-qr .qr {
    width: 98px;
    height: 98px;
  }

  .product-preview-dialog {
    align-items: end;
    padding: 0;
  }

  .product-preview-card {
    width: 100%;
    max-height: min(90vh, 760px);
    grid-template-columns: 1fr;
    overflow: auto;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 24px 24px 0 0;
  }

  .product-preview-media {
    min-height: 220px;
    padding: 13px;
  }

  .product-preview-media img {
    max-height: 260px;
  }

  .product-preview-copy {
    padding: 24px 20px calc(22px + env(safe-area-inset-bottom));
  }

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

  .product-preview-footer .btn {
    width: 100%;
  }
}

.template-dialog .template-choice-grid,
.builder-template-picker .template-choice-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.template-choice-card {
  border-radius: 8px;
  padding: 13px;
  background: #fff;
}

.template-choice-card:hover {
  transform: translateY(-2px);
}

.template-choice-copy strong {
  display: block;
  line-height: 1.12;
}

.template-choice-copy small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.35;
}

.template-choice-preview {
  min-height: 132px;
  border-radius: 8px;
}

.template-preview-classic {
  background:
    radial-gradient(circle at 82% 20%, rgba(78, 156, 130, .24), transparent 27%),
    linear-gradient(145deg, #fbfffd, #eaf5f0);
}

.template-preview-modern {
  background:
    linear-gradient(90deg, rgba(34, 49, 88, .12), transparent 44%),
    linear-gradient(145deg, #ffffff, #edf3ff);
}

.template-preview-dark {
  background:
    linear-gradient(180deg, #11141e 0 46%, #f4efe6 46% 100%);
}

.template-preview-food {
  background:
    linear-gradient(90deg, rgba(31, 15, 9, .86), rgba(74, 32, 16, .38)),
    linear-gradient(145deg, #2b150d, #d85a27);
}

.template-preview-food-showcase {
  background:
    linear-gradient(180deg, #28150e 0 54%, #fff1df 54% 100%);
}

.template-preview-dark .template-preview-bar,
.template-preview-food .template-preview-bar,
.template-preview-food-showcase .template-preview-bar {
  background: rgba(255, 255, 255, .88);
}

.template-preview-classic .template-preview-bar {
  background: #287766;
}

.template-preview-modern .template-preview-bar {
  background: #3454d1;
}

.template-preview-classic .template-preview-hero,
.template-preview-modern .template-preview-hero,
.template-preview-food-showcase .template-preview-hero {
  background: rgba(255, 255, 255, .78);
}

.template-preview-dark .template-preview-hero {
  background: rgba(255, 247, 235, .84);
}

.template-preview-food .template-preview-hero {
  background: rgba(255, 235, 205, .32);
}

.template-preview-cards i {
  background: rgba(255, 255, 255, .88);
  border: 1px solid rgba(16, 24, 40, .10);
}

@media (max-width: 899px) {
  body.store-page.template-classic-minimal .store-hero,
  body.store-page.template-modern-color .store-hero,
  body.store-page.template-elegant-dark .store-hero {
    grid-template-columns: 1fr;
  }

  body.store-page.template-modern-color .store-hero-copy,
  body.store-page.template-modern-color .store-brand-banner {
    order: initial;
  }

  body.store-page.template-elegant-dark .store-brand-banner {
    width: 100%;
    min-height: 126px;
    border-radius: 18px;
  }
}

@media (max-width: 680px) {
  body.store-page.template-classic-minimal .store-brand-banner,
  body.store-page.template-modern-color .store-brand-banner {
    min-height: 220px;
  }

  body.store-page.template-modern-color .product-card {
    grid-template-columns: 106px minmax(0, 1fr);
  }

  body.store-page.template-elegant-dark .store-hero {
    padding-top: 26px;
  }

  body.store-page.template-food-showcase .store-hero {
    min-height: 340px;
    padding: 24px 20px;
  }

  .template-choice-preview {
    min-height: 104px;
  }
}

/* =========================================================
   Store catalog demo — desktop + mobile
========================================================= */
body.store-page {
  /* I token del catalogo seguono sempre la palette configurata dal merchant.
     I fallback mantengono il tema classico anche prima del caricamento dati. */
  --store-green: var(--primary, #173f12);
  --store-green-dark: var(--primary-dark, #0e2f0b);
  --store-red: var(--secondary, #ef2f32);
  --store-ink: #171914;
  --store-muted: #70746d;
  --store-line: #ecece7;
  --store-soft: #f7f4ef;
  background: #fbfaf8;
  color: var(--store-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Le due anteprime usano una tipografia distinta senza dipendere da font esterni. */
body.store-page.template-classic-minimal {
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
}

body.store-page.template-classic-minimal .store-nav-brand-copy strong,
body.store-page.template-classic-minimal .store-hero-copy h1 {
  font-family: Georgia, "Times New Roman", serif;
}

body.store-page.template-food-premium {
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
}

body.store-page.template-food-premium .store-nav-brand-copy strong,
body.store-page.template-food-premium .section-title,
body.store-page.template-food-premium .store-hero-copy h1 {
  font-family: Georgia, "Times New Roman", serif;
}

body.store-page .store-future-feature { display: none !important; }

/* =========================================================
   Accesso commerciante e recupero password
========================================================= */
.merchant-page #auth-area:has(.merchant-login-box),
.password-reset-shell {
  display: grid;
  min-height: calc(100vh - 88px);
  place-items: center;
  padding: 42px 20px 64px;
  background:
    radial-gradient(circle at 12% 8%, color-mix(in srgb, var(--primary) 16%, transparent), transparent 30%),
    radial-gradient(circle at 88% 90%, color-mix(in srgb, var(--secondary) 14%, transparent), transparent 28%),
    #f8f8f5;
}

.merchant-login-box,
.password-reset-card {
  width: min(100%, 480px);
  margin: 0;
  padding: clamp(26px, 5vw, 44px) !important;
  border: 1px solid color-mix(in srgb, var(--primary) 16%, #e4e5df);
  border-radius: 28px !important;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 24px 60px rgba(26, 39, 28, .12);
}

.merchant-login-intro {
  margin-bottom: 26px;
}

.merchant-login-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
  font-weight: 800;
  box-shadow: 0 10px 22px var(--primary-ghost);
}

.merchant-login-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  border-radius: inherit;
}

.merchant-login-box h1,
.password-reset-card h1 {
  margin: 7px 0 9px;
  color: #172017;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(29px, 5vw, 38px);
  line-height: 1.03;
}

.merchant-login-box form,
.password-reset-card form {
  display: grid;
  gap: 9px;
}

.merchant-login-box input,
.password-reset-card input {
  min-height: 51px;
  border-color: #dde2db;
  border-radius: 13px;
  background: #fff;
}

.merchant-login-box input:focus,
.password-reset-card input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-ghost);
}

.auth-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 8px;
}

.auth-text-link,
.merchant-registration-link a {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}

.auth-text-link:hover,
.merchant-registration-link a:hover {
  color: var(--secondary);
  text-decoration: underline;
}

.auth-password-field {
  position: relative;
}

.auth-password-field input {
  width: 100%;
  padding-right: 54px;
}

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 9px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--primary);
  font-size: 17px;
  transform: translateY(-50%);
}

.auth-password-toggle:hover,
.auth-password-toggle:focus-visible {
  background: var(--primary-soft);
  outline: none;
}

.merchant-login-submit {
  width: 100%;
  min-height: 52px;
  margin-top: 17px;
  border-radius: 13px;
  font-size: 15px;
}

.merchant-registration-link {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.password-reset-card > .merchant-login-mark {
  margin-bottom: 14px;
}

@media (max-width: 560px) {
  .merchant-page #auth-area:has(.merchant-login-box),
  .password-reset-shell {
    min-height: calc(100vh - 70px);
    padding: 24px 14px 42px;
  }

  .merchant-login-box,
  .password-reset-card {
    border-radius: 22px !important;
  }
}

body.store-page .wrap { width: min(calc(100% - 48px), 1440px); max-width: 1440px; }
body.store-page .store-demo-header { position: sticky; top: 0; z-index: 80; border: 0; border-bottom: 1px solid #f1f0ec; background: rgba(255,255,255,.96); backdrop-filter: blur(16px); box-shadow: none; }
body.store-page .store-demo-header-inner { min-height: 104px; display: grid; grid-template-columns: minmax(220px, 1fr) auto minmax(320px, 1fr); align-items: center; gap: 30px; }
body.store-page .store-nav-brand { display: inline-flex; align-items: center; gap: 12px; width: fit-content; color: var(--store-ink); text-decoration: none; }
body.store-page .store-nav-logo-shell { width: 48px; height: 48px; display: grid; place-items: center; flex: 0 0 auto; overflow: hidden; border: 2px solid var(--store-green); border-left-color: var(--store-red); border-right-color: var(--store-red); border-radius: 50%; background: #fff; color: var(--store-green); font-weight: 900; }
body.store-page .store-nav-logo { width: 100%; height: 100%; object-fit: contain; }
body.store-page .store-nav-brand-copy { display: grid; line-height: 1; gap: 6px; }
body.store-page .store-nav-brand-copy strong { font-family: Georgia, "Times New Roman", serif; font-size: 24px; letter-spacing: -.02em; }
body.store-page .store-nav-brand-copy small { font-size: 9px; letter-spacing: .22em; font-weight: 800; color: #5e625a; }
body.store-page .store-demo-nav { display: flex; gap: 32px; align-items: center; }
body.store-page .store-demo-nav-link { position: relative; padding: 39px 0 35px; color: #191b17; text-decoration: none; font-size: 14px; font-weight: 650; }
body.store-page .store-demo-nav-link:first-child { color: var(--store-red); }
body.store-page .store-demo-nav-link:first-child::after { content: ""; position: absolute; left: 50%; bottom: 25px; width: 22px; height: 3px; border-radius: 5px; background: var(--store-red); transform: translateX(-50%); }
body.store-page .store-header-actions { justify-self: end; display: flex; align-items: center; gap: 14px; }
body.store-page .store-language-picker { display: block; }
body.store-page .store-language-picker select { min-height: 34px; padding: 0 26px 0 10px; border: 1px solid #e9e8e3; border-radius: 999px; background: #fff; color: #31352e; font-size: 11px; font-weight: 800; letter-spacing: .08em; box-shadow: 0 4px 14px rgba(27,35,25,.04); }
body.store-page .store-language-reset { min-width: 32px; min-height: 32px; margin-left: -10px; padding: 0 7px; border: 1px solid #e9e8e3; border-radius: 999px; background: #fff; color: var(--store-red); font-size: 10px; font-weight: 900; letter-spacing: .05em; box-shadow: 0 4px 14px rgba(27,35,25,.04); }
body.store-page .store-search { width: min(280px, 22vw); min-height: 48px; display: flex; align-items: center; gap: 9px; padding: 0 12px 0 16px; border: 1px solid #e9e8e3; border-radius: 999px; background: #fff; box-shadow: 0 4px 14px rgba(27,35,25,.04); }
body.store-page .store-search > span { color: #777d74; font-size: 23px; transform: rotate(-20deg); }
body.store-page .store-search input { min-width: 0; padding: 0; border: 0; background: transparent; box-shadow: none; font-size: 12px; }
body.store-page .store-search input:focus { outline: none; }
body.store-page .store-search-clear { width: 28px; min-width: 28px; height: 28px; min-height: 28px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: #edf1eb; color: var(--store-green); font-size: 20px; line-height: 1; }
body.store-page .store-search-clear.hidden { display: none; }
body.store-page .store-header-icon { position: relative; width: 38px; height: 38px; display: grid; place-items: center; color: #31352e; text-decoration: none; font-size: 25px; }
body.store-page .store-header-cart span { position: absolute; top: -2px; right: -2px; min-width: 19px; height: 19px; display: grid; place-items: center; padding: 0 5px; border: 2px solid #fff; border-radius: 999px; background: var(--store-red); color: #fff; font-size: 10px; font-weight: 900; }

body.store-page #store-info.store-hero { display: none !important; }
body.store-page .store-wrap { width: min(100%, 1440px); max-width: 1440px; padding: 0 0 28px; }
body.store-page .daily-offer-section { margin: 18px 32px 0; }
body.store-page .store-order-layout { display: grid !important; grid-template-columns: minmax(0, 1fr) 370px !important; gap: 0 !important; align-items: start; margin: 0 !important; }
body.store-page .store-products-column { min-width: 0; padding: 24px 32px 40px !important; }
body.store-page .category-filter-scroll { width: 100% !important; max-width: 100%; min-height: 58px !important; display: flex; flex-wrap: nowrap !important; gap: 12px !important; margin: 0 0 32px !important; padding: 0 0 2px !important; overflow-x: auto; border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; scrollbar-width: none; }
body.store-page .category-filter-scroll::-webkit-scrollbar { display: none; }
body.store-page .category-filter-scroll .btn { flex: 0 0 auto; min-height: 44px !important; display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px !important; border: 1px solid #eceae5 !important; border-radius: 999px !important; background: #fff !important; color: #34372f !important; box-shadow: 0 5px 16px rgba(32,39,29,.06) !important; font-size: 12px !important; font-weight: 750; }
body.store-page .category-filter-scroll .btn:not(.ghost) { border-color: var(--store-green) !important; background: var(--store-green) !important; color: #fff !important; }
body.store-page .category-filter-scroll .btn span { font-size: 16px; }
body.store-page .store-catalog-controls { min-height: 44px; display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
body.store-page .store-catalog-controls label { margin: 0; font-size: 13px; color: #4e524a; }
body.store-page .store-catalog-controls select { width: auto; min-height: 40px; padding: 8px 34px 8px 15px; border: 1px solid #e8e7e2; border-radius: 999px; background-color: #fff; box-shadow: 0 4px 12px rgba(32,39,29,.04); font-size: 13px; font-weight: 800; }
body.store-page .store-view-switch { margin-left: auto; display: flex; gap: 5px; }
body.store-page .store-view-switch button { width: 36px; min-width: 36px; height: 36px; min-height: 36px; display: grid; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 9px; background: transparent; color: #858a80; font-size: 20px; box-shadow: none; }
body.store-page .store-view-switch button.is-active { border-color: #f0dedb; background: #fff8f7; color: var(--store-red); }

body.store-page .products { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 18px !important; }
body.store-page .products.is-list-view { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
body.store-page .products.is-list-view .product-card { display: grid; grid-template-columns: 132px minmax(0, 1fr); }
body.store-page .products.is-list-view .product-media { min-height: 152px; margin: 8px 0 8px 8px; aspect-ratio: auto; height: auto; }
body.store-page .products.is-list-view .product-card-body { min-height: 0; }
body.store-page .product-card { min-width: 0; overflow: hidden; border: 1px solid var(--store-line) !important; border-radius: 16px !important; background: #fff !important; box-shadow: 0 5px 16px rgba(27,33,25,.06) !important; transition: transform .2s ease, box-shadow .2s ease; }
body.store-page .product-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(27,33,25,.11) !important; }
body.store-page .product-card .product-media { position: relative; align-self: stretch !important; width: calc(100% - 16px) !important; display: grid !important; place-items: center; margin: 8px 8px 0 !important; padding: 0 !important; overflow: hidden; aspect-ratio: 1 / .92; border: 0 !important; border-radius: 13px; background: #f8f2e8 !important; box-sizing: border-box; }
body.store-page .product-card .product-media img { width: 100% !important; max-width: 100% !important; height: 100% !important; display: block !important; margin: 0 !important; padding: 4px; border: 0 !important; border-radius: 0 !important; object-fit: contain !important; object-position: 50% 50% !important; transform: none !important; }
body.store-page .product-favorite { position: absolute; top: 9px; right: 10px; color: #fff; font-size: 24px; line-height: 1; text-shadow: 0 1px 5px rgba(0,0,0,.25); }
body.store-page .product-card-body { min-height: 152px; display: flex; flex-direction: column; padding: 17px 16px 15px !important; }
body.store-page .product-card h3 { margin: 0 0 10px; font-size: 15px !important; line-height: 1.2; color: var(--store-ink); }
body.store-page .product-card .desc { min-height: 38px !important; margin: 0 0 10px !important; color: var(--store-muted); font-size: 11px !important; line-height: 1.55 !important; }
body.store-page .product-ingredients-summary { display: none; }
body.store-page .product-card-footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; }
body.store-page .product-card .price { color: #161913 !important; font-size: 15px !important; font-weight: 900; }
body.store-page .product-add-button { width: 30px !important; min-width: 30px !important; height: 30px; min-height: 30px !important; display: grid; place-items: center; padding: 0 !important; border: 0 !important; border-radius: 50% !important; background: var(--store-green) !important; color: #fff !important; box-shadow: none !important; font-size: 22px !important; line-height: 1; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

body.store-page .store-side-column { min-width: 0; display: grid; gap: 22px; padding: 24px 24px 28px; border-left: 1px solid #efeee9; }
body.store-page .cart { position: sticky !important; top: 128px !important; padding: 0 !important; overflow: hidden; border: 1px solid var(--store-line) !important; border-radius: 16px !important; background: #fff !important; box-shadow: 0 5px 18px rgba(27,33,25,.06) !important; }
body.store-page .store-cart-heading { display: flex; justify-content: space-between; align-items: center; padding: 20px 20px 14px; }
body.store-page .store-cart-heading h2 { margin: 0; font-size: 15px !important; }
body.store-page .store-cart-heading span { color: #656a61; font-size: 12px; }
body.store-page #cart-items { padding: 0 20px; }
body.store-page #cart-items > .muted { padding: 22px 0; text-align: center; }
body.store-page .cart-row { display: grid; grid-template-columns: 54px minmax(0,1fr) auto; gap: 11px; align-items: start; padding: 12px 0 !important; border-bottom: 1px solid #f0efeb; }
body.store-page .cart-product-thumb { width: 54px; height: 54px; border-radius: 10px; object-fit: cover; background: var(--store-soft); }
body.store-page .cart-row-main { min-width: 0; display: grid; gap: 4px; }
body.store-page .cart-row-main > strong { font-size: 12px; }
body.store-page .cart-row-main > small { font-size: 10px; }
body.store-page .cart-quantity-controls { display: flex; align-items: center; gap: 3px; }
body.store-page .cart-quantity-controls .btn { width: 24px; min-width: 24px; height: 24px; min-height: 24px; padding: 0 !important; border: 0 !important; background: transparent !important; color: #343830 !important; }
body.store-page .cart-quantity-controls .pill { min-width: 24px; padding: 2px 5px; border: 0; background: transparent; text-align: center; font-size: 11px; }
body.store-page .cart-remove-button { min-width: 30px; min-height: 30px; overflow: hidden; padding: 0 !important; border: 0 !important; background: transparent !important; color: transparent !important; font-size: 0 !important; }
body.store-page .cart-remove-button::before { content: "×"; color: #a4a79f; font-size: 17px; }
body.store-page .cart-upsell { margin: 14px 20px 4px; padding: 14px; border: 1px solid color-mix(in srgb, var(--store-green) 20%, var(--store-line)); border-radius: 13px; background: color-mix(in srgb, var(--store-green) 5%, #fff); }
body.store-page .cart-upsell-heading { display: grid; gap: 2px; margin-bottom: 10px; }
body.store-page .cart-upsell-heading span { color: var(--store-green); font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
body.store-page .cart-upsell-heading h3 { margin: 0; color: var(--store-ink); font-size: 12px !important; }
body.store-page .cart-upsell-list { display: grid; gap: 8px; }
body.store-page .cart-upsell-item { display: grid; grid-template-columns: 38px minmax(0, 1fr) 28px; gap: 9px; align-items: center; }
body.store-page .cart-upsell-item img { width: 38px; height: 38px; border-radius: 9px; object-fit: cover; background: var(--store-soft); }
body.store-page .cart-upsell-item > div { min-width: 0; display: grid; gap: 1px; }
body.store-page .cart-upsell-item strong { overflow: hidden; color: var(--store-ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
body.store-page .cart-upsell-item span { color: var(--store-muted); font-size: 10px; font-weight: 700; }
body.store-page .cart-upsell-add { width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: var(--store-green); color: #fff; cursor: pointer; font-family: inherit; font-size: 18px; font-weight: 800; line-height: 1; }
body.store-page .cart-upsell-add:hover,
body.store-page .cart-upsell-add:focus-visible { background: var(--primary-dark); transform: translateY(-1px); }
body.store-page .cart > hr { margin: 5px 20px 0; border-color: #efeee9; }
body.store-page .cart-total-row { padding: 17px 20px 5px; font-size: 17px; }
body.store-page .cart-total-row strong:last-child { color: #11140f !important; }
body.store-page .cart-total-note { padding: 0 20px; font-size: 10px; }
body.store-page .store-checkout-button { width: calc(100% - 40px); min-height: 48px; display: flex; justify-content: space-between; align-items: center; margin: 12px 20px 20px; padding: 11px 18px; border-radius: 11px; background: var(--store-green) !important; box-shadow: none; }
body.store-page .store-checkout-button:disabled { opacity: .45; cursor: not-allowed; }
body.store-page .order-form { margin: 6px 20px 20px; padding-top: 18px; border-top: 1px solid #efeee9; }
body.store-page .store-help-card { padding: 18px; border: 1px solid var(--store-line); border-radius: 16px; background: #fff; box-shadow: 0 5px 18px rgba(27,33,25,.05); }
body.store-page .store-help-heading { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
body.store-page .store-help-online { display: flex; align-items: center; gap: 6px; margin: 12px 0; font-size: 10px; }
body.store-page .store-help-online > span { width: 7px; height: 7px; border-radius: 50%; background: #28a62b; }
body.store-page .store-help-message { width: 88%; padding: 12px; border-radius: 4px 13px 13px; background: #f5f2ed; font-size: 11px; line-height: 1.45; }
body.store-page .store-help-action { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; padding: 11px 13px; border-radius: 12px; background: #eef6ea; color: var(--store-green); text-decoration: none; font-size: 11px; font-weight: 800; }
body.store-page .store-feature-footer { display: flex; justify-content: space-around; gap: 24px; margin: 22px 32px 0; padding: 25px 10px; border-top: 1px solid #efeee9; color: #565b52; font-size: 12px; }
body.store-page .store-mobile-bottom-nav { display: none; }

/* Offerte compatte: la promozione resta ben visibile senza dominare il menu. */
body.store-page .daily-offer-section { margin: 0 0 20px; }
body.store-page .daily-offer-grid { gap: 10px; }
body.store-page .daily-offer-card { grid-template-columns: 124px minmax(0, 1fr) !important; min-height: 124px; border: 1px solid var(--store-line) !important; border-radius: 16px !important; box-shadow: 0 4px 14px rgba(27,33,25,.05) !important; }
body.store-page .daily-offer-media { min-height: 124px; }
body.store-page .daily-offer-body { position: relative; min-height: 124px; padding: 13px 16px !important; }
body.store-page .daily-offer-badge { padding: 3px 7px; font-size: 9px; }
body.store-page .daily-offer-card h2 { margin: 6px 0 3px; font-size: 18px !important; }
body.store-page .daily-offer-description { display: none; }
body.store-page .daily-offer-product-name { font-size: 11px; }
body.store-page .daily-offer-price-row { gap: 7px; margin-top: 5px; }
body.store-page .daily-offer-price { font-size: 20px !important; }
body.store-page .daily-offer-original-price { font-size: 10px; }
body.store-page .daily-offer-footer { gap: 10px; margin-top: 4px; padding-top: 0; }
body.store-page .daily-offer-validity { font-size: 9px; }
body.store-page .daily-offer-add-button { min-width: 112px; min-height: 32px; padding: 6px 10px; font-size: 10px; }
body.store-page .daily-offer-list-cards { gap: 10px; }
body.store-page .daily-offer-list-card { grid-template-columns: 96px minmax(0, 1fr); }
body.store-page .daily-offer-list-card-media { min-height: 96px; }
body.store-page .daily-offer-list-card-body { padding: 11px 13px; }
body.store-page .daily-offer-list-card-body h3 { margin: 5px 0; font-size: 14px; }

@media (max-width: 1180px) {
  body.store-page .store-demo-header-inner { grid-template-columns: minmax(210px,1fr) auto minmax(250px,1fr); gap: 18px; }
  body.store-page .store-demo-nav { gap: 18px; }
  body.store-page .products { grid-template-columns: repeat(3,minmax(0,1fr)) !important; }
}

@media (max-width: 900px) {
  body.store-page .wrap { width: min(calc(100% - 28px), 100%); }
  body.store-page .store-demo-header-inner { min-height: 78px; display: flex; justify-content: space-between; }
  body.store-page .store-nav-logo-shell { width: 40px; height: 40px; }
  body.store-page .store-nav-brand-copy strong { font-size: 17px; }
  body.store-page .store-nav-brand-copy small { font-size: 7px; }
  body.store-page .store-header-actions { margin-left: auto; gap: 3px; }
  body.store-page .store-language-picker select { min-height: 32px; padding-left: 8px; font-size: 10px; }
  body.store-page .store-language-reset { min-width: 30px; min-height: 30px; margin-left: -4px; }
  body.store-page .store-search { width: 42px; min-height: 42px; justify-content: center; padding: 0; border: 0; box-shadow: none; }
  body.store-page .store-search > span { font-size: 25px; }
  body.store-page .store-search input { position: absolute; left: 14px; right: 14px; top: 70px; width: calc(100% - 28px); min-height: 44px; display: none; padding: 0 15px; border: 1px solid var(--store-line); border-radius: 999px; background: #fff; }
  body.store-page .store-search.is-open input,
  body.store-page .store-search:focus-within input { display: block; }
  body.store-page .store-search-clear { position: absolute; z-index: 2; right: 22px; top: 78px; display: none; }
  body.store-page .store-search.has-query .store-search-clear { display: grid; }
  body.store-page .store-header-cart { display: grid !important; }
  body.store-page .store-order-layout { grid-template-columns: minmax(0,1fr) !important; }
  body.store-page .store-products-column { padding: 18px 14px 120px !important; }
  body.store-page .store-side-column { padding: 18px 14px 130px; border-left: 0; }
  body.store-page .cart { position: relative !important; top: auto !important; }
  body.store-page .store-help-card { display: none; }
  body.store-page .store-feature-footer { display: none; }
}

@media (max-width: 640px) {
  body.store-page { padding-bottom: 82px; background: #fff; }
  body.store-page .store-demo-header { position: sticky; }
  body.store-page .store-demo-header-inner { width: calc(100% - 24px); min-height: 70px; gap: 7px; }
  body.store-page .store-nav-brand { gap: 7px; }
  body.store-page .store-nav-logo-shell { width: 36px; height: 36px; }
  body.store-page .store-nav-brand-copy strong { font-size: 15px; }
  body.store-page .store-nav-brand-copy small { letter-spacing: .15em; }
  body.store-page .store-header-icon { width: 34px; height: 34px; font-size: 21px; }
  body.store-page .mobile-nav-toggle { width: 36px; min-width: 36px; height: 36px; min-height: 36px; order: -1; padding: 7px; border: 0; background: transparent; box-shadow: none; }
  body.store-page .store-wrap { padding: 0; }
  body.store-page .daily-offer-section { margin: 0 0 18px; }
  body.store-page .store-products-column { padding: 12px 12px 105px !important; }
  body.store-page .category-filter-scroll { min-height: 47px !important; gap: 8px !important; margin-bottom: 18px !important; }
  body.store-page .category-filter-scroll .btn { min-height: 35px !important; padding: 7px 11px !important; font-size: 10px !important; }
  body.store-page .category-filter-scroll .btn span { font-size: 13px; }
  body.store-page .store-catalog-controls { margin-bottom: 14px; }
  body.store-page .store-catalog-controls label { font-size: 11px; }
  body.store-page .store-catalog-controls select { min-height: 34px; padding: 6px 28px 6px 10px; font-size: 11px; }
  body.store-page .store-view-switch { gap: 2px; }
  body.store-page .store-view-switch button { width: 30px; min-width: 30px; height: 30px; min-height: 30px; font-size: 16px; }
  body.store-page .category-filter-scroll { flex-wrap: nowrap !important; min-height: 48px !important; gap: 9px !important; margin: 0 -2px 16px !important; padding: 2px 2px 7px !important; overflow-x: auto !important; overscroll-behavior-x: contain; scroll-snap-type: x proximity; }
  body.store-page .category-filter-scroll .btn { flex: 0 0 auto !important; width: auto !important; min-width: max-content !important; max-width: none !important; min-height: 36px !important; justify-content: center; padding: 7px 12px !important; border-color: #eceae5 !important; border-radius: 999px !important; background: #fff !important; box-shadow: 0 3px 10px rgba(32,39,29,.06) !important; white-space: nowrap; scroll-snap-align: start; }
  body.store-page .category-filter-scroll .btn:not(.ghost) { border-color: var(--store-green) !important; background: var(--store-green) !important; color: #fff !important; }
  body.store-page .category-filter-scroll .btn span { font-size: 12px; }
  body.store-page .products { grid-template-columns: repeat(2,minmax(0,1fr)) !important; gap: 10px !important; }
  body.store-page .products.is-list-view { grid-template-columns: 1fr !important; }
  body.store-page .products.is-list-view .product-card { grid-template-columns: 108px minmax(0, 1fr); }
  body.store-page .products.is-list-view .product-media { min-height: 108px; }
  body.store-page .product-card { border-radius: 13px !important; }
  body.store-page .product-card .product-media { width: calc(100% - 12px) !important; margin: 6px 6px 0 !important; border-radius: 10px; }
  body.store-page .product-card-body { min-height: 102px; padding: 10px 9px 9px !important; }
  body.store-page .product-card h3 { margin-bottom: 7px; font-size: 11px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body.store-page .product-card .desc { display: none; }
  body.store-page .product-card .price { font-size: 12px !important; }
  body.store-page .product-add-button { width: 27px !important; min-width: 27px !important; height: 27px; min-height: 27px !important; font-size: 18px !important; }
  body.store-page .product-favorite { top: 6px; right: 7px; font-size: 19px; }
  body.store-page .store-side-column { padding: 12px 12px 120px; }
  body.store-page .store-side-column:has(.checkout-form-collapsed) { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
  body.store-page .mobile-cart-summary { position: fixed; z-index: 92; left: 10px; right: 10px; bottom: 72px; width: auto; min-height: 58px; display: grid; grid-template-columns: 36px minmax(0,1fr) auto; align-items: center; gap: 9px; padding: 8px 10px; border: 0; border-radius: 14px; background: var(--store-green); color: #fff; box-shadow: 0 8px 24px rgba(14,47,11,.25); }
  body.store-page .mobile-cart-summary.hidden { display: none; }
  body.store-page .mobile-cart-summary > span:nth-child(2) { display: grid; text-align: left; }
  body.store-page .mobile-cart-summary small { color: rgba(255,255,255,.8); font-size: 9px; }
  body.store-page .mobile-cart-summary strong { color: #fff; font-size: 13px; }
  body.store-page .mobile-cart-icon { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.35); border-radius: 9px; font-size: 21px; }
  body.store-page .mobile-cart-checkout { padding: 11px 13px; border-radius: 999px; background: #fff; color: var(--store-green); font-size: 10px; font-weight: 850; }
  body.store-page .daily-offer-section { margin: 0 0 18px; }
  body.store-page .daily-offer-card { grid-template-columns: 104px minmax(0, 1fr) !important; min-height: 116px; }
  body.store-page .daily-offer-media { min-height: 116px; }
  body.store-page .daily-offer-body { min-height: 116px; padding: 10px 12px !important; }
  body.store-page .daily-offer-badge,
  body.store-page .daily-offer-original-price,
  body.store-page .daily-offer-validity { display: none; }
  body.store-page .daily-offer-product-name { display: block; margin: 0 0 4px; overflow: hidden; color: var(--store-muted); font-size: 10px; font-weight: 750; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
  body.store-page .daily-offer-card h2 { margin: 0 0 4px; font-size: 14px !important; }
  body.store-page .daily-offer-price-row { margin-top: 0; }
  body.store-page .daily-offer-price { font-size: 16px !important; }
  body.store-page .daily-offer-footer { position: absolute; right: 11px; bottom: 9px; }
  body.store-page .daily-offer-add-button { min-width: 82px; min-height: 27px; padding: 4px 7px; font-size: 9px; }
  body.store-page .store-mobile-bottom-nav { position: fixed; z-index: 91; left: 0; right: 0; bottom: 0; min-height: 66px; display: grid; grid-template-columns: repeat(3,1fr); padding: 6px 10px max(6px, env(safe-area-inset-bottom)); border-top: 1px solid #eae9e4; background: rgba(255,255,255,.97); backdrop-filter: blur(14px); }
  body.store-page .store-mobile-bottom-nav a { display: grid; place-items: center; gap: 2px; color: #6c7168; text-decoration: none; font-size: 9px; }
  body.store-page .store-mobile-bottom-nav a span { font-size: 19px; }
  body.store-page .store-mobile-bottom-nav a.is-active { color: var(--store-red); }
  body.store-page .product-modifier-card { border-radius: 22px 22px 0 0; }
}

@media (max-width: 360px) {
  body.store-page .store-nav-brand-copy small { display: none; }
  body.store-page .mobile-cart-checkout { padding-inline: 10px; font-size: 9px; }
}

/* =========================================================
   Merchant workspace - navigazione per attività operative
========================================================= */
body.merchant-page .merchant-view-hidden {
  display: none !important;
}

body.merchant-page .sidebar-shortcuts .merchant-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  padding: 10px 11px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  line-height: 1.3;
  text-align: left;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}

body.merchant-page .sidebar-shortcuts .merchant-nav-link:hover,
body.merchant-page .sidebar-shortcuts .merchant-nav-link:focus-visible {
  background: var(--primary-ghost);
  color: var(--primary-dark);
}

body.merchant-page .sidebar-shortcuts .merchant-nav-link.is-active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 7px 18px color-mix(in srgb, var(--primary) 24%, transparent);
}

body.merchant-page .sidebar-shortcuts .merchant-nav-link.is-active .sidebar-shortcut-mark {
  background: #fff;
  box-shadow: 0 0 0 4px color-mix(in srgb, #fff 22%, transparent);
}

body.merchant-page .merchant-dashboard {
  display: grid;
  gap: 22px;
}

body.merchant-page .merchant-dashboard-intro,
body.merchant-page .merchant-dashboard-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

body.merchant-page .merchant-dashboard-intro {
  min-height: 104px;
  padding: 26px 28px;
  border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border));
  border-radius: 20px;
  background: linear-gradient(120deg, var(--surface) 8%, var(--primary-ghost));
}

body.merchant-page .merchant-dashboard-intro h2,
body.merchant-page .merchant-dashboard-section-head h3 {
  margin: 4px 0 6px;
}

body.merchant-page .merchant-dashboard-intro p,
body.merchant-page .merchant-dashboard-section-head p {
  margin: 0;
}

body.merchant-page .merchant-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

body.merchant-page .merchant-kpi-card {
  display: grid;
  gap: 8px;
  min-height: 144px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

body.merchant-page .merchant-kpi-card-primary {
  border-color: var(--primary);
  background: linear-gradient(145deg, var(--primary), var(--primary-dark));
}

body.merchant-page .merchant-kpi-label {
  color: var(--muted);
  font-size: .8rem;
  font-weight: 850;
  letter-spacing: .02em;
}

body.merchant-page .merchant-kpi-card strong {
  align-self: end;
  font-size: clamp(1.65rem, 2.2vw, 2.15rem);
  line-height: 1;
}

body.merchant-page .merchant-kpi-card-primary .merchant-kpi-label,
body.merchant-page .merchant-kpi-card-primary strong,
body.merchant-page .merchant-kpi-card-primary .muted {
  color: #fff;
}

body.merchant-page .merchant-kpi-card-primary .muted {
  opacity: .78;
}

body.merchant-page .merchant-dashboard-orders {
  overflow: hidden;
}

body.merchant-page .merchant-dashboard-order-list {
  display: grid;
  margin-top: 16px;
  border-top: 1px solid var(--border);
}

body.merchant-page .merchant-dashboard-order {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 0;
  border-bottom: 1px solid var(--border);
}

body.merchant-page .merchant-dashboard-order p {
  margin: 4px 0 0;
  font-size: .86rem;
}

body.merchant-page .merchant-dashboard-order-meta {
  display: grid;
  gap: 4px;
  text-align: right;
}

body.merchant-page .merchant-dashboard-order-meta span {
  color: var(--primary-dark);
  font-size: .78rem;
  font-weight: 800;
}

body.merchant-page .merchant-dashboard-order-meta .order-payment-badge {
  justify-self: end;
  text-align: left;
}

body.merchant-page .merchant-dashboard-order-meta .order-payment-badge.stripe {
  color: #12612b;
  font-size: 11px;
}

body.merchant-page .merchant-dashboard-order-meta .order-payment-badge.manual {
  color: #555c6b;
  font-size: 11px;
}

body.merchant-page .merchant-pro {
  display: grid;
  gap: 22px;
}

body.merchant-page .merchant-pro-intro { align-items: center; }

body.merchant-page .merchant-pro-period {
  display: grid;
  gap: 5px;
  min-width: 170px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
}

body.merchant-page .merchant-pro-period select {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

body.merchant-page .merchant-pro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, .9fr);
  gap: 14px;
}

body.merchant-page .merchant-pro-card h3,
body.merchant-page .merchant-ai-card h3 { margin: 0 0 6px; }

body.merchant-page .merchant-pro-card > p { margin-top: 0; }

body.merchant-page .merchant-pro-chart {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

body.merchant-page .merchant-pro-chart-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 9px;
  font-size: .78rem;
}

body.merchant-page .merchant-pro-chart-track {
  overflow: hidden;
  height: 9px;
  border-radius: 99px;
  background: var(--primary-ghost);
}

body.merchant-page .merchant-pro-chart-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

body.merchant-page .merchant-pro-insights {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

body.merchant-page .merchant-pro-insights p { margin: 0; }

body.merchant-page .merchant-ai-card {
  display: grid;
  gap: 18px;
  min-height: 132px;
  border-color: color-mix(in srgb, var(--primary) 24%, var(--border));
  background: linear-gradient(120deg, var(--surface), var(--primary-ghost));
}

body.merchant-page .merchant-ai-copy p { margin-bottom: 0; }

body.merchant-page .merchant-ai-test {
  display: grid;
  gap: 10px;
  max-width: 760px;
}

body.merchant-page .merchant-ai-test label { font-weight: 750; }

body.merchant-page .merchant-ai-test textarea {
  width: 100%;
  min-height: 104px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

body.merchant-page .merchant-ai-status { margin: 0; }

body.merchant-page .merchant-ai-answer {
  border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--border));
  border-radius: 12px;
  padding: 14px;
  background: var(--surface);
  line-height: 1.55;
}

body.merchant-page .merchant-ai-catalog-draft { display: grid; gap: 12px; }
body.merchant-page .merchant-ai-draft-heading { display: grid; gap: 3px; }
body.merchant-page .merchant-ai-draft-list { display: grid; gap: 10px; }
body.merchant-page .merchant-ai-draft-item {
  display: grid;
  grid-template-columns: minmax(150px, 1.2fr) minmax(130px, .8fr) minmax(100px, .45fr);
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
body.merchant-page .merchant-ai-draft-item label { display: grid; gap: 5px; font-size: .84rem; font-weight: 700; }
body.merchant-page .merchant-ai-draft-item .checkbox-label { grid-column: 1 / -1; display: flex; align-items: center; }
body.merchant-page .merchant-ai-draft-description { grid-column: 1 / -1; }
body.merchant-page .merchant-ai-draft-item input,
body.merchant-page .merchant-ai-draft-item textarea { width: 100%; font: inherit; }
body.merchant-page .merchant-ai-ingredients { grid-column: 1 / -1; padding-top: 2px; }
body.merchant-page .merchant-ai-ingredients summary { cursor: pointer; color: var(--primary); font-weight: 800; }
body.merchant-page .merchant-ai-ingredient-list { display: grid; gap: 8px; margin-top: 10px; }
body.merchant-page .merchant-ai-ingredient-list article { display: grid; grid-template-columns: 1.3fr repeat(4, auto); gap: 8px; align-items: end; padding: 9px; border-radius: 9px; background: var(--primary-ghost); }
body.merchant-page .merchant-ai-ingredient-list label { font-size: .76rem; }
@media (max-width: 650px) { body.merchant-page .merchant-ai-ingredient-list article { grid-template-columns: 1fr 1fr; } }
@media (max-width: 650px) { body.merchant-page .merchant-ai-draft-item { grid-template-columns: 1fr; } }

body.merchant-page .merchant-coupon-card { display:grid; gap:16px; }
body.merchant-page .merchant-coupon-card h3 { margin:0 0 6px; }
body.merchant-page .merchant-coupon-form { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:12px; }
body.merchant-page .merchant-coupon-form label { display:grid; gap:6px; font-weight:700; }
body.merchant-page .merchant-coupon-form .actions { grid-column:1/-1; }
body.merchant-page .merchant-coupon-list { display:grid; gap:10px; }
body.merchant-page .merchant-coupon-item { display:flex; justify-content:space-between; gap:12px; align-items:center; padding:12px; border:1px solid var(--border); border-radius:12px; background:var(--surface); }
body.merchant-page .merchant-coupon-item .actions { flex-wrap:wrap; justify-content:flex-end; }
@media (max-width:720px) { body.merchant-page .merchant-coupon-item { align-items:stretch; flex-direction:column; } body.merchant-page .merchant-coupon-item .actions { justify-content:flex-start; } }
body.store-page .store-coupon-box { padding:12px; border:1px dashed var(--border); border-radius:12px; }
body.store-page .store-coupon-toggle { width:100%; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:0; border:0; background:transparent; color:var(--text); font:inherit; font-weight:800; text-align:left; cursor:pointer; }
body.store-page .store-coupon-toggle small { color:var(--primary); font-weight:800; }
body.store-page .store-coupon-toggle small::after { content:' +'; }
body.store-page .store-coupon-toggle.is-open small::after { content:' −'; }
body.store-page .store-coupon-row { display:flex; gap:8px; margin-top:7px; }
body.store-page .store-coupon-row input { flex:1; min-width:0; text-transform:uppercase; }
body.store-page .store-coupon-box p { margin:7px 0 0; }
@media (max-width:480px) { body.store-page .store-coupon-row { align-items:stretch; flex-direction:column; } body.store-page .store-coupon-row .btn { width:100%; } }
body.store-page .store-public-coupons { display:grid; gap:14px; margin-bottom:18px; padding:18px; border:1px solid color-mix(in srgb,var(--primary) 30%,var(--border)); border-radius:18px; background:linear-gradient(135deg,color-mix(in srgb,var(--primary) 10%,var(--surface)),var(--surface)); }
body.store-page .store-public-coupons.hidden { display:none; }
body.store-page .store-public-coupons-heading h2 { margin:3px 0 4px; }
body.store-page .store-public-coupons-heading p { margin:0; }
body.store-page .store-public-coupon-list { display:grid; gap:10px; }
body.store-page .store-public-coupon-card { display:flex; justify-content:space-between; align-items:center; gap:16px; padding:14px; border:1px solid var(--border); border-radius:14px; background:var(--surface); }
body.store-page .store-public-coupon-card h3 { margin:5px 0; }
body.store-page .store-public-coupon-card small { color:var(--muted); }
body.store-page .store-public-coupon-value { color:var(--primary); font-weight:800; }
body.store-page .store-public-coupon-action { display:grid; justify-items:end; gap:8px; }
body.store-page .store-public-coupon-action code { padding:5px 8px; border-radius:8px; background:color-mix(in srgb,var(--primary) 10%,var(--surface)); font-weight:800; letter-spacing:.06em; }
body.store-page #store-public-coupon-status { margin:0; }
@media (max-width:640px) { body.store-page .store-public-coupon-card { align-items:stretch; flex-direction:column; } body.store-page .store-public-coupon-action { grid-template-columns:1fr auto; align-items:center; justify-items:start; } }

/* Piccoli controlli aggiunti allo Store e semplificazione colori merchant. */
body.store-page .store-header-icon.store-share-button {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
}

body.store-page .store-share-button:hover,
body.store-page .store-share-button:focus-visible {
  color: var(--store-green);
  transform: translateY(-1px);
}

body.store-page .store-cart-heading > div {
  display: grid;
  gap: 3px;
}

body.store-page .cart-clear-button {
  min-height: 32px;
  padding: 6px 9px;
  border: 1px solid #eadfda;
  border-radius: 999px;
  background: #fffafa;
  color: #a44538;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

body.store-page .cart-clear-button:hover,
body.store-page .cart-clear-button:focus-visible {
  border-color: #dbafa8;
  background: #fff2f0;
}

body.store-page .cart-clear-button.hidden {
  display: none;
}

body.merchant-page .identity-color-intro {
  display: grid;
  gap: 4px;
  margin-top: 18px;
}

body.merchant-page .identity-color-intro strong {
  font-size: 14px;
}

body.merchant-page .identity-color-intro .muted {
  font-size: 12px;
}

body.merchant-page .identity-color-grid {
  margin-top: 10px;
}

body.merchant-page .identity-color-grid > div {
  padding: 13px;
  border: 1px solid color-mix(in srgb, var(--primary) 14%, var(--border));
  border-radius: 14px;
  background: color-mix(in srgb, var(--primary) 3%, #fff);
}

/* Store uniforme: media con angoli morbidi, anche nelle varianti precedenti. */
body.store-page {
  background: #fff !important;
}

body.store-page .product-card .product-media {
  border-radius: 15px !important;
}

body.store-page .product-card .product-media img {
  padding: 0 !important;
  border-radius: 13px !important;
}

body.store-page .daily-offer-media,
body.store-page .daily-offer-list-card-media {
  overflow: hidden;
  border-radius: 15px 0 0 15px;
}

body.store-page .daily-offer-media img,
body.store-page .daily-offer-list-card-media img {
  border-radius: inherit;
}

body.store-page .cart-product-thumb {
  border-radius: 12px;
}

@media (max-width: 980px) {
  body.merchant-page .merchant-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  body.merchant-page .sidebar-shortcuts .merchant-nav-link {
    width: auto;
    flex: 0 0 auto;
    min-height: 39px;
    padding: 8px 11px;
    font-size: 12px;
    white-space: nowrap;
  }

  body.merchant-page .merchant-dashboard { gap: 16px; }

  body.merchant-page .merchant-dashboard-intro {
    align-items: flex-start;
    flex-direction: column;
    min-height: 0;
    padding: 20px;
  }

  body.merchant-page .merchant-dashboard-intro .btn { width: 100%; }
  body.merchant-page .merchant-kpi-grid { gap: 10px; }
  body.merchant-page .merchant-kpi-card { min-height: 126px; padding: 16px; }

  body.store-page .store-header-icon.store-share-button { font-size: 21px; }

  body.store-page .product-card .product-media {
    border-radius: 12px !important;
  }

  body.store-page .product-card .product-media img {
    border-radius: 10px !important;
  }

  body.store-page .daily-offer-media,
  body.store-page .daily-offer-list-card-media {
    border-radius: 12px 0 0 12px;
  }
}

@media (max-width: 480px) {
  body.merchant-page .merchant-dashboard-intro,
  body.merchant-page .merchant-dashboard-section-head {
    display: grid;
    align-items: stretch;
  }

  body.merchant-page .merchant-dashboard-section-head .btn { width: 100%; }
  body.merchant-page .merchant-kpi-card { min-height: 118px; padding: 13px; }
  body.merchant-page .merchant-kpi-label { font-size: .72rem; }
  body.merchant-page .merchant-kpi-card strong { font-size: 1.45rem; }
  body.merchant-page .merchant-kpi-card small { font-size: .7rem; }
  body.merchant-page .merchant-dashboard-order { align-items: flex-start; }
  body.merchant-page .merchant-dashboard-order p { font-size: .75rem; }
}

/* =========================================================
   Sfondi Store: varianti finali, dopo il catalogo classico.
   Queste regole devono restare alla fine: il catalogo essenziale usa molte
   dichiarazioni !important e altrimenti annulla le varianti scelte.
========================================================= */
body.store-page.template-modern-color {
  background:
    radial-gradient(circle at 8% 0, color-mix(in srgb, var(--primary) 15%, transparent), transparent 32%),
    radial-gradient(circle at 96% 24%, color-mix(in srgb, var(--secondary) 13%, transparent), transparent 30%),
    #f5f7ff !important;
  --store-soft: #edf1ff;
}

body.store-page.template-modern-color .store-demo-header {
  border-bottom-color: color-mix(in srgb, var(--primary) 18%, #e5e7ef) !important;
  background: rgba(248, 249, 255, .94) !important;
}

body.store-page.template-modern-color .store-products-column {
  padding: 30px 34px 46px !important;
}

body.store-page.template-modern-color .category-filter-scroll {
  padding: 8px !important;
  border: 1px solid color-mix(in srgb, var(--primary) 17%, #dce2f0) !important;
  border-radius: 15px !important;
  background: rgba(255, 255, 255, .70) !important;
}

body.store-page.template-modern-color .category-filter-scroll .btn,
body.store-page.template-modern-color .store-catalog-controls select {
  border-radius: 10px !important;
}

body.store-page.template-modern-color .products {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 14px !important;
}

body.store-page.template-modern-color .product-card {
  display: grid !important;
  grid-template-columns: 144px minmax(0, 1fr);
  min-height: 164px;
  border-color: color-mix(in srgb, var(--primary) 18%, #dce2f0) !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, .94) !important;
  box-shadow: 0 12px 28px color-mix(in srgb, var(--primary) 9%, transparent) !important;
}

body.store-page.template-modern-color .product-card .product-media {
  width: 100% !important;
  min-height: 100%;
  margin: 0 !important;
  border-radius: 0 !important;
  background: color-mix(in srgb, var(--primary) 8%, #eef2ff) !important;
}

body.store-page.template-modern-color .product-card .product-media img {
  padding: 10px !important;
  border-radius: 0 !important;
}

body.store-page.template-modern-color .product-card-body {
  min-height: 0;
  padding: 18px 18px 15px !important;
}

body.store-page.template-modern-color .daily-offer-card,
body.store-page.template-modern-color .cart {
  border-color: color-mix(in srgb, var(--primary) 19%, #dce2f0) !important;
  border-radius: 10px !important;
}

body.store-page.template-elegant-dark {
  background:
    linear-gradient(135deg, rgba(115, 74, 39, .08), transparent 42%),
    #f5efe6 !important;
  --store-ink: #2a2119;
  --store-muted: #756b61;
  --store-line: #e3d7c7;
  --store-soft: #efe4d4;
  font-family: Georgia, "Times New Roman", serif;
}

body.store-page.template-elegant-dark .store-demo-header {
  border-bottom-color: #e1d4c3 !important;
  background: rgba(255, 251, 245, .95) !important;
}

body.store-page.template-elegant-dark .store-nav-brand-copy strong,
body.store-page.template-elegant-dark .store-catalog-controls label,
body.store-page.template-elegant-dark .product-card h3,
body.store-page.template-elegant-dark .product-card .price {
  font-family: Georgia, "Times New Roman", serif;
}

body.store-page.template-elegant-dark .products {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 0 !important;
  border-top: 1px solid #dfd1c0;
}

body.store-page.template-elegant-dark .product-card {
  border: 0 !important;
  border-right: 1px solid #dfd1c0 !important;
  border-bottom: 1px solid #dfd1c0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.store-page.template-elegant-dark .product-card:hover {
  background: rgba(255, 255, 255, .42) !important;
  box-shadow: none !important;
}

body.store-page.template-elegant-dark .product-card .product-media {
  width: calc(100% - 28px) !important;
  margin: 18px 14px 0 !important;
  border-radius: 50% !important;
  background: #efe3d2 !important;
  aspect-ratio: 1 !important;
}

body.store-page.template-elegant-dark .product-card .product-media img {
  padding: 7px !important;
  border-radius: 50% !important;
}

body.store-page.template-elegant-dark .product-card-body {
  min-height: 128px;
  padding: 16px 18px 18px !important;
}

body.store-page.template-elegant-dark .category-filter-scroll {
  border-bottom: 1px solid #dfd1c0 !important;
}

body.store-page.template-elegant-dark .category-filter-scroll .btn,
body.store-page.template-elegant-dark .store-catalog-controls select {
  border-radius: 2px !important;
  box-shadow: none !important;
}

body.store-page.template-food-premium,
body.store-page.template-food-showcase {
  background: #fbf4e9 !important;
  --store-ink: #24170f;
  --store-muted: #746155;
  --store-line: #eadbcb;
  --store-soft: #f5e8d7;
}

body.store-page.template-food-premium #store-info.store-hero,
body.store-page.template-food-showcase #store-info.store-hero {
  position: relative;
  display: grid !important;
  min-height: 286px;
  margin: 24px 32px 0;
  padding: 36px 42px;
  overflow: hidden;
  border: 0;
  border-radius: 24px;
  background:
    linear-gradient(90deg, rgba(26, 14, 9, .88), rgba(26, 14, 9, .43)),
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 52%, #2c160e), color-mix(in srgb, var(--secondary) 48%, #51200f)) !important;
}

body.store-page.template-food-premium .store-hero-copy,
body.store-page.template-food-showcase .store-hero-copy {
  position: relative;
  z-index: 2;
  max-width: 620px;
}

body.store-page.template-food-premium .store-hero-copy h1,
body.store-page.template-food-showcase .store-hero-copy h1 {
  color: #fff8f1 !important;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(38px, 5vw, 62px) !important;
  line-height: .98;
}

body.store-page.template-food-premium .store-hero-copy .muted,
body.store-page.template-food-showcase .store-hero-copy .muted {
  color: rgba(255, 248, 241, .86) !important;
}

body.store-page.template-food-premium .daily-offer-card,
body.store-page.template-food-showcase .daily-offer-card {
  border-color: color-mix(in srgb, var(--primary) 28%, #eadbcb) !important;
  background: linear-gradient(135deg, #fffaf3, color-mix(in srgb, var(--primary) 10%, #fff2df)) !important;
}

body.store-page.template-food-showcase .store-order-layout {
  grid-template-columns: minmax(0, 1fr) 400px !important;
}

body.store-page.template-food-showcase .products {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 14px !important;
}

body.store-page.template-food-showcase .product-card {
  border-color: color-mix(in srgb, var(--primary) 17%, #eadbcb) !important;
  border-radius: 9px !important;
  background: #fffdf9 !important;
  box-shadow: 0 11px 25px rgba(83, 45, 18, .08) !important;
}

body.store-page.template-food-showcase .product-card .product-media {
  width: calc(100% - 18px) !important;
  margin: 9px 9px 0 !important;
  border-radius: 7px !important;
  background: #f6e9d8 !important;
}

body.store-page.template-food-showcase .product-card .product-media img {
  padding: 5px !important;
  border-radius: 7px !important;
}

body.store-page.template-food-showcase .cart {
  border-radius: 9px !important;
  border-color: color-mix(in srgb, var(--primary) 17%, #eadbcb) !important;
}

@media (max-width: 900px) {
  body.store-page.template-modern-color .products,
  body.store-page.template-elegant-dark .products,
  body.store-page.template-food-showcase .products {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.store-page.template-modern-color .product-card {
    grid-template-columns: 1fr;
  }

  body.store-page.template-modern-color .product-card .product-media {
    width: calc(100% - 16px) !important;
    min-height: 0;
    margin: 8px 8px 0 !important;
    border-radius: 9px !important;
    aspect-ratio: 1 / .92;
  }

  body.store-page.template-modern-color .product-card .product-media img {
    border-radius: 9px !important;
  }

  body.store-page.template-food-premium #store-info.store-hero,
  body.store-page.template-food-showcase #store-info.store-hero {
    min-height: 218px;
    margin: 12px 14px 0;
    padding: 24px 20px;
    border-radius: 18px;
  }

  body.store-page.template-food-premium .store-hero-copy h1,
  body.store-page.template-food-showcase .store-hero-copy h1 {
    font-size: 34px !important;
  }

  body.store-page.template-food-showcase .store-order-layout {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* Breakpoint conclusivi per il selettore sfondi: vengono dopo tutte le
   varianti, così la griglia non può saltare da tre a quattro card al passaggio
   del mouse. */
@media (max-width: 900px) {
  .template-dialog .template-choice-grid,
  .builder-template-picker .template-choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .template-dialog .template-choice-grid,
  .builder-template-picker .template-choice-grid {
    grid-template-columns: 1fr;
  }
}

/* Override conclusivo: nessun template può riattivare la vecchia testata. */
html body.store-page #store-info.store-hero,
html body.store-page.template-food-premium #store-info.store-hero,
html body.store-page.template-food-showcase #store-info.store-hero {
  display: none !important;
}
.merchant-payments {
  display: grid;
  gap: 1rem;
}

.merchant-payment-grid > .card {
  height: 100%;
}

.merchant-payment-grid .actions {
  align-items: center;
}

.merchant-payment-grid .miapp-billing-card {
  grid-column: 1 / -1;
}

.miapp-billing-details {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-soft);
}

.miapp-billing-details summary {
  cursor: pointer;
  font-weight: 800;
}

.miapp-billing-details .grid-span-2 {
  grid-column: 1 / -1;
}

.check-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  cursor: pointer;
}

.check-row input {
  width: 20px;
  height: 20px;
  margin-top: 1px;
  flex: 0 0 auto;
}

.store-customer-account {
  display: grid;
  gap: 14px;
  margin: 18px 0;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border));
  border-radius: 16px;
  background: color-mix(in srgb, var(--primary) 6%, var(--bg));
}

.store-customer-account.is-loading {
  visibility: hidden;
}

body.store-page.store-login-gated .store-demo-header,
body.store-page.store-login-gated .store-header-slider,
body.store-page.store-login-gated .store-wrap > :not(#store-customer-account),
body.store-page.store-login-gated .store-mobile-bottom-nav,
body.store-page.store-login-gated .mobile-cart-summary,
body.store-page.store-login-gated .pwa-install-area,
body.store-page.store-login-gated .store-feature-footer {
  display: none !important;
}

body.store-page.store-login-gated .store-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

body.store-page.store-login-gated .store-customer-account {
  width: min(100%, 520px);
  margin: 0;
  box-shadow: 0 16px 42px rgba(20, 30, 20, .14);
}

.store-customer-account h3,
.store-customer-account p {
  margin: 4px 0 0;
}

.store-customer-login-form {
  display: grid;
  gap: 7px;
}

.store-customer-login-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

.store-customer-otp-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--border));
  border-radius: 14px;
  background: color-mix(in srgb, var(--primary) 8%, var(--bg));
}

.store-customer-otp-panel h4 {
  margin: 3px 0 0;
  font-size: 17px;
}

.store-customer-otp-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.store-customer-otp-timer {
  min-width: 68px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--bg);
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  text-align: center;
}

.store-customer-otp-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.store-customer-otp-input {
  min-width: 0;
  padding: 12px 10px;
  border: 1px solid var(--primary);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: .26em;
  text-align: center;
}

.store-customer-otp-resend {
  justify-self: start;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
}

.store-customer-otp-resend:disabled {
  color: var(--muted);
  cursor: not-allowed;
  text-decoration: none;
}

.store-customer-session {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.customer-verified-badge {
  display: inline-flex;
  width: fit-content;
  margin-left: 6px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

@media (max-width: 760px) {
  .miapp-billing-details .grid-span-2 {
    grid-column: auto;
  }

  .store-customer-login-row {
    grid-template-columns: 1fr;
  }

  .store-customer-login-row .btn {
    width: 100%;
  }

  .store-customer-otp-form {
    grid-template-columns: 1fr;
  }

  .store-customer-otp-form .btn {
    width: 100%;
  }
}

#btn-stripe-order:not(.hidden) {
  display: inline-flex;
}

/* Font scelto dal commerciante: prevale sui caratteri decorativi dei template. */
body.store-page,
body.store-page * {
  font-family: var(--shop-font-family, Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif) !important;
}

body.merchant-page .identity-font-field {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

body.merchant-page .identity-font-preview {
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--primary) 14%, var(--border));
  border-radius: 14px;
  background: color-mix(in srgb, var(--primary) 3%, #fff);
  font-size: 19px;
  font-weight: 700;
}

/* =========================================================
   MIAPP v90 - Cronologia privata ordini nello store
========================================================= */
body.store-page .recent-orders-section {
  margin-top: 30px;
  border-color: color-mix(in srgb, var(--primary) 18%, var(--border));
  background:
    radial-gradient(circle at 100% 0, var(--primary-ghost), transparent 34%),
    var(--panel);
}

body.store-page .recent-orders-heading {
  align-items: center;
  gap: 18px;
}

body.store-page .recent-orders-heading h2 {
  margin: 8px 0 5px;
}

body.store-page .recent-orders-heading p {
  max-width: 720px;
  margin: 0;
}

body.store-page .recent-orders-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

body.store-page .recent-orders-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 18px;
  border: 1px dashed var(--border-strong);
  border-radius: 14px;
  text-align: center;
}

body.store-page .recent-order-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--primary) 14%, var(--border));
  border-radius: 16px;
  background: color-mix(in srgb, var(--primary) 3%, var(--panel));
  box-shadow: var(--shadow-xs);
}

body.store-page .recent-order-card-heading,
body.store-page .recent-order-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

body.store-page .recent-order-card-heading > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

body.store-page .recent-order-card-heading small {
  color: var(--text-soft);
}

body.store-page .recent-order-status {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 850;
}

body.store-page .recent-order-status-delivered,
body.store-page .recent-order-status-ready_for_pickup {
  background: var(--ok-soft);
  color: var(--ok);
}

body.store-page .recent-order-status-preparing,
body.store-page .recent-order-status-out_for_delivery {
  background: var(--warning-soft);
  color: var(--warning);
}

body.store-page .recent-order-status-cancelled,
body.store-page .recent-order-status-refunded {
  background: var(--danger-soft);
  color: var(--danger);
}

body.store-page .recent-order-card ul {
  display: grid;
  gap: 5px;
  margin: 14px 0;
  padding-left: 18px;
  color: var(--text-soft);
  font-size: 13px;
}

body.store-page .recent-order-payment {
  width: fit-content;
  margin: 0 0 12px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 800;
}

body.store-page .recent-order-payment-paid {
  background: var(--ok-soft);
  color: var(--ok);
}

body.store-page .recent-order-payment-refunded,
body.store-page .recent-order-payment-failed {
  background: var(--danger-soft);
  color: var(--danger);
}

body.store-page .recent-order-card-footer {
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

@media (max-width: 760px) {
  body.store-page .recent-orders-heading {
    align-items: stretch;
    flex-direction: column;
  }

  body.store-page .recent-orders-heading .btn {
    width: 100%;
  }

  body.store-page .recent-orders-list {
    grid-template-columns: 1fr;
  }

  body.store-page .store-mobile-bottom-nav {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 420px) {
  body.store-page .recent-order-card-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

.merchant-loyalty-card,
.store-loyalty-card {
  display: grid;
  gap: 16px;
}

.merchant-fidelity {
  display: grid;
  gap: 18px;
}

.merchant-loyalty-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.merchant-loyalty-form .checkbox-label,
.merchant-loyalty-form .actions {
  grid-column: 1 / -1;
}

.merchant-loyalty-members-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  margin-top: 6px;
}

.merchant-loyalty-members-heading h4 {
  margin: 0;
}

.merchant-loyalty-members-heading h3 {
  margin: 0 0 4px;
}

.merchant-loyalty-total {
  white-space: nowrap;
  color: var(--primary);
}

.merchant-loyalty-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(190px, 1fr);
  gap: 14px;
  align-items: end;
}

.merchant-loyalty-members {
  display: grid;
  gap: 10px;
}

.merchant-loyalty-member {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.merchant-loyalty-member div {
  display: grid;
  gap: 3px;
}

.merchant-loyalty-member small,
.merchant-loyalty-member span {
  color: var(--muted);
}

.merchant-loyalty-member.is-reward-ready {
  border-color: color-mix(in srgb, var(--primary) 46%, var(--border));
  background: color-mix(in srgb, var(--primary) 6%, #fff);
}

.merchant-loyalty-member em {
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 14%, #fff);
  color: var(--primary);
  font-size: .78rem;
  font-style: normal;
  font-weight: 700;
}

.merchant-loyalty-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 4px;
}

.store-loyalty-card {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--primary) 32%, var(--border));
  border-radius: 18px;
  background: color-mix(in srgb, var(--primary) 7%, #fff);
}

.store-loyalty-card h4 {
  margin: 2px 0 0;
}

.store-loyalty-points {
  color: var(--primary);
  font-size: clamp(1.6rem, 5vw, 2.3rem);
}

.store-loyalty-progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 14%, #fff);
}

.store-loyalty-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width .25s ease;
}

@media (max-width: 760px) {
  .merchant-loyalty-form {
    grid-template-columns: 1fr;
  }

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

  .merchant-loyalty-member,
  .merchant-loyalty-members-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .merchant-loyalty-pagination {
    flex-wrap: wrap;
  }
}
