/**
 * Styles pour le Page Builder moderne
 * Architecture: Toolbar horizontale → Container → Colonnes → Widgets
 */

/* Layout principal */
.page-builder {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: calc(100vh - 100px);
}

/* ===== TOOLBAR SUR 2 LIGNES ===== */
.page-builder-toolbar-wrapper {
    position: sticky;
    top: 0;
    z-index: 100;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-radius: 12px 12px 0 0;
    overflow: hidden;
}

.page-builder-toolbar {
    background: linear-gradient(to bottom, #ffffff 0%, #f8fafc 100%);
    padding: 12px 16px;
    display: flex;
    gap: 20px;
}

/* Ligne 1 : Templates + Structure (plus compacte) */
.toolbar-row-1 {
    border-bottom: 1px solid #e2e8f0;
    padding: 10px 16px;
}

/* Ligne 2 : Widgets (optimisé) */
.toolbar-row-2 {
    border-bottom: 2px solid #e2e8f0;
    padding: 8px 16px;
}

.toolbar-row-2 .toolbar-section-full {
    width: 100%;
}

/* Le catalogue de widgets a grandi (38 entrées, 10 catégories) : sans plafond,
   il repoussait le canvas sous la ligne de flottaison. Zone défilante, la
   recherche reste visible en haut. */
.toolbar-row-2 .toolbar-items-list {
    width: 100%;
    max-height: 216px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.toolbar-row-2 .widget-search-box {
    position: sticky;
    top: 0;
    z-index: 2;
    background: white;
}

/* Mobile d'abord : sous 16px, Safari iOS zoome au focus et ne dézoome pas. */
#widget-search-input { font-size: 1rem; }
@media (min-width: 992px) {
    #widget-search-input { font-size: 13px; }
}

@media (max-width: 768px) {
    .toolbar-row-2 .toolbar-items-list { max-height: 160px; }
}

.toolbar-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.toolbar-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.toolbar-section-title i {
    font-size: 14px;
    color: #667eea;
}

.toolbar-divider {
    width: 1px;
    background: linear-gradient(to bottom, transparent 0%, #cbd5e1 20%, #cbd5e1 80%, transparent 100%);
    align-self: stretch;
}

.toolbar-items-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Items de la toolbar (containers et widgets) */
.toolbar-item {
    min-width: 55px;
    height: 55px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px;
    background: white;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    cursor: grab;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.toolbar-item:hover {
    background: #f1f5f9;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.toolbar-item:active {
    cursor: grabbing;
    transform: translateY(0);
}

.toolbar-item i {
    font-size: 20px;
    color: #667eea;
    transition: transform 0.2s;
}

.toolbar-item:hover i {
    transform: scale(1.1);
}

.toolbar-item-label {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    text-align: center;
    line-height: 1.1;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toolbar-item-desc {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    margin-bottom: 8px;
    z-index: 1000;
}

.toolbar-item-desc::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #1e293b;
}

.toolbar-item:hover .toolbar-item-desc {
    opacity: 1;
}

/* Zone d'édition principale - pleine largeur */
.editor-canvas {
    flex: 1;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 30px;
    min-height: 500px;
    width: 100%;
    position: relative;
}

.sections-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sections-empty {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.sections-empty i {
    font-size: 48px;
    color: #cbd5e1;
    margin-bottom: 15px;
}

.sections-empty h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #475569;
}

/* ================================================
   CONTAINERS
   ================================================ */

.container-block {
    background: white;
    border-radius: 10px;
    border: 2px solid #cbd5e1;
    overflow: hidden;
    transition: all 0.2s;
    margin-bottom: 15px;
}

.container-block:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.container-block.editing {
    border-color: #3b82f6;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.25);
}

.container-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 15px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-bottom: 2px solid #cbd5e1;
}

.container-handle {
    cursor: move;
    color: #94a3b8;
    font-size: 18px;
    margin-right: 8px;
}

.container-handle:hover {
    color: #3b82f6;
}

.container-type-label {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
}

.container-type-label i {
    color: #3b82f6;
    font-size: 16px;
}

.container-preview {
    padding: 20px;
    min-height: 150px;
}

.columns-preview {
    min-height: 100px;
}

.columns-preview.columns-one-column {
    grid-template-columns: 1fr;
}

.columns-preview.columns-two-columns {
    grid-template-columns: 1fr 1fr;
}

.columns-preview.columns-three-columns {
    grid-template-columns: 1fr 1fr 1fr;
}

/* ================================================
   COLONNES
   ================================================ */

.column-preview {
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 15px;
    min-height: 120px;
    transition: all 0.2s;
}

.column-preview.empty {
    background: #f1f5f9;
}

.column-preview:hover {
    border-color: #10b981;
    background: #f0fdf4;
}

.column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}

.column-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.column-add-widget-btn {
    background: #10b981;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.column-add-widget-btn:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.column-add-widget-btn i {
    font-size: 10px;
}

.column-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
    font-style: italic;
    font-size: 13px;
}

.widgets-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ================================================
   WIDGETS
   ================================================ */

.widget-block {
    background: white;
    border-radius: 6px;
    border: 2px solid #e2e8f0;
    overflow: hidden;
    transition: all 0.2s;
}

.widget-block:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.widget-block.editing {
    border-color: #667eea;
    box-shadow: 0 2px 12px rgba(102, 126, 234, 0.2);
}

.widget-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-bottom: 1px solid #e2e8f0;
}

