:root {
    --blue: #2563eb;
    --green: #059669;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;
    --bg: #f8fafc;
    --card: #ffffff;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}
button,
a,
input,
select,
textarea {
    max-width: 100%;
    min-width: 0;
}

.parts-nav {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 40px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 20;
}
.parts-nav a {
    color: var(--blue);
    text-decoration: none;
    font-size: 14px;
    font-weight: 900;
}
.parts-brand {
    display: grid;
    gap: 2px;
    color: #020617 !important;
}
.parts-brand span {
    font-size: 18px;
    line-height: 1;
}
.parts-brand img { display:block; width:152px; height:auto; }
.parts-brand small {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .8px;
}
.parts-nav-search {
    flex: 1 1 auto;
    max-width: none;
    display: grid;
    gap: 5px;
    margin-left: 8px;
}

.mobile-nav-actions,
.store-filter-tools {
    display: none;
}

.product-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #111827;
    font-size: 14px;
    font-weight: 400;
    text-align: center;
}

.product-image-placeholder[hidden] {
    display: none;
}
.parts-nav-search label {
    color: #64748b;
    font-size: 11px;
    font-weight: 500;
}
.parts-nav-search input {
    width: 100%;
    min-height: 42px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    color: #334155;
    padding: 0 14px;
    font: 500 14px/1 Inter, sans-serif;
}
.parts-nav-search input:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}
.parts-nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.parts-nav-actions a {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 13px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: #0f172a;
    background: #fff;
}
.parts-nav-actions .nav-primary {
    border-color: var(--blue);
    background: var(--blue);
    color: #fff;
}
.parts-shell {
    width: min(1560px, calc(100% - 48px));
    margin: 24px auto 48px;
}
.market-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px;
    align-items: stretch;
    margin-bottom: 22px;
    padding: 30px;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 64%);
}
.market-eyebrow {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    padding: 0 10px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .7px;
}
.market-hero h1 {
    max-width: 780px;
    margin: 14px 0 10px;
    color: #020617;
    font-size: 38px;
    line-height: 1.08;
    font-weight: 900;
}
.market-hero p {
    max-width: 760px;
    margin: 0;
    color: #475569;
    font-size: 16px;
    line-height: 1.55;
    font-weight: 700;
}
.market-hero-card {
    display: grid;
    align-content: center;
    gap: 10px;
    padding: 22px;
    border-radius: 8px;
    background: #0f172a;
    color: #fff;
}
.market-hero-card strong {
    font-size: 22px;
    font-weight: 900;
}
.market-hero-card span {
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 700;
}
.garage-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 28px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}
.garage-head {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
}
.garage-head h1,
.market-toolbar h2,
.market-sidebar h2 {
    margin: 0;
    color: #020617;
    font-size: 28px;
    font-weight: 900;
}
.garage-head p,
.market-toolbar p {
    margin: 8px 0 0;
    color: #475569;
    font-size: 16px;
    font-weight: 600;
}
.garage-tabs {
    display: inline-flex;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    overflow: hidden;
}
.garage-tabs button {
    min-height: 46px;
    padding: 0 22px;
    border: 0;
    background: #fff;
    color: #0f172a;
    font-size: 15px;
    font-weight: 900;
}
.garage-tabs button.active {
    background: var(--blue);
    color: #fff;
}
.vehicle-grid {
    display: grid;
    grid-template-columns: repeat(9, minmax(120px, 1fr));
    gap: 18px;
    margin-top: 26px;
}
.vehicle-grid label,
.side-filter label {
    display: grid;
    gap: 8px;
    color: #1e293b;
    font-size: 14px;
    font-weight: 900;
}
.vehicle-grid input,
.vehicle-grid select,
.side-filter input,
.side-filter select {
    width: 100%;
    min-height: 48px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0 14px;
    background: #fff;
    color: var(--text);
    font: 700 14px/1 Inter, sans-serif;
}
.market-layout {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 28px;
    margin-top: 34px;
}
.market-sidebar {
    position: sticky;
    top: 88px;
    align-self: start;
}
.market-sidebar h2 {
    font-size: 24px;
    margin-bottom: 18px;
}
.category-list {
    display: grid;
    gap: 8px;
    max-height: 360px;
    overflow: auto;
    padding-right: 6px;
}
.category-list button,
.side-filter button {
    width: 100%;
    min-height: 42px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #334155;
    padding: 0 12px;
    text-align: left;
    font: 800 14px/1.2 Inter, sans-serif;
    cursor: pointer;
}
.category-list .category-root.active,
.category-list .category-main.active {
    background: var(--blue);
    color: #fff;
}
.category-group {
    display: grid;
    gap: 6px;
}
.category-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #020617 !important;
    font-size: 15px !important;
    font-weight: 900 !important;
}
.category-main.active {
    color: #fff !important;
}
.category-main small {
    font-size: 16px;
    font-weight: 900;
    line-height: 1;
}
.subcategory-list {
    display: grid;
    gap: 6px;
    padding: 2px 0 8px;
}
.subcategory-list[hidden] {
    display: none !important;
}
.category-list button.subcategory {
    min-height: 36px;
    padding-left: 28px;
    color: #64748b;
    font-size: 13px;
}
.category-list button.subcategory.active {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}
.side-filter {
    display: grid;
    gap: 14px;
    margin-top: 22px;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
}
.side-filter button {
    text-align: center;
    background: #0f172a;
    color: #fff;
}
.garage-filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}
.garage-filter-actions button {
    min-height: 46px;
    min-width: 150px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    padding: 0 18px;
    font: 900 14px/1.2 Inter, sans-serif;
    cursor: pointer;
}
.garage-filter-actions #applyFiltersBtn {
    background: #2563eb;
}
.garage-filter-actions #clearFiltersBtn {
    background: #0f172a;
}
.market-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}
.product-card {
    display: grid;
    grid-template-rows: 300px auto;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease;
}
.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.10);
}
.product-card-image {
    display: grid;
    place-items: center;
    background: #f3f4f6;
}
.product-card-image img {
    width: 88%;
    height: 88%;
    object-fit: contain;
}
.product-card-body {
    display: grid;
    gap: 12px;
    padding: 18px 20px 20px;
}
.product-card h3 {
    margin: 0;
    color: #020617;
    font-size: 17px;
    font-weight: 900;
    line-height: 1.35;
}
.product-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.product-price {
    color: #020617;
    font-size: 23px;
    font-weight: 900;
}
.stock {
    color: var(--green);
    font-size: 13px;
    font-weight: 900;
}
.stock.out_of_stock { color: #dc2626; }
.stock.limited { color: #d97706; }
.seller-line {
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
}
.market-empty {
    grid-column: 1 / -1;
    padding: 40px;
    text-align: center;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    color: #64748b;
    background: #fff;
    font-weight: 800;
}
.detail-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.58);
}
.detail-modal[hidden] {
    display: none !important;
}
.detail-card {
    position: relative;
    width: min(1100px, 100%);
    max-height: 90vh;
    overflow: auto;
    background: #fff;
    border-radius: 10px;
}
.detail-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: #f1f5f9;
    color: #0f172a;
    font-size: 24px;
    cursor: pointer;
    z-index: 2;
}
.detail-layout {
    display: grid;
    grid-template-columns: .9fr 1.1fr;
    min-height: 620px;
}
.detail-image {
    display: grid;
    place-items: center;
    padding: 44px;
    background: #f3f4f6;
}
.detail-image img {
    max-width: 100%;
    max-height: 520px;
    object-fit: contain;
}
.detail-info { padding: 44px 30px 30px; }
.detail-info h2 {
    margin: 0 42px 10px 0;
    font-size: 34px;
    line-height: 1.08;
    font-weight: 900;
}
.detail-line {
    margin: 0 0 22px;
    color: #475569;
    font-size: 16px;
    font-weight: 700;
}
.detail-section {
    padding: 22px 0;
    border-top: 1px solid var(--border);
}
.detail-section h3 {
    margin: 0 0 12px;
    font-size: 22px;
    font-weight: 900;
}
.detail-rows {
    display: grid;
    gap: 12px;
}
.detail-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    color: #334155;
    font-size: 15px;
    font-weight: 700;
}
.detail-row b {
    color: #020617;
    text-align: right;
}
.detail-row .detail-value {
    color: #334155;
    text-align: right;
    font-weight: 500;
}
.detail-row .detail-value.stock {
    font-weight: 500;
}
.contact-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.contact-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 900;
}
.call-btn { background: var(--blue); color: #fff; }
.whatsapp-btn { background: #dcfce7; color: #166534; }
.map-btn { background: #f1f5f9; color: #0f172a; }

@media (max-width: 1200px) {
    .vehicle-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
    .parts-nav {
        min-height: auto;
        padding: 12px 14px;
        align-items: flex-start;
        flex-direction: column;
    }
    .parts-nav-search {
        width: 100%;
        max-width: none;
        margin-left: 0;
    }
    .parts-nav-actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }
    .parts-nav-actions a {
        min-height: 42px;
        padding: 0 8px;
        font-size: 12px;
        text-align: center;
    }
    .parts-shell { width: calc(100% - 20px); margin-top: 10px; }
    .market-hero {
        grid-template-columns: 1fr;
        padding: 18px;
        gap: 14px;
    }
    .market-hero h1 { font-size: 28px; }
    .market-hero p { font-size: 14px; }
    .market-hero-card { padding: 16px; }
    .market-hero-card strong { font-size: 18px; }
    .garage-box { padding: 16px; }
    .garage-head { flex-direction: column; }
    .garage-head h1,
    .market-toolbar h2,
    .market-sidebar h2 {
        font-size: 24px;
    }
    .garage-tabs {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .garage-tabs button {
        padding: 0 10px;
        font-size: 13px;
    }
    .market-layout,
    .product-grid,
    .detail-layout,
    .contact-actions {
        grid-template-columns: 1fr;
    }

    .vehicle-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-top: 12px;
    }

    .vehicle-grid label {
        gap: 5px;
        font-size: 11px;
    }

    .vehicle-grid input,
    .vehicle-grid select {
        min-height: 40px;
        padding: 0 9px;
        font-size: 12px;
    }
    .garage-filter-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        margin-top: 12px;
    }
    .garage-filter-actions button {
        width: 100%;
        min-width: 0;
        min-height: 48px;
    }
    .market-sidebar { position: static; }
    .category-list {
        grid-auto-flow: row;
        overflow-x: hidden;
        overflow-y: auto;
        max-height: 360px;
        padding: 0 6px 8px 0;
        scroll-snap-type: none;
    }
    .category-list button {
        min-height: 44px;
        text-align: left;
        white-space: normal;
    }
    .category-list button.subcategory {
        padding-left: 12px;
    }
    .side-filter {
        grid-template-columns: 1fr;
        margin-top: 12px;
        padding: 12px;
    }
    .product-card { grid-template-rows: 220px auto; }
    .product-card-body { padding: 14px; }
    .product-price { font-size: 20px; }
    .market-empty { padding: 28px 16px; }
    .detail-modal { padding: 10px; align-items: end; }
    .detail-card {
        width: 100%;
        max-height: 92dvh;
        border-radius: 8px 8px 0 0;
    }
    .detail-close {
        top: 10px;
        right: 10px;
    }
    .detail-info { padding: 24px 18px; }
    .detail-image { padding: 24px; }
    .detail-info h2 {
        margin-right: 44px;
        font-size: 26px;
    }
    .detail-row {
        display: grid;
        gap: 4px;
    }
    .detail-row b {
        text-align: left;
    }
    .detail-row .detail-value {
        text-align: left;
    }
}

/* Brand-safe parts navigation */
.parts-brand { flex:0 0 auto; min-width:132px; }
.parts-brand img { width:132px; max-height:44px; object-fit:contain; }
.parts-brand small { white-space:nowrap; }

@media (max-width:820px) {
    .parts-nav {
        display:grid!important;
        grid-template-columns:38px minmax(0,1fr) auto!important;
        align-items:center!important;
        gap:10px!important;
    }
    .parts-back { grid-column:1; grid-row:1; }
    .parts-brand { grid-column:2; grid-row:1; min-width:0; justify-self:start; }
    .parts-brand img { width:118px; max-height:39px; }
    .parts-brand small { font-size:11px; }
    .mobile-nav-actions { grid-column:3; grid-row:1; justify-self:end; }
    .parts-nav-search { grid-column:1 / -1; grid-row:2; width:100%!important; margin:0!important; }
    .store-menu { grid-column:1 / -1; width:100%; }
}

.market-load-more {
    grid-column: 1 / -1;
    width: min(100%, 320px);
    min-height: 48px;
    margin: 8px auto 0;
    border: 1px solid #173b7a;
    border-radius: 9px;
    background: #fff;
    color: #17366b;
    font: 800 13px/1.2 Inter, sans-serif;
    cursor: pointer;
}

/* Final marketplace filter contract: desktop open, mobile button-controlled. */
@media (min-width: 821px) {
    .store-filter-tools { display: none !important; }
    .garage-box,
    .market-sidebar { display: block !important; }
}

@media (max-width: 820px) {
    .store-filter-tools {
        display: block !important;
        visibility: visible !important;
    }
    .store-filter-buttons {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    #vehicleFilterToggle,
    #categoryFilterToggle { display: flex !important; align-items: center; justify-content: center; }
    .garage-box:not(.filter-panel-open),
    .market-sidebar:not(.filter-panel-open) { display: none !important; }
    .garage-box.filter-panel-open,
    .market-sidebar.filter-panel-open { display: block !important; }
}

/* Unified store layout for desktop and mobile web */
.parts-nav {
    min-height: 78px;
    padding: 10px clamp(16px,4vw,42px);
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    background: #fff;
}

.parts-back {
    display: none;
}

.parts-brand {
    margin-right: auto;
    gap: 4px;
}

.parts-brand span {
    color: #12366d;
    font-size: 27px;
    font-weight: 700;
    letter-spacing: -.6px;
}

.parts-brand small {
    color: #172033;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

.mobile-nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mobile-nav-actions button {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: #0b2f6b;
    cursor: pointer;
}

.mobile-search-icon,
.mobile-menu-icon {
    position: relative;
    width: 25px;
    height: 25px;
    display: block;
}

.mobile-search-icon::before {
    content: "";
    position: absolute;
    width: 15px;
    height: 15px;
    top: 1px;
    left: 1px;
    border: 2px solid currentColor;
    border-radius: 50%;
}

.mobile-search-icon::after {
    content: "";
    position: absolute;
    width: 9px;
    height: 2px;
    right: 1px;
    bottom: 5px;
    border-radius: 2px;
    background: currentColor;
    transform: rotate(45deg);
}

.mobile-menu-icon {
    background: linear-gradient(currentColor,currentColor) 0 4px/25px 2px no-repeat,
                linear-gradient(currentColor,currentColor) 0 11px/25px 2px no-repeat,
                linear-gradient(currentColor,currentColor) 0 18px/25px 2px no-repeat;
}

.parts-nav-search {
    order: 3;
    display: none;
    flex: 1 1 100%;
    width: 100%;
    margin: 4px 0 0;
}

.parts-nav-search.is-open {
    display: grid !important;
}

.store-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: clamp(16px,4vw,42px);
    z-index: 30;
    width: 190px;
    padding: 7px;
    border: 1px solid #d8e0ea;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 16px 34px rgba(15,23,42,.14);
}

.store-menu[hidden] {
    display: none !important;
}

.store-menu a {
    min-height: 40px;
    display: flex;
    align-items: center;
    padding: 0 11px;
    border-radius: 7px;
    color: #172033;
    font-size: 13px;
    font-weight: 600;
}

.store-menu a:hover {
    background: #f1f5f9;
}

.parts-shell {
    width: min(1180px,100%);
    margin: 0 auto 40px;
    padding: 22px clamp(14px,4vw,34px);
}

.store-filter-tools {
    display: block;
    margin-bottom: 20px;
}

.store-filter-buttons {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,190px));
    gap: 10px;
}

