/* Calculateur Débarras - Style */
.calculateur-debarras-container {
    max-width: 1200px;
    background: #3a4454;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3),
                0 4px 12px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    touch-action: pan-x pan-y;
}

body.calculateur-debarras-page {
    touch-action: pan-x pan-y;
}

/* Tabs */
.calculateur-tabs {
    display: flex;
    background: #2c3544;
    padding: 0;
    overflow-x: auto;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

/* Gradient fade désactivé car causait des bugs visuels lors du scroll */

.tab-button {
    flex: 0 0 auto;
    padding: 16px 16px;
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
}

.tab-button:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #e5e7eb;
}

.tab-button.active {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #ffffff;
    border-bottom-color: var(--primary-color, #e74c3c);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1),
                0 2px 8px rgba(0, 0, 0, 0.15);
}

.tab-icon {
    font-size: 20px;
}

.tab-label {
    font-size: 12px;
    line-height: 1.2;
}

/* Badge de notification */
.tab-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #ef4444;
    color: #ffffff;
    font-size: 10px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 10;
    line-height: 1;
}

.tab-badge.show {
    display: flex;
    animation: badgePop 0.3s ease;
}

@keyframes badgePop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* Content */
.calculateur-content {
    background: #f5f5f5;
    padding: 20px 30px 10px 30px;
    min-height: 490px;
    max-height: 600px;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .calculateur-content {
        padding: 20px 10px;
        min-height: 300px;
        max-height: 400px;
    }
}

.category-items {
    display: none;
}

.category-items.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Items Grid */
.items-grid {
    display: grid;
    /* Le nombre de colonnes est défini dans les réglages du plugin */
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
}

.item-card {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 0px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06),
                0 1px 3px rgba(0, 0, 0, 0.08);
}

.item-card:hover {
    border-color: var(--primary-color, #e74c3c);
    box-shadow: 0 8px 24px rgba(231, 76, 60, 0.15),
                0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px) scale(1.02);
}

.item-card.selected {
    background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
    border-color: #0ea5e9;
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.25),
                0 2px 8px rgba(14, 165, 233, 0.15);
}

.item-card.selected:hover {
    background: linear-gradient(135deg, #bae6fd 0%, #e0f2fe 100%);
    border-color: #0284c7;
    box-shadow: 0 8px 24px rgba(14, 165, 233, 0.3),
                0 4px 12px rgba(14, 165, 233, 0.2);
}

.item-icon {
    font-size: 32px;
    margin-bottom: 0px;
    filter: grayscale(0.3);
}

.item-name {
    font-size: 12px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 10px;
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    padding: 0px 10px;
}

/* Controls */
.item-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0px;
    background: transparent;
    padding: 0px 5px 5px;
    border-radius: 6px;
}

