/**
 * BWA - Garantie de Reprise
 * Front Office Styles
 *
 * @author BWA
 * @license AFL-3.0
 */

/* ========================================
   Main Container
   ======================================== */

.bwa-garantie-reprise {
    margin  : 0;
    padding : 0;
}

/* ========================================
   Header Section
   ======================================== */

.bwa-garantie-reprise__header {
    margin-bottom : 1.5rem;
}

.bwa-garantie-reprise__header .btn {
    display     : inline-flex;
    align-items : center;
    gap         : 0.5rem;
}

.bwa-garantie-reprise__header .btn .material-icons {
    font-size : 1.2rem;
}

/* ========================================
   Requests List
   ======================================== */

.bwa-garantie-reprise__list {
    margin : 1.5rem 0;
}

.bwa-garantie-reprise__item {
    transition : background-color 0.2s ease;
}

.bwa-garantie-reprise__item:hover {
    background-color : rgba(0, 0, 0, 0.02);
}

/* ========================================
   Status Badges
   ======================================== */

.bwa-garantie-reprise__status-badge {
    display        : inline-block;
    padding        : 0.25rem 0.75rem;
    border-radius  : 0.25rem;
    font-size      : 0.875rem;
    font-weight    : 600;
    text-transform : uppercase;
    letter-spacing : 0.5px;
    white-space    : nowrap;
}

.bwa-garantie-reprise__status-badge--processing {
    background-color : #17a2b8;
    color            : #fff;
}

.bwa-garantie-reprise__status-badge--awaiting_shipment {
    background-color : #ffc107;
    color            : #212529;
}

.bwa-garantie-reprise__status-badge--received {
    background-color : #007bff;
    color            : #fff;
}

.bwa-garantie-reprise__status-badge--completed {
    background-color : #28a745;
    color            : #fff;
}

.bwa-garantie-reprise__status-badge--cancelled {
    background-color : #dc3545;
    color            : #fff;
}

/* ========================================
   Empty State
   ======================================== */

.bwa-garantie-reprise__empty-state {
    text-align    : center;
    padding       : 2rem 1rem;
    margin-bottom : 2rem;
    border-bottom : 1px solid #dee2e6;
}

.bwa-garantie-reprise__empty-state .alert {
    display       : inline-flex;
    align-items   : center;
    gap           : 0.5rem;
    margin-bottom : 1rem;
}

.bwa-garantie-reprise__empty-state .material-icons {
    font-size : 1.5rem;
}

.bwa-garantie-reprise__empty-state p:last-child {
    margin-bottom : 0;
}

/* ========================================
   Info Content - Garantie de Reprise
   ======================================== */

.bwa-garantie-reprise__info-content {
    margin-top : 2rem;
}

.bwa-garantie-reprise__info-intro {
    margin-bottom : 2rem;
    padding       : 1.5rem;
    background    : #f8f9fa;
    border-radius : 0.25rem;
}

.bwa-garantie-reprise__info-intro h3 {
    font-size     : 1.5rem;
    font-weight   : 600;
    margin-bottom : 1rem;
}

.bwa-garantie-reprise__info-intro p {
    margin-bottom : 0.5rem;
}

.bwa-garantie-reprise__info-intro .text-muted {
    display     : flex;
    align-items : center;
    gap         : 0.5rem;
    margin-top  : 1rem;
}

.bwa-garantie-reprise__info-intro .material-icons {
    font-size : 1.25rem;
}

.bwa-garantie-reprise__info-block {
    margin-bottom : 2rem;
    padding       : 1.5rem;
    border        : 1px solid #dee2e6;
    border-radius : 0.25rem;
}

.bwa-garantie-reprise__info-block h4 {
    font-size     : 1.25rem;
    font-weight   : 600;
    margin-bottom : 1rem;
    padding-bottom: 0.5rem;
    border-bottom : 2px solid #007bff;
}

.bwa-garantie-reprise__info-block h5 {
    font-size     : 1.1rem;
    font-weight   : 600;
    margin-bottom : 0.75rem;
}

.bwa-garantie-reprise__info-block ul,
.bwa-garantie-reprise__info-block ol {
    margin-bottom : 0;
}

