/* ═══════════════════════════════════════════════
   MercFotoFast v2 — Kiosk CSS
   Mobile-first, design moderno, tocco generoso
   ═══════════════════════════════════════════════ */

/* ─── VARIABILI ─────────────────────────────── */
:root {
    --bg: #FAFAF8;
    --surface: #FFFFFF;
    --text: #1A1A2E;
    --text-secondary: #6B7280;
    --text-light: #9CA3AF;
    --accent: #E85D3A;
    --accent-hover: #D14E2E;
    --accent-soft: #FEF0EC;
    --green: #10B981;
    --green-soft: #ECFDF5;
    --blue: #3B82F6;
    --blue-soft: #EFF6FF;
    --gold: #F59E0B;
    --gold-soft: #FFFBEB;
    --border: #F0F0F0;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 8px;
    --shadow: 0 2px 16px rgba(26, 26, 46, 0.06);
    --shadow-lg: 0 8px 32px rgba(26, 26, 46, 0.10);
    --font-display: 'Syne', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ─── RESET ─────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overscroll-behavior-y: none;
}

a { color: inherit; text-decoration: none; }
button { font-family: var(--font-body); cursor: pointer; }
img { max-width: 100%; display: block; }

/* ─── APP SHELL ─────────────────────────────── */
.app-shell {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
    background: var(--bg);
}

/* ─── SLIDESHOW ─────────────────────────────── */
.slideshow {
    position: relative;
    height: 300px;
    overflow: hidden;
}

.slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.8s ease;
    will-change: opacity;
}

.slide-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 30px 24px;
}
.slide.active { opacity: 1; }

.slide-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.slide h2 {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 800;
    color: white;
    text-align: center;
    margin-bottom: 6px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    line-height: 1.2;
}

.slide p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    text-align: center;
}

.slide-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 2;
}

.slide-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
    cursor: pointer;
}
.slide-dot.active {
    background: white;
    transform: scale(1.3);
}

/* ─── SEZIONI ───────────────────────────────── */
.section { margin-bottom: 8px; }

.section-header {
    padding: 20px 20px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-header h3 {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.section-header a {
    font-size: 13px;
    color: var(--accent);
    font-weight: 600;
}

/* ─── CATEGORIA PINNATA ─────────────────────── */
.pinned-section {
    padding: 16px 16px 0;
}

.pinned-card {
    border-radius: var(--radius);
    overflow: hidden;
    background: linear-gradient(135deg, #1A1A2E 0%, #2D3748 100%);
    padding: 0;
    position: relative;
    min-height: 180px;
}

.pinned-overlay {
    position: relative;
    z-index: 2;
    padding: 24px 20px;
    background: linear-gradient(180deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.65) 100%);
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.pinned-emoji {
    font-size: 40px;
    margin-bottom: 10px;
    line-height: 1;
}

.pinned-card h3 {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 800;
    color: white;
    margin-bottom: 6px;
    line-height: 1.2;
}

.pinned-card p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    margin-bottom: 16px;
    line-height: 1.4;
}

.pinned-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 24px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    transition: transform 0.15s ease;
}
.pinned-btn:active { transform: scale(0.96); }
.pinned-btn .arrow { font-size: 16px; }

/* ─── ISPIRAZIONI SCROLL ────────────────────── */
.inspiration-scroll {
    display: flex;
    gap: 12px;
    padding: 0 20px 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.inspiration-scroll::-webkit-scrollbar { display: none; }

.inspiration-card {
    min-width: 200px;
    max-width: 200px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow);
    scroll-snap-align: start;
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.2s ease;
}
.inspiration-card:active { transform: scale(0.97); }

.inspiration-img {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
.inspiration-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.inspiration-img span {
    font-size: 48px;
    line-height: 1;
}

.inspiration-card .card-body {
    padding: 12px;
}

.inspiration-card h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text);
}

.inspiration-card p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.3;
}

.inspiration-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    background: var(--accent-soft);
    color: var(--accent);
}

/* ─── GRIGLIA PRODOTTI ──────────────────────── */
.product-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 0 16px 20px;
}

.product-card {
    background: var(--surface);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}
.product-card:active {
    transform: scale(0.97);
}

