:root {
    --navy: #0a223d;
    --navy-soft: #1d3754;
    --paper: rgba(255, 255, 255, 0.95);
    --paper-strong: #ffffff;
    --line: rgba(10, 34, 61, 0.12);
    --ink: #13263d;
    --muted: #596c82;
    --accent: #1b78b4;
    --accent-soft: #c8e3f3;
    --accent-strong: #2e83b3;
    --chip: #d2ebf8;
    --chip-ink: #1d4f70;
    --shadow: 0 16px 42px rgba(13, 28, 45, 0.14);
}

* {
    box-sizing: border-box;
}

[v-cloak] {
    display: none !important;
}

html,
body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: Arial, "Segoe UI", sans-serif;
    color: var(--ink);
    background: #eef3f8;
}

.page-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(238, 243, 248, 0.78);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.16s ease;
    z-index: 120;
}

.page-loader.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.page-loader-spinner {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 3px solid rgba(10, 34, 61, 0.14);
    border-top-color: var(--accent);
    animation: page-loader-spin 0.7s linear infinite;
}

@keyframes page-loader-spin {
    to {
        transform: rotate(360deg);
    }
}

a {
    color: inherit;
}

.page-bg {
    position: fixed;
    inset: 68px 0 0;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    z-index: -2;
}

.page-wash {
    position: fixed;
    inset: 68px 0 0;
    background: linear-gradient(180deg, rgba(244, 239, 231, 0.9) 0%, rgba(255, 255, 255, 0.78) 45%, rgba(238, 243, 248, 0.92) 100%);
    z-index: -1;
}

.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 40;
    background: var(--navy);
    box-shadow: 0 8px 22px rgba(8, 20, 35, 0.2);
}

.topbar-inner {
    width: min(1480px, calc(100% - 46px));
    margin: 0 auto;
    padding: 12px 0;
    display: flex;
    align-items: flex-end;
    gap: 24px;
}

.search-block {
    flex: 0 1 640px;
    margin-left: auto;
    width: min(640px, 100%);
    color: #fff;
}

.search-label {
    display: block;
    margin: 0 0 8px;
    font-size: 15px;
}

.brand-lockup {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    position: relative;
    top: -10px;
}

.brand-lockup::before {
    content: none;
}

.brand-lockup img {
    width: min(190px, 32vw);
    height: auto;
    object-fit: contain;
    display: block;
    filter: brightness(0) invert(1);
}

.page-shell {
    position: relative;
    width: min(1480px, calc(100% - 46px));
    margin: 0 auto;
    padding: 108px 0 104px;
    flex: 1 0 auto;
    min-height: calc(100vh - 120px);
}

.search-form {
    position: relative;
}

.search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 56px;
    gap: 0;
    align-items: center;
}

.search-input {
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 3px 0 0 3px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: #fff;
    font-size: 14px;
    color: #203248;
    outline: none;
}

.search-input:focus {
    border-color: rgba(255, 255, 255, 0.58);
}

.search-button {
    min-height: 44px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-left: 0;
    border-radius: 0 3px 3px 0;
    background: var(--navy-soft);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.search-results {
    position: absolute;
    left: 0;
    right: 56px;
    top: calc(100% + 6px);
    display: none;
    z-index: 30;
    border: 1px solid rgba(10, 34, 61, 0.18);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.99);
    box-shadow: 0 16px 34px rgba(12, 27, 44, 0.2);
    overflow: hidden;
}

.search-results.is-open {
    display: block;
}

.result-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 14px 16px;
    text-decoration: none;
    border-top: 1px solid rgba(216, 224, 231, 0.65);
    color: #13263d;
}

.result-item:first-child {
    border-top: 0;
}

.result-item:hover {
    background: #eaf2fb;
    color: #13263d;
}

.result-item:hover .result-title {
    color: #111827;
}

.result-item:hover .result-meta {
    color: #4b5f76;
}

.result-title {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
}

.result-meta {
    margin-top: 3px;
    color: var(--muted);
    font-size: 13px;
}

.result-pill,
.info-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: #edf2f7;
    color: #18314f;
}

.result-state {
    padding: 16px;
    color: var(--muted);
    font-size: 14px;
}

.selector-wrap {
    position: relative;
    min-width: 148px;
    top: -10px;
}

.selector-current {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: #fff;
    cursor: pointer;
    font-size: 13px;
}

.selector-current-main,
.selector-option-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.selector-current img,
.selector-option img {
    width: 20px;
    height: 14px;
    border-radius: 2px;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(16, 24, 40, 0.08);
}

.selector-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 50;
    border: 1px solid rgba(10, 34, 61, 0.18);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 40px rgba(18, 30, 41, 0.14);
    overflow: hidden;
}

.selector-dropdown.is-open {
    display: block;
}