.widget-handle {
    cursor: move;
    color: #94a3b8;
    font-size: 14px;
    margin-right: 6px;
}

.widget-handle:hover {
    color: #667eea;
}

.widget-type-label {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}

.widget-type-label i {
    color: #667eea;
    font-size: 13px;
}

.widget-preview {
    padding: 15px;
    min-height: 60px;
}

/* Bloc de section (ancien - rétrocompatibilité) */
.section-block {
    background: white;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    overflow: hidden;
    transition: all 0.2s;
}

.section-block:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.section-block.editing {
    border-color: #667eea;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.2);
}

.section-ghost {
    opacity: 0.4;
    background: #e0e7ff;
}

/* ================================================
   BOUTONS DE TOOLBAR (containers & widgets)
   ================================================ */

.toolbar-btn {
    background: transparent;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    color: #64748b;
    font-size: 13px;
    transition: all 0.2s;
}

.toolbar-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.toolbar-btn.danger:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* ================================================
   WIDGET SELECTOR (modal d'ajout de widgets)
   ================================================ */

.widget-selector-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.widget-selector-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    width: 100%;
}

.widget-selector-btn:hover {
    background: #f0fdf4;
    border-color: #10b981;
    transform: translateX(3px);
}

.widget-selector-btn i {
    font-size: 24px;
    color: #10b981;
    width: 30px;
    text-align: center;
}

.widget-selector-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 14px;
    margin-bottom: 3px;
}

.widget-selector-desc {
    font-size: 12px;
    color: #64748b;
}

/* ================================================
   DRAG & DROP STYLES
   ================================================ */

/* Widget en cours de drag depuis la toolbar */
.toolbar-widget.dragging {
    opacity: 0.5;
    cursor: grabbing;
    transform: scale(0.95);
}

/* Widget verrouillé (offre non disponible) */
.toolbar-widget.widget-locked {
    opacity: 0.75;
    cursor: not-allowed !important;
    pointer-events: auto;
    position: relative;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
    border: none !important;
    border-left: 4px solid #cbd5e1 !important;
    border-radius: 0 8px 8px 0 !important;
    overflow: visible;
}

/* Couleur de bordure selon le plan */
.toolbar-widget.widget-locked.plan-essential {
    border-left-color: #3b82f6 !important;
}

.toolbar-widget.widget-locked.plan-pro {
    border-left-color: #f59e0b !important;
}

.toolbar-widget.widget-locked:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    opacity: 0.9;
}

.toolbar-widget.widget-locked .toolbar-item-label {
    color: #64748b;
    font-size: 12px;
}

.toolbar-widget.widget-locked i.fa-solid:not(.widget-lock-icon) {
    color: #94a3b8 !important;
}