.product-icon {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.product-icon span {
    font-size: 44px;
    line-height: 1;
}

.product-icon.has-image {
    overflow: hidden;
}

.product-icon-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Gradient per ogni prodotto */
.product-icon.stampe { background: linear-gradient(135deg, #FEF0EC, #FDE8E0); }
.product-icon.ingrandimenti { background: linear-gradient(135deg, #EFF6FF, #DBEAFE); }
.product-icon.tele { background: linear-gradient(135deg, #ECFDF5, #D1FAE5); }
.product-icon.foto_quadri { background: linear-gradient(135deg, #FFFBEB, #FEF3C7); }
.product-icon.cuscino_foto { background: linear-gradient(135deg, #F5F3FF, #EDE9FE); }
.product-icon.cornici { background: linear-gradient(135deg, #FFF1F2, #FFE4E6); }

.product-card .card-body {
    padding: 12px;
}

.product-card h4 {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 2px;
    color: var(--text);
}

.product-card .price-hint {
    font-size: 11px;
    color: var(--text-secondary);
}

.badge-popular {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 3px 8px;
    border-radius: var(--radius-xs);
    font-size: 9px;
    font-weight: 700;
    background: var(--gold);
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 1;
}

/* ─── BOTTOM BAR ────────────────────────────── */
.bottom-bar {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 8px calc(10px + var(--safe-bottom));
    background: var(--surface);
    border-top: 1px solid var(--border);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 480px;
    margin: 0 auto;
    z-index: 100;
}

.bottom-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 14px;
    border: none;
    background: transparent;
    border-radius: 12px;
    transition: all 0.2s ease;
    position: relative;
}
.bottom-tab:active { transform: scale(0.92); }

.bottom-tab .tab-icon {
    font-size: 22px;
    line-height: 1;
    transition: transform 0.2s ease;
}

.bottom-tab .tab-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.bottom-tab.active .tab-label { color: var(--accent); }
.bottom-tab.active .tab-icon { transform: scale(1.1); }
.bottom-tab.active::after {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--accent);
    border-radius: 0 0 3px 3px;
}

.bottom-spacer {
    height: calc(70px + var(--safe-bottom));
}

/* ─── WIZARD HEADER ─────────────────────────── */
.wizard-header {
    padding: 12px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.back-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #F3F4F6;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
    flex-shrink: 0;
}
.back-btn:active { background: #E5E7EB; }

.wizard-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    flex: 1;
    color: var(--text);
}

.step-indicator {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Progress bar */
.progress-bar {
    height: 3px;
    background: #F0F0F0;
}
.progress-fill {
    height: 100%;
    background: var(--accent);
    transition: width 0.4s ease;
    border-radius: 0 2px 2px 0;
}

/* ─── BIG CTA ───────────────────────────────── */
.cta-bottom {
    padding: 12px 16px calc(12px + var(--safe-bottom));
    background: var(--surface);
    border-top: 1px solid var(--border);
    position: sticky;
    bottom: 0;
    z-index: 50;
}

.cta-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 14px;
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: white;
    background: var(--accent);
    transition: all 0.15s ease;
    letter-spacing: 0.5px;
    touch-action: manipulation;
}
.cta-btn:active {
    transform: scale(0.98);
    background: var(--accent-hover);
}
.cta-btn:disabled {
    background: #D1D5DB;
    cursor: not-allowed;
    transform: none;
}

/* ─── BADGE GUIDA ───────────────────────────── */
.badge-guide {
    margin: 12px 16px;
    padding: 10px 14px;
    background: var(--blue-soft);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #1E40AF;
    line-height: 1.4;
    animation: fadeSlideIn 0.5s ease;
}
.badge-guide .icon { font-size: 16px; flex-shrink: 0; }

.badge-tier {
    margin: 12px 16px;
    padding: 10px 14px;
    background: var(--green-soft);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #065F46;
    font-weight: 500;
    line-height: 1.4;
    animation: fadeSlideIn 0.5s ease;
}
.badge-tier .icon { font-size: 16px; flex-shrink: 0; }

.badge-success {
    margin: 12px 16px;
    padding: 10px 14px;
    background: var(--green-soft);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #065F46;
    font-weight: 600;
    animation: fadeSlideIn 0.3s ease;
}

/* ─── ANIMAZIONI ────────────────────────────── */
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeScale {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.8); }
}

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

/* ─── FORMAT PAGE ───────────────────────────── */
.format-intro {
    padding: 16px 20px 8px;
}
.format-intro p {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.format-list {
    padding: 0 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.format-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}
.format-item:active, .format-item.selected {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.format-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.format-name {
    font-weight: 700;
    font-size: 16px;
    color: var(--text);
}

.format-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    background: var(--gold);
    color: white;
    margin-top: 2px;
    width: fit-content;
}

.format-tier-hint {
    font-size: 11px;
    color: var(--green);
    font-weight: 500;
}

.format-price {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    text-align: right;
}

/* ─── UPLOAD PAGE ───────────────────────────── */
.upload-area {
    margin: 12px 16px;
    padding: 36px 20px;
    border: 2px dashed #D1D5DB;
    border-radius: var(--radius);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--surface);
}
.upload-area:active {
    border-color: var(--accent);
    background: var(--accent-soft);
}
.upload-icon { font-size: 44px; margin-bottom: 10px; line-height: 1; }
.upload-area h4 {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text);
    letter-spacing: 0;
    text-transform: none;
}
.upload-area p {
    font-size: 13px;
    color: var(--text-secondary);
}
.upload-limit {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-light);
    font-weight: 500;
}

.upload-info {
    text-align: center;
    padding: 8px 16px;
    font-size: 13px;
    color: var(--text-secondary);
}


.print-mode-block {
    margin: 12px 16px;
    padding: 14px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
}
.print-mode-title {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}
.print-mode-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}
.print-mode-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.mode-btn {
    border: 2px solid var(--border);
    background: #FAFAFA;
    border-radius: 14px;
    padding: 12px 10px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: all 0.18s ease;
}
.mode-btn:active {
    transform: scale(0.98);
}
.mode-btn.selected {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 0 0 1px rgba(226, 29, 72, 0.08);
}
.mode-name {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}
.mode-desc {
    font-size: 11px;
    line-height: 1.35;
    color: var(--text-secondary);
    min-height: 30px;
}
.mode-price {
    font-size: 18px;
    font-weight: 800;
    color: var(--accent);
    margin-top: 2px;
}

/* Photo grid */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 0 16px;
}

.photo-thumb {
    aspect-ratio: 1;
    border-radius: var(--radius-xs);
    overflow: hidden;
    position: relative;
    background: #F3F4F6;
    animation: fadeScale 0.3s ease;
}
.photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.photo-thumb.uploading {
    opacity: 0.85;
}
.photo-thumb.error {
    border: 2px solid #EF4444;
}

.photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: #F3F4F6;
}

/* Photo status overlays */
.photo-status {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-xs);
}
.photo-status.error {
    background: rgba(239, 68, 68, 0.3);
    cursor: pointer;
}
.photo-status span { font-size: 24px; }

.spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.photo-progress-ring {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.photo-check {
    position: absolute;
    bottom: 4px;
    left: 4px;
    width: 22px;
    height: 22px;
    background: var(--green);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

/* Copy selector */
.copy-selector {
    position: absolute;
    bottom: 4px;
    right: 4px;
    display: flex;
    align-items: center;
    gap: 1px;
    background: rgba(0, 0, 0, 0.75);
    border-radius: 14px;
    padding: 2px 4px;
}
.copy-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: white;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.copy-btn:active { background: rgba(255, 255, 255, 0.2); }
.copy-count {
    color: white;
    font-size: 13px;
    font-weight: 700;
    min-width: 18px;
    text-align: center;
}

/* Delete button */
.photo-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}
.photo-thumb:hover .photo-delete,
.photo-thumb:active .photo-delete {
    opacity: 1;
}
/* Always visible on touch devices */
@media (hover: none) {
    .photo-delete { opacity: 0.8; }
}

/* Upload progress bar */
.upload-progress-bar {
    margin: 12px 16px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    box-shadow: var(--shadow);
}
.upload-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.upload-progress-track {
    height: 4px;
    background: #E5E7EB;
    border-radius: 2px;
    overflow: hidden;
}
.upload-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Price ticker */
.price-ticker {
    margin: 12px 16px;
    padding: 14px 16px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.ticker-left {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}
.ticker-left strong {
    color: var(--text);
    font-size: 14px;
}
.ticker-detail { font-size: 12px; }
.ticker-right { text-align: right; }
.ticker-total {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 800;
    color: var(--accent);
}
.ticker-fee {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Tier hint discreto sotto il prezzo */
.tier-hint-small {
    text-align: center;
    padding: 4px 16px 8px;
    font-size: 12px;
    color: var(--text-light);
    font-weight: 400;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    background: var(--text);
    color: white;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    z-index: 200;
    transition: opacity 0.3s;
    box-shadow: var(--shadow-lg);
    max-width: 90%;
    text-align: center;
}

/* ─── RESPONSIVE ────────────────────────────── */
@media (min-width: 481px) {
    .app-shell {
        box-shadow: var(--shadow-lg);
        border-left: 1px solid var(--border);
        border-right: 1px solid var(--border);
    }
    body {
        background: #EDEDEB;
    }
}

@media (max-width: 350px) {
    .slide h2 { font-size: 20px; }
    .product-grid { gap: 8px; padding: 0 12px 16px; }
    .product-icon { height: 80px; }
    .product-icon span { font-size: 36px; }
    .section-header { padding: 16px 12px 10px; }
}

/* ─── RIEPILOGO / CARRELLO ─────────────────── */
.cart-page {
    padding: 0 16px calc(110px + var(--safe-bottom));
}

.cart-hero {
    position: relative;
    overflow: hidden;
    margin: 18px 0 16px;
    padding: 22px 20px;
    border-radius: 24px;
    background: linear-gradient(135deg, #FFFFFF 0%, #FFF7F4 100%);
    border: 1px solid #F3E3DD;
    box-shadow: var(--shadow);
}

.cart-hero::before,
.cart-hero::after {
    content: '';
    position: absolute;
    border-radius: 999px;
    background: rgba(232, 93, 58, 0.07);
    pointer-events: none;
}

.cart-hero::before {
    width: 140px;
    height: 140px;
    right: -26px;
    top: -36px;
}

.cart-hero::after {
    width: 92px;
    height: 92px;
    right: 22px;
    bottom: -40px;
}

.cart-hero-pill {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid #F6D6CC;
    font-size: 13px;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.cart-hero h1 {
    margin: 14px 0 8px;
    font-family: var(--font-display);
    font-size: 30px;
    line-height: 1.05;
    position: relative;
    z-index: 1;
}

.cart-hero p {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.45;
    position: relative;
    z-index: 1;
}

.cart-summary-card,
.cart-list-card,
.cart-totals-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: var(--shadow);
}

.cart-summary-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 14px;
    margin-bottom: 16px;
}

.cart-summary-block {
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px;
    background: #FFFFFF;
}

.cart-summary-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.cart-summary-value {
    font-size: 28px;
    line-height: 1;
    font-weight: 800;
    color: var(--text);
}

.cart-summary-value.small {
    font-size: 21px;
    color: var(--accent);
}

.cart-summary-sub {
    margin-top: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.45;
}

.cart-list-card {
    padding: 10px;
}

.cart-section-title {
    padding: 12px 14px 8px;
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
}

.cart-section-title.no-pad {
    padding: 0 0 10px;
}

.cart-item-row {
    display: grid;
    grid-template-columns: 86px 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border-top: 1px solid var(--border);
}

.cart-item-row:first-of-type {
    border-top: none;
}

.cart-item-thumbs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.cart-thumb {
    aspect-ratio: 1;
    border-radius: 12px;
    background: linear-gradient(135deg, #F8D9CF 0%, #FCEEE9 100%);
    border: 1px solid #F3E3DD;
}

.cart-item-title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 8px;
}

.cart-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.cart-pill {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #FFFFFF;
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

.cart-pill.mode {
    background: var(--accent-soft);
    border-color: #F6D6CC;
    color: var(--accent);
}

.cart-item-note {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.45;
}

.cart-item-price {
    text-align: right;
    white-space: nowrap;
}

.cart-item-price .label {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 6px;
}

.cart-item-price .value {
    color: var(--accent);
    font-size: 24px;
    font-weight: 800;
    line-height: 1;
}

.cart-totals-card {
    margin-top: 16px;
    padding: 18px;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    font-size: 16px;
    border-bottom: 1px solid var(--border);
}

.cart-total-row .muted {
    display: block;
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 14px;
}

.cart-total-row.grand-total {
    border-bottom: none;
    padding-top: 16px;
    font-size: 24px;
    font-weight: 800;
}

.cart-actions {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    padding: 14px 16px calc(14px + var(--safe-bottom));
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    background: rgba(250, 250, 248, 0.94);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(229, 231, 235, 0.95);
}

.cart-btn {
    min-height: 58px;
    border-radius: 18px;
    border: none;
    font-size: 16px;
    font-weight: 800;
    padding: 14px 16px;
}

.cart-btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.cart-btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 14px 30px rgba(232, 93, 58, 0.22);
}

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

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

    .cart-item-price {
        text-align: left;
    }

    .cart-actions {
        grid-template-columns: 1fr;
    }
}


/* ─── DATI CLIENTE / CONFERMA ───────────────── */

.cart-actions.single-action {
    grid-template-columns: 1fr;
}

.post-order-actions-card {
    padding: 10px 10px 18px;
    margin-bottom: 104px;
}

.post-order-note {
    padding: 8px 14px 0;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.55;
}

.customer-card {
    padding: 10px 10px 16px;
}

.customer-form {
    display: grid;
    gap: 14px;
    padding: 8px 14px 0;
}

.form-field label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}

.form-field input {
    width: 100%;
    min-height: 56px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: #fff;
    padding: 0 16px;
    font-size: 17px;
    color: var(--text);
    outline: none;
}

.form-field input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(232, 93, 58, 0.10);
}

.form-alert {
    margin: 0 14px 8px;
    padding: 14px 16px;
    border-radius: 16px;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #B91C1C;
    font-size: 14px;
    font-weight: 700;
}

.privacy-check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    margin-bottom: 4px;
    font-size: 0.9rem;
    color: #444;
}
.privacy-check-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
}
.privacy-link {
    color: #1a1a1a;
    font-weight: 600;
    text-decoration: underline;
}

.customer-actions-inline {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 4px;
}

.cart-hero.success {
    background: linear-gradient(135deg, #FFFFFF 0%, #ECFDF5 100%);
    border-color: #CDEDDD;
}

.cart-hero.success::before,
.cart-hero.success::after {
    background: rgba(16, 185, 129, 0.08);
}

.success-pill {
    background: #ECFDF5;
    color: #059669;
    border-color: #BDE7D3;
}

.confirm-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 14px;
    border-top: 1px solid var(--border);
    font-size: 16px;
    color: var(--text);
}

.confirm-row:first-of-type {
    border-top: none;
}

.confirm-row span {
    color: var(--text-secondary);
}

.confirm-row.total {
    font-size: 22px;
    font-weight: 800;
}

@media (max-width: 420px) {
    .customer-actions-inline {
        grid-template-columns: 1fr;
    }
    .confirm-row {
        flex-direction: column;
        align-items: flex-start;
    }
}


/* ═══════════════════════════════════════════════
   CANVAS EDITOR — Personalizzazione tela
   ═══════════════════════════════════════════════ */

.canvas-editor-page {
    padding-bottom: calc(100px + var(--safe-bottom));
}

.ce-format-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--blue-soft);
    margin: 0 16px 4px;
    border-radius: var(--radius-sm);
}
.ce-format-label {
    font-size: 14px;
    color: var(--text-secondary);
}
.ce-format-value {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

/* ─── ORIENTATION BUTTONS ──────────────────── */
.ce-orient-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 0 16px;
}
.ce-orient-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    transition: all 0.2s ease;
}
.ce-orient-btn:hover {
    border-color: #ccc;
}
.ce-orient-btn.on {
    border-color: var(--green);
    background: var(--green-soft);
}
.ce-orient-icon {
    width: 44px;
    height: auto;
    margin-bottom: 8px;
}
.ce-orient-btn.on .ce-orient-icon rect {
    fill: #bfdbfe;
    stroke: #2563eb;
}
.ce-orient-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}
.ce-orient-btn.on .ce-orient-label {
    color: #065F46;
}
.ce-orient-size {
    font-size: 12px;
    color: var(--text-secondary);
}
.ce-orient-btn.on .ce-orient-size {
    color: #065F46;
}