.bwa-garantie-reprise__info-block li {
    margin-bottom : 0.75rem;
    line-height   : 1.6;
}

.bwa-garantie-reprise__info-block li:last-child {
    margin-bottom : 0;
}

.bwa-garantie-reprise__steps-list {
    counter-reset : step-counter;
    list-style    : none;
    padding-left  : 0;
}

.bwa-garantie-reprise__steps-list > li {
    padding-left  : 3rem;
    position      : relative;
    margin-bottom : 1.5rem;
}

.bwa-garantie-reprise__steps-list > li::before {
    counter-increment : step-counter;
    content           : counter(step-counter, decimal-leading-zero);
    position          : absolute;
    left              : 0;
    top               : 0;
    background        : #007bff;
    color             : #fff;
    width             : 2rem;
    height            : 2rem;
    line-height       : 2rem;
    text-align        : center;
    border-radius     : 50%;
    font-weight       : 700;
    font-size         : 0.875rem;
}

.bwa-garantie-reprise__info-footer {
    margin-top    : 2rem;
    padding       : 1.5rem;
    background    : #e9ecef;
    border-radius : 0.25rem;
    text-align    : center;
}

.bwa-garantie-reprise__info-footer p {
    margin-bottom : 0;
}

/* ========================================
   Info Box
   ======================================== */

.bwa-garantie-reprise__info-box {
    padding       : 1.5rem;
    border-radius : 0.375rem;
    margin-bottom : 1.5rem;
}

.bwa-garantie-reprise__info-box h4,
.bwa-garantie-reprise__info-box h5 {
    margin-top    : 0;
    margin-bottom : 0.75rem;
}

.bwa-garantie-reprise__info-box p:last-child {
    margin-bottom : 0;
}

/* ========================================
   Form
   ======================================== */

.bwa-garantie-reprise__form {
    margin : 1.5rem 0;
}

.bwa-garantie-reprise__orders {
    margin-bottom : 1.5rem;
}

.bwa-garantie-reprise__orders-heading {
    display         : flex;
    align-items     : center;
    justify-content : space-between;
    gap             : 1rem;
    margin-bottom   : 1rem;
}

.bwa-garantie-reprise__orders-heading h4 {
    margin      : 0;
    font-size   : 1.15rem;
    font-weight : 600;
}

.bwa-garantie-reprise__order-section {
    margin-bottom : 1.5rem;
    border        : 1px solid #dee2e6;
    border-radius : 0.375rem;
    overflow      : hidden;
}

.bwa-garantie-reprise__order-section .card-header {
    background-color : #f8f9fa;
    border-bottom    : 1px solid #dee2e6;
    padding          : 1rem 1.25rem;
}

.bwa-garantie-reprise__order-section .card-header h5 {
    margin    : 0;
    font-size : 1.125rem;
}

.bwa-garantie-reprise__order-section .card-body {
    padding : 1.25rem;
}

.bwa-garantie-reprise__order-section--ineligible {
    opacity      : 0.85;
    border-color : #ced4da;
}

.bwa-garantie-reprise__order-section--ineligible .card-header {
    background-color : #f1f3f5;
}

.bwa-garantie-reprise__expired-orders {
    margin-top  : 2rem;
    padding-top : 1.5rem;
    border-top  : 1px solid #dee2e6;
}

.bwa-garantie-reprise__expired-orders h4 {
    margin-bottom : 0.5rem;
}

.bwa-garantie-reprise__ineligible-header {
    display         : flex;
    align-items     : flex-start;
    justify-content : space-between;
    gap             : 1rem;
    cursor          : default;
}

/* ========================================
   Product Row
   ======================================== */

.bwa-garantie-reprise__product-row {
    vertical-align : middle;
}

.bwa-garantie-reprise__product-row td {
    vertical-align : middle;
}

.bwa-garantie-reprise__product-row .product-checkbox {
    width  : 1.25rem;
    height : 1.25rem;
    cursor : pointer;
}

.bwa-garantie-reprise__product-row .product-quantity {
    max-width : 100px;
}

.bwa-garantie-reprise__product-row .img-thumbnail {
    max-width  : 60px;
    max-height : 60px;
    object-fit : cover;
}

