:root {
    --navy: #071b43;
    --navy-2: #0d2859;
    --gold: #c7953f;
    --gold-soft: #f5ead6;
    --ink: #101828;
    --muted: #667085;
    --line: #e4e7ec;
    --surface: #ffffff;
    --canvas: #f7f8fa;
    --success: #168447;
    --warning: #b87506;
    --danger: #b42318;
    --shadow: 0 18px 50px rgba(7, 27, 67, .08);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--canvas);
    font-synthesis: none;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--canvas);
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at top right, rgba(199, 149, 63, .08), transparent 32rem),
        var(--canvas);
    color: var(--ink);
}

button,
input,
select {
    font: inherit;
}

input[type="search"]::-webkit-search-cancel-button {
    display: none;
    appearance: none;
}

button,
select {
    cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid rgba(199, 149, 63, .35);
    outline-offset: 2px;
}

[hidden] {
    display: none !important;
}

.app-shell {
    width: min(100%, 1180px);
    min-height: 100vh;
    margin: 0 auto;
    background: rgba(255, 255, 255, .84);
    box-shadow: 0 0 0 1px rgba(7, 27, 67, .04), var(--shadow);
}

.topbar {
    position: sticky;
    z-index: 30;
    top: 0;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    min-height: 108px;
    padding: 18px clamp(24px, 4vw, 58px);
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(16px);
}

.brand {
    grid-column: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: auto;
    padding: 0;
    border: 0;
    background: transparent;
}

.brand-icon {
    display: block;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: contain;
}

.brand-wordmark {
    color: #121820;
    font-size: clamp(1.3rem, 3vw, 2rem);
    font-weight: 650;
    letter-spacing: -.055em;
    white-space: nowrap;
}

.brand-wordmark span {
    font-weight: 780;
}

.mode-switch {
    grid-column: 3;
    justify-self: end;
    display: inline-flex;
    gap: 6px;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f9fafb;
}

.mode-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    border: 0;
    border-radius: 10px;
    color: var(--muted);
    background: transparent;
    font-size: .86rem;
    font-weight: 700;
}

.mode-button.is-active {
    color: white;
    background: var(--navy);
    box-shadow: 0 8px 18px rgba(7, 27, 67, .18);
}

.mode-icon {
    font-size: 1.2rem;
    line-height: 1;
}

main {
    min-height: calc(100vh - 108px);
}

.view {
    display: none;
    padding: clamp(26px, 4vw, 54px);
}

.view.is-active {
    display: block;
}

.search-panel {
    margin-bottom: 30px;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 18px;
    color: var(--navy);
    font-size: clamp(1.55rem, 3vw, 2.25rem);
    line-height: 1.15;
    letter-spacing: -.035em;
}

.search-form {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    min-height: 76px;
    border: 1.5px solid #cfd4dc;
    border-radius: 18px;
    background: white;
    box-shadow: 0 10px 30px rgba(7, 27, 67, .05);
    transition: border-color .2s ease, box-shadow .2s ease;
}

.search-form:focus-within {
    border-color: var(--gold);
    box-shadow: 0 0 0 4px rgba(199, 149, 63, .12), 0 10px 30px rgba(7, 27, 67, .06);
}

.search-icon {
    width: 24px;
    height: 24px;
    margin-left: 24px;
    border: 2px solid var(--navy);
    border-radius: 50%;
}

.search-icon::after {
    content: "";
    position: absolute;
    width: 10px;
    height: 2px;
    margin: 19px 0 0 -1px;
    transform: rotate(45deg);
    transform-origin: left center;
    border-radius: 2px;
    background: var(--navy);
}

.search-form input {
    min-width: 0;
    height: 72px;
    padding: 0 18px;
    border: 0;
    outline: 0;
    color: var(--navy);
    background: transparent;
    font-size: clamp(1.05rem, 2.3vw, 1.45rem);
    font-weight: 650;
}

.search-form input::placeholder {
    color: #98a2b3;
    font-weight: 450;
}

.clear-search {
    width: 40px;
    height: 40px;
    margin-right: 10px;
    padding: 0 0 3px;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--muted);
    background: white;
    font-size: 1.6rem;
    line-height: 1;
}

.search-submit {
    align-self: stretch;
    min-width: 118px;
    margin: 7px;
    padding: 0 24px;
    border: 0;
    border-radius: 12px;
    color: white;
    background: var(--navy);
    font-weight: 750;
}

.search-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 4px 0;
}

.search-summary {
    margin: 0;
    color: var(--muted);
    font-size: .96rem;
}

.search-summary strong {
    color: var(--navy);
}

.filter-row {
    display: flex;
    gap: 8px;
}