.ce-section-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 16px 20px 8px;
}

/* ─── WRAP BUTTONS ─────────────────────────── */
.ce-wrap-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    padding: 0 16px;
}
.ce-wrap-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 4px 8px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    transition: all 0.15s ease;
}
.ce-wrap-btn:hover {
    border-color: #ccc;
}
.ce-wrap-btn.on {
    border-color: var(--green);
    background: var(--green-soft);
}
.ce-wrap-icon {
    width: 30px;
    height: 30px;
    margin-bottom: 5px;
}
.ce-wrap-label {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.2;
    text-align: center;
}
.ce-wrap-btn.on .ce-wrap-label {
    color: #065F46;
    font-weight: 600;
}

/* ─── CROP AREA ────────────────────────────── */
.ce-crop-outer {
    padding: 0 16px;
    position: relative;
}
.ce-crop-container {
    position: relative;
    margin: 0 auto;
    overflow: hidden;
    border-radius: var(--radius-sm);
    background: #111;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}
.ce-crop-container canvas {
    display: block;
}
.ce-crop-container::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: var(--radius-sm);
}

/* Locked state — slight dimming, no cursor change */
.ce-crop-container:not(.unlocked) {
    cursor: default;
}
.ce-crop-container.unlocked {
    cursor: grab;
}
.ce-crop-container.unlocked:active {
    cursor: grabbing;
}

