/* ── Ovis Marketplace — Design System ─────────────────────────────────────── */

:root {
    --ovis-navy: #14213D;
    --ovis-orange: #E85D04;
    --ovis-amber: #FCA311;
    --ovis-bg: #F4F5F7;
    --ovis-surface: #FFFFFF;
    --ovis-text: #14213D;
    --ovis-muted: #64748B;
    --ovis-border: #E2E8F0;
    --ovis-shadow: 0 1px 3px rgba(0, 0, 0, 0.07), 0 4px 12px rgba(0, 0, 0, 0.05);
    --ovis-shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.11), 0 8px 36px rgba(0, 0, 0, 0.07);
    --ovis-radius: 10px;
    --ovis-radius-sm: 6px;
    --ovis-header-h: 62px;
}

html,
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--ovis-bg);
    color: var(--ovis-text);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

*, ::before, ::after {
    box-sizing: border-box;
}

/* ── Site Layout ─────────────────────────────────────────────────────────── */

.ovis-site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Header / Top Navigation ─────────────────────────────────────────────── */

.ovis-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--ovis-navy);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06), 0 4px 20px rgba(0, 0, 0, 0.25);
    height: var(--ovis-header-h);
}

.ovis-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 12px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (min-width: 600px) {
    .ovis-header-inner {
        padding: 0 16px;
        gap: 12px;
    }
}

@media (min-width: 960px) {
    .ovis-header-inner {
        padding: 0 24px;
        gap: 16px;
    }
}

.ovis-mobile-toggle {
    color: #fff !important;
    margin-left: -8px;
}

/* Brand */
.ovis-brand {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.03em;
    flex-shrink: 0;
}

@media (min-width: 600px) {
    .ovis-brand {
        gap: 8px;
        font-size: 1.25rem;
        margin-right: 8px;
    }
}

.ovis-brand:hover {
    opacity: 0.9;
}

.ovis-brand-icon {
    width: 24px;
    height: 24px;
    color: var(--ovis-orange);
    flex-shrink: 0;
}

@media (min-width: 600px) {
    .ovis-brand-icon {
        width: 28px;
        height: 28px;
    }
}

.ovis-brand-name {
    background: linear-gradient(135deg, #fff 40%, var(--ovis-amber));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Primary Nav Links */
.ovis-nav-links {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.ovis-nav-link {
    display: inline-block;
    padding: 6px 14px;
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
}

.ovis-nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* Search Bar */
.ovis-header-search {
    flex: 1;
    max-width: 480px;
    margin: 0 12px;
    position: relative;
    display: flex;
    align-items: center;
}

.ovis-search-icon {
    position: absolute;
    left: 12px;
    width: 16px;
    height: 16px;
    color: rgba(255, 255, 255, 0.45);
    pointer-events: none;
    flex-shrink: 0;
}

.ovis-search-input {
    width: 100%;
    height: 38px;
    padding: 0 16px 0 38px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    color: #fff;
    font-size: 0.875rem;
    font-family: inherit;
    outline: none;
    transition: background 0.15s, border-color 0.15s;
    -webkit-appearance: none;
}

.ovis-search-input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.ovis-search-input:focus {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.35);
}

.ovis-search-input::-webkit-search-cancel-button {
    display: none;
}

/* Header Actions */
.ovis-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    margin-left: auto;
}

@media (min-width: 600px) {
    .ovis-header-actions {
        gap: 8px;
    }
}

/* Sell / CTA Button */
.ovis-btn-sell {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--ovis-orange);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 7px;
    text-decoration: none;
    transition: background 0.15s, transform 0.1s;
    white-space: nowrap;
}

@media (min-width: 600px) {
    .ovis-btn-sell {
        padding: 7px 16px;
        font-size: 0.875rem;
    }
}

.ovis-btn-sell:hover {
    background: #d44f00;
    transform: translateY(-1px);
}

.ovis-btn-sell svg {
    flex-shrink: 0;
}

/* User Menu Dropdown */
.ovis-user-menu {
    position: relative;
}

.ovis-user-trigger {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}

@media (min-width: 600px) {
    .ovis-user-trigger {
        gap: 7px;
        padding: 6px 12px;
    }
}

.ovis-user-trigger:hover,
.ovis-user-menu:focus-within .ovis-user-trigger {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.35);
}

.ovis-user-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.ovis-chevron {
    transition: transform 0.2s;
}

.ovis-user-menu:focus-within .ovis-chevron {
    transform: rotate(180deg);
}

.ovis-user-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 180px;
    background: var(--ovis-surface);
    border: 1px solid var(--ovis-border);
    border-radius: 10px;
    box-shadow: var(--ovis-shadow-lg);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
    z-index: 200;
}

.ovis-user-menu:focus-within .ovis-user-dropdown,
.ovis-user-menu:hover .ovis-user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.ovis-dropdown-item {
    display: block;
    width: 100%;
    padding: 8px 12px;
    color: var(--ovis-text);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.12s;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}

.ovis-dropdown-item:hover {
    background: var(--ovis-bg);
}

.ovis-dropdown-signout {
    color: #EF4444;
}

.ovis-dropdown-signout:hover {
    background: #FEF2F2;
}

.ovis-dropdown-divider {
    height: 1px;
    background: var(--ovis-border);
    margin: 6px 0;
}

/* ── Fitment Badges ── */
.ovis-fitment-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: #0ea5e9;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 5;
}

/* ── Main Content Area ────────────────────────────────────────────────────── */

.ovis-main {
    flex: 1;
    padding-top: 28px;
    padding-bottom: 48px;
}

.ovis-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}


