﻿/* Reset default browser margin and padding */
html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    overflow: hidden;
}

/* Container that holds the entire content */
.container {
    display: flex;
    flex-direction: column;
    height: 100%; /* Full height of the viewport */
    width: 100%; /* Full width of the viewport */
    box-sizing: border-box; /* Include padding in the element's total width and height */
}

/* Main content area */
.main-content {
    display: flex;
    flex: 1;
    border: 2px solid#c8c8c8;
    overflow: hidden;
    position: relative;
}

.toggle-button {
    position: absolute;
    top: 20px;
    left: 415px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 10px;
    cursor: pointer;
    z-index: 1000; /* Make sure it stays on top */
}

.sidebar.closed,
.sidebar.collapsed {
    transform: translateX(-100%); /* Move out of view */
    display: none;
    width: 0;
}

/* Sidebar styles */
.sidebar {
    width: 410px;
    padding: 0;
    background-color: #f4f4f4;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    transition: transform 0.3s ease, width 0.3s ease; /* Animation */
    transform: translateX(0); /* Default open */
    z-index: 2; /* Higher z-index to overlay on the map */
}

.top-container {
    margin-bottom: 10px;
    background-color: #1e1e1e;
}
/* Search container styles */
.search-container {
    position: relative;
    display: flex;
    margin-bottom: 10px;
    margin-top: 30px;
    margin-left: 12px;
    margin-right: 12px;
}

#search {
    width: 90%;
    margin-left: 17px;
    padding: 10px;
    padding-left: 40px; /* Add padding to the right to make space for the icon */
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 16px;
    box-sizing: border-box; /* Ensures padding doesn't cause overflow */
}

#searchIcon {
    position: absolute;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
    color: #676767;
    cursor: pointer;
}

/* Recommendations container styles */
.recommendations-container {
    display: none;
    position: absolute;
    top: 100%; /* Position below the search input */
    background-color: #fff;
    border-radius: 5px;
    border: 1px solid black;
    max-height: 200px;
    overflow-y: auto;
    width: 90%; /* Ensure it matches the width of the search input */
    box-sizing: border-box;
    margin-left: 17px;
}

/* Recommendation item styles */
.recommendation-item {
    padding: 8px;
    cursor: pointer;
}

    .recommendation-item:hover {
        background-color: #f0f0f0;
    }

/* Tabs container styles */
.tabs-container {
    margin-bottom: 15px;
}

/* Tabs and Showing Results container styles */
.tabs {
    display: flex;
    gap: 40px;
    margin-bottom: 10px;
    justify-content: center;
    width: 100%;
    font-size: 16px;
}

.tab-link {
    text-decoration: none;
    color: white; /* Default tab color */
    padding: 10px 15px;
    border-radius: 4px;
    font-family: Figtree;
    font-weight: 400;
    display: inline-block;
}

    .tab-link.active {
        background-color: #030303; /* Background color for the active tab */
        color: #fff; /* Text color for the active tab */
        border-color: #030303; /* Border color for the active tab (to create box effect) */
    }

    .tab-link:hover {
        background-color: #030303;
    }

/* Container for sorting and showing results */
.sorting-results-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.showing-results {
    font-size: 14px;
    color: black;
    font-weight: 600;
    margin-left: 25px;
}

/* Styling for the sort dropdown */
.sort select {
    padding: 1px;
    font-size: 14px;
    border-radius: 5px;
    border: 1px solid #ccc;
    background-color: #fff;
    cursor: pointer;
    margin-right: 40px;
}

    /* Add custom arrow to the dropdown */
    .sort select::-ms-expand {
        display: none; /* Remove default arrow in IE */
    }

.sort {
    display: flex;
    align-items: center;
}

    .sort::before {
        margin-right: 10px; /* Space between label and dropdown */
        font-size: 14px;
        color: #555;
    }

.instructions {
    margin-left: 20px;
}

/* Dealer list styles */
#dealer-list {
    padding: 5px;
    overflow-y: auto; /* Enable scroll the dealer list */
    max-height: calc(85vh - 20px); /* Adjusted to fit within the sidebar */
    box-sizing: border-box; /* Ensures padding and borders are included in the width */
}

/* Dealer item styles (box-like appearance) */
.dealer-item {
    display: flex;
    align-items: flex-start;
    width: 350px;
    padding: 10px;
    margin-left: 5px;
    cursor: pointer;
    border: 1px solid #ddd; /* Light border around each dealer item */
    border-radius: 5px; /* Rounded corners for the box */
    background-color: #fff; /* White background color for the box */
    margin-bottom: 10px; /* Space between boxes */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow for 3D effect */
    transition: box-shadow 0.3s ease, background-color 0.3s ease; /* Smooth transition for hover effect */
}

    /* Dealer item hover effect */
    .dealer-item:hover {
        background-color: #f9f9f9; /* Light gray background on hover */
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* More pronounced shadow on hover */
    }