.filter-chip {
    min-width: 74px;
    min-height: 40px;
    padding: 0 17px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: white;
    font-size: .86rem;
    font-weight: 700;
}

.filter-chip.is-active {
    border-color: var(--navy);
    color: white;
    background: var(--navy);
}

.product-results {
    display: grid;
    gap: 12px;
}

.product-row {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr) auto;
    align-items: center;
    gap: 22px;
    width: 100%;
    min-height: 154px;
    padding: 10px 24px 10px 10px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
    color: inherit;
    text-align: left;
    background: white;
    box-shadow: 0 5px 18px rgba(7, 27, 67, .035);
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.product-row:hover,
.product-row:focus-visible {
    transform: translateY(-1px);
    border-color: var(--gold);
    box-shadow: 0 12px 26px rgba(7, 27, 67, .08);
}

.product-thumb {
    width: 132px;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 11px;
    background: #f7f4ef;
}

.product-thumb img,
.detail-main-image img,
.gallery-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-main {
    min-width: 0;
}

.product-main h2 {
    margin: 0 0 7px;
    overflow: hidden;
    color: var(--navy);
    font-size: clamp(1rem, 2.1vw, 1.32rem);
    font-weight: 700;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-category {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: .86rem;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 7px;
    color: white;
    background: var(--navy);
    font-size: .8rem;
    font-weight: 750;
    letter-spacing: .035em;
}

.product-side {
    min-width: 145px;
    text-align: right;
}

.product-price {
    display: block;
    margin-bottom: 12px;
    color: var(--navy);
    font-size: clamp(1.25rem, 2.8vw, 1.72rem);
    font-weight: 800;
    letter-spacing: -.025em;
}

.stock-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--success);
    font-size: .82rem;
    font-weight: 700;
}

.stock-label::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.stock-label.is-out {
    color: var(--warning);
}

.empty-state,
.loading-state {
    display: grid;
    place-items: center;
    min-height: 390px;
    padding: 60px 20px;
    text-align: center;
}

.empty-state h2,
.loading-state h2 {
    margin-bottom: 8px;
    color: var(--navy);
}

.empty-state p,
.loading-state p {
    max-width: 560px;
    margin-bottom: 0;
    color: var(--muted);
    line-height: 1.65;
}

.empty-mark {
    display: grid;
    place-items: center;
    width: 78px;
    height: 78px;
    margin-bottom: 20px;
    border: 1px solid var(--gold);
    border-radius: 50%;
    color: var(--gold);
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: .1em;
}

.spinner {
    width: 42px;
    height: 42px;
    margin-bottom: 16px;
    border: 3px solid var(--gold-soft);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.detail-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.back-button,
.quiet-button {
    min-height: 44px;
    padding: 0 17px;
    border: 1px solid var(--line);
    border-radius: 11px;
    color: var(--navy);
    background: white;
    font-weight: 700;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
    gap: clamp(28px, 4vw, 50px);
    align-items: start;
}

.detail-main-image {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #f8f6f2;
}

.gallery-strip {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 9px;
    margin-top: 10px;
}

.gallery-thumb {
    aspect-ratio: 1;
    overflow: hidden;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: white;
}

.gallery-thumb.is-active {
    border: 2px solid var(--gold);
}

.eyebrow {
    margin-bottom: 8px;
    color: var(--gold);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.detail-info h1 {
    margin-bottom: 14px;
}

.detail-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.detail-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.detail-price {
    color: var(--navy);
    font-size: clamp(1.9rem, 4.5vw, 3rem);
    font-weight: 850;
    letter-spacing: -.045em;
}

.fact-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    margin: 22px 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--line);
}

.fact {
    min-height: 86px;
    padding: 16px;
    background: white;
}

.fact span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.fact strong {
    color: var(--navy);
    font-size: .94rem;
}

.price-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: white;
    box-shadow: 0 10px 28px rgba(7, 27, 67, .04);
}

.price-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 20px 22px;
    border-bottom: 1px solid var(--line);
}

.price-card-header h2 {
    margin: 0;
    color: var(--navy);
    font-size: 1.2rem;
}

.price-option-button {
    min-height: 36px;
    padding: 0 13px;
    border: 1px solid #d7dce3;
    border-radius: 9px;
    color: var(--muted);
    background: white;
    font-size: .76rem;
    font-weight: 700;
}

.price-list {
    padding: 4px 22px 18px;
}

.price-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 20px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: .91rem;
}

.price-line:last-child {
    border-bottom: 0;
}

.price-line strong {
    color: var(--navy);
    font-weight: 750;
}

.price-line.is-total {
    align-items: center;
    margin-top: 4px;
    padding: 18px 0 4px;
    color: var(--navy);
    font-size: 1rem;
    font-weight: 800;
}

