/* Fonts via CSS @import (reliable). Icons are linked once from App.razor. */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Syne:wght@600;700;800&display=swap');

/* Replaces Bootstrap reboot bits we still need after dropping bootstrap.min.css. */
*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    --fk-bg: #f4f7fb;
    --fk-surface: #ffffff;
    --fk-ink: #0f172a;
    --fk-muted: #526175;
    --fk-line: #dbe3ee;
    --fk-slate: #132033;
    --fk-ice: #8fd6e8;
    --fk-ice-deep: #2aa8c4;
    /* Text/fill variant of ice-deep that meets WCAG AA (4.5:1) on light surfaces and under white text. */
    --fk-ice-ink: #0e7490;
    --fk-ice-strong: #0e7490;
    --fk-mist: #e8f4f8;
    --fk-accent: #ff7a45;
    --fk-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
    --fk-radius: 1rem;
    --fk-font-display: "Syne", sans-serif;
    --fk-font-body: "Manrope", sans-serif;
    --fk-nav-h: 4.25rem;
    --fk-max: 1200px;
    /* Space reserved when the compare tray is visible (FAB / page padding). */
    --fk-compare-tray-clearance: 0px;
    --fk-filters-fab-gap: 1.1rem;
}

/* Matches single-row tray height; FAB sits just above with a small gap. */
body:has(.fk-compare-tray) {
    --fk-compare-tray-clearance: 5.25rem;
    --fk-filters-fab-gap: 0.55rem;
}

@media (max-width: 640px) {
    body:has(.fk-compare-tray) {
        --fk-compare-tray-clearance: 5.5rem;
        --fk-filters-fab-gap: 0.5rem;
    }
}

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--fk-font-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--fk-bg);
    color: var(--fk-ink);
}

body {
    line-height: 1.5;
    text-rendering: optimizeLegibility;
}

img {
    border-style: none;
    vertical-align: middle;
}

button,
input,
select,
textarea {
    margin: 0;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-weight: 500;
    line-height: 1.2;
}

p {
    margin-top: 0;
    margin-bottom: 1rem;
}

/* Minimal Bootstrap replacements — avoid loading bootstrap.min.css (~230 KiB). */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.spinner-border {
    display: inline-block;
    width: 1.75rem;
    height: 1.75rem;
    vertical-align: text-bottom;
    border: 0.2em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: fk-spinner 0.7s linear infinite;
}

@keyframes fk-spinner {
    to { transform: rotate(360deg); }
}

a, .btn-link {
    color: var(--fk-ice-deep);
    text-decoration: none;
}

a:hover, a:focus, .btn-link:hover, .btn-link:focus {
    text-decoration: none;
}

.fk-nav-link,
.fk-nav-link:link,
.fk-nav-link:visited,
.fk-nav-link:hover,
.fk-nav-link:focus,
.fk-nav-link.active {
    text-decoration: none !important;
    color: var(--fk-muted);
    font-weight: 600;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    transition: background 0.2s ease, color 0.2s ease;
}

.fk-nav-link:hover,
.fk-nav-link.active {
    color: var(--fk-ink);
    background: rgba(143, 214, 232, 0.22);
}

.btn-primary {
    color: #fff;
    background: var(--fk-ice-deep);
    border-color: var(--fk-ice-deep);
}

.btn-primary:hover {
    background: #2396b0;
    border-color: #2396b0;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(42, 168, 196, 0.25);
}

.content {
    padding-top: 0;
}

h1:focus {
    outline: none;
}

.container-fluid {
    max-width: 1400px;
    margin: 0 auto;
}

.fk-shell {
    width: min(100% - 2rem, var(--fk-max));
    margin-inline: auto;
}

.fk-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.85rem 1.35rem;
    border: 1px solid transparent;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    text-decoration: none;
    cursor: pointer;
}

.fk-btn:hover {
    transform: translateY(-1px);
}

.fk-btn-primary {
    background: var(--fk-ice-deep);
    color: #fff;
    box-shadow: 0 12px 28px rgba(42, 168, 196, 0.28);
}

.fk-btn-primary:hover {
    background: #2396b0;
    color: #fff;
}

.fk-btn-ghost {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(8px);
}

.fk-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.28);
    color: #fff;
}

.fk-btn-outline {
    background: transparent;
    color: var(--fk-ink);
    border-color: var(--fk-line);
}

.fk-btn-outline:hover {
    border-color: var(--fk-ice-deep);
    color: var(--fk-ice-deep);
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 1.25rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

#blazor-error-ui {
    color-scheme: light only;
    background: #1a2b33;
    color: #f4f7f8;
    bottom: 0;
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.18);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.75rem 2.5rem 0.85rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-size: 0.95rem;
}

#blazor-error-ui .reload {
    color: #7fd4c8;
    margin-left: 0.5rem;
    font-weight: 600;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.85rem;
    top: 0.55rem;
    color: #c5d0d4;
    text-decoration: none;
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