/* Dealer marker circle style */
.dealer-marker {
    width: 20px;
    height: 20px;
    background-color: #52b82f; /* Blue background color */
    border-radius: 50%; /* Circle shape */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff; /* White text color */
    font-size: 13px;
    font-weight: 400;
    margin-right: 10px; /* Space between marker and details */
    flex-shrink: 0; /* Prevent shrinking */
}

/* Dealer details styles */
.dealer-details {
    display: flex;
    flex-direction: column;
    flex: 1; /* Allow details to take the remaining space */
}

    .dealer-details h3 {
        color: #1e1e1e;
        font-family: Inter, sans-serif;
        font-size: clamp( 15px, calc(14px + (22 - 14) * (100vw - 768px) / (1920 - 768)), 20px ); /* Make the font size change dynamically*/
        font-style: normal;
        font-weight: 600;
        line-height: normal;
        margin: 0; /* Remove default margin */
    }

.dealer-label {
    color: #676767;
    font-family: Inter, sans-serif;
    font-size: clamp( 10px, calc(14px + (22 - 14) * (100vw - 768px) / (1920 - 768)), 13px ); /* Make the font size change dynamically*/
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    margin: 3px 0; /* Margin between paragraphs */
}

.dealer-tel {
    color: #676767;
    font-family: Inter, sans-serif;
    font-size: clamp( 10px, calc(14px + (22 - 14) * (100vw - 768px) / (1920 - 768)), 13px ); /* Make the font size change dynamically*/
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    margin: 3px 0; /* Margin between paragraphs */
}

.dealer-distance {
    color: #676767;
    font-family: Inter, sans-serif;
    font-size: clamp( 10px, calc(14px + (22 - 14) * (100vw - 768px) / (1920 - 768)), 13px ); /* Make the font size change dynamically*/
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    margin: 3px 0; /* Margin between paragraphs */
}

.dealer-address {
    color: #676767;
    font-family: Inter, sans-serif;
    font-size: clamp( 10px, calc(14px + (22 - 14) * (100vw - 768px) / (1920 - 768)), 14px ); /* Make the font size change dynamically*/
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    margin: 5px 0; /* Margin between paragraphs */
}

/* Phone icon styles */
.phone-icon {
    width: 14px; /* Adjust size as needed */
    height: 14px; /* Adjust size as needed */
    vertical-align: middle; /* Align icon with text */
    margin-right: 5px; /* Space between icon and text */
    display: inline-block; /* Ensure icon is inline with text */
}

.location-icon {
    width: 14px;
    height: 14px;
    vertical-align: middle;
    margin-right: 5px;
    display: inline-block;
}

/* Map styles */
#lokamap {
    flex: 1;
    height: 100%; /* Adjusted to take full available height */
    z-index: 1; /* Lower z-index to place behind the sidebar */
    position: absolute; /* Make sure it occupies the full area */
    top: 0; /* Align to the top */
    left: 0; /* Align to the left */
    right: 0; /* Align to the right */
    bottom: 0; /* Align to the bottom */
}

/* Adjust map position when sidebar is open */
.map-shifted {
    transform: translateX(200px); /* Move the map right by the sidebar width */
    transition: transform 0.3s ease; /* Smooth transition */
}

/*Media query for screen smaller than 720px*/
@media screen and (max-width: 720px) {
    .dealer-item {
        display: flex;
        align-items: flex-start;
        width: auto;
        height: auto;
        padding: auto;
        margin-right: auto;
        margin-left: auto;
        cursor: pointer;
        border: 1px solid #ddd; /* Light border around each dealer item */
        border-radius: 5px; /* Rounded corners for the box */
        background-color: #fff; /* White background color for the box */
        margin-bottom: 10px; /* Space between boxes */
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow for 3D effect */
        transition: box-shadow 0.3s ease, background-color 0.3s ease; /* Smooth transition for hover effect */
    }

    #dealer-list {
        padding: 21px;
        overflow-y: auto; /* Enable scroll the dealer list */
        max-height: calc(85vh - 20px); /* Adjusted to fit within the sidebar */
        box-sizing: border-box; /* Ensures padding and borders are included in the width */
    }

    #lokatoo_map {
        flex: 100%;
        flex-shrink: 0;
        flex-grow: 0;
        height: auto;
        display: block;
    }

    /* Adjust map position when sidebar is open */
    .map-shifted {
        transform: translateX(1px); /* Move the map right by the sidebar width */
        transition: transform 0.3s ease; /* Smooth transition */
    }

    .sidebar {
        flex: 100%;
        flex-shrink: 0;
        flex-grow: 0;
    }
}