.store-filter-buttons button {
    min-height: 46px;
    padding: 0 12px;
    border: 1px solid #d8e0ea;
    border-radius: 8px;
    background: #fff;
    color: #17366b;
    font: 600 13px/1.2 Inter,sans-serif;
    cursor: pointer;
}

.store-filter-buttons button[aria-expanded="true"] {
    border-color: #2563eb;
    background: #eff6ff;
}

.garage-box:not(.filter-panel-open),
.market-sidebar:not(.filter-panel-open) {
    display: none !important;
}

.garage-box.filter-panel-open,
.market-sidebar.filter-panel-open {
    display: block !important;
    margin: 0 0 20px;
    padding: 18px;
    border: 1px solid #dfe6ef;
    border-radius: 10px;
    background: #fff;
    box-shadow: none;
}

.market-layout {
    display: block;
}

.market-toolbar h2 {
    display: none;
}

.product-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 16px;
}

.product-card {
    grid-template-rows: 300px auto;
}

@media (max-width: 820px) {
    .parts-shell {
        width: 100%;
    }

    .store-filter-buttons {
        grid-template-columns: repeat(2,minmax(0,1fr));
    }

    .product-card {
        grid-template-rows: 240px auto;
    }
}

@media (max-width: 420px) {
    .product-card {
        grid-template-rows: 190px auto;
    }
}

