#used_machines {
    position: absolute;
    top: 8vh;
    left: 5vh;
    width: calc(100% - 10vh);
    height: 89%;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(calc(20% - 15px), 1fr);
    grid-template-rows: 1fr;
    gap: 20px;
    padding: 10px;
    box-sizing: border-box;
    overflow-x: auto;
    overflow-y: hidden;
    align-items: stretch;
}

#used_machines > * {
    height: 100%;
}

#used_machines::-webkit-scrollbar {
    height: 4vh;
}

#used_machines::-webkit-scrollbar-track {
    background: var(--color_05);
    border-radius: 2vh;
    margin: 0.5vh;
}

#used_machines::-webkit-scrollbar-thumb {
    background: var(--color_03);
    border-radius: 2vh;
    border: 0.5vh solid var(--color_05);
}

#used_machines::-webkit-scrollbar-thumb:hover {
    background: var(--color_04);
}

#used_machines {
    scrollbar-width: auto;
    scrollbar-color: var(--color_03) var(--color_05);
}

#used_machines_nav_left,
#used_machines_nav_right {
    position: absolute;
    top: 16vh;
    height: 81%;
    width: 5vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 6;
    cursor: pointer;
}

#used_machines_nav_left {
    left: 0;
}

#used_machines_nav_right {
    right: 0;
}

#used_machines_nav_arrow_left,
#used_machines_nav_arrow_right {
    color: #fff;
    font-size: 5vh;
    font-weight: 100;
    opacity: 0.6;
    transition: opacity 0.2s ease;
    user-select: none;
}

#used_machines_nav_left:hover #used_machines_nav_arrow_left,
#used_machines_nav_right:hover #used_machines_nav_arrow_right {
    opacity: 1;
}

.used_machines_frame {
    width: 100%;
    height: 100%;
    position: relative;
    top: 0%;
    border: 1px solid #000000;
    border-radius: 1vh;
    overflow: hidden;
    background-color: rgb(45,45,45);
}

.used_machines_frame.collapsed {
    height: 10vh !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: height 0.3s ease;
    margin-top: auto;
    margin-bottom: auto;
    align-self: center;
}

.used_machines_frame.collapsed .used_machines_model {
    position: relative;
    top: 0;
    height: 6vh;
    font-size: 2.7vh;
    line-height: 6vh;
}

.used_machines_frame.collapsed .used_machines_vin {
    position: relative;
    top: 0;
    height: 4.5vh;
    font-size: 2.0vh;
    line-height: 4.5vh;
}

.used_machines_model {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6%;
    text-align: center;
    font-size: 2.7vh;
    line-height: 4.7vh;
    color: var(--header_font);
    background-color: var(--header);
    border-bottom: 1px solid var(--header_border);
    z-index: 3;
}

.used_machines_vin {
    position: absolute;
    top: 6%;
    left: 0;
    width: 100%;
    height: 4.5%;
    text-align: center;
    font-size: 2.0vh;
    line-height: 3.6vh;
    background-color: var(--black_trans);
    border-bottom: 1px solid var(--black_trans_border);    
    z-index: 2;
}

.used_machines_image {
    position: absolute;
    top: 6%;
    left: 0;
    width: 100%; 
    height: calc(79% - 75px);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    cursor: pointer;
}

.used_machines_image_hover_overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.used_machines_frame:not(.admin-template):not(.admin-mode-active) .used_machines_image:hover .used_machines_image_hover_overlay {
    background: rgba(0, 0, 0, 0.4);
}

.used_machines_see_more_btn {
    opacity: 0;
    background: var(--black_trans);
    color: var(--font);
    border: none;
    border-radius: 0.5vh;
    padding: 1vh 2vh;
    font-family: inherit;
    font-size: 1.8vh;
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.2s ease;
    z-index: 2;
}

.used_machines_frame:not(.admin-template):not(.admin-mode-active) .used_machines_image:hover .used_machines_see_more_btn {
    opacity: 1;
}

.used_machines_see_more_btn:hover {
    transform: scale(1.05);
}

.used_machines_discount {
    position: absolute;
    bottom: 9%;
    right: 0;
    width: 24%;
    height: 5%;
    text-align: center;
    font-size: 1.0vw;
    line-height: 1.7vw;
    background-color: var(--red_trans);
    border-left: 1px solid var(--red_trans_border);
    border-top: 1px solid var(--red_trans_border);
    z-index: 2;
}

.used_machines_price {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 50%;
    height: 9%;
    text-align: center;
    font-size: 1.7vw;
    line-height: 2.9vw;
    background-color: var(--black_trans);
    border-left: 1px solid var(--black_trans_border);
    border-top: 1px solid var(--black_trans_border);
    z-index: 2;
}