/* Crop frame with rule of thirds */
.ce-crop-frame {
    position: absolute;
    border: 2px solid rgba(255, 255, 255, 0.92);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    transition: left 0.06s ease, top 0.06s ease, width 0.06s ease, height 0.06s ease;
}
.ce-crop-frame::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            0deg,
            transparent, transparent calc(33.33% - 0.5px),
            rgba(255,255,255,0.2) calc(33.33% - 0.5px),
            rgba(255,255,255,0.2) calc(33.33% + 0.5px),
            transparent calc(33.33% + 0.5px)
        ),
        repeating-linear-gradient(
            90deg,
            transparent, transparent calc(33.33% - 0.5px),
            rgba(255,255,255,0.2) calc(33.33% - 0.5px),
            rgba(255,255,255,0.2) calc(33.33% + 0.5px),
            transparent calc(33.33% + 0.5px)
        );
}

/* ─── LOCK BUTTON ──────────────────────────── */
.ce-lock-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 10px;
    padding: 12px 20px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}
.ce-lock-btn:active {
    transform: scale(0.98);
}
.ce-lock-btn.locked {
    color: var(--text-secondary);
    border-color: var(--border);
    background: var(--surface);
}
.ce-lock-btn:not(.locked) {
    color: #065F46;
    border-color: var(--green);
    background: var(--green-soft);
}
.ce-lock-btn svg {
    flex-shrink: 0;
}