/* Mobile filter panels stay closed until their own button is pressed. */
@media (max-width: 820px) {
    .store-filter-tools {
        grid-template-columns: 1fr !important;
    }

    .garage-box:not(.filter-panel-open),
    .market-sidebar:not(.filter-panel-open) {
        display: none !important;
    }

    .garage-box.filter-panel-open,
    .market-sidebar.filter-panel-open {
        display: block !important;
    }

    .product-card-image img[style*="display: none"] {
        display: none !important;
    }
}

/* Compact, standard e-commerce product detail */
#productDetailModal .detail-card {
    width: min(760px, calc(100% - 32px)) !important;
    max-height: calc(100dvh - 32px) !important;
    padding: 0 !important;
    overflow-y: auto !important;
    border-radius: 16px !important;
    background: #fff !important;
}

#productDetailModal .detail-close {
    position: sticky !important;
    top: 0 !important;
    z-index: 5 !important;
    width: 100% !important;
    min-height: 54px !important;
    margin: 0 !important;
    padding: 0 20px !important;
    border: 0 !important;
    border-bottom: 1px solid #e2e8f0 !important;
    border-radius: 0 !important;
    background: rgba(255, 255, 255, .97) !important;
    color: #07182e !important;
    font-size: 0 !important;
    text-align: left !important;
    backdrop-filter: blur(10px);
}

