: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-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 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: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
}

.store-page .product-add-button {
  flex: 0 0 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 .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-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-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-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-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 .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-form-grid {
    grid-template-columns: 1fr;
  }

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

  .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-media {
    min-height: min(58vw, 250px);
  }

  .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%;
  }
}


/* =========================================================
   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);
}

/* ---- 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-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;
}

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;
  }
}
