/* Catalogue pièces — panier / proforma / recherche */

.piece-catalog-row {
    margin-left: -0.4rem;
    margin-right: -0.4rem;
}

.piece-catalog-col {
    padding-left: 0.4rem;
    padding-right: 0.4rem;
}

.piece-catalog-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.piece-catalog-link:hover,
.piece-catalog-link:focus {
    text-decoration: none;
    color: inherit;
}

.piece-catalog-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    margin-bottom: 0;
    border: 1px solid #fed7aa !important;
    border-radius: 16px !important;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.08);
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;
}

.piece-catalog-card:hover {
    transform: translateY(-3px);
    border-color: #fb923c !important;
    box-shadow: 0 12px 28px rgba(234, 88, 12, 0.16);
}

.piece-catalog-body {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0.7rem 0.75rem 0.8rem;
}

.piece-catalog-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    margin-bottom: 0.55rem;
}

.piece-catalog-stock {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #64748b;
}

.piece-catalog-stock strong {
    font-size: 0.78rem;
    font-weight: 800;
}

.piece-catalog-stock.text-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #15803d;
}

.piece-catalog-stock.text-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #b45309;
}

.piece-catalog-stock.text-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.piece-catalog-add-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #ea580c;
    font-size: 0.72rem;
    flex-shrink: 0;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.piece-catalog-card:hover .piece-catalog-add-hint {
    background: #ea580c;
    border-color: #ea580c;
    color: #fff;
}

.piece-catalog-visual {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 92px;
    margin-bottom: 0.55rem;
    padding: 0.45rem;
    border-radius: 12px;
    background: linear-gradient(180deg, #fffaf5 0%, #fff7ed 100%);
    border: 1px solid #ffedd5;
}

.piece-catalog-visual img {
    max-height: 80px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.piece-catalog-visual .icon-settings,
.piece-catalog-visual__placeholder {
    font-size: 2.5rem;
    color: #fdba74;
    line-height: 1;
    opacity: 0.7;
}

.piece-catalog-title {
    font-size: 0.82rem;
    font-weight: 650;
    color: #1e293b;
    line-height: 1.35;
    margin: 0 0 0.55rem;
    min-height: 2.2em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.piece-catalog-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    margin-top: auto;
    padding: 0.45rem 0.55rem;
    border-radius: 10px;
    background: #fff7ed;
    border: 1px solid #ffedd5;
}

.piece-catalog-cat {
    font-size: 0.7rem;
    font-weight: 600;
    color: #c2410c;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 48%;
}

.piece-catalog-price {
    font-size: 0.78rem;
    font-weight: 800;
    padding: 0.18rem 0.5rem;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #fdba74;
    color: #9a3412;
    white-space: nowrap;
}

.piece-catalog-empty {
    padding: 2.5rem 1rem;
    text-align: center;
    color: #94a3b8;
    font-weight: 500;
}

/* Barre de recherche catalogue */
.panier-catalog-search {
    flex-shrink: 0;
    padding-top: 1rem;
    padding-bottom: 0.85rem;
    background: linear-gradient(180deg, #ffffff 0%, #fffaf7 100%);
    border-bottom: 1px solid rgba(234, 88, 12, 0.08);
}

.piece-catalog-search {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    padding: 0.35rem 0.4rem 0.35rem 0.85rem;
    border-radius: 14px;
    border: 1px solid #fed7aa;
    background: linear-gradient(180deg, #ffffff 0%, #fff7ed 100%);
    box-shadow: 0 1px 2px rgba(154, 52, 18, 0.06);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.piece-catalog-search:focus-within {
    border-color: #fb923c;
    box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.28), 0 2px 8px rgba(234, 88, 12, 0.1);
}

.piece-catalog-search__icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    color: #ea580c;
    font-size: 0.95rem;
    opacity: 0.9;
}

.piece-catalog-search__input {
    flex: 1;
    min-width: 0;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0.55rem 0.25rem;
    font-size: 0.92rem;
    color: #343a40;
    height: auto;
}

.piece-catalog-search__input::placeholder {
    color: #b45309;
    opacity: 0.55;
}

.piece-catalog-search__input:focus {
    outline: none;
    box-shadow: none !important;
}

.piece-catalog-search__reset {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    margin: 0;
    padding: 0;
    border: 1px solid #fed7aa;
    border-radius: 11px;
    background: #fff;
    color: #c2410c;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.piece-catalog-search__reset:hover {
    background: #ea580c;
    border-color: #ea580c;
    color: #fff;
    transform: translateY(-1px);
}

.piece-catalog-search__reset:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.35);
}

.piece-catalog-search__reset:active {
    transform: none;
}

/* Chips catégories */
.piece-cat-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 1rem;
    padding: 0.15rem 0 0.35rem;
}

.piece-cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    max-width: 100%;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid #fed7aa;
    background: linear-gradient(180deg, #ffffff 0%, #fff7ed 100%);
    color: #9a3412;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
    box-shadow: 0 1px 2px rgba(154, 52, 18, 0.06);
}

.piece-cat-chip i {
    font-size: 0.78rem;
    opacity: 0.85;
}

.piece-cat-chip span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 11rem;
}

.piece-cat-chip:hover {
    border-color: #fb923c;
    background: #fff7ed;
    color: #c2410c;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(234, 88, 12, 0.12);
}

.piece-cat-chip:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.35);
}

.piece-cat-chip.is-active {
    border-color: #ea580c;
    background: #ea580c;
    color: #fff;
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.28);
}

.piece-cat-chip.is-active:hover {
    background: #c2410c;
    border-color: #c2410c;
    color: #fff;
}

/* Compat : ancienne classe qty si encore utilisée */
.piece-catalog-qty {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 0.5rem;
}

.piece-catalog-qty strong {
    font-size: 0.85rem;
    padding: 0.1rem 0.45rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.85);
}

@media (max-width: 575.98px) {
    .piece-catalog-row {
        margin-left: -4px;
        margin-right: -4px;
    }

    .piece-catalog-row > .piece-catalog-col {
        padding-left: 4px;
        padding-right: 4px;
        margin-bottom: 0.65rem !important;
    }

    .piece-catalog-card:hover {
        transform: none;
    }

    .piece-catalog-body {
        padding: 0.9rem 0.95rem 0.85rem;
    }

    .piece-catalog-visual {
        flex: 0 0 auto;
        min-height: 120px;
        margin-bottom: 0.75rem;
    }

    .piece-catalog-visual img {
        max-height: 100px;
    }

    .piece-catalog-title {
        font-size: 0.9rem;
        min-height: auto;
        -webkit-line-clamp: 3;
        margin-bottom: 0.75rem;
    }

    .piece-catalog-footer {
        padding: 0.55rem 0.7rem;
    }

    .piece-catalog-cat {
        font-size: 0.78rem;
        max-width: 55%;
    }

    .piece-catalog-price {
        font-size: 0.88rem;
    }
}

@media (min-width: 576px) and (max-width: 991.98px) {
    .piece-catalog-visual {
        min-height: 82px;
    }

    .piece-catalog-visual img {
        max-height: 70px;
    }
}
