#catalog-page-header {
    display: flex;
    margin-block: 1.75rem;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;

    .logo-container {
        display: flex;
        align-items: center;
        gap: 1rem;
    }

    #back-button {
        outline: 0;
        border: 0;
        box-shadow: none;
        cursor: pointer;

        &:focus {
            outline: 0;
            border: 0;
            box-shadow: none;
        }
    }

    #category-search-input {
        border-radius: 0.4em;
        color: rgba(21, 34, 72, .75);
        flex: 1;
        font-size: clamp(1rem, 0.83785rem + 0.4324vw, 1.4rem);
        overflow: hidden;
        padding: .3em;
        text-indent: 2.4em;
        width: 100%;
        border: 2px solid #dee2e6;

        &:focus {
            -webkit-box-shadow: 0 0 4px 0 #fff;
            -moz-box-shadow: 0 0 4px 0 #fff;
            box-shadow: 0 0 4px 0 #fff;
            outline: none;
        }

        &::placeholder {
            color: #959595;
            white-space: nowrap;
        }
    }

    #import-all,
    #import-all-products {
        font-weight: 700;
        border: 1px solid #f48320;
        background-color: rgba(18, 35, 75, .039);
        color: #f48320;
        border-radius: .25rem;
        padding: .5rem;
        cursor: pointer;
        text-align: center;
        height: 2.5rem;
        width: 6rem;

        display: flex;
        align-items: center;
        justify-content: center;

        .text {
            width: max-content;
        }

        .import-spinner {
            width: 25px;
            aspect-ratio: 1;
        }
    }

    #update-categories {
        font-weight: 700;
        border: 1px solid #f48320;
        background-color: rgba(18, 35, 75, .039);
        color: #f48320;
        border-radius: .25rem;
        padding: .5rem;
        cursor: pointer;
        text-align: center;
        height: 2.5rem;
        width: 6rem;

        display: flex;
        align-items: center;
        justify-content: center;

        .text {
            width: max-content;
        }

        .update-categories-spinner {
            width: 25px;
            aspect-ratio: 1;
        }
    }
}


.items-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, 250px);
    gap: 1rem;
    justify-items: center;
}

.category-card {

    outline: 0;
    width: 100%;
    text-decoration: none;
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    justify-content: space-between;
    box-shadow: rgba(0, 0, 0, 0.075) 0px 0.125rem 0.25rem;
    background-color: rgb(255, 255, 255);
    padding: 1.5em;
    border-radius: 0.8rem;
    box-sizing: border-box;
    line-height: 2rem;

    &:hover {
        box-shadow: rgba(0, 0, 0, 0.04) 0px 8px 8px, rgba(0, 0, 0, 0.04) 0px 8px 10px;
        cursor: pointer;
    }

    &:focus {
        outline: 0;
        border: 0;
        box-shadow: none;
    }

    .title {

        color: #152248;
        font-size: clamp(1rem, 0.83785rem + 0.4324vw, 1.4rem);
        font-weight: 600;
        text-align: center;
        text-overflow: ellipsis;
        width: 100%;

        overflow: hidden;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    img {
        width: 88px;
        height: 48px;
        object-fit: contain;
    }
}

.sub-category-card {
    img {
        width: 100%;
        height: 96px;
    }
}

.product-card {

    box-sizing: border-box;

    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    margin: 0;
    padding: 1rem;
    gap: 1rem;
    width: 100%;

    text-decoration: none;

    box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .075);
    background-color: white;
    border-radius: 1rem;
    border: 1px solid #dee2e6;

    &:focus {
        box-shadow: none;
    }

    .product-details {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        align-items: center;
        gap: .5rem;
        width: 100%;
        margin-top: 1rem;

        .title {
            white-space: normal;
            text-align: center;
            font-weight: 700;
            font-size: 1.25rem;
            line-height: 1.5rem;
            height: calc(1.5rem * 3);
            color: rgba(33, 37, 41, 1);


            overflow: hidden;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 3;
        }

        .out-of-stock {
            color: rgba(220, 53, 69, 1);
            text-align: center;
            font-weight: 700;
        }

        .available {
            color: rgba(25, 135, 84, 1);
            text-align: center;
            font-weight: 700;
        }

        .price {
            color: #152248;
            text-align: left;
            font-weight: 700;
        }
    }

    .button-groups {
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        align-items: center;
        gap: .5rem;
        width: 100%;
        height: 100%;

        .btn {
            font-weight: 700;
            width: 100%;
            border: 1px solid #f48320;
            background-color: rgba(18, 35, 75, .039);
            color: #f48320;
            border-radius: .25rem;
            padding: .5rem;
            cursor: pointer;
            text-align: center;
            box-sizing: border-box;
            display: flex;
            justify-content: center;
        }

        .btn .text {
            width: max-content;
            text-align: center;
            width: 100%;
        }

        .btn .button-spinner-img {
            width: 20px;
            aspect-ratio: 1;
            text-align: center;
        }

        .attach-to-preexisting-product-btn,
        .detach-product-btn {
            border: 1px solid #152248;
            background-color: rgba(18, 35, 75, .039);
            color: #152248;
        }
    }
}

#attachToPreExistingProductModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 99;

    .modal-container {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background-color: white;
        border-radius: 5px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        z-index: 100;
        width: 30vw;

        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 1rem;
            border-bottom: 1px solid #dee2e6;

            .modal-title {
                padding: 1rem;
                margin: 0;
                font-size: 1.25rem;
                font-weight: 700;
            }

            .modal-close {
                cursor: pointer;
                background-color: #f48320;
                color: white;
                box-sizing: content-box;
                width: 1em;
                height: 1em;
                padding: .25em .25em;
                border: 0;
                border-radius: .25rem;
                opacity: .5;
                margin: auto;
                margin-right: .5rem;
                background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e") center / 1em auto no-repeat;
            }

            .modal-close:hover {
                opacity: 1;
            }
        }

        .modal-body {
            padding: 1rem;

            .attach-with-pre-existing-product-select {
                width: 100%;

                option {
                    background-color: white;
                }

                option:hover {
                    background-color: #f48320;
                }

                option:checked {
                    background-color: #f48320;
                }
            }

            .select2-container {
                width: 100% !important;
            }

            .select2-container .select2-results__option--highlighted {
                background-color: #f48320 !important;
            }
        }

        .modal-footer {
            display: flex;
            justify-content: flex-end;
            align-items: center;
            padding: 1rem;
            gap: 1rem;

            button {
                padding: .5rem 1rem;
                border-radius: 5px;
                border: none;
                cursor: pointer;

                .text {
                    width: max-content;
                    text-align: center;
                    width: 100%;
                }

                .button-spinner-img {
                    width: 20px;
                    aspect-ratio: 1;
                    text-align: center;
                }
            }

            .saving-button,
            .attach-button {
                color: white;
                background-color: #666666;
                pointer-events: none;
            }

            .saving-button {
                cursor: auto;
                pointer-events: none;
                display: none;
            }

            button:hover {
                opacity: .75;
            }
        }
    }
}

.hidden {
    display: none;
}


#progressModal.modal-overlay,
#confirmModal.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;

    &.active {
        opacity: 1;
        visibility: visible;

        .modal,
        .progress-modal {
            transform: scale(1);
        }
    }

    .modal {
        background: white;
        border-radius: 20px;
        padding: 30px;
        max-width: 400px;
        width: 90%;
        text-align: center;
        transform: scale(0.7);
        transition: all 0.3s ease;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);

        h2 {
            color: #333;
            margin-bottom: 15px;
            font-size: 1.5rem;
        }

        p {
            color: #666;
            margin-bottom: 25px;
            line-height: 1.5;
        }
    }

    .modal-buttons {
        display: flex;
        gap: 15px;
        justify-content: center;
    }

    .btn {
        padding: 12px 24px;
        border: none;
        border-radius: 25px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        min-width: 100px;

        &.btn-cancel {
            background: #f5f5f5;
            color: #666;

            &:hover {
                background: #eee;
            }
        }

        &.btn-confirm {
            background: #f48320;
            color: white;
            box-shadow: 0 4px 15px rgba(244, 131, 32, 0.4);

            &:hover {
                transform: translateY(-1px);
                box-shadow: 0 6px 20px rgba(244, 131, 32, 0.6);
                background: #e6751c;
            }
        }
    }

    .progress-modal {
        background: white;
        border-radius: 20px;
        padding: 40px;
        max-width: 500px;
        width: 90%;
        text-align: center;
        transform: scale(0.7);
        transition: all 0.3s ease;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);

        &.active {
            transform: scale(1);
        }
    }

    .progress-header {
        h2 {
            color: #333;
            margin-bottom: 10px;
            font-size: 1.5rem;
        }
    }

    .progress-status {
        color: #666;
        margin-bottom: 30px;
        font-size: 14px;
    }

    .progress-container {
        background: #f0f0f0;
        height: 8px;
        border-radius: 10px;
        overflow: hidden;
        margin-bottom: 20px;
        position: relative;
    }

    .progress-bar {
        height: 100%;
        background: #f48320;
        border-radius: 10px;
        width: 0%;
        transition: width 0.5s ease;
        position: relative;

        &::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
            animation: shimmer 2s infinite;
        }
    }

    .progress-text {
        font-size: 18px;
        font-weight: 600;
        color: #333;
        margin-bottom: 15px;
    }

    .current-category {
        color: #f48320;
        font-size: 14px;
        margin-bottom: 20px;
        min-height: 20px;
    }

    .progress-details {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 20px;
        margin-top: 20px;
    }

    .detail-item {
        text-align: center;

        .detail-number {
            font-size: 24px;
            font-weight: bold;
            color: #f48320;
            display: block;
        }

        .detail-label {
            font-size: 12px;
            color: #666;
            text-transform: uppercase;
            letter-spacing: 1px;
        }
    }

    .success-icon {
        width: 60px;
        height: 60px;
        margin: 0 auto 20px;
        border-radius: 50%;
        background: #4CAF50;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 24px;
    }

    .error-icon {
        width: 60px;
        height: 60px;
        margin: 0 auto 20px;
        border-radius: 50%;
        background: #f44336;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 24px;
    }

    .close-btn {
        background: #f48320;
        color: white;
        border: none;
        padding: 12px 30px;
        border-radius: 25px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        margin-top: 20px;
        transition: all 0.3s ease;

        &:hover {
            background: #e6751c;
            transform: translateY(-1px);
        }
    }

    .hidden {
        display: none !important;
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}