.bwa-garantie-reprise__product-row--ineligible {
    background-color : #f8f9fa;
}

/* ========================================
   Actions
   ======================================== */

.bwa-garantie-reprise__actions {
    display     : flex;
    gap         : 1rem;
    flex-wrap   : wrap;
    margin-top  : 1.5rem;
    padding-top : 1.5rem;
    border-top  : 1px solid #dee2e6;
}

.bwa-garantie-reprise__actions .btn {
    display     : inline-flex;
    align-items : center;
    gap         : 0.5rem;
}

.bwa-garantie-reprise__actions .btn .material-icons {
    font-size : 1.2rem;
}

/* ========================================
   Products Table (View Page)
   ======================================== */

.bwa-garantie-reprise__products {
    margin-top : 2rem;
}

.bwa-garantie-reprise__products h4 {
    margin-bottom : 1rem;
}

.bwa-garantie-reprise__products .badge {
    font-size   : 0.75rem;
    padding     : 0.375rem 0.625rem;
    font-weight : 600;
}

.bwa-garantie-reprise__products .badge-success {
    background-color : #28a745;
    color            : #fff;
}

.bwa-garantie-reprise__products .badge-danger {
    background-color : #dc3545;
    color            : #fff;
}

.bwa-garantie-reprise__products .badge-warning {
    background-color : #ffc107;
    color            : #212529;
}

/* ========================================
   Customer Account Link
   ======================================== */

.bwa-garantie-reprise-link {
    display         : block;
    padding         : 1rem;
    text-decoration : none;
    transition      : all 0.3s ease;
    border-radius   : 0.375rem;
}

.bwa-garantie-reprise-link:hover {
    background-color : rgba(0, 0, 0, 0.03);
    text-decoration  : none;
}

.bwa-garantie-reprise-link .link-item {
    display     : flex;
    align-items : center;
    gap         : 0.75rem;
    color       : inherit;
}

.bwa-garantie-reprise-link .material-icons {
    font-size : 1.5rem;
    color     : #6c757d;
}

/* ========================================
   Invoice Download Link
   ======================================== */

.bwa-garantie-reprise__invoice-link {
    color           : #007bff;
    text-decoration : none;
    display         : inline-flex;
    align-items     : center;
    gap             : 0.25rem;
    transition      : all 0.2s ease;
    font-weight     : 500;
}

.bwa-garantie-reprise__invoice-link:hover {
    color           : #0056b3;
    text-decoration : underline;
}

.bwa-garantie-reprise__invoice-link .material-icons {
    font-size      : 1rem;
    vertical-align : middle;
}

/* ========================================
   Order Accordion
   ======================================== */

.bwa-garantie-reprise__order-section .card-header .btn-link {
    text-decoration : none;
    color           : #212529;
}

.bwa-garantie-reprise__order-section .card-header .btn-link:hover {
    text-decoration : none;
    color           : #212529;
}

.bwa-garantie-reprise__order-section .badge {
    background-color : #007bff !important;
    color            : #fff !important;
    font-weight      : 500;
}

.bwa-garantie-reprise__order-section .material-icons {
    color      : #6c757d;
    transition : transform 0.3s ease;
}

.bwa-garantie-reprise__order-section .btn-link:not(.collapsed) .material-icons:last-child {
    transform : rotate(180deg);
}

.bwa-garantie-reprise__order-section .collapse {
    transition : height 0.35s ease;
}

.bwa-garantie-reprise__order-section .collapse.show {
    display : block;
}

/* ========================================
   Search Bar
   ======================================== */

.bwa-garantie-reprise__search .input-group {
    box-shadow : 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.bwa-garantie-reprise__search .input-group-text {
    background-color : #f8f9fa;
    border-right     : 0;
}

.bwa-garantie-reprise__search .form-control {
    border-left  : 0;
    border-right : 0;
}

.bwa-garantie-reprise__search .form-control:focus {
    box-shadow   : none;
    border-color : #ced4da;
}

.bwa-garantie-reprise__search .btn {
    display     : inline-flex;
    align-items : center;
    gap         : 0.25rem;
}

.bwa-garantie-reprise__search .btn .material-icons {
    font-size : 1rem;
}

#search-results-count {
    display     : block;
    font-weight : 500;
}

