/* ── Wrap ───────────────────────────────────────────── */
.tmp-wrap { font-family: inherit; max-width: 900px; margin: 0 auto; }
.tmp-wrap * { box-sizing: border-box; }
.hidden { display: none !important; }

/* ── Étapes ─────────────────────────────────────────── */
.tmp-steps {
    display: flex; gap: 0; margin-bottom: 28px;
    border-bottom: 2px solid #e5e7eb;
}
.tmp-step {
    flex: 1; padding: 12px 8px; text-align: center;
    font-size: 13px; color: #9ca3af; cursor: default;
    border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.tmp-step span {
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; border-radius: 50%;
    background: #e5e7eb; color: #6b7280;
    font-weight: 700; font-size: 12px; margin-right: 6px;
}
.tmp-step.active { color: #1a1a1a; border-bottom-color: #1a1a1a; }
.tmp-step.active span { background: #1a1a1a; color: #fff; }
.tmp-step.done span { background: #d4af37; color: #fff; }

/* ── Carte ───────────────────────────────────────────── */
#tmp-map {
    height: 420px; border-radius: 8px;
    border: 2px solid #e5e7eb; margin: 12px 0;
}
.tmp-map-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.tmp-map-info { padding: 8px 12px; background: #f9fafb; border-radius: 6px; font-size: 13px; }
.tmp-map-info span { margin-right: 16px; }

.tmp-gpx-padding-group {
    margin-top: 10px;
    padding: 12px 14px;
    background: #fdf8e7;
    border: 1px solid #e8d999;
    border-radius: 8px;
}
.tmp-gpx-padding-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    margin-bottom: 8px;
}
.tmp-gpx-padding-group #tmp-gpx-padding-value {
    color: #b8860b;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.tmp-gpx-padding-group input[type="range"] { width: 100%; cursor: pointer; }
.tmp-gpx-padding-hint { font-size: 12px; color: #777; margin-top: 4px; }
.tmp-link-btn {
    background: none;
    border: none;
    color: #b8860b;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    font-size: 12px;
    font-weight: 600;
}
.tmp-link-btn:hover { color: #856100; }

/* Curseur "move" quand on survole le rectangle de sélection sur la carte */
.leaflet-interactive[stroke="#d4af37"] { cursor: move !important; }

/* ── Boutons ─────────────────────────────────────────── */
.tmp-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 18px; border-radius: 6px; border: none;
    font-size: 14px; font-weight: 500; cursor: pointer;
    transition: all .15s ease; text-decoration: none;
}
.tmp-btn-primary { background: #1a1a1a; color: #fff; }
.tmp-btn-primary:hover:not(:disabled) { background: #333; }
.tmp-btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.tmp-btn-secondary { background: #fff; color: #1a1a1a; border: 1.5px solid #d1d5db; }
.tmp-btn-secondary:hover { border-color: #1a1a1a; }
.tmp-btn-ghost { background: transparent; color: #6b7280; }
.tmp-btn-ghost:hover { color: #1a1a1a; }
.tmp-btn-cta {
    background: #d4af37; color: #1a1a1a;
    font-size: 16px; font-weight: 700; padding: 14px 28px;
}
.tmp-btn-cta:hover { background: #c9a227; }

.tmp-nav-row { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; }

/* ── Options ─────────────────────────────────────────── */
.tmp-options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.tmp-options-grid .tmp-full-width { grid-column: 1 / -1; }
@media (max-width: 600px) { .tmp-options-grid { grid-template-columns: 1fr; } }

.tmp-option-group { display: flex; flex-direction: column; gap: 8px; }
.tmp-option-label { font-weight: 600; font-size: 13px; color: #374151; }

.tmp-radio-cards { display: flex; flex-wrap: wrap; gap: 8px; }
.tmp-radio-card {
    border: 2px solid #e5e7eb; border-radius: 8px;
    padding: 10px 14px; cursor: pointer; font-size: 13px;
    transition: all .15s; user-select: none;
}
.tmp-radio-card:hover { border-color: #9ca3af; }
.tmp-radio-card.selected { border-color: #1a1a1a; background: #1a1a1a; color: #fff; }
.tmp-radio-card .price-add { font-size: 11px; opacity: .75; margin-left: 4px; }

.tmp-color-row { display: flex; align-items: center; gap: 10px; }
.tmp-color-row input[type=color] {
    width: 42px; height: 42px; border: 2px solid #e5e7eb;
    border-radius: 6px; padding: 2px; cursor: pointer;
}
.tmp-color-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.tmp-preset {
    width: 28px; height: 28px; border-radius: 50%;
    cursor: pointer; border: 2px solid transparent;
    transition: border-color .15s;
}
.tmp-preset:hover, .tmp-preset.active { border-color: #d4af37; }

.tmp-checkbox-row {
    display: flex; align-items: center; gap: 8px;
    font-size: 14px; cursor: pointer;
}
.tmp-checkbox-row input { width: 18px; height: 18px; cursor: pointer; }
.tmp-price-badge {
    background: #fef9ec; color: #92400e;
    font-size: 11px; padding: 2px 7px; border-radius: 12px;
}

#tmp-region-name {
    width: 100%; padding: 9px 12px; border: 1.5px solid #d1d5db;
    border-radius: 6px; font-size: 14px;
}
#tmp-region-name:focus { border-color: #1a1a1a; outline: none; }

.tmp-price-recap {
    margin-top: 20px; padding: 14px 20px;
    background: #f9fafb; border-radius: 8px;
    font-size: 16px; text-align: right;
}
.tmp-price-recap strong { font-size: 22px; }

/* ── Preview 3D ──────────────────────────────────────── */
#tmp-preview-wrap {
    position: relative; width: 100%; height: 440px;
    background: #0d0d0d; border-radius: 10px; overflow: hidden;
}
#tmp-preview-canvas { width: 100% !important; height: 100% !important; display: block; }
.tmp-loading-overlay {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    background: rgba(10,10,10,.85); color: #fff;
}
.tmp-spinner {
    width: 40px; height: 40px; margin-bottom: 14px;
    border: 3px solid rgba(255,255,255,.2);
    border-top-color: #d4af37;
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.tmp-preview-legend { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; }
.tmp-legend-swatch { display: inline-block; width: 18px; height: 18px; border-radius: 3px; }

/* ── Socles ──────────────────────────────────────────── */
.tmp-base-cards { display: flex; flex-wrap: wrap; gap: 12px; }
.tmp-base-card {
    border: 2px solid #e5e7eb; border-radius: 10px;
    padding: 10px; cursor: pointer; text-align: center;
    width: 120px; transition: all .15s; user-select: none;
}
.tmp-base-card:hover { border-color: #9ca3af; }
.tmp-base-card.selected { border-color: #d4af37; box-shadow: 0 0 0 2px #d4af37; }
.tmp-base-card svg { width: 80px; height: 60px; }
.tmp-base-card .tmp-base-name { font-size: 12px; font-weight: 600; margin-top: 6px; }
.tmp-base-card .tmp-base-desc { font-size: 10px; color: #6b7280; margin-top: 2px; }
.tmp-base-card .tmp-base-price { font-size: 11px; color: #92400e; background: #fef9ec; border-radius: 10px; padding: 1px 6px; margin-top: 4px; display: inline-block; }

/* ── Gravure laser ───────────────────────────────────── */
.tmp-engraving-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 10px; }
@media (max-width: 600px) { .tmp-engraving-row { grid-template-columns: 1fr; } }
.tmp-engraving-field { display: flex; flex-direction: column; gap: 6px; }
.tmp-engraving-field label { font-size: 13px; font-weight: 500; color: #374151; }
.tmp-engraving-field textarea {
    width: 100%; padding: 8px 10px; border: 1.5px solid #d1d5db;
    border-radius: 6px; font-size: 14px; resize: vertical;
}
.tmp-engraving-field textarea:focus { border-color: #1a1a1a; outline: none; }
.tmp-engraving-field input[type=range] { width: 100%; }

.tmp-font-options { display: flex; flex-direction: column; gap: 6px; }
.tmp-font-option {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; border: 1.5px solid #e5e7eb;
    border-radius: 6px; cursor: pointer; transition: border-color .15s;
}
.tmp-font-option:hover { border-color: #9ca3af; }
.tmp-font-option.selected { border-color: #d4af37; background: #fffbeb; }
.tmp-font-option input[type=radio] { display: none; }
.tmp-font-option .tmp-font-sample { font-size: 16px; }

.tmp-align-btns { display: flex; gap: 6px; }
.tmp-align-btn {
    padding: 6px 14px; border: 1.5px solid #e5e7eb;
    border-radius: 6px; cursor: pointer; background: #fff;
    font-size: 16px; transition: all .15s;
}
.tmp-align-btn.active { border-color: #1a1a1a; background: #1a1a1a; color: #fff; }

.tmp-engraving-preview {
    margin-top: 14px; padding: 16px; background: #c8a97e;
    border-radius: 8px; text-align: center;
    min-height: 100px; display: flex; align-items: center; justify-content: center;
}
#tmp-engraving-canvas {
    max-width: 100%; background: transparent;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.3));
}

/* ── Récap commande ──────────────────────────────────── */
.tmp-recap-card {
    background: #f9fafb; border: 1px solid #e5e7eb;
    border-radius: 10px; padding: 20px 24px; margin-bottom: 20px;
}
.tmp-recap-card table { width: 100%; border-collapse: collapse; }
.tmp-recap-card td { padding: 7px 0; border-bottom: 1px solid #f0f0f0; }
.tmp-recap-card td:first-child { color: #6b7280; font-size: 13px; width: 160px; }
.tmp-recap-card td:last-child { font-weight: 500; }
.tmp-recap-card .tmp-total td { border-bottom: none; font-size: 18px; font-weight: 700; padding-top: 14px; }

/* ── Mockup viewer ───────────────────────────────────── */
.tmp-mockup-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tmp-mockup-tab {
    padding: 8px 16px; border-radius: 20px; border: 2px solid #e5e7eb;
    cursor: pointer; font-size: 13px; font-weight: 500;
    transition: all .15s; background: #fff;
}
.tmp-mockup-tab:hover { border-color: #9ca3af; }
.tmp-mockup-tab.active { border-color: #d4af37; background: #d4af37; color: #1a1a1a; }

.tmp-mockup-viewer {
    position: relative; width: 100%; border-radius: 12px; overflow: hidden;
    background: #111;
}
.tmp-mockup-bg {
    position: relative; width: 100%; padding-top: 62.5%; /* 16:10 ratio */
    background-size: cover; background-position: center;
    transition: background-image .3s ease;
}
.tmp-mockup-obj {
    position: absolute;
    transform-origin: center bottom;
    transition: left .3s ease, top .3s ease, width .3s ease;
    cursor: grab;
    filter: drop-shadow(0 8px 20px rgba(0,0,0,.5));
}
.tmp-mockup-obj:active { cursor: grabbing; }
.tmp-mockup-obj canvas { display: block; width: 100%; height: 100%; }

.tmp-mockup-shadow {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(0,0,0,.35) 0%, transparent 70%);
    pointer-events: none;
    transition: all .3s ease;
}

.tmp-mockup-empty {
    display: none; padding: 60px; text-align: center; color: #888;
}
.tmp-mockup-controls {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 4px; font-size: 13px;
}
.tmp-btn-sm { padding: 6px 12px; font-size: 12px; }

/* ── Divers ──────────────────────────────────────────── */
.tmp-hint { color: #6b7280; font-size: 13px; margin: 0 0 10px; }
.tmp-error { color: #b91c1c; font-size: 13px; padding: 8px 12px; background: #fef2f2; border-radius: 6px; margin-top: 8px; }
.tmp-product-note { background: #fffbeb; border-left: 3px solid #d4af37; padding: 10px 14px; border-radius: 0 6px 6px 0; font-size: 14px; }

/* ── Bannière reprendre conception ──────────────────── */
.tmp-restore-banner {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    background: #fffbeb; border: 1.5px solid #d4af37;
    border-radius: 8px; padding: 12px 16px; margin-bottom: 16px;
    font-size: 14px;
}
.tmp-restore-banner span { flex: 1; }

/* ── Blocs étape 1 ───────────────────────────────────── */
.tmp-step-block { margin-bottom: 28px; }
.tmp-step-block h3 { margin: 0 0 6px; font-size: 16px; }

/* ── Cartes de format ────────────────────────────────── */
.tmp-format-cards {
    display: flex; gap: 14px; flex-wrap: wrap; margin: 12px 0;
}
.tmp-format-card {
    display: flex; flex-direction: column; align-items: center;
    gap: 8px; padding: 16px 20px; border-radius: 10px;
    border: 2px solid #e5e7eb; cursor: pointer;
    transition: all .15s ease; min-width: 110px;
    background: #fff;
}
.tmp-format-card:hover  { border-color: #9ca3af; }
.tmp-format-card.selected { border-color: #1a1a1a; box-shadow: 0 0 0 3px rgba(26,26,26,.1); }
.tmp-format-visual {
    background: #1a1a1a; border-radius: 3px;
    /* dimensions injectées inline */
}
.tmp-format-name  { font-size: 13px; font-weight: 600; }
.tmp-format-price { font-size: 13px; color: #6b7280; }
.tmp-price-preview {
    font-size: 13px; color: #6b7280; margin-top: 4px;
}
.tmp-price-preview strong { color: #1a1a1a; }

/* ── Upsell multi-taille (étape 5) ──────────────────── */
.tmp-upsell-section {
    background: #f9fafb; border: 1.5px solid #e5e7eb;
    border-radius: 10px; padding: 20px; margin: 20px 0;
}
.tmp-upsell-section h4 { margin: 0 0 6px; font-size: 15px; }
.tmp-upsell-cards {
    display: flex; gap: 14px; flex-wrap: wrap; margin-top: 14px;
}
.tmp-upsell-card {
    display: flex; flex-direction: column; align-items: center;
    gap: 6px; padding: 16px 18px; border-radius: 10px;
    border: 2px solid #e5e7eb; cursor: pointer;
    transition: all .15s ease; background: #fff;
    text-align: center; min-width: 120px;
}
.tmp-upsell-card:hover  { border-color: #9ca3af; }
.tmp-upsell-card.selected { border-color: #d4af37; background: #fffbeb; }
.tmp-upsell-icon  { font-size: 22px; }
.tmp-upsell-size  { font-size: 14px; font-weight: 600; }
.tmp-upsell-desc  { font-size: 11px; color: #9ca3af; }
.tmp-upsell-price { font-size: 13px; color: #6b7280; }
.tmp-upsell-btn {
    font-size: 12px; font-weight: 600;
    color: #1a1a1a; padding: 4px 10px;
    background: #f3f4f6; border-radius: 20px;
    margin-top: 2px;
}
.tmp-upsell-card.selected .tmp-upsell-btn { background: #d4af37; color: #fff; }
.tmp-upsell-total {
    margin-top: 14px; padding: 10px 14px;
    background: #fff; border-radius: 8px;
    border: 1px solid #e5e7eb; font-size: 14px;
}
.tmp-upsell-total strong { font-size: 16px; }

/* ── Section sauvegarde ──────────────────────────────── */
.tmp-save-section {
    padding: 14px 0; border-top: 1px solid #e5e7eb; margin: 16px 0;
}
.tmp-save-row { display: flex; gap: 10px; flex-wrap: wrap; }
.tmp-save-feedback {
    margin-top: 8px; padding: 8px 12px;
    border-radius: 6px; font-size: 13px;
}
.tmp-feedback-success { background: #ecfdf5; color: #065f46; }
.tmp-feedback-error   { background: #fef2f2; color: #b91c1c; }
.tmp-copy-link-wrap {
    display: flex; gap: 8px; margin-top: 10px; align-items: center;
}
.tmp-copy-link-wrap input {
    flex: 1; padding: 7px 10px; border: 1.5px solid #d1d5db;
    border-radius: 6px; font-size: 12px; color: #6b7280;
    background: #f9fafb;
}

/* ── Bouton & modal Admin "Générer STL" ─────────────────────────── */
.tmp-admin-bar {
    margin-top: 20px;
    padding: 16px;
    background: #fef3c7;
    border: 2px dashed #d97706;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.tmp-btn-admin {
    background: #1f2937;
    color: #fbbf24;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    font-size: 14px;
}
.tmp-btn-admin:hover { background: #111827; }
.tmp-btn-admin:disabled { background: #6b7280; cursor: not-allowed; color: #d1d5db; }
.tmp-admin-hint {
    font-size: 12px;
    color: #92400e;
    flex: 1;
}

.tmp-admin-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tmp-admin-modal-inner {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 480px;
    width: 90%;
    position: relative;
    text-align: center;
}
.tmp-admin-modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #6b7280;
    line-height: 1;
}
.tmp-admin-modal h3 { margin-top: 0; margin-bottom: 20px; }
.tmp-admin-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #e5e7eb;
    border-top-color: #d97706;
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: tmpSpin 0.9s linear infinite;
}
@keyframes tmpSpin { to { transform: rotate(360deg); } }
.tmp-admin-modal-inner .tmp-btn { margin: 8px 6px; display: inline-block; }

/* ── Partage social ─────────────────────────────────────── */
.tmp-btn-share {
    background: linear-gradient(135deg, #6366f1, #ec4899);
    color: white;
    border: none;
    font-weight: 600;
}
.tmp-btn-share:hover { filter: brightness(1.1); }

.tmp-share-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tmp-share-modal-inner {
    background: white;
    padding: 28px;
    border-radius: 14px;
    max-width: 500px;
    width: 92%;
    position: relative;
}
.tmp-share-modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #6b7280;
    line-height: 1;
}
.tmp-share-modal h3 { margin: 0 0 6px; }
.tmp-share-intro { color: #6b7280; font-size: 13px; margin-bottom: 20px; }

.tmp-share-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}
.tmp-share-platform {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 8px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    transition: all 0.15s;
    text-decoration: none;
}
.tmp-share-platform:hover {
    border-color: #6366f1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
    text-decoration: none;
}
.tmp-share-platform svg, .tmp-share-platform .emoji {
    width: 32px; height: 32px;
    font-size: 28px;
    line-height: 1;
}
.tmp-share-platform.facebook  { color: #1877f2; }
.tmp-share-platform.twitter   { color: #000;    }
.tmp-share-platform.pinterest { color: #e60023; }
.tmp-share-platform.whatsapp  { color: #25d366; }
.tmp-share-platform.linkedin  { color: #0a66c2; }
.tmp-share-platform.telegram  { color: #229ed9; }
.tmp-share-platform.messenger { color: #0084ff; }
.tmp-share-platform.email     { color: #6b7280; }
.tmp-share-platform.native    { color: #8b5cf6; }
.tmp-share-platform.copy      { color: #d4af37; }

.tmp-share-copy-wrap {
    display: flex;
    gap: 8px;
    border-top: 1px solid #e5e7eb;
    padding-top: 14px;
}
.tmp-share-copy-wrap input {
    flex: 1;
    padding: 8px 10px;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    font-size: 12px;
    color: #6b7280;
    background: #f9fafb;
}