#productDetailModal .detail-close::before {
    content: "‹  Ürün Detayı";
    font: 800 16px/1 "Inter", sans-serif;
}

#productDetailContent { padding-bottom: 92px !important; }

#productDetailModal .commerce-product-hero {
    min-height: 170px;
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    align-items: center;
    gap: 24px;
    padding: 22px 28px;
    border-bottom: 1px solid #e2e8f0;
}

#productDetailModal .commerce-product-image {
    width: 140px;
    height: 140px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid #dbe3ed;
    border-radius: 12px;
    background: #f8fafc;
}

#productDetailModal .commerce-product-image img {
    width: 100% !important;
    height: 100% !important;
    padding: 8px;
    object-fit: contain !important;
    cursor: zoom-in;
}

.product-image-viewer {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: grid;
    place-items: center;
    padding: 56px 18px 24px;
    background: rgba(3, 10, 20, .94);
    backdrop-filter: blur(8px);
}

.product-image-viewer[hidden] {
    display: none !important;
}

.product-image-viewer img {
    width: auto;
    max-width: min(100%, 1100px);
    max-height: calc(100dvh - 88px);
    object-fit: contain;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .42);
    touch-action: pinch-zoom;
}

.product-image-viewer button {
    position: fixed;
    top: 14px;
    right: 16px;
    z-index: 1;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

#productDetailModal .commerce-product-summary { min-width: 0; }

#productDetailModal .commerce-category {
    display: block;
    margin-bottom: 7px;
    color: #64748b;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .025em;
    text-transform: uppercase;
}

