/* Engine listing page styles — carbon-copied verbatim from legacy /old engine.php embedded <style> (2026-06-19).
   Card + carousel slide/backdrop rules are shared via card.css + v3-carousel.css. */
/* ─── V3 Variables ─── */
:root {
    --v3-white:      #FFFFFF;
    --v3-snow:       #F8FAFC;
    --v3-snow2:      #EEF4F8;
    --v3-steel:      #5A8AA7;
    --v3-steel-lt:   #7AAEC8;
    --v3-steel-dk:   #3D6B85;
    --v3-royal:      #2843A7;
    --v3-royal-lt:   #3A58C4;
    --v3-ink:        #0E1A2B;
    --v3-slate-mid:  #3D5166;
    --v3-muted:      #7A96AA;
    --v3-muted2:     #B0C4D0;
    --v3-border:     rgba(90,138,167,0.18);
    --v3-border2:    rgba(90,138,167,0.10);
    --v3-card-shadow: 0 4px 32px rgba(40,67,167,0.08), 0 1px 4px rgba(14,26,43,0.06);
    --v3-card-shadow-hover: 0 16px 48px rgba(40,67,167,0.16), 0 4px 12px rgba(14,26,43,0.1);
    --v3-ff-display: 'Libre Baskerville', Georgia, serif;
    --v3-ff-body:    'Plus Jakarta Sans', sans-serif;
    --v3-ease-lux:   cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

* {
  margin: 0;
  font-family: var(--v3-ff-body) !important;
}

.engine-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    width: 95%;
    max-width: 1430px;
    margin: auto;
    padding: 20px 0;
}

.filter-item {
    margin-bottom: 15px;
}

/* Right Section */
.right-section {
    flex: 1;
    margin-left: 20px;
}

.listing-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    width: 100%;
}

body {
    background: var(--v3-snow);
}

/* ─── V3 Listing Card Styles ─── */
.v3-listing-card {
    background: var(--v3-white);
    border-radius: 12px;
    border: 1px solid var(--v3-border2);
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--v3-card-shadow);
    transition: transform 0.35s var(--v3-ease-lux), box-shadow 0.35s var(--v3-ease-lux);
    position: relative;
}
.v3-listing-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--v3-card-shadow-hover);
}
.v3-listing-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--v3-royal), var(--v3-steel));
    opacity: 0; transition: opacity 0.3s;
    z-index: 4;
}
.v3-listing-card:hover::before { opacity: 1; }

.v3-card-badge {
    position: absolute; top: 16px; left: 16px; z-index: 4;
    font-family: var(--v3-ff-body) !important;
    font-size: 9px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
    padding: 4px 12px; border-radius: 4px;
    background: var(--v3-steel); color: var(--v3-white);
}
.v3-card-badge.v3-featured { background: var(--v3-royal); }
.v3-card-badge.v3-sold {
    background: #C0392B; color: #FFFFFF;
    font-size: 11.25px; padding: 5px 15px;
}

.v3-card-save {
    position: absolute; top: 14px; right: 14px; z-index: 4;
    width: 34px; height: 34px; border-radius: 50%;
    background: rgba(255,255,255,0.9); backdrop-filter: blur(8px);
    border: 1px solid var(--v3-border); display: flex;
    align-items: center; justify-content: center;
    color: var(--v3-steel); font-size: 14px; cursor: pointer;
    box-shadow: 0 2px 8px rgba(14,26,43,0.1);
    transition: background 0.25s, color 0.25s;
    text-decoration: none;
}
.v3-card-save:hover { background: var(--v3-royal); color: var(--v3-white); border-color: var(--v3-royal); }

.v3-card-image-wrap {
    aspect-ratio: 4 / 3; overflow: hidden;
    background: var(--v3-snow2);
    display: flex; align-items: center; justify-content: center;
}
.v3-card-image-wrap img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.5s var(--v3-ease-lux);
}
.v3-listing-card:hover .v3-card-image-wrap img { transform: scale(1.05); }

.v3-card-body { padding: 22px 22px 20px; }
.v3-card-category {
    font-family: var(--v3-ff-body) !important;
    font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--v3-steel); margin-bottom: 6px;
}
.v3-card-title {
    font-family: var(--v3-ff-display) !important; font-size: 18px; font-weight: 700;
    color: var(--v3-ink); margin-bottom: 16px; line-height: 1.25;
    letter-spacing: -0.01em;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; text-overflow: ellipsis;
    min-height: 45px;
}