.price-line.is-total strong {
    color: var(--gold);
    font-size: 1.32rem;
}

.price-note {
    margin: 0;
    padding: 14px 22px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    background: #fafafa;
    font-size: .74rem;
    line-height: 1.55;
}

.calculator-heading {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.calculator-heading h1 {
    margin-bottom: 8px;
}

.calculator-heading p:last-child {
    margin: 0;
    color: var(--muted);
}

.rate-date {
    align-self: flex-start;
    padding: 10px 14px;
    border-radius: 999px;
    color: var(--success);
    background: #eaf7ef;
    font-size: .78rem;
    font-weight: 750;
}

.calculator-layout {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    gap: 24px;
    align-items: start;
}

.calculator-card {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: white;
}

.field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.field {
    display: grid;
    gap: 8px;
}

.field span {
    color: var(--navy);
    font-size: .78rem;
    font-weight: 750;
}

.field input,
.field select {
    width: 100%;
    min-height: 52px;
    padding: 0 14px;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    color: var(--ink);
    background: white;
}

.calculator-actions {
    display: flex;
    gap: 10px;
    margin-top: 22px;
}

.primary-button,
.secondary-button {
    min-height: 50px;
    padding: 0 22px;
    border-radius: 11px;
    font-weight: 800;
}

.primary-button {
    border: 1px solid var(--navy);
    color: white;
    background: var(--navy);
}

.secondary-button {
    border: 1px solid var(--line);
    color: var(--navy);
    background: white;
}

.full-button {
    width: 100%;
    margin-top: 16px;
}

.calculator-result {
    min-height: 410px;
}

.result-placeholder {
    display: grid;
    place-items: center;
    min-height: 410px;
    padding: 50px 20px;
    color: var(--muted);
    text-align: center;
}

.result-placeholder h2 {
    margin: 12px 0 8px;
    color: var(--navy);
}

.result-placeholder p {
    margin: 0;
}

.result-symbol {
    display: grid;
    place-items: center;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    color: var(--gold);
    background: var(--gold-soft);
    font-size: 2rem;
}

.modal {
    position: fixed;
    z-index: 100;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(7, 27, 67, .56);
    backdrop-filter: blur(5px);
}

.modal-card {
    position: relative;
    z-index: 1;
    width: min(100%, 430px);
    padding: 30px;
    border-radius: 18px;
    background: white;
    box-shadow: 0 30px 90px rgba(7, 27, 67, .28);
}

.modal-card h2 {
    margin-bottom: 10px;
    color: var(--navy);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 38px;
    height: 38px;
    padding: 0 0 3px;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--muted);
    background: white;
    font-size: 1.45rem;
}

.modal-copy {
    margin-bottom: 20px;
    color: var(--muted);
    line-height: 1.55;
}

.form-message {
    min-height: 20px;
    margin: 14px 0 0;
    color: var(--danger);
    font-size: .84rem;
}

.form-message.is-success {
    color: var(--success);
}

@media (max-width: 860px) {
    .topbar {
        grid-template-columns: 1fr auto;
        min-height: 92px;
    }

    .brand {
        grid-column: 1;
        justify-self: start;
    }

    .mode-switch {
        grid-column: 2;
    }

    .detail-layout,
    .calculator-layout {
        grid-template-columns: 1fr;
    }

    .detail-gallery {
        max-width: 620px;
        margin: 0 auto;
    }
}

@media (max-width: 640px) {
    .topbar {
        position: relative;
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 16px 18px;
    }

    .brand,
    .mode-switch {
        grid-column: 1;
        justify-self: center;
    }

    .brand {
        justify-self: center;
    }

    .brand-icon {
        width: 38px;
        height: 38px;
    }

    .view {
        padding: 24px 16px 40px;
    }

    .search-form {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .search-submit {
        grid-column: 1 / -1;
        min-height: 48px;
        margin: 0 7px 7px;
    }

    .search-tools,
    .calculator-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .product-row {
        grid-template-columns: 92px minmax(0, 1fr);
        gap: 13px;
        padding: 9px 12px 9px 9px;
    }

    .product-thumb {
        width: 92px;
    }

    .product-side {
        grid-column: 2;
        min-width: 0;
        margin-top: -3px;
        text-align: left;
    }

    .product-price {
        display: inline-block;
        margin: 0 12px 0 0;
        font-size: 1.05rem;
    }

    .product-main h2 {
        white-space: normal;
    }

    .fact-grid,
    .field-grid {
        grid-template-columns: 1fr;
    }

    .detail-price-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .gallery-strip {
        grid-template-columns: repeat(4, 1fr);
    }
}