#productDetailModal .commerce-product-summary h2 {
    margin: 0 0 10px !important;
    color: #07182e !important;
    font-size: 22px !important;
    line-height: 1.2 !important;
    font-weight: 800 !important;
}

#productDetailModal .commerce-price {
    display: block;
    color: #07182e;
    font-size: 26px;
    line-height: 1.1;
    font-weight: 900;
}

#productDetailModal .commerce-stock {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
}

#productDetailModal .commerce-stock i {
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: #16a34a;
}

#productDetailModal .commerce-stock .stock,
#productDetailModal .commerce-row .stock { color: #16a34a !important; }

#productDetailModal .commerce-section {
    padding: 22px 28px;
    border-bottom: 1px solid #e2e8f0;
}

#productDetailModal .commerce-section h3 {
    margin: 0 0 12px !important;
    color: #07182e !important;
    font-size: 16px !important;
    line-height: 1.25 !important;
    font-weight: 800 !important;
}

#productDetailModal .commerce-row {
    min-height: 46px;
    display: grid;
    grid-template-columns: minmax(110px, .55fr) minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    border-bottom: 1px solid #edf1f5;
}

#productDetailModal .commerce-row:last-child { border-bottom: 0; }

#productDetailModal .commerce-row > span {
    color: #64748b;
    font-size: 12px;
    font-weight: 500;
}

#productDetailModal .commerce-row > strong {
    min-width: 0;
    color: #1e293b;
    font-size: 12px;
    font-weight: 600;
    text-align: right;
    overflow-wrap: anywhere;
}

#productDetailModal .seller-contact-note {
    margin: 12px 0 0;
    padding: 10px 12px;
    border-left: 3px solid #e5ad00;
    border-radius: 7px;
    background: #fffbea;
    color: #475569;
    font-size: 11px;
    line-height: 1.45;
    font-weight: 600;
}

#productDetailModal .commerce-description p {
    margin: 0;
    color: #475569;
    font-size: 13px;
    line-height: 1.55;
}

#productDetailModal .contact-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin: 0 !important;
    padding: 12px 28px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid #e2e8f0;
    background: rgba(255, 255, 255, .97);
    backdrop-filter: blur(10px);
}

#productDetailModal .contact-actions .guest-login-action {
    width: 100%;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: #07182e !important;
    color: #fff !important;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