.used_machines_warranty {
    position: absolute;
    bottom: calc(15% + 9px);
    left: 0;
    width: 100%;
    height: 55px;
    text-align: center;
    font-size: 1.5vh;
    color: var(--font);
    background-color: var(--body);
    border-top: 1px solid var(--body_border);
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    gap: 1vh;
    padding: 0 1vh;
}

.used_machines_warranty svg {
    width: auto;
    height: 100%;
    overflow: visible;
    flex-shrink: 0;
}

.used_machines_warranty_item {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    height: 100%;
    flex: 1;
    gap: 0.5vh;
}

.used_machines_warranty_item svg {
    height: 70%;
    width: auto;
    flex-shrink: 0;
}

.used_machines_warranty_item img {
    height: 70%;
    width: auto;
    flex-shrink: 0;
}

.used_machines_warranty_calc {
    font-size: 1.1vh;
    color: var(--font);
    line-height: 1.2;
    white-space: nowrap;
}

.used_machines_remark {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 15%;
    text-align: center;
    font-size: 1.5vh;
    line-height: 2.2vh;
    padding-top: 7px;
    color: var(--font);
    background-color: var(--body_border);
    border-top: 1px solid var(--body_border_light);
    z-index: 2;
}

#used_machines_containter_top {
    position: absolute;
    left: 0;
    top: 3vh;
    height: 3vh;
    width: 100%;
    z-index: 10;
}

#used_machines_category {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    height: 100%;
    width: auto;
    display: flex;
    gap: 0.4vh;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.used_machines_category_button {
    top: 1px;
    text-transform: uppercase;
    height: calc(100%- 2px);
    font-size: 1.7vh;
    width: auto;
    box-sizing: border-box;
    background: var(--body);
    border: 1px solid var(--body_border) !important;
    color: var(--font);
    padding: 0.8vh 1.5vh;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    outline: none;
    transition: background-color 0.2s, color 0.2s, border 0.2s;
    pointer-events: auto !important;
    position: relative;
    margin: 0.5vh;
    border-radius: 0.3vh;
}

.used_machines_category_button:hover {
    background-color: var(--body_border) !important;
    border: 1px solid var(--body_border_light) !important;
    color: var(--font) !important;
}

.used_machines_category_button.active {
    background-color: var(--header) !important;
    border: 1px solid var(--header_border) !important;
    color: var(--header_font) !important;
}

.used_machines_category_button.active:hover {
    background-color: var(--button_hover_bg) !important;
    border: 1px solid var(--button_hover_border) !important;
    color: var(--header_font) !important;
}

#used_machines_list_controls {
    position: absolute;
    top: 0;
    right: 0;
    width: auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    z-index: 5;
    padding: 0 2%;
    box-sizing: border-box;
}

#used_machines_list_controls_right {
    display: flex;
    align-items: center;
    gap: 1vh;
}

#used_machines_sort_dropdown {
    background: var(--body);
    border: 1px solid var(--body_border);
    border-radius: 0.3vh;
    color: var(--font);
    font-family: inherit;
    font-size: 1.6vh;
    padding: 0.8vh 1.5vh;
    cursor: pointer;
    outline: none;
}

#used_machines_sort_dropdown:hover {
    background-color: var(--body_border) !important;
    border: 1px solid var(--body_border_light) !important;
    color: var(--font) !important;
}

#used_machines_sort_dropdown option {
    background: var(--body);
    color: var(--font);
}

#used_machines_sort_order_btn {
    background: var(--body);
    border: 1px solid var(--body_border);
    border-radius: 0.3vh;
    color: var(--font);
    font-family: inherit;
    font-size: 2vh;
    padding: 0.5vh 1.2vh;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#used_machines_sort_order_btn:hover {
    background: var(--body_border);
}

.used_machines_engine_select {
    background: var(--body_in);
    border: 1px solid var(--body_border);
    border-radius: 0.3vh;
    color: var(--font);
    font-family: inherit;
    font-size: 1.1vh;
    padding: 0.2vh 0.3vh;
    cursor: pointer;
    outline: none;
}

.used_machines_engine_select option {
    background: var(--body);
    color: var(--font);
}

.used_machines_warranty_item input[type="date"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.used_machines_warranty_item input[type="date"]::-webkit-calendar-picker-indicator {
    display: none;
}

.used_machines_warranty_item input[type="date"]::-webkit-inner-spin-button,
.used_machines_warranty_item input[type="date"]::-webkit-clear-button {
    display: none;
}

.used_machines_frame.inactive {
    filter: grayscale(75%) brightness(0.7);
    opacity: 0.6;
    pointer-events: none;
}

.used_machines_frame.inactive .used_machines_model {
    background-color: var(--color_03) !important;
    border-bottom-color: var(--body_border) !important;
}

.used_machines_frame.admin-mode-active .used_machines_image {
    cursor: default;
}

.used_machines_admin_overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.2vh;
    z-index: 5;
}



