@font-face {
    font-family: 'SourceSans3';
    src: url('./lib/SourceSans3-VariableFont.ttf') format('truetype')
}

.home-page {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem 1.25rem;
    max-width: 1400px;
    margin: 0 auto;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #003366;
    color: white;
    padding: 1rem;
    gap: 12px;
    width: 100%;
}

@media (max-width: 959px) {
    .mud-appbar.mud-appbar-fixed-top {
        position: static !important;
        height: auto !important;
        min-height: 56px;
    }

    .mud-appbar > .mud-toolbar {
        height: auto !important;
        min-height: 56px;
        padding: 4px 8px;
    }

    .mud-main-content {
        padding-top: 0 !important;
    }

    .header {
        padding: 0.5rem;
        flex-wrap: wrap;
    }

    .header input {
        margin: 0;
    }
}

    .header button {
        color: white;
    }

    .header .mud-button-outlined {
        border: 1px solid white;
    }

    .header input {
        flex: 1;
        margin: 0 1rem;
        padding: 0.5rem;
        border-radius: 4px;
        border: 1px solid #ccc;
    }

main {
    flex: 1;
    padding: 1rem;
    overflow: auto;
}

.no-wrap-label > .mud-input-control-input-container > label > span.mud-typography > span {
    display: inline-block;
    max-width: 115px;
    vertical-align: middle;
}

/* MudAutocomplete styling */
.search-input .mud-input-slot {
    color: white !important;
    caret-color: white !important;
}

    .search-input .mud-input-slot::placeholder {
        color: rgba(255, 255, 255, 0.7) !important;
        opacity: 1 !important;
    }

.search-input .mud-input-label {
    color: rgba(255, 255, 255, 0.7) !important;
}

.search-input .mud-input-underline::before,
.search-input .mud-input-underline::after {
    border-color: white !important;
}

.item-dialog {
    --oo-brand-blue: #173D6E;
    --oo-brand-blue-dark: #003A70;
    --oo-link-blue: #0E3D71;
    --oo-panel: #FAFAFA;
    --oo-panel-strong: #F2F3F6;
    --oo-border: rgba(189, 189, 189, 0.5);
    --oo-text: #282828;
    max-width: 1200px !important;
    width: min(1200px, 90vw) !important;
    margin: auto !important;
    border-radius: 10px;
    overflow: hidden;
    font-family: "SourceSans3", Arial, sans-serif;
}

    .item-dialog,
    .item-dialog .mud-dialog-content {
        overflow-x: hidden;
        max-height: none !important;
    }

        .item-dialog .mud-dialog {
            max-height: 95vh !important;
            display: flex;
            flex-direction: column;
        }

        .item-dialog .mud-dialog-content {
            overflow-y: auto;
            flex: 1 1 auto;
            min-height: 0;
        }

        .item-dialog .mud-grid,
        .item-dialog .mud-item,
        .item-dialog .image-pane,
        .item-dialog .details-pane {
            min-width: 0;
        }

        .item-dialog img,
        .item-dialog .image-carousel {
            max-width: 100%;
        }

        /* Dialog title/header */

        .item-dialog .mud-dialog-title {
            background: var(--oo-brand-blue-dark);
            color: #FFFFFF;
            padding: 0.85rem 1.25rem;
            box-shadow: 0 3px 3px rgba(0, 0, 0, 0.25);
        }

        .item-dialog .image-photo-info {
            padding: 0.4rem 0.75rem;
            text-align: center;
            font-size: 0.8rem;
            color: var(--oo-text);
            border-top: 1px solid #FFFFFF;
        }

        .item-dialog .image-photo-disclaimer {
            font-style: italic;
            color: #c0392b;
        }

        .item-dialog .image-photo-date {
            margin-top: 0.1rem;
        }

.item-dialog-title {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    width: 100%;
    gap: 0.5rem;
}

.item-dialog-title-main {
    justify-self: start;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 1.1rem;
    font-weight: 700;
}

.item-dialog-title-price {
    justify-self: center;
    text-align: center;
    width: 100%;
    font-size: 1.1rem;
    font-weight: 700;
}

/* Dialog body/actions */

.item-dialog .mud-dialog-content {
    padding: 0.65rem 0.85rem 0.5rem;
    background: #FFFFFF;
}