/* ─── 3D PREVIEW WALL ──────────────────────── */
.ce-wall {
    margin: 0 16px;
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #c7bfb4;
}
.ce-wall-texture {
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            90deg,
            rgba(0,0,0,0.01) 0px, rgba(0,0,0,0.01) 1px,
            transparent 1px, transparent 30px
        ),
        repeating-linear-gradient(
            0deg,
            rgba(0,0,0,0.01) 0px, rgba(0,0,0,0.01) 1px,
            transparent 1px, transparent 30px
        );
    opacity: 0.5;
}
.ce-canvas3d {
    position: relative;
    z-index: 2;
    filter: drop-shadow(3px 8px 16px rgba(0,0,0,0.35));
}
.ce-wall-shadow {
    position: absolute;
    bottom: 0;
    left: 15%;
    width: 70%;
    height: 20px;
    background: radial-gradient(ellipse, rgba(0,0,0,0.06) 0%, transparent 70%);
    z-index: 1;
}

/* ─── INFO BAR ─────────────────────────────── */
.ce-info {
    margin: 12px 16px 0;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}
.ce-info strong {
    color: var(--text);
    font-weight: 600;
}

/* ─── RESPONSIVE ───────────────────────────── */
@media (max-width: 380px) {
    .ce-wrap-row {
        gap: 4px;
        padding: 0 12px;
    }
    .ce-wrap-btn {
        padding: 8px 2px 6px;
    }
    .ce-wrap-icon {
        width: 24px;
        height: 24px;
    }
    .ce-wrap-label {
        font-size: 10px;
    }
    .ce-wall {
        min-height: 200px;
        margin: 0 12px;
    }
}