.used_machines_admin_btn_edit {
    background: transparent;
    color: var(--font_dark1);
    border: 0.2vh solid var(--font_dark1);
    border-radius: 0.4vh;
    padding: 0.8vh 2vh;
    font-family: inherit;
    font-size: 2.5vh;
    font-weight: bold;
    min-width: 40%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.used_machines_admin_btn_edit:hover {
    background: transparent;
    color: var(--font);
    border: 0.2vh solid var(--font);
}




.used_machines_admin_btn_sold {
    background: transparent;
    color: var(--green_light);
    border: 0.2vh solid var(--green_light);
    border-radius: 0.4vh;
    padding: 0.8vh 2vh;
    font-family: inherit;
    font-size: 2.5vh;
    font-weight: bold;
    min-width: 40%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.used_machines_admin_btn_sold :hover {
    background: transparent;
    color: var(--green_light_border);
    border: 0.2vh solid var(--green_light_border);
}



.used_machines_admin_btn_delete {
    background: transparent;
    color: var(--red_light_border);
    border: 0.2vh solid var(--red_light_border);
    border-radius: 0.4vh;
    padding: 0.8vh 2vh;
    font-family: inherit;
    font-size: 2.5vh;
    font-weight: bold;
    min-width: 40%;
    cursor: pointer;
    transition: all 0.2s ease;
}


.used_machines_admin_btn_delete:hover {
    background: transparent;
    color: var(--red_light);
    border: 0.2vh solid var(--red_light);
}



.used_machines_admin_btn_delete2 {
    background: var(--red);
    color: var(--font);
    border: none;
    border-radius: 0.4vh;
    padding: 0.8vh 2vh;
    font-family: inherit;
    font-size: 2.5vh;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.used_machines_admin_btn_delete2:hover {
    background: #ff4d3a;
    transform: scale(1.05);
}

#delete_confirm_overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

#delete_confirm_window {
    background: var(--body);
    border: 1px solid var(--body_border);
    border-radius: 1vh;
    padding: 3vh;
    min-width: 30vw;
    text-align: center;
}

#delete_confirm_title {
    font-size: 2.2vh;
    color: var(--font);
    margin-bottom: 2vh;
}

#delete_confirm_subtitle {
    font-size: 1.6vh;
    color: var(--font_dark2);
    margin-bottom: 2vh;
}

#delete_confirm_input {
    background: var(--body_in);
    border: 1px solid var(--body_border);
    border-radius: 0.5vh;
    color: var(--font);
    font-family: inherit;
    font-size: 1.8vh;
    padding: 1vh 2vh;
    width: 60%;
    text-align: center;
    outline: none;
    margin-bottom: 2vh;
}

#delete_confirm_input:focus {
    border-color: var(--header);
}

#delete_confirm_buttons {
    display: flex;
    gap: 2vh;
    justify-content: center;
}

#delete_confirm_cancel {
    background: var(--header);
    color: var(--header_font);
    border: none;
    border-radius: 0.5vh;
    padding: 1vh 3vh;
    font-family: inherit;
    font-size: 1.8vh;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

#delete_confirm_cancel:hover {
    background: var(--button_hover_bg);
}

#delete_confirm_delete {
    background: var(--red);
    color: var(--font);
    border: none;
    border-radius: 0.5vh;
    padding: 1vh 3vh;
    font-family: inherit;
    font-size: 1.8vh;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.5;
    pointer-events: none;
}

#delete_confirm_delete.enabled {
    opacity: 1;
    pointer-events: auto;
}

#delete_confirm_delete.enabled:hover {
    background: #ff4d3a;
}

.used_machines_engine_icon {
    height: 70%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.used_machines_engine_icon svg {
    height: 100%;
    width: auto;
}

.used_machines_engine_icon img {
    height: 100%;
    width: auto;
}

#list_template_action_buttons {
    position: absolute;
    top: 3vh;
    left: 11.5vh;
    display: none;
    gap: 1.7vh;
    z-index: 5;
}

#list_template_action_buttons.visible {
    display: flex;
}

#list_template_btn_save {
    padding: 0.85vh 1.7vh;
    width: 11.9vh;
    background: var(--green);
    color: var(--font);
    border: none;
    border-radius: 0.68vh;
    font-size: 1.87vh;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

#list_template_btn_save:hover {
    background: #6ee04f;
    transform: translateY(-1px);
}

#list_template_btn_cancel {
    padding: 0.85vh 1.7vh;
    width: 11.9vh;
    background: var(--red);
    color: var(--font);
    border: none;
    border-radius: 0.68vh;
    font-size: 1.87vh;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

#list_template_btn_cancel:hover {
    background: #ff4d3a;
    transform: translateY(-1px);
}

.invalid-date {
    animation: blinkRedDate 0.6s ease-in-out 3;
}

@keyframes blinkRedDate {
    0%, 100% { 
        background-color: rgba(206, 59, 40, 0.3);
    }
    50% { 
        background-color: transparent;
    }
}