/* Related Products List Style */
.related-product-card {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    display: block;
    /* Ensure it behaves like a block */
    text-decoration: none;
    /* Remove underline from links if any */
}

.related-product-card:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.06);
    border-color: #e0e0e0;
    transform: translateY(-2px);
}

.related-prod-img-box {
    width: 70px;
    height: 70px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    padding: 5px;
}

.related-prod-img-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.related-prod-info {
    flex-grow: 1;
    min-width: 0;
    /* Enable truncation in flex item */
    padding-left: 20px;
}

.related-prod-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a2745;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.related-prod-desc {
    font-size: 13px;
    color: #777;
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.related-brand {
    color: #999;
    font-weight: 600;
    font-size: 14px;
    margin-right: 25px;
    white-space: nowrap;
}

.qty-control-group {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 2px;
    margin-right: 15px;
}

.qty-control-group .input-group-text {
    background: transparent;
    border: none;
    color: #888;
    font-size: 13px;
    padding: 0 8px;
    font-weight: 500;
}

.qty-control-group input {
    border: none;
    width: 40px;
    text-align: center;
    font-weight: 600;
    color: #333;
    outline: none;
    border-left: 1px solid #eee;
    padding: 6px 0;
    font-size: 14px;
}

.qty-control-group .uom-select-wrapper {
    border-left: 1px solid #eee;
    position: relative;
    padding: 0 5px;
}

.qty-control-group select {
    border: none;
    background: transparent;
    font-size: 13px;
    color: #333;
    outline: none;
    padding: 6px 15px 6px 5px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    font-weight: 500;
}

.qty-control-group .uom-select-wrapper::after {
    content: '\f078';
    /* FontAwesome chevron-down */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: #888;
    pointer-events: none;
}

.btn-wishlist-rel {
    border: 1px solid #e0e0e0;
    background: #fff;
    color: #999;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    margin-right: 15px;
    transition: all 0.2s;
    cursor: pointer;
}

.btn-wishlist-rel:hover {
    border-color: #e53824;
    color: #e53824;
    background: #fff0ef;
}

.btn-quote-rel {
    border: 1px solid #fab005;
    color: #fab005;
    background: #fff;
    font-weight: 600;
    font-size: 14px;
    padding: 8px 20px;
    border-radius: 4px;
    transition: all 0.2s;
    min-width: 130px;
    text-align: center;
    cursor: pointer;
}

.btn-quote-rel:hover {
    background: #fab005;
    color: #fff;
}

@media (max-width: 991px) {
    .related-product-card .d-flex.flex-wrap {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .related-prod-info {
        padding-left: 0;
        margin-top: 10px;
        margin-bottom: 15px;
    }

    .related-prod-right-actions {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 15px;
    }

    .related-brand {
        margin-right: 0;
        width: 100%;
        margin-bottom: 10px;
    }
}

@media (max-width: 767px) {
    .related-product-card {
        padding: 12px;
    }

    .related-actions-group {
        width: 100%;
        margin-top: 15px;
        flex-direction: column;
        align-items: flex-start !important;
        gap: 12px !important;
    }

    .rel-brand-label {
        text-align: left;
        margin-right: 0;
        margin-bottom: 5px;
        width: 100%;
        display: block;
    }

    .rel-qty-uom-mobile,
    .rel-actions-mobile {
        width: 100%;
        display: flex;
        gap: 8px !important;
    }

    .rel-qty-uom-mobile .rel-input-wrapper,
    .rel-qty-uom-mobile .uom-select-wrapper,
    .rel-actions-mobile .btn-quote-outline {
        flex: 1;
    }

    .btn-wishlist-rel {
        margin-right: 0 !important;
        flex-shrink: 0;
    }

    .btn-quote-outline {
        padding: 0 10px !important;
        min-width: 0;
    }
}

/* Redesigned Related Actions */
.rel-input-wrapper {
    position: relative;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: #fff;
    display: flex;
    align-items: center;
    height: 38px;
    width: 80px;
}

.rel-input-wrapper input {
    border: none;
    background: transparent;
    width: 100%;
    height: 100%;
    padding: 0 5px 0 10px;
    outline: none;
    font-size: 14px;
    color: #495057;
}

.uom-select-wrapper {
    position: relative;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: #fff;
    height: 38px;
    min-width: 90px;
}

.uom-select-wrapper select {
    border: none;
    background: transparent;
    width: 100%;
    height: 100%;
    padding: 0 25px 0 10px;
    outline: none;
    font-size: 14px;
    color: #495057;
    appearance: none;
    cursor: pointer;
}

.uom-select-wrapper::after {
    content: '\f107';
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #adb5bd;
    pointer-events: none;
}

.btn-wishlist-rel {
    width: 38px;
    height: 38px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: #fff;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    cursor: pointer;
}

.btn-wishlist-rel:hover {
    background: #f8f9fa;
    color: #e53824;
    border-color: #dee2e6;
}

.btn-quote-outline {
    height: 38px;
    padding: 0 20px;
    border: 1px solid #fec107;
    border-radius: 4px;
    background: #fff;
    color: #fec107;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-quote-outline:hover {
    background: #fec107;
    color: #fff;
}

.rel-brand-label {
    min-width: 80px;
    text-align: right;
    font-weight: 600;
    color: #6c757d;
    font-size: 14px;
    margin-right: 15px;
}