/* ========================================
   Selection Summary
   ======================================== */

.bwa-garantie-reprise__summary {
    margin-top    : 2rem;
    margin-bottom : 1.5rem;
    border        : 2px solid #007bff;
}

.bwa-garantie-reprise__summary .card-header {
    background-color : #f8f9fa;
    border-bottom    : 1px solid #007bff;
}

.bwa-garantie-reprise__summary .card-header h5 {
    color       : #007bff;
    font-weight : 600;
}

.bwa-garantie-reprise__summary .card-header .material-icons {
    color        : #007bff;
    font-size    : 1.5rem;
    margin-right : 0.5rem;
}

.bwa-garantie-reprise__summary-list {
    max-height : 400px;
    overflow-y : auto;
}

.bwa-garantie-reprise__summary-list ul {
    list-style   : none;
    padding-left : 1rem;
}

.bwa-garantie-reprise__summary-list li {
    padding   : 0.25rem 0;
    font-size : 0.9rem;
}

.bwa-garantie-reprise__summary-list li::before {
    content     : "•";
    color       : #007bff;
    font-weight : bold;
    display     : inline-block;
    width       : 1rem;
    margin-left : -1rem;
}

.bwa-garantie-reprise__summary .badge {
    font-size : 0.75rem;
    padding   : 0.25rem 0.5rem;
    color     : var(--bs-secondary-color) !important;
}

#summary-count {
    color     : #007bff;
    font-size : 1.2rem;
}

.user-info .dropdown-menu #bwa-garantie-reprise-link {
    display : none;
}

.bwa-garantie-reprise__header .badge-secondary {
    background : grey;
}

/* ========================================
   Responsive - Mobile First
   ======================================== */

@media (max-width : 767px) {
    .bwa-garantie-reprise__header .btn {
        width           : 100%;
        justify-content : center;
    }

    .bwa-garantie-reprise__list table {
        font-size : 0.875rem;
    }

    .bwa-garantie-reprise__list .btn {
        font-size : 0.75rem;
        padding   : 0.375rem 0.75rem;
    }

    .bwa-garantie-reprise__order-section .card-header h5 {
        font-size : 1rem;
    }

    .bwa-garantie-reprise__product-row .img-thumbnail {
        max-width  : 50px;
        max-height : 50px;
    }

    .bwa-garantie-reprise__actions {
        flex-direction : column;
    }

    .bwa-garantie-reprise__actions .btn {
        width           : 100%;
        justify-content : center;
    }

    /* Info Content - Mobile */
    .bwa-garantie-reprise__info-intro,
    .bwa-garantie-reprise__info-block,
    .bwa-garantie-reprise__info-footer {
        padding : 1rem;
    }

    .bwa-garantie-reprise__info-intro h3 {
        font-size : 1.25rem;
    }

    .bwa-garantie-reprise__info-block h4 {
        font-size : 1.1rem;
    }

    .bwa-garantie-reprise__info-block h5 {
        font-size : 1rem;
    }

    .bwa-garantie-reprise__steps-list > li {
        padding-left : 2.5rem;
    }

    .bwa-garantie-reprise__steps-list > li::before {
        width       : 1.75rem;
        height      : 1.75rem;
        line-height : 1.75rem;
        font-size   : 0.75rem;
    }
}

@media (max-width : 575px) {
    /* Stack table for very small screens */
    .bwa-garantie-reprise__list table {
        display     : block;
        overflow-x  : auto;
        white-space : nowrap;
    }

    .bwa-garantie-reprise__info-box {
        padding : 1rem;
    }

    .bwa-garantie-reprise__order-section .card-body {
        padding : 0.75rem;
    }

    /* Info Content - Extra Small Screens */
    .bwa-garantie-reprise__info-intro,
    .bwa-garantie-reprise__info-block,
    .bwa-garantie-reprise__info-footer {
        padding : 0.75rem;
    }
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
    .bwa-garantie-reprise__header .btn,
    .bwa-garantie-reprise__actions {
        display : none;
    }

    .bwa-garantie-reprise__status-badge {
        border     : 1px solid #000;
        color      : #000 !important;
        background : #fff !important;
    }
}