@media (max-width: 600px) {
    #productDetailModal .detail-card {
        width: 100% !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
    }

    #productDetailModal .commerce-product-hero {
        min-height: 132px;
        grid-template-columns: 104px minmax(0, 1fr);
        gap: 14px;
        padding: 16px 14px;
    }

    #productDetailModal .commerce-product-image {
        width: 104px;
        height: 104px;
        border-radius: 9px;
    }

    #productDetailModal .commerce-product-summary h2 {
        margin-bottom: 7px !important;
        font-size: 17px !important;
    }

    #productDetailModal .commerce-category {
        margin-bottom: 5px;
        font-size: 8px;
    }

    #productDetailModal .commerce-price { font-size: 21px; }
    #productDetailModal .commerce-stock { margin-top: 7px; font-size: 10px; }
    #productDetailModal .commerce-section { padding: 17px 14px; }

    #productDetailModal .commerce-section h3 {
        margin-bottom: 9px !important;
        font-size: 14px !important;
    }

    #productDetailModal .commerce-row {
        min-height: 40px;
        grid-template-columns: 92px minmax(0, 1fr);
        gap: 10px;
    }

    #productDetailModal .commerce-row > span,
    #productDetailModal .commerce-row > strong { font-size: 11px; }
    #productDetailModal .contact-actions {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 6px !important;
        padding: 8px 12px calc(8px + env(safe-area-inset-bottom)) !important;
    }

    #productDetailModal .contact-actions a {
        width: auto !important;
        min-width: 0 !important;
        min-height: 38px !important;
        padding: 7px 6px !important;
        border-radius: 8px !important;
        font-size: 11px !important;
        font-weight: 800 !important;
        white-space: nowrap;
    }
}

/* Final logo alignment guard */
.parts-brand { flex:0 0 auto!important; min-width:132px!important; }
.parts-brand img { display:block!important; width:132px!important; height:auto!important; max-height:44px!important; object-fit:contain!important; }
.parts-brand small { white-space:nowrap; }

@media (max-width:820px) {
    .parts-nav { display:grid!important; grid-template-columns:38px minmax(0,1fr) auto!important; align-items:center!important; gap:10px!important; }
    .parts-back { grid-column:1!important; grid-row:1!important; }
    .parts-brand { grid-column:2!important; grid-row:1!important; min-width:0!important; justify-self:start!important; }
    .parts-brand img { width:118px!important; max-height:39px!important; }
    .parts-brand small { font-size:11px!important; }
    .mobile-nav-actions { grid-column:3!important; grid-row:1!important; justify-self:end!important; }
    .parts-nav-search { grid-column:1 / -1!important; grid-row:2!important; width:100%!important; margin:0!important; }
    .store-menu { grid-column:1 / -1!important; width:100%!important; }
}

/* Desktop devices remain desktop even when browser zoom narrows the CSS viewport. */
@media (min-width: 821px), (hover: hover) and (pointer: fine) {
    .store-filter-tools {
        display: none !important;
    }

    .garage-box {
        display: block !important;
        visibility: visible !important;
    }

    .market-layout {
        display: grid !important;
        grid-template-columns: 290px minmax(0, 1fr) !important;
        gap: 28px !important;
    }

    .market-sidebar {
        display: block !important;
        visibility: visible !important;
        position: sticky !important;
        top: 98px !important;
        align-self: start !important;
    }
}

/* Desktop filters are always visible; mobile filters open on demand. */
@media (min-width: 821px) {
    .store-filter-tools {
        display: none !important;
    }

    .garage-box,
    .market-sidebar {
        display: block !important;
    }

    .market-sidebar {
        position: sticky !important;
        top: 98px !important;
        align-self: start !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
    }

    .market-layout {
        display: grid !important;
        grid-template-columns: 290px minmax(0,1fr) !important;
        gap: 28px !important;
    }
}