.selector-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    text-decoration: none;
    border-top: 1px solid rgba(216, 224, 231, 0.65);
    font-size: 14px;
    color: var(--ink);
}

.selector-option:first-child {
    border-top: 0;
}

.selector-option:hover {
    background: #f7fafc;
}

.selector-check {
    color: #0f766e;
    font-weight: 800;
}

.content-stack {
    margin-top: 22px;
}

.message-card,
.detail-card,
.intro-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.intro-card,
.message-card,
.detail-card {
    padding: 18px 20px;
}

.intro-title,
.message-card h2 {
    margin: 0 0 10px;
    font-size: 32px;
    line-height: 1.05;
}

.intro-copy,
.message-card p {
    margin: 0;
    max-width: 840px;
    color: var(--muted);
    line-height: 1.6;
}

.detail-card {
    padding: 18px 20px 22px;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 18px;
}

.detail-header-copy {
    min-width: 0;
}

.detail-title {
    margin: 0;
    font-size: clamp(22px, 2.2vw, 34px);
    line-height: 0.98;
}

.detail-grid {
    display: grid;
    grid-template-columns: minmax(240px, 360px) minmax(300px, 1fr) minmax(280px, 340px);
    gap: 24px;
    align-items: start;
}

.image-panel,
.spec-panel,
.qr-panel {
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
}

.image-panel {
    position: relative;
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 249, 252, 0.95));
}

.image-zoom-trigger {
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-in;
}

.image-zoom-trigger.is-loading {
    visibility: hidden;
}

.image-loading-state {
    position: absolute;
    inset: 16px;
    display: grid;
    place-items: center;
    pointer-events: none;
}

.image-spinner {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 3px solid rgba(27, 120, 180, 0.16);
    border-top-color: var(--accent-strong);
    animation: image-spinner-rotate 0.8s linear infinite;
}

.image-panel img {
    width: 100%;
    max-height: 390px;
    object-fit: contain;
}

@keyframes image-spinner-rotate {
    to {
        transform: rotate(360deg);
    }
}

.product-image-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.product-image-empty img {
    width: min(180px, 80%);
    max-height: 180px;
    margin-bottom: 16px;
    opacity: 0.74;
}

.image-modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(8, 20, 35, 0.78);
    backdrop-filter: blur(4px);
}