/* Badge du plan requis - en bas du widget */
.widget-plan-badge {
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    padding: 2px 6px;
    font-size: 8px;
    font-weight: 700;
    color: white;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    z-index: 10;
}

.widget-plan-badge.badge-essential {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.widget-plan-badge.badge-pro {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* Icône de cadenas - masqué pour un affichage plus propre */
.widget-lock-icon {
    display: none;
}

/* ===== POPUP WIDGET SELECTOR - Widgets verrouillés ===== */
.widget-selector-btn.widget-locked {
    opacity: 0.7;
    cursor: not-allowed !important;
    position: relative;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
    border: none !important;
    border-left: 4px solid #cbd5e1 !important;
    border-radius: 0 8px 8px 0 !important;
}

.widget-selector-btn.widget-locked.plan-essential {
    border-left-color: #3b82f6 !important;
}

.widget-selector-btn.widget-locked.plan-pro {
    border-left-color: #f59e0b !important;
}

.widget-selector-btn.widget-locked:hover {
    transform: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    opacity: 0.85;
}

.widget-selector-btn.widget-locked i.fa-solid:first-child {
    color: #94a3b8 !important;
}

.widget-selector-btn.widget-locked .widget-selector-name {
    color: #64748b;
}

.widget-selector-btn.widget-locked .widget-selector-desc {
    color: #94a3b8;
}

/* Badge du plan dans le popup */
.widget-selector-btn .widget-popup-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 3px 8px;
    font-size: 9px;
    font-weight: 700;
    color: white;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.widget-selector-btn .widget-popup-badge.badge-essential {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.widget-selector-btn .widget-popup-badge.badge-pro {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* Icône cadenas dans le popup - masqué */
.widget-selector-btn .widget-popup-lock {
    display: none;
}

/* Colonne en survol pendant le drag (drop zone active) */
.column-preview.drag-over {
    background: linear-gradient(135deg, #e0f2fe 0%, #dbeafe 100%);
    border: 2px solid #3b82f6;
    border-style: solid;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.column-preview.drag-over .column-header {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 6px;
    padding: 8px 12px;
}

.column-preview.drag-over .column-empty-state {
    color: #3b82f6;
    font-weight: 600;
}

/* Animation lors du drop */
@keyframes dropFeedback {
    0% {
        transform: scale(0.95);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.widget-block.just-dropped {
    animation: dropFeedback 0.3s ease;
}

/* Styles pour SortableJS */
.sortable-ghost {
    opacity: 0.4;
    background: #e0f2fe;
    border: 2px dashed #3b82f6;
}

.sortable-chosen {
    cursor: grabbing;
}

.sortable-drag {
    opacity: 1;
    background: white;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* ================================================
   ANCIEN SYSTÈME (rétrocompatibilité)
   ================================================ */

/* Toolbar de section */
.section-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e2e8f0;
}

.section-handle {
    cursor: move;
    color: #94a3b8;
    font-size: 16px;
    margin-right: 8px;
}

.section-handle:hover {
    color: #667eea;
}

.section-type-label {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.section-type-label i {
    color: #667eea;
}

.section-toolbar-btn {
    background: transparent;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    color: #64748b;
    font-size: 13px;
    transition: all 0.2s;
}

.section-toolbar-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.section-toolbar-btn.danger:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Preview de section */
.section-preview {
    padding: 20px;
    min-height: 100px;
}

.section-preview.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-style: italic;
}

/* Sidebar d'édition à droite (cohérent avec le menu de gauche) */
.section-editor-sidebar {
    position: fixed;
    top: 0;
    right: -450px;
    width: 450px;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.section-editor-sidebar[style*="display: block"],
.section-editor-sidebar[style*="display:block"] {
    right: 0;
}

.section-editor-header {
    flex-shrink: 0;
    padding: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-bottom: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.section-editor-header h4 {
    font-size: 17px;
    font-weight: 600;
    color: white;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-editor-header h4 i {
    font-size: 18px;
}

.section-editor-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 20px;
    color: white;
    cursor: pointer;
    padding: 8px;
    line-height: 1;
    border-radius: 6px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.section-editor-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.section-editor-body {
    flex: 1 1 0;
    padding: 24px;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 180px);
}

.section-editor-footer {
    flex-shrink: 0;
    padding: 20px 24px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.section-editor-footer .btn-save {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.section-editor-footer .btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.section-editor-footer .btn-cancel {
    background: #e2e8f0;
    color: #475569;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.section-editor-footer .btn-cancel:hover {
    background: #cbd5e1;
}

/* Scrollbar personnalisée pour le body de la sidebar */
.section-editor-body::-webkit-scrollbar {
    width: 8px;
}

.section-editor-body::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.section-editor-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.section-editor-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
    font-family: inherit;
}

.form-group .help-text {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}

/* Toggle button */
.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #667eea;
}

input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* Boutons d'action */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e2e8f0;
    color: #475569;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #cbd5e1;
}

/* Responsive */
@media (max-width: 1200px) {
    .page-builder {
        flex-direction: column;
    }

    .section-editor-sidebar {
        width: 100%;
        right: -100%;
    }

    .section-editor-sidebar[style*="display: block"],
    .section-editor-sidebar[style*="display:block"] {
        right: 0;
    }
}

@media (max-width: 768px) {
    .section-editor-sidebar {
        width: 100%;
    }
}

/* ================================================
   WIDGET GROUPS (Grille avec séparateurs visuels)
   ================================================ */

.widgets-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
}

.widget-group {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0;
}

.widget-group:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* En-tête de groupe avec barre colorée - horizontal */
.widget-group-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: white;
    border-right: 1px solid #e2e8f0;
    border-left-width: 3px;
    border-left-style: solid;
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    flex-shrink: 0;
}

.widget-group-header i {
    font-size: 12px;
}

/* Liste des widgets dans le groupe - en ligne horizontale */
.widget-group-items {
    padding: 4px;
    background: white;
    display: flex;
    flex-wrap: nowrap;
    gap: 3px;
}

.widget-group-items .toolbar-item {
    margin: 0;
    width: auto;
    min-width: 65px;
    height: auto;
    min-height: 60px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 3px;
    padding: 6px 8px;
    background: white;
    text-align: center;
    flex-shrink: 0;
}

.widget-group-items .toolbar-item:hover {
    background: #f8fafc;
}

.widget-group-items .toolbar-item i {
    font-size: 20px;
    flex-shrink: 0;
}

.widget-group-items .toolbar-item-label {
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
    text-align: center;
    line-height: 1.2;
    width: 100%;
    word-break: break-word;
}

/* Responsive */
@media (max-width: 1024px) {
    .widget-group-items {
        flex-wrap: wrap;
    }

    .widget-group-items .toolbar-item {
        min-width: 60px;
        min-height: 55px;
        padding: 5px 6px;
    }
}

@media (max-width: 768px) {
    .widgets-grid {
        gap: 6px;
    }

    .widget-group {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .widget-group-header {
        padding: 5px 8px;
        font-size: 12px;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }

    .widget-group-items {
        padding: 4px;
        flex-wrap: wrap;
        gap: 3px;
    }

    .widget-group-items .toolbar-item {
        min-width: 55px;
        min-height: 50px;
        padding: 4px 5px;
    }

    .widget-group-items .toolbar-item i {
        font-size: 16px;
    }

    .widget-group-items .toolbar-item-label {
        font-size: 8px;
    }
}

/* Autocomplete Map */
.map-autocomplete-wrapper {
    position: relative;
    width: 100%;
}

.map-autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    z-index: 2100;
    max-height: 250px;
    overflow-y: auto;
}

.map-autocomplete-item {
    padding: 12px 15px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.map-autocomplete-item:last-child {
    border-bottom: none;
}

.map-autocomplete-item:hover {
    background: #f0f4ff;
    color: #667eea;
}

.map-autocomplete-item .address-main {
    font-weight: 600;
}

.map-autocomplete-item .address-sub {
    font-size: 12px;
    color: #94a3b8;
}
