/* style.css */
body {
    font-family: sans-serif;
    text-align: center;
    background-color: #f9f9f9;
    padding: 0 20px 20px 20px;
    padding-top: 0 !important;
    margin-top: 0 !important;
}

#car-image {
    cursor: zoom-in;
    transition: transform 0.2s ease;
}

#car-image:hover {
    transform: scale(1.02);
}

#cars-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); 
    gap: 8px;
    padding: 5px;
    justify-content: center;
}

#cars-grid a, .car-item {
    display: block;
    background: white;
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
    text-decoration: none;
    color: #333;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #f0f0f0;
}

#cars-grid a:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.12);
}

#cars-grid h3 {
    margin: 5px 0;
    font-size: 1.25em;
    line-height: 1.1;
    min-height: 2.4em;
    max-height: 2.4em;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: bold;
    color: #333;
    overflow: hidden;
    word-break: break-word;
}

#cars-grid img { width: 100%; height: auto; }

#cars-grid p {
    font-size: 0.8em;
    margin: 5px 0;
}

/* iPad / Tablets */
@media (min-width: 600px) {
    #cars-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
        padding: 15px;
    }
    #cars-grid h3 { font-size: 1.25em; }
    #cars-grid p { font-size: 0.96em; }
}

/* Desktop */
@media (min-width: 1024px) {
    #cars-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 20px;
        margin: 0 auto;
    }
    #cars-grid h2 { font-size: 1.5em; min-height: 2.2em; }
    #cars-grid h3 { font-size: 1.25em; min-height: 2.2em; }
    #cars-grid p { font-size: 1em; }
}

h1 {
    font-size: clamp(1.5rem, 5vw, 2.5rem); 
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 20px 0;
    width: 100%;
}

#lightbox {
    display: none;
    position: fixed;
    z-index: 999;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
}

#lightbox img {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

/* --- STH Comparison Slider Styles --- */
.sth-comparison-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 8px; /* Matches frame */
    cursor: ew-resize;
    user-select: none;
}

.sth-comparison-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 80%;
    width: 4px;
    background-color: #2196F3;
    cursor: ew-resize;
    z-index: 10;
    transform: translateX(-50%);
}

.sth-comparison-handle::after {
    content: "⬌";
    color: white;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: auto; 
    bottom: 0px;
    left: 50%;
    transform: translate(-50%);
    width: 40px;
    height: 40px;
    background-color: #2196F3;
    border: 4px solid white;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}
    
.sth-comparison-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* Keeps full card visible */
    display: block;
}

.sth-comparison-overlay {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    overflow: hidden;
    clip-path: inset(0 0 0 80%);
}

/* style.css additions */
.global-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    padding: 10px 0;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    gap: 15px;
}

.logo {
    font-weight: bold;
    text-decoration: none;
    color: #2196F3;
    font-size: 1.2em;
    white-space: nowrap;
}

.search-container {
    flex-grow: 1;
}

#global-search {
    width: 100%;
    padding: 10px 15px;
    border-radius: 20px;
    border: 1px solid #ddd;
    font-size: 16px; /* 16px prevents iOS from auto-zooming on tap */
    outline: none;
}

#global-search:focus {
    border-color: #2196F3;
}

.header-spacer {
    height: 55px; /* Adjust based on your header height */
}

.search-container {
    position: relative; /* Anchor for the dropdown */
}

#search-dropdown {
    position: absolute;
    top: 100%;
    left: 16px;
    width: calc(100% - 32px);
    border-top: none;
    background: white;
    border: 1px solid #ddd;
    border-radius: 0 0 15px 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    z-index: 2000;
    max-height: 400px;
    overflow-y: auto;
    display: none; /* Hidden by default */
    text-align: left;
}

.search-suggestion {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9em;
    color: #333;
    transition: background 0.2s;
}

.search-suggestion:hover {
    background-color: #f1f8ff;
    color: #2196F3;
}

.suggestion-type {
    float: right;
    font-size: 0.75em;
    color: #999;
    font-weight: bold;
}