/* CSS pour le widget Conditionnement */

.cond-widget-container {
    display: inline-block;
    vertical-align: top;
    position: relative;
    margin-left: 10px;
}

.cond-widget {
    margin-top: 5px;
    padding: 10px;
    border: 1px solid #dcdcdc;
    border-radius: 8px;
    background: #fbfbfb;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    width: 200px;
}

.cond-widget-title {
    text-align: center;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    color: #555;
    margin-bottom: 5px;
}

.cond-widget-qty-display {
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 8px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 4px;
}

.cond-widget-buttons {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-bottom: 8px;
}

.cond-btn {
    padding: 4px 12px;
    border-radius: 12px;
    border: 1px solid #ccc;
    background: #fff;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.cond-btn.active {
    background: #4B46E2;
    color: white;
    border-color: #4B46E2;
}

.cond-stepper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.cond-stepper input {
    width: 40px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 2px;
}

.cond-stepper button {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid #ccc;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.cond-stepper button:hover {
    background: #eee;
}

.cond-badges {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 8px;
}

.cond-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 8px;
    background: #eee;
    color: #333;
}

.cond-info-text {
    text-align: center;
    font-size: 10px;
    color: #777;
    margin-top: 5px;
}

/* Lux Pro Stock Design System */
:root {
    --cond-theme-color: #263c5c;
    /* Default fallback, updated by JS */
}

.cond-lux-badge {
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    width: 100%;
    min-width: 320px;
    background: #ffffff;
    border: 1px solid #d1dce8;
    border-radius: 8px;
    padding: 0;
    font-size: 13px;
    color: #2c3e50;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
    transition: all 0.3s ease;
    overflow: hidden;
}

.cond-badge-header {
    background: var(--cond-theme-color);
    /* Dolibarr Top Menu Color */
    color: #ffffff;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.cond-badge-content {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: space-around;
    padding: 8px 10px;
}

.cond-lux-badge:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.cond-lux-sep {
    width: 1px;
    height: 18px;
    background: #e2e8f0;
    margin: 0 10px;
}

.cond-lux-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.status-ok .cond-lux-dot {
    background: #28a745;
    /* Eldy success */
    box-shadow: 0 0 8px #28a745;
}

.status-low .cond-lux-dot {
    background: #ffc107;
    /* Warning yellow for better contrast on blue */
    /* Eldy danger */
    box-shadow: 0 0 8px #ffc107;
}

.status-negative .cond-lux-dot {
    background: #f82a4d;
    box-shadow: 0 0 10px #f82a4d;
}

.status-negative.cond-lux-badge .cond-badge-header {
    background: #dc3545 !important;
}

.cond-stock-badge.status-negative {
    background: #dc3545 !important;
}

.status-negative .cond-val-palette, 
.status-negative .cond-val-carton, 
.status-negative .cond-val-piece {
    color: #dc3545 !important;
}

.status-negative .cond-lbl-sub {
    color: #b02a37 !important;
    font-weight: 600;
}

.cond-val-palette {
    color: #6f42c1;
    font-size: 16px;
    font-weight: 700;
}

.cond-val-carton {
    color: #bc9526;
    font-size: 16px;
    font-weight: 700;
    /* Eldy Warning */
}

.cond-val-piece {
    color: #475569;
    font-size: 16px;
    font-weight: 700;
}

.cond-lbl-sub {
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
}

/* Movement list badge Lux style */
.cond-mvt-badge {
    display: inline-flex;
    align-items: center;
    color: #ffffff !important;
    border-radius: 8px;
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    margin: 2px;
    white-space: nowrap;
    vertical-align: middle;
    letter-spacing: 0.5px;
}

.cond-mvt-badge-plus {
    background: #28a745 !important;
    /* Green */
}

.cond-mvt-badge-minus {
    background: #dc3545 !important;
    /* Red */
}

/* Summary view adjustments */
.cond-summary-wrapper {
    margin-left: 20px;
    display: inline-block;
    vertical-align: middle;
    width: 100%;
    max-width: 650px;
}

@media (max-width: 992px) {
    .cond-lux-badge {
        min-width: unset;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 12px;
    }

    .cond-lux-sep {
        display: none;
    }
}

@media (max-width: 480px) {
    .cond-lux-badge {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px;
    }

    .cond-summary-wrapper {
        margin-left: 0;
        margin-top: 10px;
    }
}

/* Stock badges in product list and reassortment */
.cond-stock-badge {
    display: inline-flex;
    align-items: center;
    background: var(--cond-theme-color);
    color: #ffffff !important;
    border-radius: 8px;
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
    cursor: default;
    transition: transform 0.2s;
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
}

.cond-stock-badge:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Support for new Widget Models */
.cond-style-glass .cond-tab-btn {
    background: rgba(255, 255, 255, 0.4);
    color: #475569;
}
.cond-style-glass .cond-tab-btn.active {
    background: var(--cond-theme-color) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(var(--cond-theme-color-rgb, 38, 60, 92), 0.3);
}

.cond-style-dark .cond-tab-btn.active {
    background: var(--cond-theme-color) !important;
    color: white !important;
}

.cond-style-slim .cond-tab-btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.cond-style-select select:focus {
    outline: none;
    border-color: var(--cond-theme-color);
    box-shadow: 0 0 0 3px rgba(38, 60, 92, 0.2);
}

/* Material Style */
.cond-style-material .cond-tab-btn.active {
    background: var(--cond-theme-color) !important;
    color: white !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Neon Style */
.cond-style-neon .cond-tab-btn.active {
    background: var(--cond-theme-color) !important;
    color: white !important;
    box-shadow: 0 0 15px var(--cond-theme-color);
}

/* Contrast Style */
.cond-style-contrast .cond-tab-btn.active {
    background: var(--cond-theme-color) !important;
    color: #fff !important;
}

/* Ensure the cell content is centered if possible */
td:has(> .cond-stock-badge) {
    text-align: center;
}

.cond-qty-bound {
    display: none !important;
}