.image-modal-dialog {
    position: relative;
    width: min(1120px, 100%);
    max-height: calc(100vh - 48px);
    padding: 26px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 48px rgba(6, 16, 29, 0.32);
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal-dialog img {
    width: auto;
    max-width: 100%;
    max-height: calc(100vh - 120px);
    object-fit: contain;
}

.image-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 999px;
    background: rgba(10, 34, 61, 0.1);
    color: var(--navy);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.image-modal-close:hover {
    background: rgba(10, 34, 61, 0.16);
}

.spec-panel-title {
    margin: 0 0 14px;
    font-size: 22px;
    font-weight: 500;
}

.spec-grid {
    display: grid;
    gap: 8px;
}

.spec-row {
    display: grid;
    grid-template-columns: minmax(150px, 180px) minmax(0, 1fr);
    column-gap: 18px;
    align-items: stretch;
}

.spec-row:nth-child(even) .spec-key,
.spec-row:nth-child(even) .spec-value {
    background: rgba(15, 42, 74, 0.04);
}

.spec-key {
    padding: 11px 10px;
    border-radius: 2px;
    color: #526981;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.spec-value {
    padding: 11px 10px;
    border-radius: 2px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

.spec-value-with-copy {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.spec-value-with-copy span {
    min-width: 0;
}

.spec-link {
    color: #1264d1;
    font-weight: 600;
    text-decoration: none;
}

.spec-link:hover {
    text-decoration: underline;
}

.size-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.size-chip {
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 999px;
    background: var(--chip);
    color: var(--chip-ink);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.size-chip:hover {
    background: #abd5ee;
    color: #163d56;
}

.size-chip.is-active {
    background: var(--accent-strong);
    color: #fff;
    border-color: var(--accent-strong);
}

.qr-shell {
    position: relative;
    display: grid;
    place-items: center;
    padding: 20px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid rgba(10, 34, 61, 0.1);
    min-height: 292px;
}

.qr-shell canvas,
.qr-shell img {
    max-width: 100%;
    height: auto;
}

.qr-code-actions {
    margin-top: 12px;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: nowrap;
}

.qr-code-actions .ghost-button,
.qr-code-actions .solid-button {
    width: auto;
    flex: 0 0 auto;
    gap: 8px;
}

.qr-code-actions button svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.qr-copy-button {
    width: 22px;
    min-width: 22px;
    height: 22px;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--accent-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: none;
}

.qr-copy-button svg {
    width: 18px;
    height: 18px;
}

.qr-copy-button:hover {
    color: #256f98;
}

.spec-copy-button {
    flex: 0 0 auto;
}

.ghost-button,
.solid-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.ghost-button {
    border: 1px solid rgba(10, 34, 61, 0.18);
    background: #fff;
    color: var(--navy);
}

.solid-button {
    border: 0;
    background: var(--accent-strong);
    color: #fff;
}

.barcode-panel {
    margin-top: 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow);
    padding: 18px 20px 22px;
}

.barcode-panel-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.barcode-intro {
    margin: 0;
    max-width: 720px;
    color: var(--muted);
    line-height: 1.5;
}

.barcode-gtin-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #1f2937;
    font-size: 13px;
    font-weight: 700;
}

.barcode-toolbar {
    margin-top: 18px;
    display: flex;
    gap: 14px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.barcode-field {
    display: grid;
    gap: 6px;
    min-width: 150px;
    font-size: 12px;
    font-weight: 700;
    color: #526981;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.barcode-field input {
    min-height: 42px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid rgba(10, 34, 61, 0.14);
    background: #fff;
    color: var(--ink);
    font-size: 16px;
}

.barcode-check {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 8px;
    border: 1px solid rgba(10, 34, 61, 0.12);
    background: #fff;
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
}

.barcode-check input {
    width: 16px;
    height: 16px;
}

.barcode-generate-button {
    min-width: 210px;
}

.barcode-error {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 14px;
    font-weight: 700;
}

.barcode-output-grid {
    margin-top: 18px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.barcode-output-card {
    border: 1px solid rgba(10, 34, 61, 0.12);
    border-radius: 8px;
    background: #fff;
    padding: 12px 14px 14px;
}

.barcode-output-card--wide {
    grid-column: 1 / -1;
}

.barcode-output-head h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: #111827;
}

.barcode-preview-row {
    margin-top: 12px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.barcode-preview-row--pallet {
    align-items: center;
}

.barcode-canvas-shell {
    display: grid;
    place-items: center;
    min-height: 0;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid rgba(10, 34, 61, 0.1);
    background: #fff;
    overflow: auto;
}

.barcode-canvas-shell--package {
    padding: 10px;
}

.barcode-canvas-shell--pallet {
    padding: 0;
}

.barcode-canvas-shell canvas {
    max-width: 100%;
    height: auto;
}

.barcode-preview-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding-top: 38px;
}

.barcode-preview-row--pallet .barcode-preview-actions {
    padding-top: 0;
}

.barcode-icon-button {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: #111827;
    cursor: pointer;
}

.barcode-icon-button.is-primary {
    color: #1783ff;
}

.barcode-icon-button svg {
    width: 20px;
    height: 20px;
}

.footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 35;
    min-height: 80px;
    padding: 0 18px;
    background: var(--navy);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
    box-shadow: 0 -8px 24px rgba(8, 20, 35, 0.16);
}

@media (max-width: 1160px) {
    .topbar-inner {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .brand-lockup {
        order: 1;
    }

    .selector-wrap {
        order: 2;
    }

    .search-block {
        order: 3;
        margin-left: 0;
        width: 100%;
    }

    .page-shell {
        padding-top: 138px;
        padding-bottom: 122px;
        min-height: calc(100vh - 148px);
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .page-shell {
        width: min(100%, calc(100% - 18px));
        padding-top: 142px;
        padding-bottom: 128px;
        min-height: calc(100vh - 152px);
    }

    .topbar-inner {
        width: min(100%, calc(100% - 18px));
    }

    .selector-dropdown {
        position: fixed;
        left: 10px;
        right: 10px;
        top: auto;
        bottom: 10px;
        min-width: 0;
        max-height: 70vh;
        overflow: auto;
        border-radius: 18px;
    }

    .search-button,
    .selector-current {
        width: auto;
    }

    .topbar-inner {
        gap: 12px;
    }

    .detail-header {
        flex-direction: column;
    }

    .detail-summary {
        text-align: left;
        min-width: 0;
    }

    .barcode-panel-head {
        flex-direction: column;
    }

    .spec-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .brand-lockup img {
        width: min(140px, 34vw);
    }

    .qr-code-actions {
        flex-direction: row;
        justify-content: center;
    }

    .ghost-button,
    .solid-button {
        width: 100%;
    }

    .qr-code-actions .ghost-button,
    .qr-code-actions .solid-button {
        width: auto;
    }

    .barcode-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .barcode-preview-row {
        flex-direction: column;
        align-items: stretch;
    }

    .barcode-preview-actions {
        padding-top: 0;
    }

    .image-modal {
        padding: 12px;
    }

    .image-modal-dialog {
        max-height: calc(100vh - 24px);
        padding: 18px;
    }

    .image-modal-dialog img {
        max-height: calc(100vh - 72px);
    }

    .barcode-field,
    .barcode-check,
    .barcode-generate-button {
        width: 100%;
    }
}