html.dark-mode,
body.dark-mode,
.dark-mode {
    --fk-bg: #0f141c;
    --fk-surface: #182130;
    --fk-ink: #e8eef7;
    --fk-muted: #9aa8bc;
    --fk-ice-ink: #5cc6dc;
    --fk-line: #2a3648;
    --fk-mist: #1a2433;
    --fk-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
    background: var(--fk-bg);
    color: var(--fk-ink);
}

.dark-mode .page,
.dark-mode main,
.dark-mode .content,
.dark-mode article {
    background: var(--fk-bg);
    color: var(--fk-ink);
}

/* Cookie / analytics consent — compact fixed bottom bar. */
.fk-consent {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1200;
    padding: 0.45rem 0.75rem calc(0.45rem + env(safe-area-inset-bottom, 0px));
    padding-bottom: calc(0.45rem + env(safe-area-inset-bottom, 0px) + var(--fk-compare-tray-clearance, 0px));
    pointer-events: none;
}

.fk-consent-inner {
    pointer-events: auto;
    width: min(100%, var(--fk-max));
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem 0.85rem;
    padding: 0.55rem 0.8rem;
    background: var(--fk-surface);
    color: var(--fk-ink);
    border: 1px solid var(--fk-line);
    border-radius: 0.75rem;
    box-shadow: var(--fk-shadow);
}

.fk-consent-text {
    flex: 1 1 14rem;
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.35;
    color: var(--fk-muted);
}

.fk-consent-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-left: auto;
}

.fk-consent-accept,
.fk-consent-decline {
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.82rem;
    padding: 0.38rem 0.85rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.fk-consent-accept {
    background: var(--fk-ice-strong);
    color: #fff;
    border-color: var(--fk-ice-strong);
}

.fk-consent-accept:hover,
.fk-consent-accept:focus-visible {
    filter: brightness(1.05);
}

.fk-consent-decline {
    background: #fde8e8;
    color: #9b2c2c;
    border-color: #f5c2c2;
}

.fk-consent-decline:hover,
.fk-consent-decline:focus-visible {
    background: #fbd0d0;
    border-color: #ef9a9a;
    color: #7f1d1d;
}

.dark-mode .fk-consent-decline {
    background: color-mix(in srgb, #9b2c2c 28%, var(--fk-surface));
    color: #fecaca;
    border-color: color-mix(in srgb, #f87171 35%, var(--fk-line));
}

/* Image / card skeleton “shadow lines” */
.fk-img {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: color-mix(in srgb, var(--fk-mist) 70%, var(--fk-line));
}

.fk-img img {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    opacity: 0;
    transition: opacity 0.28s ease;
}

.fk-img.is-ready {
    background: transparent;
}

.fk-img.is-ready img {
    opacity: 1;
}

.fk-img-shine {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(
        105deg,
        transparent 0%,
        transparent 38%,
        color-mix(in srgb, #fff 55%, transparent) 50%,
        transparent 62%,
        transparent 100%
    );
    background-size: 220% 100%;
    animation: fk-shine 1.35s ease-in-out infinite;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.fk-img.is-ready .fk-img-shine {
    opacity: 0;
    animation: none;
}

@keyframes fk-shine {
    from { background-position: 100% 0; }
    to { background-position: -100% 0; }
}

.fk-skel-line {
    display: block;
    height: 0.72rem;
    border-radius: 999px;
    background: linear-gradient(
        90deg,
        color-mix(in srgb, var(--fk-line) 80%, var(--fk-mist)) 0%,
        color-mix(in srgb, #fff 70%, var(--fk-line)) 45%,
        color-mix(in srgb, var(--fk-line) 80%, var(--fk-mist)) 100%
    );
    background-size: 220% 100%;
    animation: fk-shine 1.35s ease-in-out infinite;
}

.fk-skel-title {
    width: 78%;
    height: 0.85rem;
}

.fk-skel-price {
    width: 36%;
    margin-top: 0.35rem;
}

.fk-card-skeleton {
    pointer-events: none;
}

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

.fk-card-skeleton .fk-card-image {
    padding: 0;
}

.fk-card-skeleton .fk-img {
    min-height: 100%;
}

.fk-grid-is-refreshing {
    opacity: 0.55;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.fk-results-stage,
.fk-plp-stage {
    position: relative;
}

.fk-slow-loader {
    position: absolute;
    left: 50%;
    top: 1.25rem;
    transform: translateX(-50%);
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 1rem;
    border-radius: 999px;
    background: var(--fk-surface);
    border: 1px solid var(--fk-line);
    box-shadow: var(--fk-shadow);
    color: var(--fk-muted);
    font-size: 0.9rem;
    font-weight: 600;
    pointer-events: none;
}

.fk-slow-loader .spinner-border {
    width: 1.05rem;
    height: 1.05rem;
    border-width: 0.15rem;
}

@media (prefers-reduced-motion: reduce) {
    .fk-img-shine,
    .fk-skel-line {
        animation: none;
    }

    .fk-img img {
        transition: none;
    }
}