.v3-card-specs {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px 12px; margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--v3-border2);
}
.v3-spec-label {
    font-family: var(--v3-ff-body) !important;
    font-size: 9px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--v3-muted2); margin-bottom: 2px;
}
.v3-spec-value {
    font-family: var(--v3-ff-body) !important;
    font-size: 12px; font-weight: 500; color: var(--v3-slate-mid);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.v3-card-footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.v3-card-price small {
    font-family: var(--v3-ff-body) !important;
    font-size: 9px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--v3-muted2); display: block; margin-bottom: 2px;
}
.v3-card-price strong {
    font-family: var(--v3-ff-display) !important; font-size: 20px; font-weight: 700;
    color: var(--v3-royal); letter-spacing: -0.02em;
}

.v3-card-cta {
    background: var(--v3-snow2); color: var(--v3-royal);
    font-family: var(--v3-ff-body) !important;
    font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
    padding: 8px 16px; border-radius: 6px;
    border: 1px solid var(--v3-border);
    cursor: pointer; text-decoration: none;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    display: flex; align-items: center; gap: 6px;
    white-space: nowrap;
}
.v3-card-cta:hover { background: var(--v3-royal); color: var(--v3-white); border-color: var(--v3-royal); }

.headers {
    position: relative;
    width: 100%;
    min-height: 550px;         /* fixed height, consistent with the index hero (not 80vh) */
    padding: 160px 16px 120px; /* top clears the 130px nav; bottom = fixed search→bottom gap */
    box-sizing: border-box;
    background: url('/assets/pages/img/products/engine1.jpg') center center/cover no-repeat;
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* anchor content to bottom so search→bottom is a fixed 120px (not centred free-space) */
    align-items: center;
    color: white;
    text-align: center;
}

.headers::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.headers h1, .headers p {
    position: relative;
    z-index: 2;
}

.headers h1 {
    font-size: 4.5rem;
    font-family: "EB Garamond", serif !important;
    margin-top: 0;             /* nav clearance handled by .headers padding-top */
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7);
}

.headers p {
    font-size: 1.5rem;
    font-family: "EB Garamond", serif !important;
    color: white !important;
    z-index: 2;
    margin: 10px 0 0;          /* gap below tagline handled by .search-bar margin-top (match index) */
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7);
}

.search-bar {
    display: flex;
    margin-top: 60px;          /* match index hero: fixed gap above the search bar */
    justify-content: center;
    gap: 10px;
    width: 41%;
    max-width: 900px;
    position: relative;
    z-index: 2;
}

.search-bar input {
    flex: 2;
    min-width: 200px;
    color: black;
}

.search-bar button {
    background-color: #e30b17;
    color: white;
    cursor: pointer;
    min-width: 120px;
}

.search-bar button:hover {
    background-color: #c00914;
}

@media (max-width: 768px) {
    .search-bar {
        flex-direction: column;
        gap: 15px;
        width: 100%;
    }
}

/* ─── V3 Filter Sidebar ─── */
.filter-item h4 {
    font-family: var(--v3-ff-body) !important;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 12px 0;
    margin: 0;
    border-bottom: 1px solid var(--v3-border2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--v3-ink);
    transition: color 0.2s;
}
.filter-item h4:hover { color: var(--v3-royal); }

@media (max-width: 1024px) {
    .right-section { width: 100%; margin: 0; }
}

.arrow {
    font-size: 18px;
    color: var(--v3-muted);
    transition: transform 0.3s var(--v3-ease-lux);
    line-height: 1;
}
.filter-item.open .arrow { transform: rotate(180deg); }

.filter-content {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    max-height: 184px;
    padding: 10px 4px;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: var(--v3-muted2) transparent;
}
.filter-content::-webkit-scrollbar { width: 4px; }
.filter-content::-webkit-scrollbar-track { background: transparent; border-radius: 10px; }
.filter-content::-webkit-scrollbar-thumb { background: var(--v3-muted2); border-radius: 10px; }
.filter-content::-webkit-scrollbar-thumb:hover { background: var(--v3-steel); }

.filter-content a {
    display: block;
    padding: 5px;
    font-size: 13px;
    font-weight: 500;
    color: var(--v3-slate-mid);
}

.selected-filters, #selected-filters {
    background: var(--v3-snow);
    padding: 10px 12px;
    margin-bottom: 12px;
    border: 1px solid var(--v3-border2);
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px 5px;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(40,67,167,0.08);
    color: var(--v3-royal);
    font-family: var(--v3-ff-body) !important;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 100px;
    border: 1px solid rgba(40,67,167,0.14);
}
.remove-tag {
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    color: var(--v3-royal);
    opacity: 0.6;
    transition: opacity 0.2s;
}
.remove-tag:hover { opacity: 1; }

/* V3 Checkbox styling */
.filter-checkbox input[type="checkbox"] {
    accent-color: var(--v3-royal);
    width: 16px;
    height: 16px;
    margin-right: 10px;
    cursor: pointer;
}
.filter-checkbox {
    font-family: var(--v3-ff-body) !important;
    font-size: 13px;
    color: var(--v3-slate-mid);
}