/* ─── CORNICI CATALOGO ───────────────────── */
.frames-page, .frame-detail-page { padding: 14px 14px 0; }
.frames-hero { padding: 16px; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); margin-bottom: 14px; }
.frames-eyebrow { font-size: 11px; letter-spacing: .16em; font-weight: 700; color: var(--text-light); margin-bottom: 6px; }
.frames-title { font-family: var(--font-display); font-size: 27px; line-height: 1.1; margin-bottom: 6px; }
.frames-subtitle { color: var(--text-secondary); font-size: 15px; }
.frames-filters { margin-top: 14px; display: grid; gap: 12px; }
.frames-filter-block p { font-size: 13px; font-weight: 700; margin-bottom: 7px; color: var(--text-secondary); }
.frames-pills { display:flex; flex-wrap:wrap; gap:8px; }
.frames-pill { border:1px solid var(--border); background:#fff; border-radius:999px; padding:8px 12px; font-size:12px; font-weight:600; color:var(--text-secondary); }
.frames-pill.is-active { background: var(--color-background-secondary, var(--text)); color:var(--text); border-color:var(--border); }
.frames-grid { display:grid; gap:12px; margin-bottom: 12px; }
.frame-card--catalog, .frame-detail-card { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.frame-card--catalog { border: 1px solid rgba(0,0,0,.04); }
.frame-card__image-wrap { display:block; background:#f6f6f7; aspect-ratio: 4/3; padding: 14px; }
.frame-card__image, .frame-detail-image { width:100%; height:100%; object-fit:contain; border-radius: 12px; }
.frame-card__placeholder { min-height: 150px; display:flex; align-items:center; justify-content:center; color:var(--text-light); font-weight:700; background:#f6f6f7; border-radius: 12px; }
.frame-card__body, .frame-detail-body { padding: 14px; }
.frame-card__top { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
.frame-card__top h3, .frame-detail-body h1 { font-family: var(--font-display); font-size: 21px; line-height:1.15; }
.frame-card__top p, .frame-detail-desc { color: var(--text-secondary); margin-top: 6px; font-size: 14px; }
.frame-chip-row { display:flex; flex-wrap:wrap; gap:6px; margin-top:12px; }
.frame-chip { display:inline-flex; align-items:center; justify-content:center; min-height: 28px; padding: 5px 10px; border-radius:999px; background:#f3f4f6; color:var(--text-secondary); font-size: 11px; font-weight:700; }
.frame-chip--price { background: #eef1f5; color:var(--text); }
.frame-chip--soft { background: var(--accent-soft); color: var(--accent); }
.frame-chip--outline { background:#fff; border:1px solid var(--border); }
.frame-link { margin-top: 14px; display:inline-flex; align-items:center; gap:6px; font-size: 13px; font-weight: 700; color: var(--accent); text-decoration:none; }
.frame-link:hover { text-decoration: underline; }
.frame-card__actions { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top: 14px; }
.frame-link--primary { min-height: 38px; padding: 0 14px; border:1px solid var(--border); border-radius: 12px; background:#fff; color: var(--text); text-decoration:none; }
.frame-link--primary:hover { text-decoration:none; }
.frame-detail-actions--top { margin-bottom: 16px; }
.frame-empty { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); padding: 16px; color: var(--text-secondary); }
.frame-detail-card { display:grid; gap:0; }
.frame-detail-image-wrap { background:#f6f6f7; aspect-ratio: 4/3; padding: 16px; }
.frame-requirements { margin-top: 16px; background: #faf7f3; border-radius: 16px; padding: 14px; }
.frame-requirements h3 { font-family: var(--font-display); font-size: 17px; margin-bottom: 10px; }
.frame-slot-list { display:grid; gap:8px; }
.frame-slot-item { display:grid; grid-template-columns: 32px 1fr; gap:10px; align-items:center; padding: 9px 10px; background:#fff; border-radius: 12px; }
.frame-slot-num { width: 28px; height:28px; border-radius:50%; background: #eef1f5; color:var(--text); display:flex; align-items:center; justify-content:center; font-weight:700; font-size: 12px; }
.frame-detail-actions { display:grid; gap:8px; margin-top:16px; }
.frame-action-primary.secondary-btn, .frame-action-secondary.secondary-btn { min-height:46px; border-radius: 14px; border:1px solid var(--border); background:#fff; color: var(--text); display:flex; align-items:center; justify-content:center; font-weight:600; font-size: 14px; }
.frame-action-primary.secondary-btn { background: var(--color-background-secondary, #f7f7f8); }
@media (min-width: 700px) { .frame-detail-card { grid-template-columns: .92fr 1.08fr; } }
@media (min-width: 860px) { .frames-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ─────────────────────────────────────────────
   CUSCINO FOTO — configurazione semplice
───────────────────────────────────────────── */
.cushion-config-card {
    margin-top: 18px;
    padding: 18px;
    background: #fff;
    border: 1px solid #e8e1d8;
    border-radius: 18px;
    box-shadow: 0 10px 26px rgba(34, 30, 27, 0.05);
}
.cushion-config-title {
    font-size: 18px;
    font-weight: 800;
    color: #2f2a26;
    margin-bottom: 8px;
}
.cushion-config-copy {
    margin: 0 0 16px;
    color: #5f5852;
    font-size: 14px;
    line-height: 1.55;
}
.cushion-colors { margin-bottom: 16px; }
.cushion-color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}
.cushion-color-option {
    border: 1px solid #ddd3c8;
    background: #fff;
    color: #2f2a26;
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
}
.cushion-color-option.active {
    border-color: #8b6d57;
    box-shadow: 0 0 0 2px rgba(139, 109, 87, 0.12);
    background: #faf6f2;
}
.cushion-color-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.12);
    flex: 0 0 18px;
}
.cushion-note-input {
    width: 100%;
    border: 1px solid #ddd3c8;
    border-radius: 14px;
    padding: 12px 14px;
    font: inherit;
    color: #2f2a26;
    background: #fff;
    resize: vertical;
}
.cushion-note-input:focus {
    outline: none;
    border-color: #8b6d57;
    box-shadow: 0 0 0 2px rgba(139, 109, 87, 0.12);
}
.cushion-selected-color {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f7f2ed;
    color: #4d4036;
    font-size: 14px;
    font-weight: 600;
}
.hidden { display: none !important; }


/* ─── UPLOAD DA TELEFONO ───────────────────── */
.phone-upload-shell {
    margin: 0 16px 12px;
}
.phone-upload-toggle {
    width: 100%;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
    color: var(--text);
}
.phone-upload-toggle-left {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}
.phone-upload-toggle-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    font-size: 18px;
}
.phone-upload-toggle-right {
    font-size: 13px;
    color: var(--accent);
    font-weight: 600;
}
.phone-upload-panel {
    margin-top: 10px;
    background: var(--surface);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 16px;
}
.phone-upload-panel.hidden,
.hidden { display: none !important; }
.phone-upload-copy {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 12px;
}
.phone-upload-qr-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}
.phone-upload-qr {
    width: 160px;
    height: 160px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: white;
}
.phone-upload-link {
    font-size: 11px;
    color: var(--text-light);
    text-align: center;
    word-break: break-all;
    margin-bottom: 10px;
}
.phone-upload-status {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 12px;
}
.phone-upload-actions {
    display: flex;
    justify-content: center;
}
.phone-upload-refresh {
    border: none;
    background: var(--accent);
    color: white;
    border-radius: 999px;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 700;
}
.upload-phone-page {
    padding-bottom: calc(24px + var(--safe-bottom));
}
.upload-phone-header {
    margin-bottom: 0;
}
.upload-phone-card {
    margin: 16px;
    background: var(--surface);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    padding: 24px 18px;
    text-align: center;
}
.upload-phone-icon {
    font-size: 42px;
    margin-bottom: 8px;
}
.upload-phone-card h1 {
    font-family: var(--font-display);
    font-size: 24px;
    line-height: 1.15;
    margin-bottom: 8px;
}
.upload-phone-lead {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 18px;
}
.upload-phone-picker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 54px;
    border-radius: 14px;
    background: var(--accent);
    color: white;
    font-weight: 700;
    font-size: 16px;
    box-shadow: 0 8px 24px rgba(232, 93, 58, 0.18);
}
.upload-phone-picker input {
    display: none;
}
.upload-phone-help {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-light);
}
.upload-phone-progress {
    margin-top: 18px;
    text-align: left;
}
.upload-phone-progress-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.upload-phone-progress-track {
    height: 10px;
    border-radius: 999px;
    background: #F3F4F6;
    overflow: hidden;
}
.upload-phone-progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--accent) 0%, #F59E0B 100%);
    transition: width 0.2s ease;
}
.upload-phone-result {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
}
.upload-phone-result.ok {
    background: var(--green-soft);
    color: #047857;
}
.upload-phone-result.error {
    background: #FEF2F2;
    color: #B91C1C;
}
.upload-phone-return {
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* === FOTOQUADRO EDITOR === */
.fq-page{padding:14px 14px 110px;max-width:980px;margin:0 auto;}
.fq-hero{padding:10px 2px 6px;}
.fq-title{font-size:1.6rem;font-weight:800;line-height:1.1;color:#171717;}
.fq-subtitle{margin-top:8px;color:#5b5b5b;font-size:1rem;line-height:1.45;}
.fq-card{background:#fff;border:1px solid rgba(0,0,0,.06);border-radius:24px;padding:16px;box-shadow:0 10px 25px rgba(0,0,0,.06);margin-top:14px;}
.fq-card--primary{padding:18px;background:linear-gradient(180deg,#fffaf7 0%,#ffffff 100%);border-color:rgba(232,93,58,.14);box-shadow:0 14px 34px rgba(232,93,58,.08);}
.fq-card--secondary{padding:14px 16px;}
.fq-preview-wrap{display:flex;justify-content:center;align-items:center;padding:6px 0;}
.fq-room{width:min(100%,520px);background:linear-gradient(180deg,#f5f5f5 0%,#ececec 100%);border-radius:22px;padding:18px;box-shadow:inset 0 1px 0 rgba(255,255,255,.6);}
.frame-stage{position:relative;margin:0 auto;aspect-ratio:3/4;width:min(100%,380px);}
.frame-stage.landscape{aspect-ratio:4/3;width:min(100%,470px);}
.fq-frame-image{width:100%;height:100%;display:block;object-fit:contain;filter:drop-shadow(0 14px 28px rgba(0,0,0,.16));user-select:none;-webkit-user-drag:none;}
.photo-window{position:absolute;left:33.6%;top:27.2%;width:33.2%;height:46.8%;overflow:hidden;border-radius:2px;background:#f2f2f2;box-shadow:inset 0 0 0 1px rgba(0,0,0,.08);}
.frame-stage.landscape .photo-window{left:26.9%;top:33.6%;width:46.6%;height:33.1%;}
.photo-window img{width:100%;height:100%;object-fit:cover;display:block;}
.control-title-row{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:10px;}
.control-eyebrow{font-size:.82rem;font-weight:800;letter-spacing:.04em;text-transform:uppercase;color:var(--accent);margin-bottom:2px;}
.control-hint{font-size:.88rem;line-height:1.3;color:#7a4a3d;max-width:180px;text-align:right;}
.control-hint--soft{color:#7b7b7b;}
.control-title{font-size:1.05rem;font-weight:800;color:#171717;margin-bottom:10px;}
.segmented{display:grid;grid-template-columns:1fr 1fr;gap:10px;}
.segmented--compact .segmented-btn{padding:12px 13px;}
.segmented-btn,.frame-option{border:1px solid rgba(0,0,0,.09);background:#fff;border-radius:18px;padding:14px;text-align:left;transition:.18s ease;cursor:pointer;}
.segmented-btn.active,.frame-option.active{border-color:rgba(232,93,58,.35);background:#fff7f3;box-shadow:0 0 0 2px rgba(232,93,58,.10);transform:translateY(-1px);}
.segmented-btn-title{display:block;font-weight:800;color:#171717;}
.segmented-btn-sub{display:block;font-size:.92rem;color:#666;margin-top:4px;line-height:1.35;}
.frame-list{display:grid;gap:10px;}
.frame-list--featured{gap:12px;}
.frame-option{display:grid;grid-template-columns:86px 1fr;align-items:center;gap:14px;padding:16px;}
.frame-thumb{width:86px;height:106px;object-fit:cover;border-radius:14px;background:#f4f4f4;box-shadow:0 8px 20px rgba(0,0,0,.08);}
.frame-name{font-weight:800;color:#171717;font-size:1rem;}
.frame-desc{margin-top:3px;color:#6a6a6a;font-size:.92rem;line-height:1.35;}
.field-label{display:block;font-weight:700;margin-bottom:8px;color:#171717;}
@media (max-width: 520px){.control-title-row{flex-direction:column;align-items:flex-start}.control-hint{text-align:left;max-width:none}}
@media (min-width: 860px){.fq-page{padding-top:18px}.frame-list{grid-template-columns:repeat(3,1fr)}.frame-option{grid-template-columns:1fr;justify-items:center;text-align:center}.frame-thumb{width:126px;height:154px}.frame-copy{text-align:center}.control-hint{max-width:220px}}


/* ─── ISPIRAZIONI (pagine kiosk) ────────────── */
.insp-kiosk-page {
    padding-bottom: calc(90px + var(--safe-bottom));
}

.insp-cat-section { margin-bottom: 8px; }

.insp-cat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 16px 10px;
}
.insp-cat-thumb {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: var(--shadow);
}
.insp-cat-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.insp-cat-info { flex: 1; min-width: 0; }
.insp-cat-info h3 {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
}
.insp-cat-info p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.insp-cat-arrow {
    font-size: 20px;
    color: var(--accent);
    flex-shrink: 0;
}

.insp-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 4px 16px 16px;
    scrollbar-width: none;
}
.insp-scroll::-webkit-scrollbar { display: none; }

.insp-card {
    min-width: 200px;
    max-width: 200px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.15s ease;
    flex-shrink: 0;
}
.insp-card:active { transform: scale(0.97); }

.insp-card-img {
    height: 140px;
    overflow: hidden;
    position: relative;
}
.insp-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.insp-card-placeholder {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 44px;
    background: linear-gradient(135deg, #FEF0EC, #EFF6FF);
}

.insp-card-body { padding: 12px 14px 14px; }
.insp-card-title {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.25;
    margin-bottom: 4px;
}
.insp-card-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.insp-card-tag {
    display: inline-block;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
}

/* Card "vedi tutte" a fine scroll */
.insp-card-all {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    box-shadow: none;
    border: 2px dashed var(--accent);
    min-height: 220px;
}
.insp-card-all-inner {
    text-align: center;
    color: var(--accent);
    font-weight: 700;
    font-size: 14px;
    padding: 16px;
}
.insp-card-all-icon {
    font-size: 28px;
    display: block;
    margin-bottom: 6px;
}

/* ─── Pagina categoria ─── */
.insp-cat-hero {
    padding: 12px 16px 4px;
}
.insp-cat-hero-img {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    max-height: 200px;
}
.insp-cat-hero-img img {
    width: 100%;
    height: 100%;
    max-height: 200px;
    object-fit: cover;
    display: block;
}
.insp-cat-hero-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    padding: 12px 4px 0;
}

.insp-grid-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 16px;
}
.insp-grid-card {
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.15s ease;
}
.insp-grid-card:active { transform: scale(0.97); }
.insp-grid-img {
    height: 120px;
    overflow: hidden;
}
.insp-grid-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.insp-grid-body { padding: 10px 12px 12px; }
.insp-grid-title {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.25;
    margin-bottom: 4px;
}

/* Stato vuoto */
.insp-empty-kiosk {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-secondary);
}
.insp-empty-kiosk .cta-btn {
    margin-top: 20px;
    display: inline-block;
    width: auto;
    padding: 14px 28px;
}

/* ═══════════════════════════════════════════════
   DESKTOP ≥1024px — BLOCCO SOLO ADDITIVO
   Nessuna regola esistente modificata.
   Sotto i 1024px: tutto identico a prima.
   ═══════════════════════════════════════════════ */
@media (min-width: 1024px) {

    /* Shell più largo e centrato */
    .app-shell { max-width: 1080px; }
    .bottom-bar { max-width: 1080px; }

    /* ── HOME ── */
    .slideshow { height: 400px; }
    .pinned-section { padding: 20px 24px 0; }
    .pinned-card { min-height: 260px; }
    .section-header { padding: 24px 24px 14px; }
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
        padding: 0 24px 24px;
    }
    .inspiration-scroll { padding: 0 24px 16px; gap: 16px; }
    .inspiration-card { min-width: 240px; max-width: 240px; }

    /* ── PAGINE WIZARD (formato, carrello, dati, upload) ──
       Contenuto centrato a larghezza leggibile */
    .format-page, .cart-page, .upload-page {
        max-width: 760px;
        margin: 0 auto;
        width: 100%;
    }
    .format-list {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    .photo-grid { grid-template-columns: repeat(5, 1fr); }
    .cart-actions { max-width: 760px; }

    /* ── ISPIRAZIONI ── */
    .insp-kiosk-page { max-width: 900px; margin: 0 auto; }
    .insp-grid-section { grid-template-columns: repeat(3, 1fr); }
    .insp-card, .insp-card-all { min-width: 240px; max-width: 240px; }
}