.item-dialog .mud-dialog-actions {
    padding: 0.55rem 0.65rem 0.65rem;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 0.5rem;
    background: #FFFFFF;
    border-top: 1px solid var(--oo-border);
}

.item-dialog .mud-button-close {
    color: #FFFFFF;
}

.item-dialog .item-dialog-ok-button {
    min-width: 82px;
    height: 36px;
    padding: 0 1.25rem;
    border: 1px solid #282828;
    border-radius: 9px;
    background-color: var(--oo-brand-blue);
    color: #FAFAFA;
    font-weight: 700;
    text-transform: none;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

    .item-dialog .item-dialog-ok-button:hover {
        background-color: var(--oo-brand-blue-dark);
        border-color: #282828;
    }

    .item-dialog .item-dialog-ok-button:active {
        transform: translateY(1px);
    }

.item-dialog a {
    color: var(--oo-link-blue);
    text-decoration: underline;
}

/* MudGrid spacing */

.no-gap {
    margin: 0 !important;
    width: 100%;
}

    /* MudBlazor usually emits mud-grid-item here */
    .no-gap > .mud-grid-item {
        padding: 0.5rem;
    }

/* Mobile view switcher (hidden on desktop) */

.mobile-view-switcher {
    display: none;
}

/* Left and right panes */

.image-pane,
.details-pane {
    height: 100%;
    background: var(--oo-panel);
    border: 1px solid var(--oo-border);
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    overflow: hidden;
}

.image-pane {
    display: flex;
    flex-direction: column;
}

/* Image carousel */

.item-dialog .image-pane {
    height: clamp(220px, 40vh, 460px) !important;
    overflow: hidden;
}

.item-dialog .image-carousel {
    flex: 1 1 auto;
    min-height: 0;
    position: relative;
    overflow: hidden;
    height: 100%;
    background: var(--oo-panel-strong);
}

    .item-dialog .image-carousel .mud-carousel-content,
    .item-dialog .image-carousel .mud-carousel-item {
        height: 100%;
    }

    .item-dialog .image-carousel .mud-carousel-delimiters {
        bottom: 6px;
    }

    .item-dialog .image-carousel .mud-button-root.mud-icon-button {
        background: rgba(255, 255, 255, 0.6);
        z-index: 2;
    }

.image-slide {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .image-slide a {
        height: 100%;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

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

.item-dialog .image-footer {
    flex: 0 0 auto;
    border-top: 1px solid #FFFFFF;
    background: var(--oo-panel);
}

    .item-dialog .image-footer .mud-icon-button {
        color: var(--oo-brand-blue);
    }

.item-action-row {
    padding: 0.4rem 0.75rem 0.75rem;
    border-top: 1px solid #FFFFFF;
    min-height: 36px;
}

    .item-action-row .mud-icon-button {
        color: var(--oo-brand-blue);
    }

/* Right pane / tabs */

.details-pane {
    display: flex;
    flex-direction: column;
    height: clamp(220px, 40vh, 460px) !important;
}

.fill-tabs {
    min-height: 24.5rem !important;
    height: 24.5rem !important;
    overflow-y: hidden !important;
}

    .fill-tabs .mud-tabs-toolbar {
        background: var(--oo-panel);
        border-bottom: 1px solid var(--oo-border);
        min-height: 38px;
    }

    .fill-tabs .mud-tab {
        min-height: 38px;
        padding: 0 1.1rem;
        font-size: 0.95rem;
        font-family: "SourceSans3", Arial, sans-serif;
        text-transform: none;
    }

        .fill-tabs .mud-tab.mud-tab-active {
            color: var(--oo-brand-blue);
            font-weight: 700;
        }

    .fill-tabs .mud-tabpanel {
        flex: 1;
        overflow: auto;
    }

/* Item detail key/value table (scoped under .item-dialog for specificity over MudTable) */

.item-dialog .kv-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    border-spacing: 0;
    font-family: "SourceSans3", Arial, sans-serif;
    background: #FFFFFF;
}

    .item-dialog .kv-table th,
    .item-dialog .kv-table td {
        padding: 7px 10px;
        vertical-align: middle;
        font-size: 0.92rem;
        line-height: 1.2;
    }

    .item-dialog .kv-table td {
        word-break: break-word;
    }

        .item-dialog .kv-table td:first-child {
            width: 34ch;
            color: #282828;
            font-weight: 700;
            white-space: nowrap;
            background: #FAFAFA;
            border-right: 3px solid #FFFFFF;
        }

        .item-dialog .kv-table td:last-child {
            color: #111111;
            font-weight: 400;
        }

    .item-dialog .kv-table tbody tr:nth-child(odd) td {
        background-color: #FAFAFA;
    }

    .item-dialog .kv-table tbody tr:nth-child(even) td {
        background-color: #FFFFFF;
    }

    .item-dialog .kv-table tbody tr td {
        border-bottom: 3px solid #FFFFFF;
        border-radius: 0;
    }

    /* Make empty-looking rows less tall */
    .item-dialog .kv-table td:empty::after {
        content: "\00a0";
    }

/* item detail blurb ribbon */

.item-detail-blurb-ribbon-wrap {
    padding: 0 0.35rem 0.35rem;
}

.item-detail-blurb-ribbon {
    border-color: var(--oo-brand-blue);
    color: var(--oo-brand-blue);
    background: #FFFFFF;
    border-radius: 9px;
    font-family: "SourceSans3", Arial, sans-serif;
    min-height: 35px;
}

/* Utility */

.flex-1 {
    flex: 1 1 auto;
}

/* Mobile */

@media (max-width: 600px) {
    .item-dialog {
        width: 100vw !important;
        max-width: 100vw !important;
        margin: 0 !important;
        border-radius: 0;
    }

    .item-dialog .mud-dialog {
        max-height: 100vh !important;
        height: 100vh;
        border-radius: 0;
    }

    /* Show the mobile view switcher, hide the inactive column */
    .mobile-view-switcher {
        display: flex;
        gap: 0.35rem;
        padding: 0.35rem 0.25rem 0.5rem;
        position: sticky;
        top: 0;
        background: #FFFFFF;
        z-index: 3;
    }

    .mvs-btn {
        flex: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.35rem;
        min-height: 40px;
        padding: 0 0.75rem;
        border: 1px solid var(--oo-border);
        border-radius: 8px;
        background: #FFFFFF;
        color: var(--oo-brand-blue);
        font-family: inherit;
        font-size: 0.95rem;
        font-weight: 600;
        cursor: pointer;
    }

        .mvs-btn.active {
            background: var(--oo-brand-blue);
            color: #FFFFFF;
            border-color: var(--oo-brand-blue);
        }

    .item-dialog-grid.mobile-view-images .details-col,
    .item-dialog-grid.mobile-view-details .image-col {
        display: none;
    }

    /* Let panes size to their content on mobile so the dialog body scrolls naturally */
    .item-dialog .image-pane,
    .item-dialog .details-pane,
    .item-dialog .fill-tabs {
        height: auto;
        min-height: 0;
        max-height: none;
    }

    .item-dialog .image-pane {
        height: 60vh;
    }

    .item-dialog-title {
        grid-template-columns: 1fr;
        padding-right: 2.5rem; /* room for MudDialog close X */
    }

    .item-dialog-title-price {
        justify-self: start;
        text-align: left;
        font-size: 0.95rem;
    }

    .no-gap > .mud-grid-item {
        padding: 0.25rem;
    }

    /* Unify each label+value into one visual "card" row on mobile */
    .item-dialog .kv-table,
    .item-dialog .kv-table tbody,
    .item-dialog .kv-table tr {
        border-spacing: 0;
    }

        .item-dialog .kv-table tr {
            display: block;
            padding: 6px 10px;
            border-bottom: 2px solid #FFFFFF;
        }

        .item-dialog .kv-table tbody tr:nth-child(odd) {
            background-color: #FAFAFA;
        }

        .item-dialog .kv-table tbody tr:nth-child(even) {
            background-color: #FFFFFF;
        }

        .item-dialog .kv-table th,
        .item-dialog .kv-table td {
            display: block;
            width: auto;
            padding: 0;
            font-size: 0.92rem;
            line-height: 1.25;
            background: transparent;
            border: 0;
            white-space: normal;
        }

            .item-dialog .kv-table td:first-child {
                font-size: 0.78rem;
                text-transform: uppercase;
                letter-spacing: 0.03em;
                color: #555;
                font-weight: 600;
                margin-bottom: 2px;
            }

            .item-dialog .kv-table td:last-child {
                font-size: 1rem;
                font-weight: 500;
                color: #111;
            }
}
