:root {
    --primary-red: #d80000;
    --dark-footer: #1a1a1a;
    --row-hover: #fff5f6;
}

body {
    height: 100vh;
    height: 100dvh; /* mobile : s'ajuste quand la barre d'adresse se cache */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.header-red {
    background-color: var(--primary-red);
    color: white;
    padding: 1rem 0;
    flex-shrink: 0;
}

@media (max-width: 1023px) {
    .header-red .field.has-addons input {
        width: 110px;
    }
}

.main-layout {
    flex-grow: 1;
    min-height: 0; /* empêche le flex item de grandir au-delà de sa taille allouée */
    display: flex;
    overflow: hidden;
    background-color: #f5f5f5;
}

.catalog-section {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: white;
}

.cart-section {
    width: 400px;
    border-left: 1px solid #dbdbdb;
    background-color: #f9f9f9;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

@media (max-width: 1023px) {
    .main-layout {
        overflow: hidden;
    }

    .cart-section {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 80vh;
        border-left: none;
        border-top: 2px solid #dbdbdb;
        border-radius: 1rem 1rem 0 0;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
        z-index: 100;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
    }

    .cart-section.is-open {
        transform: translateY(0);
    }

    .cart-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 99;
    }

    .cart-overlay.is-open {
        display: block;
    }

    .cart-fab {
        display: flex;
        position: fixed;
        bottom: 1rem;
        left: 50%;
        transform: translateX(-50%);
        z-index: 98;
    }

    .modal {
        z-index: 200;
    }

    .catalog-section {
        padding: 0.5rem;
    }
}

@media (min-width: 1024px) {
    .cart-fab {
        display: none;
    }

    .cart-overlay {
        display: none;
    }
}

.table-container {
    margin-top: 1rem;
}

.article-row:hover {
    background-color: var(--row-hover) !important;
}

.qty-input {
    width: 65px !important;
}

[x-cloak] {
    display: none !important;
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-thumb {
    background: #dbdbdb;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-red);
}

.footer-compact {
    background-color: var(--dark-footer);
    color: white;
    padding: 0.5rem 1.5rem;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.border-top {
    border-top: 1px solid #dbdbdb;
}