.ovis-hero {
    background: linear-gradient(135deg, #0F172A 0%, #14213D 55%, #1E3A5F 100%);
    border-radius: 16px;
    padding: clamp(40px, 6vw, 72px) clamp(24px, 4vw, 48px);
    text-align: center;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.ovis-hero::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -10%;
    width: 480px;
    height: 480px;
    background: radial-gradient(circle, rgba(232, 93, 4, 0.18) 0%, transparent 65%);
    pointer-events: none;
}

.ovis-hero-title {
    font-size: clamp(1.875rem, 4.5vw, 3.25rem);
    font-weight: 700;
    margin: 0 0 14px;
    letter-spacing: -0.03em;
    line-height: 1.12;
}

.ovis-hero-sub {
    font-size: clamp(1rem, 2vw, 1.125rem);
    color: rgba(255, 255, 255, 0.72);
    margin: 0 auto 36px;
    max-width: 520px;
    font-weight: 400;
    line-height: 1.6;
}

.ovis-hero-search {
    max-width: 540px;
    margin: 0 auto 28px;
}

.ovis-hero-ctas {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ── Listing Card ────────────────────────────────────────────────────────── */

.ovis-card {
    background: var(--ovis-surface);
    border-radius: var(--ovis-radius);
    box-shadow: var(--ovis-shadow);
    border: 1px solid var(--ovis-border);
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.ovis-card:hover {
    box-shadow: var(--ovis-shadow-lg);
    transform: translateY(-3px);
}

.ovis-card-img-wrap {
    position: relative;
    overflow: hidden;
    height: 210px;
    background: #F1F5F9;
    flex-shrink: 0;
}

.ovis-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.ovis-card:hover .ovis-card-img-wrap img {
    transform: scale(1.03);
}

.ovis-watch-btn {
    position: absolute !important;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(4px);
    z-index: 10;
}

.ovis-watch-btn:hover {
    background: white !important;
}

/* ── Listing Detail Page ── */
.listing-image-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
}

.listing-detail-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ── Badge Classes ── */
.ovis-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #fff;
    z-index: 10;
}

.ovis-badge-new {
    background: #10B981;
}

.ovis-badge-exc {
    background: var(--ovis-orange);
}

.ovis-badge-good {
    background: #3B82F6;
}

.ovis-badge-fair {
    background: #6B7280;
}

.ovis-badge-parts {
    background: #000;
}

.ovis-card-price {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 12px 14px 2px;
}

.ovis-card-title {
    font-size: 0.9375rem;
    font-weight: 500;
    margin: 0 14px 6px;
    color: var(--ovis-navy);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ovis-card-meta {
    font-size: 0.8125rem;
    color: var(--ovis-muted);
    margin: 0 14px 12px;
}

.ovis-card-footer {
    border-top: 1px solid var(--ovis-border);
    padding: 8px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.ovis-card-seller {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ovis-navy);
}

.ovis-card-type-icon {
    font-size: 1rem;
    opacity: 0.8;
}

.ovis-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.ovis-badge-new {
    background: #D1FAE5;
    color: #065F46;
}

.ovis-badge-exc {
    background: #DBEAFE;
    color: #1E40AF;
}

.ovis-badge-good {
    background: #FEF3C7;
    color: #92400E;
}

.ovis-badge-fair {
    background: #FFE4E6;
    color: #9F1239;
}

.ovis-badge-parts {
    background: #F3E8FF;
    color: #6B21A8;
}

/* Card content */
.ovis-card-body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0;
}

.ovis-card-price {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--ovis-orange);
    margin: 0 0 4px;
    line-height: 1.2;
}

.ovis-card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--ovis-text);
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.ovis-card-meta {
    font-size: 0.8125rem;
    color: var(--ovis-muted);
    margin: 0;
    flex: 1;
    padding-bottom: 12px;
}

.ovis-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid var(--ovis-border);
    margin-top: auto;
}

.ovis-card-seller {
    font-size: 0.75rem;
    color: var(--ovis-muted);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ovis-card-type-icon {
    font-size: 0.875rem;
    flex-shrink: 0;
    margin-left: 4px;
}

/* ── Top nav search bar ───────────────────────────────────────────────────── */

.top-search .mud-input-root {
    background: rgba(255, 255, 255, 0.10) !important;
    border-radius: 8px !important;
}

.top-search .mud-input-root:hover,
.top-search .mud-input-root:focus-within {
    background: rgba(255, 255, 255, 0.16) !important;
}

.top-search input {
    color: white !important;
}

.top-search input::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

.top-search .mud-input-outlined-border {
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.top-search .mud-input-adornment svg {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* ── Utility ─────────────────────────────────────────────────────────────── */

.listing-detail-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.payment-message {
    min-height: 1.2em;
    font-size: 0.875rem;
    color: #EF4444;
}

.admin-nav-card {
    cursor: pointer;
    transition: box-shadow 0.2s ease;
}

.admin-nav-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14) !important;
}

/* ── Blazor error UI ─────────────────────────────────────────────────────── */

#blazor-error-ui {
    background: #FEF2F2;
    bottom: 0;
    box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.1);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: #991B1B;
    font-size: 0.875rem;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}


.hero-banner {
    background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%);
    border-radius: 12px;
    color: white;
}

.listing-card {
    cursor: pointer;
    transition: box-shadow 0.2s ease, transform 0.1s ease;
}

.listing-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12) !important;
    transform: translateY(-2px);
}

.listing-image-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
}

.listing-detail-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.payment-message {
    min-height: 1.2em;
    font-size: 0.875rem;
    color: #d32f2f;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* Admin nav cards */
.admin-nav-card {
    cursor: pointer;
    transition: box-shadow 0.2s ease;
}

.admin-nav-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14) !important;
}