/* ============================================
   KATAGAMI STUDIO - ÉDITEUR DE POCHOIRS
   Charte graphique RO Studio
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #ffffff;
    color: #000000;
    overflow: hidden;
    letter-spacing: -0.01em;
}

.configurator {
    display: grid;
    grid-template-columns: 1fr 480px;
    height: 100vh;
}

/* ============================================
   PANNEAU DE PRÉVISUALISATION (GAUCHE)
   ============================================ */
.preview-panel {
    background: #f5f5f5;
    background-image: radial-gradient(circle, #d3d7d6 1px, transparent 1px);
    background-size: 20px 20px;
    overflow: auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 60px 60px 60px;
}

.preview-panel::-webkit-scrollbar {
    width: 6px;
}

.preview-panel::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.preview-panel::-webkit-scrollbar-thumb {
    background: #d3d7d6;
    border-radius: 3px;
}

/* ============================================
   ÉCRAN D'ACCUEIL - PANNEAU GAUCHE
   ============================================ */
.welcome-screen {
    text-align: center;
    max-width: 500px;
}

.welcome-logo {
    margin-bottom: 40px;
}

.welcome-logo img {
    max-width: 200px;
    height: auto;
}

.welcome-title {
    font-size: 2rem;
    font-weight: 700;
    color: #000000;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

/* ============================================
   CONTRÔLES DE ZOOM - STYLE GLASSMORPHISM
   ============================================ */
.zoom-controls {
    position: fixed;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 20;
}

.zoom-btn {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    color: #1a1a1a;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.zoom-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.zoom-btn:active {
    transform: translateY(0);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}


/* ============================================
   TOGGLE ORIENTATION - STYLE GLASSMORPHISM
   ============================================ */
.orientation-toggle {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 20;
    display: none;
}

.orientation-toggle.visible {
    display: block;
}

.orientation-btn {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 25px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a1a1a;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.orientation-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.orientation-btn:active {
    transform: translateY(0);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* Wrapper capsule pour le bouton Centrer - VERSION SANS CAPSULE EXTERNE */
.center-design-wrapper {
    position: fixed;
    top: 220px;
    left: 20px;
    z-index: 20;
    display: none;
    /* Plus de background, border, padding - juste un conteneur invisible */
}

.center-design-wrapper.visible {
    display: block;
}

.center-design-btn {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 25px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a1a1a;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.center-design-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.center-design-btn:active {
    transform: translateY(0);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* ============================================
   BOUTON TOGGLE DIMENSIONS - STYLE GLASSMORPHISM
   ============================================ */
.toggle-dimensions-wrapper {
    position: fixed;
    bottom: 20px;
    left: 150px;
    z-index: 20;
    display: none;
}

.toggle-dimensions-wrapper.visible {
    display: block;
}

.toggle-dimensions-btn {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 25px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a1a1a;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.toggle-dimensions-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.toggle-dimensions-btn:active {
    transform: translateY(0);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* ============================================
   AFFICHAGE DES DIMENSIONS - STYLE GLASSMORPHISM
   ============================================ */
.size-display {
    position: fixed;
    top: 80px;
    left: 20px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    padding: 16px 20px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    z-index: 20;
    display: none;
    font-size: 0.85rem;
}

.size-display.visible {
    display: block;
}

.size-display-title {
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 10px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.size-display-values {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.size-display-item {
    color: #1a1a1a;
    font-weight: 600;
    font-size: 0.95rem;
}

.size-display-item span {
    color: #666666;
    font-weight: 500;
}

.size-display-quality {
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 4px;
    /* Plus de background ni padding - juste le texte coloré */
}

.size-display-quality.quality-excellent {
    color: #27ae60;
}

.size-display-quality.quality-good {
    color: #2980b9;
}

.size-display-quality.quality-medium {
    color: #f39c12;
}

.size-display-quality.quality-poor {
    color: #e74c3c;
}

/* ============================================
   PLACEHOLDER & POCHOIR
   ============================================ */
.placeholder-text {
    color: #666666;
    font-size: 1.3rem;
    text-align: center;
    font-weight: 500;
}

.pochoir-wrapper {
    position: relative;
    display: inline-block;
}

.pochoir-outer-frame {
    background: rgba(180, 180, 180, 0.25);
    border: 3px dashed rgba(0, 0, 0, 0.25);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pochoir-container {
    background: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
}

.zone-label {
    position: absolute;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    pointer-events: none;
    z-index: 5;
}

.zone-label.top {
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
}

.zone-label.printable {
    display: none;
}

/* ============================================
   GUIDES D'ALIGNEMENT
   ============================================ */
.alignment-guide {
    position: absolute;
    background: #22c55e;
    pointer-events: none;
    z-index: 2500;
    opacity: 0;
    transition: opacity 0.1s ease;
    display: none !important;
}

.alignment-guide.visible {
    opacity: 1;
}

.alignment-guide.horizontal {
    height: 2px;
    width: 100%;
    left: 0;
}

.alignment-guide.vertical {
    width: 2px;
    height: 100%;
    top: 0;
}

.alignment-guide.center {
    background: #22c55e;
    box-shadow: 0 0 4px rgba(34, 197, 94, 0.5);
}

/* ============================================
   QUADRILLAGE PENDANT LE DÉPLACEMENT
   ============================================ */
.design-area.dragging::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(to right, #d3d7d6 1px, transparent 1px),
        linear-gradient(to bottom, #d3d7d6 1px, transparent 1px),
        linear-gradient(to right, #a0a0a0 2px, transparent 2px),
        linear-gradient(to bottom, #a0a0a0 2px, transparent 2px);
    background-size: 
        40px 40px,
        40px 40px,
        80px 80px,
        80px 80px;
    pointer-events: none;
    z-index: 1;
}

.alignment-guide.edge {
    background: #ec4899;
    box-shadow: 0 0 4px rgba(236, 72, 153, 0.5);
}

/* ============================================
   ZONE DE DESIGN
   ============================================ */
.design-area {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: visible;
}

.design-image {
    position: absolute;
    cursor: move;
    transition: outline 0.2s;
    outline: none !important;
}

.design-image:hover {
    outline: 1px solid #d3d7d6 !important;
    outline-offset: 0px;
}

/* Masquer TOUS les contrôles par défaut (même au hover) */
.design-image .ui-resizable-handle,
.design-image .design-delete-control,
.design-image .design-rotate-control {
    display: none !important;
}

.design-image.ui-selected {
    outline: 2px solid #000000 !important;
    outline-offset: 0px;
}

/* Afficher les contrôles UNIQUEMENT quand sélectionné */
.design-image.ui-selected .ui-resizable-handle {
    display: block !important;
}

.design-image.ui-selected .design-delete-control,
.design-image.ui-selected .design-rotate-control {
    display: flex !important;
}

.design-image:focus {
    outline: none !important;
}

.design-image img {
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
    user-select: none;
}

/* ============================================
   CONTRÔLES CANVA-STYLE
   ============================================ */

/* ============================================
   CONTRÔLES DU DESIGN - GLASSMORPHISM
   ============================================ */

/* Contrôle de suppression (poubelle au-dessus) */
.design-delete-control {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 36px;
    background: rgba(245, 245, 245, 0.6);
    backdrop-filter: blur(15px) saturate(150%);
    -webkit-backdrop-filter: blur(15px) saturate(150%);
    border: 1px solid rgba(200, 200, 200, 0.4);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 15;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.design-delete-control svg {
    width: 18px;
    height: 18px;
    color: rgba(50, 50, 50, 0.8);
    transition: color 0.2s ease;
}

.design-delete-control:hover {
    background: rgba(235, 235, 235, 0.7);
    border-color: rgba(200, 200, 200, 0.5);
    transform: translateX(-50%) scale(1.1);
    box-shadow: 
        0 6px 24px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.design-delete-control:hover svg {
    color: rgba(0, 0, 0, 0.9);
}

/* ============================================
   CONTRÔLE DE ROTATION - GLASSMORPHISM
   ============================================ */
/* Contrôle de rotation (en dessous du design) */
.design-rotate-control {
    position: absolute;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(245, 245, 245, 0.6);
    backdrop-filter: blur(15px) saturate(150%);
    -webkit-backdrop-filter: blur(15px) saturate(150%);
    border: 1px solid rgba(200, 200, 200, 0.4);
    border-radius: 25px;
    padding: 8px 16px;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 15;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.design-rotate-control:active {
    cursor: grabbing;
}

.design-rotate-control .rotate-icon {
    width: 16px;
    height: 16px;
    color: rgba(50, 50, 50, 0.8);
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.design-rotate-control .rotation-degrees {
    color: rgba(50, 50, 50, 0.9);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.design-rotate-control:hover {
    background: rgba(235, 235, 235, 0.7);
    border-color: rgba(200, 200, 200, 0.5);
    transform: translateX(-50%) scale(1.05);
    box-shadow: 
        0 6px 24px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.design-rotate-control:hover .rotate-icon,
.design-rotate-control:hover .rotation-degrees {
    color: rgba(0, 0, 0, 0.9);
}


/* ============================================
   POIGNÉES DE REDIMENSIONNEMENT - GLASSMORPHISM
   ============================================ */
/* Poignées de redimensionnement (4 coins uniquement) */
.ui-resizable-handle {
    position: absolute;
    font-size: 0.1px;
    display: block;
    touch-action: none;
    background: rgba(245, 245, 245, 0.7);
    backdrop-filter: blur(10px) saturate(150%);
    -webkit-backdrop-filter: blur(10px) saturate(150%);
    border: 1.5px solid rgba(200, 200, 200, 0.6);
    border-radius: 50%;
    width: 12px;
    height: 12px;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    z-index: 14;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.ui-resizable-handle:hover {
    background: rgba(235, 235, 235, 0.8);
    border-color: rgba(150, 150, 150, 0.7);
    transform: scale(1.2);
    box-shadow: 
        0 3px 12px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* ============================================
   OUTLINE DU DESIGN SÉLECTIONNÉ - LIGNE PLUS FINE
   ============================================ */
.design-image.ui-selected {
    outline: 1.5px solid rgba(100, 100, 100, 0.6) !important;
    outline-offset: 0px;
}

.design-image.ui-resizable-resizing {
    border: none !important;
    outline: 1.5px solid rgba(100, 100, 100, 0.7) !important;
}

/* ============================================
   NETTOYAGE JQUERY UI
   ============================================ */
.ui-resizable-helper,
.ui-resizable-helper * {
    display: none !important;
    border: none !important;
    outline: none !important;
}

.ui-resizable-autohide .ui-resizable-handle,
.ui-resizable-autohide .ui-resizable-helper {
    display: none !important;
}

.design-image .ui-wrapper,
.ui-wrapper,
.ui-resizable-ghost {
    border: none !important;
    outline: none !important;
    display: none !important;
}

.ui-resizable-resizing,
.ui-draggable-dragging {
    border: none !important;
}

/* ============================================
   POSITIONNEMENT DES 4 COINS
   ============================================ */
.ui-resizable-nw {
    cursor: nw-resize;
    left: -6px;
    top: -6px;
}

.ui-resizable-ne {
    cursor: ne-resize;
    right: -6px;
    top: -6px;
}

.ui-resizable-sw {
    cursor: sw-resize;
    left: -6px;
    bottom: -6px;
}

.ui-resizable-se {
    cursor: se-resize;
    right: -6px;
    bottom: -6px;
}

/* ============================================
   PANNEAU DE CONFIGURATION (DROITE)
   ============================================ */
.setup-panel {
    background: #ffffff;
    border-left: 1px solid #d3d7d6;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* ============================================
   ÉCRAN D'ACCUEIL - PANNEAU DROITE
   ============================================ */
.welcome-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
}

.welcome-panel-header {
    padding: 30px 20px 20px;
    border-bottom: 1px solid #d3d7d6;
    background: #ffffff;
}

.brand-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #000000;
    text-align: left;
    letter-spacing: -0.02em;
}

.welcome-content {
    flex: 1;
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.welcome-panel-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #000000;
    margin-bottom: 40px;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.steps-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-bottom: 50px;
}

.step-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.step-number {
    font-size: 0.9rem;
    font-weight: 700;
    color: #000000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.step-description {
    font-size: 1rem;
    font-weight: 400;
    color: #666666;
    line-height: 1.5;
}

.start-btn {
    width: 100%;
    background: #000000;
    color: #ececec;
    border: none;
    padding: 16px 32px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 400;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    font-family: 'Roboto', sans-serif;
    box-shadow: none;
}

.start-btn:hover {
    opacity: 0.85;
    transform: translateY(-2px);
}

/* ============================================
   PANNEAU DE CONFIGURATION DES ÉTAPES - GLASSMORPHISM
   ============================================ */
.config-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.setup-header {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 20px;
    flex-shrink: 0;
    display: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.brand-title-small {
    text-align: left;
    margin-bottom: 8px;
}

.brand-title-small span {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: -0.01em;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.step-indicator {
    text-align: left;
    margin-bottom: 15px;
}

.step-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1a1a1a;
    letter-spacing: 0.3px;
}

.tabs-header {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 0 20px;
    margin-top: 20px;
}

.tab-wrapper {
    position: relative;
}

.tab {
    width: 100%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px) saturate(150%);
    -webkit-backdrop-filter: blur(10px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    padding: 10px 18px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    color: #1a1a1a;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    position: relative;
    font-family: 'Roboto', sans-serif;
    text-align: center;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.tab:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.tab.active {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    border-color: rgba(0, 0, 0, 0.8);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.tab.validated {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-color: rgba(46, 204, 113, 0.5);
    color: #1a1a1a;
}

.tab .check-icon {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: rgba(46, 204, 113, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #ffffff;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

/* ============================================
   CONTENU DES ONGLETS
   ============================================ */
.tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px 20px;
    padding-bottom: 100px; /* Espace pour le footer fixe */
}

.tab-content::-webkit-scrollbar {
    width: 6px;
}

.tab-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.tab-content::-webkit-scrollbar-thumb {
    background: rgba(211, 215, 214, 0.5);
    backdrop-filter: blur(10px);
    border-radius: 3px;
}

.tab-content::-webkit-scrollbar-thumb:hover {
    background: rgba(211, 215, 214, 0.8);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.section-title {
    font-size: calc(1.1rem + 1px);
    color: #1a1a1a;
    margin-bottom: 20px;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

/* ============================================
   GRILLE DE TAILLES - EFFET BOMBÉ/SOUPLE
   ============================================ */

.size-selection-container {
    padding: 24px;
    background: rgba(245, 245, 245, 0.4);
    backdrop-filter: blur(15px) saturate(150%);
    -webkit-backdrop-filter: blur(15px) saturate(150%);
    border: 1px solid rgba(200, 200, 200, 0.3);
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
    .size-selection-container {
        padding: 20px;
    }
}

.size-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 20px;
    align-items: end;
}

.size-option {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 20px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    perspective: 800px;
}

.size-rectangle {
    background: 
        radial-gradient(
            ellipse at center,
            rgba(255, 182, 193, 0.12) 0%,
            rgba(255, 182, 193, 0.08) 40%,
            rgba(255, 182, 193, 0.06) 100%
        );
    backdrop-filter: blur(15px) saturate(150%);
    -webkit-backdrop-filter: blur(15px) saturate(150%);
    border: 1px solid rgba(255, 182, 193, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    opacity: 0.92;
    box-shadow: 
        0 8px 32px rgba(255, 182, 193, 0.1),
        inset 0 2px 12px rgba(255, 255, 255, 0.25),
        inset 0 -2px 12px rgba(255, 182, 193, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: visible;
    
    /* Effet bombé avec transform 3D */
    transform: rotateX(2deg) rotateY(-1deg);
    transform-style: preserve-3d;
    
    /* Bords légèrement irréguliers */
    clip-path: polygon(
        1% 0%,
        99% 0%,
        100% 1%,
        100% 99%,
        99% 100%,
        1% 100%,
        0% 99%,
        0% 1%
    );
}

/* Reflet de lumière pour accentuer l'effet bombé */
.size-rectangle::before {
    content: '';
    position: absolute;
    top: 10%;
    left: 10%;
    right: 10%;
    height: 40%;
    background: 
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.15) 0%,
            transparent 100%
        );
    border-radius: 50%;
    filter: blur(8px);
    pointer-events: none;
    z-index: 1;
    opacity: 0.8;
}

/* HOVER - Accentue l'effet bombé */
.size-rectangle:hover {
    transform: translateY(-6px) rotateX(3deg) rotateY(-2deg) scale(1.02);
    background: 
        radial-gradient(
            ellipse at center,
            rgba(255, 182, 193, 0.18) 0%,
            rgba(255, 182, 193, 0.12) 40%,
            rgba(255, 182, 193, 0.08) 100%
        );
    border-color: rgba(255, 182, 193, 0.3);
    opacity: 0.96;
    box-shadow: 
        0 16px 48px rgba(255, 182, 193, 0.18),
        inset 0 3px 15px rgba(255, 255, 255, 0.3),
        inset 0 -3px 15px rgba(255, 182, 193, 0.15);
}

.size-rectangle:hover::before {
    opacity: 1;
}

/* ÉTAT SÉLECTIONNÉ */
.size-option.selected {
    background: transparent;
}

.size-option.selected .size-preview,
.size-option.selected .size-dimensions,
.size-option.selected .size-info,
.size-option.selected .size-description {
    color: #1a1a1a;
}

.size-option.selected .size-rectangle {
    background: 
        radial-gradient(
            ellipse at center,
            rgba(255, 182, 193, 0.25) 0%,
            rgba(255, 182, 193, 0.18) 40%,
            rgba(255, 182, 193, 0.12) 100%
        );
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 2px solid rgba(255, 105, 180, 0.5);
    opacity: 0.98;
    box-shadow: 
        0 16px 56px rgba(255, 105, 180, 0.25),
        inset 0 4px 20px rgba(255, 255, 255, 0.35),
        inset 0 -4px 20px rgba(255, 182, 193, 0.2),
        0 0 0 4px rgba(255, 182, 193, 0.12);
    transform: translateY(-4px) rotateX(2deg) rotateY(-1deg) scale(1.01);
}

.size-option.selected .size-preview {
    color: #1a1a1a;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

/* Proportions des rectangles */
.size-rectangle[data-format="A4"] { width: 80px; height: 113px; }
.size-rectangle[data-format="A5"] { width: 70px; height: 99px; }
.size-rectangle[data-format="A6"] { width: 60px; height: 85px; }
.size-rectangle[data-format="A7"] { width: 50px; height: 71px; }
.size-rectangle[data-format="A8"] { width: 45px; height: 64px; }

.size-preview {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1a1a1a;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6);
    position: relative;
    z-index: 2;
}

.size-dimensions {
    font-size: 0.75rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 2px;
    white-space: nowrap;
    position: relative;
    z-index: 2;
}

.size-info {
    font-size: 0.65rem;
    color: #666666;
    font-weight: 500;
    white-space: nowrap;
}

/* ============================================
   UPLOAD DE FICHIER - GLASSMORPHISM
   ============================================ */
.upload-section {
    border: 2px dashed rgba(150, 150, 150, 0.4);
    border-radius: 16px;
    padding: 30px 20px;
    text-align: center;
    background: rgba(245, 245, 245, 0.5);
    backdrop-filter: blur(15px) saturate(150%);
    -webkit-backdrop-filter: blur(15px) saturate(150%);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.upload-section:hover {
    border-color: rgba(100, 100, 100, 0.6);
    background: rgba(235, 235, 235, 0.6);
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.upload-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
}

.upload-icon svg {
    width: 100%;
    height: 100%;
    color: rgba(100, 100, 100, 0.6);
    transition: color 0.3s ease;
}

.upload-section:hover .upload-icon svg {
    color: rgba(50, 50, 50, 0.8);
}

.upload-formats {
    color: #666666;
    font-size: 0.85rem;
    margin-bottom: 15px;
    font-weight: 500;
}

/* BOUTON IMPORTER - NOIR GLASS */
.upload-btn {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px 24px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    font-family: 'Roboto', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.upload-btn:hover {
    background: rgba(0, 0, 0, 0.95);
    transform: translateY(-3px);
    box-shadow: 
        0 8px 28px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.upload-btn:active {
    transform: translateY(-1px);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* ============================================
   ENCADRÉ INFORMATIF - GRIS
   ============================================ */
.upload-info {
    margin-top: 20px;
    padding: 20px;
    background: rgba(245, 245, 245, 0.4);
    backdrop-filter: blur(15px) saturate(150%);
    -webkit-backdrop-filter: blur(15px) saturate(150%);
    border: 1px solid rgba(200, 200, 200, 0.3);
    border-radius: 12px;
    text-align: left;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.upload-info-content {
    margin-bottom: 20px;
}

.upload-info p {
    color: #666666;
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: 12px;
}

.upload-info p:last-child {
    margin-bottom: 0;
}

.upload-info-note {
    background: rgba(220, 220, 220, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 12px 15px;
    border-radius: 8px;
    border-left: 3px solid rgba(100, 100, 100, 0.7);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.upload-info-toggle {
    background: none;
    border: none;
    color: rgba(50, 50, 50, 0.8);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 0;
    text-decoration: underline;
    transition: all 0.2s;
    font-family: 'Roboto', sans-serif;
}

.upload-info-toggle:hover {
    color: rgba(0, 0, 0, 1);
}

.upload-info-contact {
    padding: 15px;
    background: rgba(235, 235, 235, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(200, 200, 200, 0.4);
    border-radius: 8px;
    text-align: center;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.upload-info-contact p {
    margin: 0;
    color: #1a1a1a;
    font-size: 0.9rem;
}

.upload-info-contact-link {
    color: rgba(50, 50, 50, 0.9);
    font-weight: 600;
    text-decoration: underline;
    transition: all 0.2s;
}

.upload-info-contact-link:hover {
    color: rgba(0, 0, 0, 1);
}


/* ============================================
   ÉTAT "FICHIER UPLOADÉ" - GLASSMORPHISM
   ============================================ */
.uploaded-file-section {
    text-align: center;
}

.uploaded-preview {
    background: rgba(245, 245, 245, 0.5);
    backdrop-filter: blur(15px) saturate(150%);
    -webkit-backdrop-filter: blur(15px) saturate(150%);
    border: 2px solid rgba(200, 200, 200, 0.4);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 15px;
    position: relative;
    height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.uploaded-preview-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.preview-container {
    position: relative;
    max-width: 100%;
    margin: 0 auto 15px;
    overflow: hidden;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 140px;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.preview-container img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    margin: 0 auto;
}

.file-actions {
    display: flex;
    gap: 20px;
    margin-top: 12px;
    justify-content: center;
    padding-top: 0;
    border-top: none;
}

.file-action-btn {
    background: rgba(245, 245, 245, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(200, 200, 200, 0.4);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 8px 16px;
    color: #1a1a1a;
    font-family: 'Roboto', sans-serif;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.file-action-btn:hover {
    background: rgba(235, 235, 235, 0.7);
    transform: translateY(-2px);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* ============================================
   BOUTONS PRINCIPAUX
   ============================================ */

/* ============================================
   BOUTON "AJOUTER AU PANIER" - GLASSMORPHISM
   ============================================ */

/* Container footer fixe pour le bouton */
.validate-btn-footer {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 480px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    padding: 20px;
    z-index: 9999;
    box-shadow: 
        0 -8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    display: none;
    justify-content: center;
    align-items: center;
}

/* Visible seulement quand config-panel n'a PAS la classe hidden */
.config-panel:not(.hidden) ~ .validate-btn-footer {
    display: flex;
}

.validate-design-btn {
    position: relative;
    width: 100%;
    max-width: 360px;
    background: rgba(0, 0, 0, 0.85) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    padding: 16px 32px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    display: block;
    margin: 0;
    font-family: 'Roboto', sans-serif;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.validate-design-btn:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.95) !important;
    transform: translateY(-4px) scale(1.02);
    box-shadow: 
        0 12px 48px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3) !important;
}

.validate-design-btn:active:not(:disabled) {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 
        0 6px 24px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.validate-design-btn:disabled {
    background: rgba(211, 215, 214, 0.4) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    color: rgba(102, 102, 102, 0.8) !important;
    border: 1px solid rgba(211, 215, 214, 0.3) !important;
    cursor: not-allowed;
    transform: none;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    opacity: 0.7;
}

/* ============================================
   ÉTAT "UPLOAD EN COURS" - JUSTE LE CADRE POINTILLÉ
   ============================================ */
.progress-overlay {
    padding: 30px 20px;
    text-align: center;
    background: transparent;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    height: 220px;
    border: none;
}

.progress-bar-container {
    width: 100%;
    max-width: 280px;
    background: rgba(220, 220, 220, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    height: 8px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.1),
        0 1px 0 rgba(255, 255, 255, 0.3);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.9) 0%,
        rgba(50, 50, 50, 0.8) 25%,
        rgba(0, 0, 0, 0.9) 50%,
        rgba(50, 50, 50, 0.8) 75%,
        rgba(0, 0, 0, 0.9) 100%
    );
    background-size: 200% 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
    width: 0%;
    animation: liquidFlow 2s ease-in-out infinite;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

@keyframes liquidFlow {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

.progress-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.progress-percentage {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a1a;
}

.progress-stage {
    font-size: 0.9rem;
    color: #666666;
    font-weight: 500;
}

.cancel-upload-btn {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    font-family: 'Roboto', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.cancel-upload-btn:hover {
    background: rgba(0, 0, 0, 0.95);
    transform: translateY(-2px);
    box-shadow: 
        0 6px 16px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* ============================================
   ÉTAT "ERREUR" - GLASSMORPHISM
   ============================================ */
.error-overlay {
    border: 2px solid rgba(220, 100, 100, 0.5);
    border-radius: 16px;
    padding: 30px 20px;
    text-align: center;
    background: rgba(250, 235, 235, 0.5);
    backdrop-filter: blur(15px) saturate(150%);
    -webkit-backdrop-filter: blur(15px) saturate(150%);
    height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 
        0 4px 16px rgba(220, 100, 100, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.error-title {
    font-size: 1.1rem;
    color: rgba(180, 80, 80, 0.9);
    margin-bottom: 10px;
    font-weight: 600;
}

.error-message {
    color: #666666;
    font-size: 0.85rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

.retry-btn {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.retry-btn:hover {
    background: rgba(0, 0, 0, 0.95);
    transform: translateY(-2px);
    box-shadow: 
        0 6px 16px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}


/* ============================================
   UTILITAIRES
   ============================================ */
.hidden {
    display: none !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .configurator {
        grid-template-columns: 1fr 350px;
    }
}

@media (max-width: 768px) {
    .configurator {
        grid-template-columns: 1fr;
        grid-template-rows: 60vh 40vh;
    }
    
    .setup-panel {
        border-left: none;
        border-top: 1px solid #d3d7d6;
    }
    
    .size-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   HEADER - PANIER & CHANGER DE PRODUIT - GLASSMORPHISM
   ============================================ */

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0px;
}

.cart-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 30px;
    color: #1a1a1a;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.cart-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.cart-btn:active {
    transform: translateY(0);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.cart-badge {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #ffffff;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.cart-btn:hover .cart-badge {
    background: rgba(0, 0, 0, 0.9);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.header-subtitle {
    text-align: left;
    margin-bottom: 0px;
}

.change-product-link {
    font-size: 14px;
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    opacity: 0.8;
}

.change-product-link:hover {
    color: #1a1a1a;
    opacity: 1;
    text-decoration: underline;
}

/* ============================================
   MODAL D'AVERTISSEMENT QUALITÉ - GLASSMORPHISM
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(200, 200, 200, 0.3);
    padding: 40px;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 
        0 16px 56px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.modal-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #1a1a1a;
}

.modal-text {
    font-size: 16px;
    color: #333333;
    margin-bottom: 12px;
    line-height: 1.6;
}

.modal-question {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 24px 0 28px;
}

.modal-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.modal-btn {
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    font-weight: 600;
    padding: 12px 40px;
    border: 1px solid rgba(200, 200, 200, 0.4);
    border-radius: 30px;
    background: rgba(245, 245, 245, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #1a1a1a;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.modal-btn:hover {
    background: rgba(235, 235, 235, 0.7);
    border-color: rgba(150, 150, 150, 0.5);
    transform: translateY(-2px);
    box-shadow: 
        0 6px 24px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.modal-btn:active {
    transform: translateY(0);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* ============================================
   CACHER LE HEADER ET BOUTONS ZOOM SUR L'ÉCRAN D'ACCUEIL
   ============================================ */

/* Par défaut, cacher les boutons zoom et le header */
.zoom-controls {
    display: none !important;
}

/* Afficher les boutons zoom et le header après avoir cliqué sur Commencer */
body.editor-active .zoom-controls {
    display: flex !important;
}

body.editor-active .setup-header {
    display: block !important;
}
.size-description {
    font-size: 0.75rem;
    font-weight: 600;
    color: #666666;
    margin-top: 4px;
    text-align: center;
    font-style: normal;
}

/* ============================================
   LABELS DIMENSIONS - SANS BACKGROUND, SANS GRAS
   ============================================ */
.pochoir-dimension-label {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    font-weight: 400;
    color: #1a1a1a;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    padding: 4px 12px;
    border-radius: 0;
    white-space: nowrap;
    z-index: 10;
    transition: opacity 0.3s ease;
    box-shadow: none;
}

.pochoir-dimension-label.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Label Katagami complet - au dessus du outer frame */
.pochoir-wrapper > .pochoir-dimension-label {
    top: -35px;
}

/* Label Zone imprimable - au dessus du container */
.pochoir-container > .pochoir-dimension-label.printable {
    top: -30px;
}

/* Upload désactivé */
.upload-section.disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}


/* ============================================
   COMPARAISON DPI - PASTILLES GLASSMORPHISM
   ============================================ */
.dpi-comparison {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
}

.dpi-comparison-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
}

.dpi-comparison-item.bad {
    border: 2px solid rgba(180, 180, 180, 0.4);
}

.dpi-comparison-item.good {
    border: 2px solid rgba(150, 150, 150, 0.5);
}

.dpi-comparison-item:hover {
    transform: translateY(-4px);
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.dpi-label {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #333;
}

.dpi-image-wrapper {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    background: transparent;
    border-radius: 8px;
    overflow: hidden;
}

.dpi-image {
    width: 120px;
    height: 120px;
    object-fit: contain;
}

.dpi-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

/* PASTILLES GLASSMORPHISM */
.dpi-icon {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.dpi-status.bad .dpi-icon {
    background: rgba(220, 100, 100, 0.6);
    border: 1px solid rgba(200, 80, 80, 0.5);
}

.dpi-status.good .dpi-icon {
    background: rgba(100, 180, 120, 0.6);
    border: 1px solid rgba(80, 160, 100, 0.5);
}

.dpi-text {
    font-size: 14px;
    font-weight: 600;
}

.dpi-status.bad .dpi-text {
    color: rgba(140, 140, 140, 0.9);
}

.dpi-status.good .dpi-text {
    color: rgba(100, 100, 100, 0.9);
}

/* ============================================
   RESPONSIVE MOBILE
   ============================================ */

@media (max-width: 768px) {

    body {
        height: auto !important;
        min-height: 100vh;
        overflow-y: scroll !important;
    }
    
    /* ==========================================
       LAYOUT PRINCIPAL - COLONNE
       ========================================== */
    
    .configurator {
        display: flex !important;
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        grid-template-columns: none;
    }
    
    /* ==========================================
       ORDER DES ÉLÉMENTS
       ========================================== */
    
    .setup-panel {
        display: flex;
        flex-direction: column;
        width: 100%;
        height: auto;
        border-left: none;
    }
    
    .setup-header {
        order: 1;
        padding: 16px 20px;
    }
    
    .preview-panel {
        order: 2;
        position: relative; /* ← IMPORTANT pour contenir les boutons absolus */
        width: 100%;
        height: auto; /* ← CHANGÉ de 500px à auto */
        min-height: 600px;
        padding: 20px 20px;
        padding-bottom: 100px !important; /* ← ESPACE POUR LE FOOTER */
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .pochoir-wrapper {
        margin: 0 auto;
    }

    .tabs-header {
        order: 3;
        margin: 0 20px;
        padding: 16px 0;
        background: transparent;
        border-bottom: none;
    }
    
    .tab-content {
        order: 4;
        padding: 20px;
        padding-bottom: 120px;
    }
    
    .validate-btn-footer {
        order: 5;
        width: 100% !important;
        max-width: 100% !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 16px 20px;
        z-index: 9999;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.1);
    }
    
    /* ==========================================
       HEADER MOBILE
       ========================================== */
    
    .brand-title-small {
        margin-bottom: 6px;
    }
    
    .brand-title-small span {
        font-size: 1.1rem;
    }
    
    .header-subtitle {
        margin-bottom: 0;
    }
    
    .change-product-link {
        font-size: 13px;
    }
    
    /* ==========================================
       ONGLETS MOBILE
       ========================================== */
    
    .tabs-header {
        gap: 8px;
    }
    
    .tab {
        font-size: 13px;
        padding: 8px 12px;
    }
    
    /* ==========================================
       BOUTONS PREVIEW MOBILE - ABSOLUS ET COMPACTS
       ========================================== */

    /* Tous les contrôles passent en absolute au lieu de fixed */
    .zoom-controls,
    .size-display,
    .center-design-wrapper,
    .orientation-toggle,
    .toggle-dimensions-wrapper {
        position: absolute !important;
    }

    /* Zoom controls - plus petits */
    .zoom-controls {
        top: 10px;
        left: 10px;
        gap: 6px;
    }

    .zoom-btn {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }

    /* Size display - plus compact */
    .size-display {
        top: 50px;
        left: 10px;
        padding: 8px 12px;
        font-size: 0.7rem;
    }

    .size-display-title {
        font-size: 0.6rem;
        margin-bottom: 4px;
    }

    .size-display-values {
        gap: 4px;
        margin-bottom: 6px;
    }

    .size-display-item {
        font-size: 0.7rem;
    }

    .size-display-quality {
        font-size: 0.65rem;
    }

    /* Center design button - plus petit */
    .center-design-wrapper {
        top: 160px;
        left: 10px;
    }

    .center-design-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    /* Orientation toggle - DÉPLACÉ PLUS HAUT */
    .orientation-toggle {
        bottom: 120px; /* ← AU-DESSUS DU FOOTER */
        left: 10px;
        z-index: 10000 !important;
    }

    .orientation-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    /* Toggle dimensions - DÉPLACÉ PLUS HAUT */
    .toggle-dimensions-wrapper {
        bottom: 120px; /* ← AU-DESSUS DU FOOTER */
        left: 110px;
        z-index: 10000 !important;
    }

    .toggle-dimensions-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    /* Placeholder text */
    .placeholder-text {
        font-size: 1rem;
        padding: 0 20px;
    }

    /* ==========================================
       GESTION AFFICHAGE DES BOUTONS
       ========================================== */

    /* Les boutons qui s'affichent avec .visible */
    .size-display {
        display: none;
    }

    .size-display.visible {
        display: block !important;
    }

    .center-design-wrapper {
        display: none;
    }

    .center-design-wrapper.visible {
        display: block !important;
    }

    .orientation-toggle.visible,
    .toggle-dimensions-wrapper.visible {
        display: block !important;
    }

    /* ==========================================
       CONFIG PANEL MOBILE
       ========================================== */
    
    .section-title {
        font-size: 1rem;
        margin-bottom: 16px;
    }
    
    .size-selection-container {
        padding: 16px;
    }
    
    .size-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .size-option {
        padding: 12px 8px;
    }
    
    /* ==========================================
       UPLOAD MOBILE
       ========================================== */
    
    .upload-section {
        padding: 24px 16px;
        height: 180px;
    }
    
    .upload-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 12px;
    }
    
    .upload-formats {
        font-size: 0.8rem;
        margin-bottom: 12px;
    }
    
    .upload-btn {
        font-size: 0.85rem;
        padding: 10px 20px;
    }
    
    .uploaded-file-section .uploaded-preview {
        height: 180px;
        padding: 16px;
    }
    
    .preview-container {
        height: 100px;
        padding: 12px;
    }
    
    /* ==========================================
       BOUTON VALIDATION MOBILE
       ========================================== */
    
    .validate-design-btn {
        max-width: 100%;
        font-size: 0.9rem;
        padding: 14px 28px;
    }
    
    /* ==========================================
       DPI COMPARISON MOBILE
       ========================================== */
    
    .dpi-comparison {
        flex-direction: column;
        gap: 20px;
    }
    
    .dpi-comparison-item {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
    
    /* ==========================================
       MODALS MOBILE
       ========================================== */
    
    .modal-content {
        padding: 30px 20px;
        width: 95%;
    }
    
    .modal-title {
        font-size: 20px;
    }
    
    .modal-text {
        font-size: 15px;
    }
    
    .modal-buttons {
        flex-direction: column;
        gap: 12px;
    }
    
    .modal-btn {
        width: 100%;
        padding: 12px 32px;
    }

    /* Permettre le zoom tactile sur la preview */
    .preview-panel {
        touch-action: manipulation !important; /* Au lieu de pinch-zoom */
        -webkit-overflow-scrolling: touch;
        overflow: visible;
    }
    
    .pochoir-wrapper {
        transition: transform 0.1s ease-out;
        transform-origin: center center;
    }
    
    /* Empêcher le zoom sur le reste */
    .setup-panel,
    .config-panel,
    .tab-content,
    .validate-btn-footer {
        touch-action: pan-y !important;
    }
}