/* ============================================================
   Volantino Digitale - Stili (namespace vd-)
   ============================================================ */

/* ---------- Base comune ---------- */
.vd-notice { padding: 12px 16px; border-radius: 8px; margin: 12px 0; background: #f0f4f8; border: 1px solid #d5dee8; font-size: 15px; }
.vd-notice-ok  { background: #e8f7ee; border-color: #b7e4c7; color: #1b6b3a; }
.vd-notice-err { background: #fdecec; border-color: #f5b5b5; color: #a12020; }

.vd-btn { display: inline-block; padding: 9px 18px; border: 1px solid #c7ccd4; border-radius: 8px; background: #fff; color: #222; font-size: 15px; cursor: pointer; text-decoration: none; transition: background .15s; }
.vd-btn:hover { background: #f3f5f8; }
.vd-btn-primary { background: #16407c; border-color: #16407c; color: #fff; font-weight: 600; }
.vd-btn-primary:hover { background: #1d54a3; color: #fff; }
.vd-btn-ghost { border-style: dashed; color: #777; }
.vd-btn-icon { width: 30px; height: 30px; border: 1px solid #d0d5dc; border-radius: 6px; background: #fff; cursor: pointer; font-size: 15px; line-height: 1; }
.vd-btn-icon:hover { background: #f2f4f7; }

.vd-hp { position: absolute !important; left: -9999px !important; }

/* ---------- Form auth ---------- */
.vd-auth-box { max-width: 420px; margin: 0 auto; padding: 24px; border: 1px solid #e3e6ea; border-radius: 12px; background: #fff; }
.vd-auth-box h3 { margin-top: 0; }
.vd-form input[type="text"], .vd-form input[type="email"], .vd-form input[type="password"],
.vd-editor input[type="text"], .vd-editor input[type="email"], .vd-editor input[type="url"],
.vd-editor input[type="date"], .vd-editor input[type="number"], .vd-editor textarea {
	width: 100%; padding: 9px 12px; border: 1px solid #c7ccd4; border-radius: 8px; font-size: 15px; box-sizing: border-box;
}
.vd-editor input:focus, .vd-editor textarea:focus { outline: 2px solid #16407c33; border-color: #16407c; }

/* ---------- Dashboard ---------- */
.vd-dashboard { max-width: 860px; margin: 0 auto; }
.vd-dash-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.vd-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.vd-table th, .vd-table td { padding: 10px 12px; border-bottom: 1px solid #e6e9ee; text-align: left; }
.vd-table th { background: #f6f8fa; font-weight: 600; }
.vd-badge-pub   { background: #e8f7ee; color: #1b6b3a; padding: 3px 10px; border-radius: 20px; font-size: 13px; }
.vd-badge-draft { background: #f4f4f4; color: #666;    padding: 3px 10px; border-radius: 20px; font-size: 13px; }
.vd-actions a { text-decoration: none; }
.vd-empty { color: #777; font-style: italic; }

/* ---------- Editor ---------- */
.vd-editor { max-width: 860px; margin: 0 auto; }
.vd-fieldset { border: 1px solid #e3e6ea; border-radius: 12px; padding: 18px 20px; margin: 18px 0; background: #fff; }
.vd-fieldset h4 { margin: 0 0 14px; font-size: 17px; border-bottom: 1px solid #eef0f3; padding-bottom: 8px; }
.vd-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
@media (max-width: 640px) { .vd-grid-2 { grid-template-columns: 1fr; } }
.vd-editor label { font-size: 14px; font-weight: 600; color: #333; }

.vd-logo-row { margin-top: 6px; }
.vd-upload-box { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
#vd-logo-preview { max-height: 70px; max-width: 160px; border-radius: 8px; border: 1px solid #e3e6ea; background: #fff; }

/* Repeater prodotti */
.vd-prodotto { display: grid; grid-template-columns: 110px 1fr 36px; gap: 14px; align-items: start; padding: 14px; border: 1px solid #e6e9ee; border-radius: 10px; margin-bottom: 12px; background: #fafbfc; }
@media (max-width: 640px) { .vd-prodotto { grid-template-columns: 1fr; } }
.vd-prodotto-foto { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.vd-p-preview { width: 100px; height: 100px; object-fit: cover; border-radius: 8px; border: 1px solid #dfe3e8; background: #fff; }
.vd-prodotto-campi { display: flex; flex-direction: column; gap: 8px; }
.vd-prezzi-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.vd-prezzi-row label { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.vd-prezzi-row input { width: 110px; }
.vd-p-sconto-hint { font-weight: 700; color: #c62828; font-size: 15px; }
.vd-prodotto-tools { display: flex; flex-direction: column; gap: 6px; }

.vd-save-bar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 16px 0 40px; }
.vd-check { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.vd-spinner { width: 20px; height: 20px; border: 3px solid #d7dce3; border-top-color: #16407c; border-radius: 50%; animation: vd-spin .7s linear infinite; }
@keyframes vd-spin { to { transform: rotate(360deg); } }

/* ============================================================
   VOLANTINO PUBBLICO
   ============================================================ */
.vd-flyer { max-width: 960px; margin: 0 auto; padding: 0 12px 40px; font-family: inherit; }

.vd-flyer-header { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 22px; border-radius: 14px; background: linear-gradient(135deg, #16407c, #1d54a3); color: #fff; margin-bottom: 8px; }
.vd-flyer-logo { max-height: 80px; max-width: 180px; border-radius: 10px; background: #fff; padding: 6px; }
.vd-flyer-shop h1 { margin: 0 0 4px; font-size: 28px; color: #fff; }
.vd-flyer-shop p { margin: 2px 0; font-size: 14px; opacity: .92; }
.vd-flyer-shop a { color: #ffd54d; }

.vd-flyer-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 10px 0 22px; }
.vd-flyer-title { font-size: 24px; font-weight: 800; margin: 0; }
.vd-flyer-validity { background: #fff4d6; border: 1px solid #f0dfa6; color: #7a5b00; padding: 6px 14px; border-radius: 20px; font-size: 14px; font-weight: 600; }

.vd-flyer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }

.vd-card { position: relative; border: 1px solid #e5e8ec; border-radius: 14px; background: #fff; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.vd-card-img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: #f4f6f8; display: block; }
.vd-card-noimg { width: 100%; aspect-ratio: 1 / 1; background: #f2f4f7; display: flex; align-items: center; justify-content: center; color: #b7bec7; font-size: 40px; }
.vd-card-body { padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.vd-card-title { font-size: 16px; font-weight: 700; margin: 0; line-height: 1.3; }
.vd-card-desc { font-size: 13px; color: #666; margin: 0; flex: 1; }

.vd-card-prices { display: flex; align-items: baseline; gap: 10px; margin-top: 4px; }
.vd-price-old { text-decoration: line-through; color: #999; font-size: 14px; }
.vd-price-now { font-size: 22px; font-weight: 800; color: #c62828; }
.vd-price-only { font-size: 20px; font-weight: 800; color: #16407c; }

.vd-badge-sconto { position: absolute; top: 10px; right: 10px; background: #c62828; color: #fff; font-weight: 800; font-size: 15px; padding: 6px 10px; border-radius: 10px; box-shadow: 0 2px 6px rgba(0,0,0,.25); }

.vd-flyer-footer { margin-top: 30px; text-align: center; font-size: 13px; color: #888; }
.vd-print-bar { text-align: right; margin: 6px 0 14px; }

/* ---------- Sfoglia pagine ---------- */
.vd-nav { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 0 0 16px; }
.vd-nav-btn { width: 46px; height: 46px; border-radius: 50%; border: 1px solid #c7ccd4; background: #fff; font-size: 20px; cursor: pointer; transition: background .15s, transform .1s; }
.vd-nav-btn:hover:not(:disabled) { background: #16407c; color: #fff; border-color: #16407c; }
.vd-nav-btn:active:not(:disabled) { transform: scale(.93); }
.vd-nav-btn:disabled { opacity: .35; cursor: default; }
.vd-nav-counter { font-size: 16px; font-weight: 700; color: #333; min-width: 60px; text-align: center; }

.vd-pages { overflow: hidden; touch-action: pan-y; }
.vd-track { display: flex; transition: transform .45s cubic-bezier(.4, 0, .2, 1); will-change: transform; }
.vd-page { min-width: 100%; box-sizing: border-box; }

.vd-dots { display: flex; justify-content: center; gap: 10px; margin-top: 20px; }
.vd-dot { width: 12px; height: 12px; border-radius: 50%; border: none; background: #cdd3db; cursor: pointer; padding: 0; transition: background .2s, transform .2s; }
.vd-dot:hover { background: #9aa5b2; }
.vd-dot-active { background: #16407c; transform: scale(1.25); }

@media (prefers-reduced-motion: reduce) {
	.vd-track { transition: none; }
}

/* ============================================================
   PAGINA DEDICATA /crea-volantino/
   ============================================================ */
.vd-app-body { margin: 0; background: #f2f4f8; color: #222; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
.vd-topbar { background: #16407c; color: #fff; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 22px; }
.vd-topbar-title { font-size: 19px; font-weight: 800; }
.vd-topbar a { color: #ffd54d; text-decoration: none; }
.vd-topbar a:hover { text-decoration: underline; }
.vd-app-main { max-width: 900px; margin: 28px auto 60px; padding: 0 14px; }
.vd-app-h2 { font-size: 26px; margin: 0 0 6px; }
.vd-app-sub { color: #555; margin: 0 0 22px; }
.vd-app-footer { text-align: center; padding: 20px 0 34px; font-size: 14px; }
.vd-app-footer a { color: #16407c; }

.vd-auth-wrap { max-width: 480px; margin: 0 auto; }
.vd-tabs { display: flex; }
.vd-tab { padding: 11px 24px; border: 1px solid #dfe3ea; border-bottom: none; background: #e9edf3; border-radius: 10px 10px 0 0; cursor: pointer; font-size: 15px; font-weight: 700; color: #555; }
.vd-tab + .vd-tab { margin-left: 4px; }
.vd-tab-active { background: #fff; color: #16407c; }
.vd-tab-panel { border: 1px solid #dfe3ea; background: #fff; border-radius: 0 12px 12px 12px; padding: 22px; }
.vd-btn-block { width: 100%; padding: 12px; font-size: 16px; }
.vd-btn-big { padding: 14px 28px; font-size: 17px; }
.vd-btn-add { margin-top: 4px; }
.vd-empty-box { text-align: center; padding: 50px 20px; border: 2px dashed #d5dbe3; border-radius: 14px; background: #fff; }
.vd-count { font-weight: 700; color: #16407c; font-size: 14px; }

/* Card negozio */
.vd-negozio-card { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; background: #fff; border: 1px solid #dfe3ea; border-radius: 14px; padding: 18px 22px; margin-bottom: 22px; }
.vd-negozio-logo { width: 70px; height: 70px; object-fit: contain; border-radius: 10px; border: 1px solid #e6e9ee; background: #fff; }
.vd-negozio-info { flex: 1; min-width: 200px; }
.vd-negozio-info h2 { margin: 0 0 4px; }
.vd-negozio-info p { margin: 0; color: #555; font-size: 14px; line-height: 1.5; }

.vd-app-body .vd-editor .vd-fieldset,
.vd-app-body .vd-dashboard .vd-table { background: #fff; }


/* ---------- Stampa ---------- */
@media print {
	header, footer, nav, aside, .vd-print-bar, .vd-nav, .vd-dots, .site-header, .site-footer, .sidebar, #wpadminbar { display: none !important; }
	body { background: #fff !important; }
	.vd-flyer { max-width: none; padding: 0; }
	.vd-flyer-header { border-radius: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
	.vd-pages { overflow: visible; }
	.vd-track { display: block !important; transform: none !important; }
	.vd-page { min-width: 0; page-break-after: always; break-after: page; }
	.vd-page:last-child { page-break-after: auto; break-after: auto; }
	.vd-flyer-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
	.vd-card { break-inside: avoid; box-shadow: none; }
	.vd-badge-sconto { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