.search-wrapper {
    position: relative;
    display: inline-block;
}
.search-wrapper .serchicon {
    position: absolute;
    top: 14px;
    left: 12px;
}
.search-wrapper .serchicon img {
    width: 30px;
    height: 28px;
}
.search-input {
    padding: 16px 15px 15px 48px !important;
    width: 550px;
    border-radius: 30px !important;
    border: none;
    font-size: 17px;
    font-family: "EB Garamond", serif !important;
    font-weight: 400;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    outline: none;
    background: white;
    color: #142238;
}

.type-tag {
    font-size: 12px;
    padding: 1px 6px 5px 6px;
    border-radius: 20px !important;
    margin-right: 8px;
    color: #fff;
    text-transform: capitalize;
}

.tag-aircraft { background-color: #065f46; }
.tag-engine   { background-color: #1e40af; }
.tag-part     { background-color: #991b1b; }
.tag-service  { background-color: #9d174d; }
.tag-default  { background-color: #1e3a8a; }
.part-info { background-color: #991b1b; }

.suggestion-item {
    display: flex;
    max-height: 200px !important;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #334155;
    cursor: pointer;
}
.suggestion-item:hover {
    background-color: #1e293b;
}
#suggestionList {
    max-height: 200px !important;
    overflow-y: auto;
    overflow-x: hidden;
    position: absolute;
    width: 100%;
    border-radius: 30px !important;
    background-color: #1e293b;
    scrollbar-width: thin;
    scrollbar-color: #999 transparent;
}
#suggestionList::-webkit-scrollbar { width: 6px; }
#suggestionList::-webkit-scrollbar-track { background: transparent; }
#suggestionList::-webkit-scrollbar-thumb { background-color: #999; border-radius: 4px; }

@media (max-width: 1024px) {
    .search-input {
        width: 500px !important;
        padding: 16px 15px 15px 48px;
        font-size: 15px;
    }
}
@media (max-width: 768px) {
    .search-input {
        width: 60vw !important;
        padding: 16px 15px 15px 48px !important;
        font-size: 14px !important;
    }
    #suggestionList { width: 100%; }
}
@media (max-width: 480px) {
    .search-input {
        width: 90vw !important;
        padding: 16px 15px 15px 48px !important;
        font-size: 14px;
    }
    .search-wrapper .serchicon { top: 14px !important; }
    #suggestionList { width: 100%; position: relative !important; }
    #suggestionBox li {
        font-size: 14px;
        flex-direction: column !important;
        align-items: flex-start !important;
    }
    #suggestionBox li .type-tag {
        margin-top: 6px !important;
        margin-left: 0 !important;
    }
    .search-wrapper { margin-top: 5vh !important; }
}

/* ─── Engine Page Layout ─── */
.engine-page-wrap {
    margin-top: 50px;
    display: flex;
    gap: 30px;
    align-items: flex-start;
}
.filter-sidebar {
    width: 280px;
    min-width: 280px;
    background: var(--v3-white);
    border: 1px solid var(--v3-border2);
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--v3-card-shadow);
    position: sticky;
    top: 20px;
}
.filter-sidebar h3 {
    font-family: var(--v3-ff-display) !important;
    font-size: 22px;
    font-weight: 700;
    color: var(--v3-ink);
}
.clear-filters-btn {
    font-family: var(--v3-ff-body) !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    color: var(--v3-royal) !important;
    background: none !important;
    border: 1px solid var(--v3-border) !important;
    border-radius: 6px !important;
    padding: 5px 12px !important;
    cursor: pointer !important;
    transition: background 0.2s, color 0.2s !important;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.clear-filters-btn:hover {
    background: var(--v3-royal) !important;
    color: var(--v3-white) !important;
    border-color: var(--v3-royal) !important;
}

@media (max-width: 1024px) {
    .engine-page-wrap {
        flex-direction: column;
        gap: 20px;
    }
    .filter-sidebar {
        width: 100%;
        min-width: unset;
        margin-bottom: 10px;
        position: static;
    }
}

/* ─── V3 Pagination ─── */
.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: 30px 0;
    gap: 6px;
}
.pagination a, .pagination span {
    font-family: var(--v3-ff-body) !important;
    color: var(--v3-slate-mid);
    background-color: var(--v3-white);
    padding: 8px 14px;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--v3-border);
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.pagination a:hover {
    background-color: var(--v3-snow2);
    border-color: var(--v3-royal);
    color: var(--v3-royal);
    text-decoration: none;
}
.pagination a.active {
    background-color: var(--v3-royal);
    color: var(--v3-white);
    font-weight: 700;
    border: 1px solid var(--v3-royal);
    pointer-events: none;
}
.pagination span.dots {
    background-color: transparent;
    color: var(--v3-muted2);
    border: none;
    cursor: default;
}

/* ─── V3 Responsive Grid ─── */
@media (max-width: 1200px) {
    .listing-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .listing-cards { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 480px) {
    .listing-cards { grid-template-columns: 1fr !important; }
    .v3-card-title { font-size: 16px; min-height: auto; }
    .v3-card-price strong { font-size: 18px; }
}

/* ─── Card Image Carousel ─── */
@supports not (aspect-ratio: 1 / 1) { .v3-card-image-wrap, .v3-card-carousel { height: 240px; } }
.v3-card-carousel {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--v3-snow2);
    cursor: default;
}
.v3-carousel-track {
    position: relative;
    width: 100%;
    height: 100%;
}
/* v3 carousel slide/backdrop rules live in /assets/pages/css/v3-carousel.css (shared) */
.v3-video-play-icon {
    position: absolute;
    bottom: 10px;
    left: 10px;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.9);
    background: rgba(0,0,0,0.45);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 2;
}
.v3-listing-card:hover .v3-carousel-slide.active .v3-video-play-icon {
    opacity: 0;
}
.v3-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(4px);
    color: transparent;
    font-size: 0;
    padding: 0;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.25s, background 0.2s;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(14,26,43,0.12);
}
.v3-carousel-btn::after {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    border-top: 2px solid var(--v3-ink);
    border-right: 2px solid var(--v3-ink);
}
.v3-card-carousel:hover .v3-carousel-btn { opacity: 1; }
.v3-carousel-btn:hover { background: var(--v3-white); }
.v3-carousel-prev { left: 8px; }
.v3-carousel-prev::after { transform: rotate(-135deg); margin-left: 2px; }
.v3-carousel-next { right: 8px; }
.v3-carousel-next::after { transform: rotate(45deg); margin-right: 2px; }
.v3-carousel-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 5;
}
.v3-carousel-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}
.v3-carousel-dot.active {
    background: var(--v3-white);
    transform: scale(1.3);
}
.v3-carousel-more {
    position: absolute;
    bottom: 10px;
    right: 10px;
    z-index: 5;
    font-family: var(--v3-ff-body) !important;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--v3-white);
    background: rgba(14,26,43,0.7);
    backdrop-filter: blur(4px);
    padding: 3px 10px;
    border-radius: 100px;
}