.item-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #374151;
    font-size: 18px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.item-btn:hover {
    background: var(--primary-color, #e74c3c);
    border-color: var(--primary-color, #e74c3c);
    color: #ffffff;
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.item-btn:active {
    transform: scale(0.9);
    animation: btnBounce 0.3s ease;
}

@keyframes btnBounce {
    0%, 100% { transform: scale(0.9); }
    50% { transform: scale(1.05); }
}

.item-btn.minus {
    font-size: 24px;
}

.item-count {
    min-width: 35px;
    font-size: 18px;
    font-weight: bold;
    color: #1f2937;
    text-align: center;
}

/* Footer */
.calculateur-footer {
    background: linear-gradient(135deg, #2c3544 0%, #3a4454 100%);
    padding: 30px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

@media (max-width: 900px) {
    .calculateur-footer {
        flex-wrap: wrap;
    }
}

.volume-display {
    display: flex;
    flex-direction: column;
    gap: 0px;
}

.volume-label {
    color: #9ca3af;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    margin-bottom: 0;
}

.volume-value {
    color: #ffffff;
    font-size: 32px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    line-height: 1;
    margin-top: 0;
}

.volume-value.pulse {
    animation: volumePulse 0.5s ease;
}

@keyframes volumePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); color: #fbbf24; }
}

.footer-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.reset-button {
    background: rgba(75, 85, 99, 0.5);
    color: #9ca3af;
    border: 2px solid #4b5563;
    padding: 0;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    font-size: 24px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.reset-button:hover {
    background: #4b5563;
    color: #ffffff;
    border-color: #6b7280;
    box-shadow: 0 4px 12px rgba(75, 85, 99, 0.3);
}

.reset-icon {
    font-size: 26px;
    display: inline-block;
    transition: transform 0.3s ease;
    line-height: 1;
}

.reset-button:hover .reset-icon {
    transform: rotate(180deg);
}

.submit-button {
    background: var(--primary-color, #e74c3c);
    color: #ffffff;
    border: none;
    padding: 18px 40px;
    border-radius: 0px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.35),
                0 2px 8px rgba(231, 76, 60, 0.25);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.submit-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.submit-button:hover::before {
    left: 100%;
}

.submit-button:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 30px rgba(231, 76, 60, 0.45),
                0 4px 12px rgba(231, 76, 60, 0.3);
}

.submit-button:active {
    transform: translateY(-1px) scale(0.98);
}

.submit-button:disabled {
    background: #6b7280;
    cursor: not-allowed;
    opacity: 0.5;
    box-shadow: none;
}

/* Scrollbar personnalisé */
.calculateur-content::-webkit-scrollbar {
    width: 8px;
}

.calculateur-content::-webkit-scrollbar-track {
    background: #e5e7eb;
    border-radius: 4px;
}

.calculateur-content::-webkit-scrollbar-thumb {
    background: var(--primary-color, #e74c3c);
    border-radius: 4px;
}

.calculateur-content::-webkit-scrollbar-thumb:hover {
    background: #c0392b;
}

/* Scrollbar personnalisé pour Step 2 - Récapitulatif */
#recapitulatif-scroll-container {
    -webkit-overflow-scrolling: touch;
}

#recapitulatif-scroll-container::-webkit-scrollbar {
    height: 8px;
}

#recapitulatif-scroll-container::-webkit-scrollbar-track {
    background: #e5e7eb;
    border-radius: 4px;
    margin: 0 10px;
}

#recapitulatif-scroll-container::-webkit-scrollbar-thumb {
    background: var(--primary-color, #e74c3c);
    border-radius: 4px;
}

#recapitulatif-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #c0392b;
}

/* Scrollbar plus visible sur mobile */
@media (max-width: 768px) {
    #recapitulatif-scroll-container::-webkit-scrollbar {
        height: 12px;
    }

    #recapitulatif-scroll-container::-webkit-scrollbar-track {
        background: #d1d5db;
    }

    #recapitulatif-scroll-container::-webkit-scrollbar-thumb {
        background: var(--primary-color, #e74c3c);
        border-radius: 6px;
        border: 2px solid #f5f5f5;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .calculateur-debarras-container {
        margin: 0px;
        border-radius: 0px;
    }

    .tab-button {
        flex: 0 0 auto;
        padding: 15px 15px 10px;
        font-size: 13px;
        gap: 4px;
    }

    .tab-icon {
        font-size: 18px;
    }

    .tab-label {
        font-size: 10px;
        line-height: 1.1;
        white-space: nowrap;
        padding: 0 2px;
    }

    .items-grid {
        /* Le nombre de colonnes mobile est défini dans les réglages du plugin */
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .item-card {
        padding: 0px 6px;
    }

    .item-controls {
        gap: 4px;
    }

    .item-btn {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }

    .item-count {
        min-width: 30px;
        font-size: 16px;
    }

    .item-icon {
        font-size: 30px;
        margin-bottom: 0px;
    }

    .item-name {
        font-size: 12px;
        min-height: 30px;
        margin-bottom: 6px;
    }

    .calculateur-footer {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 15px 20px;
        gap: 12px;
        align-items: center;
    }

    .volume-display {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 8px;
        flex: 1;
        order: 1;
        min-width: 0;
    }

    .volume-label {
        font-size: 13px;
        white-space: nowrap;
    }

    .volume-value {
        font-size: 20px;
        white-space: nowrap;
    }

    .calculateur-footer > .reset-button {
        width: 36px;
        height: 36px;
        order: 2;
        margin: 0;
        flex-shrink: 0;
    }

    .reset-icon {
        font-size: 20px;
    }

    .footer-buttons {
        width: 100%;
        display: flex;
        flex-direction: row;
        gap: 7px;
        order: 3;
    }

    /* Badge de notification - Déplacer plus haut pour ne pas cacher le texte */
    .tab-badge {
        top: 2px;
        left: 6px;
    }

    .submit-button {
        width: 100%;
        padding: 14px 16px;
        font-size: 13px;
        justify-content: center;
        white-space: nowrap;
        line-height: 1.2;
    }
}

/* Le nombre de colonnes est maintenant géré par les réglages du plugin */
/* @media (max-width: 480px) {
    .items-grid {
        grid-template-columns: repeat(2, 1fr);
    }
} */