/* Mobile web marketplace */
@media (max-width: 820px) {
    body {
        background: #fff;
    }

    .parts-nav {
        min-height: 78px;
        padding: 10px 22px;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 12px;
        background: #fff;
    }

    .parts-back {
        display: none;
    }

    .parts-brand {
        margin-right: auto;
        gap: 4px;
    }

    .parts-brand span {
        color: #12366d;
        font-size: 27px;
        font-weight: 700;
        letter-spacing: -.6px;
    }

    .parts-brand small {
        color: #172033;
        font-size: 15px;
        font-weight: 500;
        letter-spacing: 0;
        text-transform: none;
    }

    .mobile-nav-actions {
        display: flex;
        align-items: center;
        gap: 22px;
        color: #0b2f6b;
    }

    .mobile-search-icon,
    .mobile-menu-icon {
        position: relative;
        width: 25px;
        height: 25px;
        display: block;
    }

    .mobile-search-icon::before {
        content: "";
        position: absolute;
        width: 15px;
        height: 15px;
        top: 1px;
        left: 1px;
        border: 2px solid currentColor;
        border-radius: 50%;
    }

    .mobile-search-icon::after {
        content: "";
        position: absolute;
        width: 9px;
        height: 2px;
        right: 1px;
        bottom: 5px;
        border-radius: 2px;
        background: currentColor;
        transform: rotate(45deg);
    }

    .mobile-menu-icon {
        background: linear-gradient(currentColor,currentColor) 0 4px/25px 2px no-repeat,
                    linear-gradient(currentColor,currentColor) 0 11px/25px 2px no-repeat,
                    linear-gradient(currentColor,currentColor) 0 18px/25px 2px no-repeat;
    }

    .parts-nav-search {
        order: 3;
        display: none;
        flex: 1 1 100%;
        margin: 4px 0 0;
    }

    .parts-shell {
        width: 100%;
        margin: 0 auto 36px;
        padding: 20px 22px;
    }

    .store-filter-tools {
        display: grid;
        grid-template-columns: minmax(0,1fr) 180px;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 20px;
    }

    .store-filter-buttons {
        display: grid;
        grid-template-columns: repeat(2,minmax(0,1fr));
        gap: 8px;
    }

    .store-filter-buttons button,
    #sortProducts {
        min-height: 46px;
        border: 1px solid #d8e0ea;
        border-radius: 7px;
        background: #fff;
        color: #17366b;
        font: 600 12px/1.2 Inter,sans-serif;
    }

    .store-filter-buttons button {
        position: relative;
        padding: 0 8px 0 27px;
    }

    .store-filter-buttons button::before {
        content: "";
        position: absolute;
        left: 9px;
        top: 50%;
        width: 12px;
        height: 10px;
        transform: translateY(-50%);
        border-top: 2px solid currentColor;
        border-bottom: 2px solid currentColor;
    }

    .store-filter-buttons button[aria-expanded="true"] {
        border-color: #2563eb;
        background: #eff6ff;
    }

    #sortProducts {
        width: 100%;
        padding: 0 34px 0 14px;
        color: #334155;
        font-weight: 500;
    }

    .garage-box,
    .market-sidebar {
        display: none;
    }

    .garage-box.filter-panel-open,
    .market-sidebar.filter-panel-open {
        display: block;
        margin: 0 0 18px;
        padding: 16px;
        border: 1px solid #dfe6ef;
        border-radius: 10px;
        background: #fff;
        box-shadow: none;
    }

    .garage-head h1,
    .market-sidebar h2 {
        margin: 0 0 12px;
        font-size: 18px;
    }

    .market-layout {
        display: block;
    }

    .market-toolbar {
        min-height: auto;
        margin: 0 0 18px;
        padding: 0;
        border: 0;
    }

    .market-toolbar h2 {
        display: none;
    }

    .market-toolbar p {
        margin: 0;
        color: #64748b;
        font-size: 13px;
        font-weight: 400;
    }

    .product-grid {
        display: grid;
        grid-template-columns: repeat(2,minmax(0,1fr));
        gap: 14px 12px;
    }

    .product-card {
        min-width: 0;
        grid-template-rows: 260px auto;
        border: 1px solid #dfe6ef;
        border-radius: 8px;
        box-shadow: none;
        overflow: hidden;
    }

    .product-card:hover {
        transform: none;
        box-shadow: none;
    }

    .product-card-image {
        padding: 12px;
        background: #fff;
        border-bottom: 1px solid #e2e8f0;
    }

    .product-card-image .product-image-placeholder {
        border: 0;
        font-size: 14px;
    }

    .product-card-body {
        min-height: 134px;
        padding: 13px 12px 15px;
    }

    .product-card h3 {
        margin: 0 0 8px;
        color: #12366d;
        font-size: 15px;
        font-weight: 700;
        line-height: 1.3;
    }

    .seller-line {
        margin-bottom: 10px;
        color: #667085;
        font-size: 13px;
        font-weight: 400;
    }

    .product-card-meta {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .product-price {
        color: #12366d;
        font-size: 18px;
        font-weight: 700;
    }

    .stock {
        padding: 0;
        border: 0;
        background: transparent !important;
        color: #667085 !important;
        font-size: 13px;
        font-weight: 400;
    }
}