/* ─── React integration overrides ───
   Legacy used <h4 onclick> + checkbox JS for collapsible filters; the React
   port uses native <details>/<summary> (no JS, crawlable links inside) like the
   aircraft page. These rules give <summary> the legacy .filter-item h4 look and
   drop the default marker. The shared SiteHeader/SiteFooter EB-Garamond override
   lives globally in globals.css. */
.filter-sidebar h3 { text-transform: uppercase; }
.filter-item > summary {
    list-style: none;
    font-family: var(--v3-ff-body) !important;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    padding: 12px 0;
    margin: 0;
    border-bottom: 1px solid var(--v3-border2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--v3-ink);
    transition: color 0.2s;
}
.filter-item > summary::-webkit-details-marker { display: none; }
.filter-item > summary::marker { content: ""; }
.filter-item > summary:hover { color: var(--v3-royal); }
.filter-item[open] > summary .arrow { transform: rotate(180deg); }
.filter-content a.checked { color: var(--v3-royal); font-weight: 700; }

/* ─── Empty state (no results) ─── */
.listing-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 64px 28px;
    background: var(--v3-white);
    border: 1px solid var(--v3-border2);
    border-radius: 12px;
    box-shadow: var(--v3-card-shadow);
}
.listing-empty-icon {
    width: 84px;
    height: 84px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(160deg, #f4f7ff 0%, #e7eeff 100%);
    color: var(--v3-royal);
    margin-bottom: 22px;
}
.listing-empty-icon svg { width: 40px; height: 40px; }
.listing-empty-title {
    font-family: var(--v3-ff-display) !important;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--v3-ink);
    margin: 0 0 10px;
}
.listing-empty-text {
    font-family: var(--v3-ff-body) !important;
    font-size: 15px;
    line-height: 1.65;
    color: var(--v3-slate-mid);
    max-width: 460px;
    margin: 0 0 24px;
}
.listing-empty-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--v3-ff-body) !important;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--v3-white);
    background: linear-gradient(135deg, var(--v3-royal) 0%, var(--v3-royal-lt) 100%);
    border-radius: 8px;
    padding: 13px 26px;
    box-shadow: 0 4px 14px rgba(40, 67, 167, 0.28);
    text-decoration: none;
    transition: box-shadow 0.25s ease, transform 0.2s ease;
}
.listing-empty-cta:hover {
    box-shadow: 0 7px 20px rgba(40, 67, 167, 0.4);
    transform: translateY(-2px);
    text-decoration: none;
}