@media (max-width: 420px) {
    .parts-nav {
        padding-left: 14px;
        padding-right: 14px;
    }

    .parts-shell {
        padding-left: 12px;
        padding-right: 12px;
    }

    .store-filter-tools {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .product-grid {
        gap: 10px 8px;
    }

    .product-card {
        grid-template-rows: 190px auto;
    }

    .product-card-body {
        min-height: 128px;
        padding: 11px 10px 13px;
    }

    .product-card h3 {
        font-size: 14px;
    }

    .product-price {
        font-size: 17px;
    }
}

@media (max-width: 420px) {
    .parts-nav-actions {
        grid-template-columns: 1fr;
    }
    .parts-shell {
        width: calc(100% - 14px);
    }
    .market-hero {
        padding: 14px;
    }
    .market-hero h1 {
        font-size: 24px;
    }
    .garage-box {
        padding: 12px;
    }
    .vehicle-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
    .vehicle-grid input,
    .vehicle-grid select,
    .side-filter input,
    .side-filter select {
        min-height: 38px;
        font-size: 12px;
    }
    .product-card {
        grid-template-rows: 190px auto;
    }
    .product-card-meta {
        align-items: flex-start;
        flex-direction: column;
    }
    .contact-actions {
        gap: 8px;
    }
    .contact-actions a {
        min-height: 46px;
    }
}

/* Customer parts clean layout overrides */
.parts-nav {
    justify-content: flex-start;
}

.parts-nav-search {
    flex: 1 1 0;
    width: auto;
    max-width: none;
}

.parts-back {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: #0f172a !important;
    background: #fff;
    font-size: 28px !important;
    font-weight: 500 !important;
    line-height: 1;
}

.parts-brand span {
    font-weight: 700;
}

.vehicle-grid label {
    color: #334155;
    font-weight: 600;
}

.vehicle-grid input,
.vehicle-grid select {
    color: #334155;
    font-weight: 500;
}

.garage-head h1,
.market-toolbar h2 {
    font-weight: 700;
}

.product-card {
    grid-template-rows: 240px minmax(150px, auto);
}

.product-card-image {
    min-height: 0;
    overflow: hidden;
    padding: 14px;
}

.product-card-image img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-card h3 {
    color: #1e293b;
    font-weight: 600;
}

.seller-line,
.stock {
    font-weight: 500;
}

.product-price {
    font-weight: 900;
}

.detail-modal {
    display: block;
    padding: 0;
    background: #fff;
    overflow: auto;
}

.detail-card {
    width: 100%;
    min-height: 100dvh;
    max-height: none;
    overflow: visible;
    border-radius: 0;
}

.detail-close {
    position: sticky;
    top: 12px;
    left: 24px;
    right: auto;
    z-index: 5;
    width: auto;
    min-width: 78px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: #0f172a;
    font-size: 14px;
    font-weight: 600;
}

.detail-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 24px 24px 0;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
}

.detail-breadcrumb i {
    color: #94a3b8;
    font-style: normal;
}

.detail-layout {
    width: min(1280px, calc(100% - 48px));
    min-height: auto;
    margin: 18px auto 48px;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.detail-info h2 {
    color: #1e293b;
    font-weight: 600;
}

.detail-line,
.detail-section h3,
.detail-row,
.detail-row span,
.detail-row .detail-value {
    font-weight: 400;
}

.detail-section h3 {
    color: #1e293b;
    font-size: 20px;
}

.detail-row b.detail-price {
    color: #020617;
    font-size: 21px;
    font-weight: 900;
}

.detail-row b:not(.detail-price) {
    font-weight: 400;
}

@media (max-width: 820px) {
    .parts-nav {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
    }

    .parts-nav-search {
        flex: 1 1 100%;
        order: 3;
    }

    .parts-shell {
        width: calc(100% - 18px);
    }

    .market-sidebar {
        display: flex;
        flex-direction: column;
    }

    .side-filter {
        order: -1;
    }

    .product-card {
        grid-template-rows: 190px auto;
    }

    .detail-modal {
        padding: 0;
        align-items: stretch;
    }

    .detail-card {
        max-height: none;
        border-radius: 0;
    }

    .detail-layout {
        width: calc(100% - 18px);
        margin: 14px auto 28px;
        grid-template-columns: 1fr;
    }

    .detail-breadcrumb {
        padding: 14px 12px 0;
    }
}

/* Final mobile filter visibility */
.parts-back {
    width: 38px !important;
    height: 38px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 38px !important;
    border: 1px solid #d8e0ea !important;
    border-radius: 10px !important;
    background: #fff !important;
    color: #0f172a !important;
    font-size: 28px !important;
    line-height: 1 !important;
}

.store-filter-tools,
.mobile-nav-actions {
    display: block;
}

.mobile-nav-actions {
    display: flex;
}

@media (max-width: 820px) {
    .store-filter-tools {
        grid-template-columns: 1fr !important;
    }

    .garage-box:not(.filter-panel-open),
    .market-sidebar:not(.filter-panel-open) {
        display: none !important;
    }

    .garage-box.filter-panel-open,
    .market-sidebar.filter-panel-open {
        display: block !important;
    }

    .product-card-image img[style*="display: none"] {
        display: none !important;
    }
}
