/* ===== Plus Jakarta Sans ===== */
@font-face {
    font-family: 'Plus Jakarta Sans';
    src: url('/fonts/PlusJakartaSans-Regular.woff2') format('woff2'),
        url('/fonts/PlusJakartaSans-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Plus Jakarta Sans';
    src: url('/fonts/PlusJakartaSans-Italic.woff2') format('woff2'),
        url('/fonts/PlusJakartaSans-Italic.woff') format('woff');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

/* ===== JetBrains Mono ===== */
@font-face {
    font-family: 'JetBrains Mono';
    src: url('/fonts/JetBrainsMono-Regular.woff2') format('woff2'),
        url('/fonts/JetBrainsMono-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'JetBrains Mono';
    src: url('/fonts/JetBrainsMono-Italic.woff2') format('woff2'),
        url('/fonts/JetBrainsMono-Italic.woff') format('woff');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}
#fhc-root {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-primary);
    padding-bottom: 88px;
}

/* ── Filtry ───────────────────────────────────────────────── */

.fhc-filters {
    background: #fcfcfc;
    border: 1px solid #eae9e9;
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 24px;
}

.fhc-filters-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.fhc-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--neutral-600);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.fhc-input,
.fhc-select {
    width: 100%;
    padding: 8px 12px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 13px;
    background: var(--white);
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--transition-base);
}

.fhc-input::placeholder { color: var(--text-light-dark); }

.fhc-input:focus,
.fhc-select:focus {
    border-color: var(--primary-brand);
    box-shadow: 0 0 0 3px rgba(51, 153, 255, 0.1);
}

/* ── Blokada kategorii ───────────────────────────────────── */

.fhc-lock-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 13px;
    color: #1d4ed8;
}

.fhc-lock-notice.fhc-hidden { display: none; }

.fhc-clear-link {
    color: var(--primary-brand);
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    white-space: nowrap;
    background: none;
    border: none;
    font-size: 13px;
    font-family: var(--font-body);
}

.fhc-clear-link:hover { color: #1a7de6; }

/* ── Skeleton loader ──────────────────────────────────────── */

@keyframes fhc-shimmer {
    0%   { background-position: -800px 0; }
    100% { background-position:  800px 0; }
}

.fhc-skel {
    display: block;
    background: linear-gradient(
        90deg,
        #ece8e1 25%,
        #e0dbd2 50%,
        #ece8e1 75%
    );
    background-size: 1600px 100%;
    animation: fhc-shimmer 1.6s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

/* — Skeleton karty produktu — */

.fhc-card-skeleton {
    pointer-events: none;
    user-select: none;
    cursor: default;
}

.fhc-card-skeleton .fhc-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.fhc-skel-name {
    height: 18px;
    flex: 1;
    max-width: 60%;
}

.fhc-skel-badge {
    height: 18px;
    width: 68px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.fhc-skel-img-inner {
    flex: 1;
    align-self: stretch;
    border-radius: var(--radius-sm);
    min-height: 0;
}

.fhc-skel-price {
    height: 26px;
    width: 108px;
    border-radius: 7px;
}

.fhc-skel-btn {
    height: 42px;
    width: 100%;
    border-radius: var(--radius-md);
    margin-top: 12px;
}

/* — Skeleton tabeli porównawczej — */

.fhc-table-skeleton {
    width: 100%;
}

.fhc-tskel-head {
    display: grid;
    background: #faf9f7;
    border-bottom: 2px solid var(--warm-border);
    position: sticky;
    top: 0;
    z-index: 2;
}

.fhc-tskel-head-cell {
    padding: 16px 18px;
    display: flex;
    align-items: center;
}

.fhc-tskel-head-product {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 18px 14px;
}

.fhc-tskel-thumb {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.fhc-tskel-pname {
    height: 12px;
    width: 72%;
    border-radius: 4px;
}

.fhc-tskel-pname-2 {
    height: 11px;
    width: 50%;
    border-radius: 4px;
    opacity: 0.6;
}

.fhc-tskel-row {
    display: grid;
    border-bottom: 1px solid var(--warm-border);
}

.fhc-tskel-row:last-child {
    border-bottom: none;
}

.fhc-tskel-row-cell {
    padding: 14px 18px;
    display: flex;
    align-items: center;
}

.fhc-tskel-row-data {
    justify-content: center;
}

/* ── Grid — lista kart (jak product-list) ────────────────── */

.fhc-grid {
    display: grid;
        gap: 16px;
        grid-template-columns: 1fr 1fr 1fr 1fr;
}

/* ── Karta produktu (styl product-card) ──────────────────── */

.fhc-card {
    background: #fcfcfc;
    border: 1px solid #eae9e9;
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: box-shadow var(--transition-base), border-color var(--transition-base);
}

.fhc-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--warm-border);
}

.fhc-card.fhc-selected {
    border-color: var(--primary-brand);
    box-shadow: 0 0 0 2px var(--primary-brand);
}

.fhc-card.fhc-disabled {
    opacity: 0.35;
    pointer-events: none;
}

/* Header — nazwa produktu */
.fhc-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: #fcfcfc;
    border-bottom: 1px solid #eae9e9;
    flex-wrap: wrap;
    gap: 8px;
}

.fhc-card-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--neutral-800);
    line-height: 1.3;
}

.fhc-card-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 6px;
    letter-spacing: 0.3px;
    white-space: nowrap;
    background: #eff6ff;
    color: #2563eb;
}

/* Body — grid: obrazek | placeholder prawa kolumna */
.fhc-card-body {
        display: flex;
            flex-direction: column;
}

/* Lewa kolumna — obrazek + buy */
.fhc-card-image-col {
    padding: 24px;
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    background: var(--white);
}

.fhc-card-image-wrap {
    width: 100%;
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.fhc-card-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.fhc-card:hover .fhc-card-image-wrap img {
    transform: scale(1.04);
}

/* Buy section */
.fhc-card-buy {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 4px;
    border-top: 1px solid var(--gray-200);
}

.fhc-card-price-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.fhc-card-price {
    font-family: var(--font-mono, var(--font-display));
    font-size: 22px;
    font-weight: 700;
    color: var(--neutral-800);
    line-height: 1;
}

.fhc-card-category {
    font-size: 11px;
    font-weight: 600;
    color: var(--neutral-600);
    letter-spacing: 0.3px;
}

/* Checkbox compare — stylizowany jak btn-buy */
.fhc-card-compare {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.fhc-card-compare input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.fhc-card-compare-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    color: var(--primary-brand);
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--primary-brand);
    background: transparent;
    transition: background var(--transition-base), color var(--transition-base);
    text-align: center;
}

.fhc-card-compare-btn svg {
    flex-shrink: 0;
}

.fhc-card-compare:hover .fhc-card-compare-btn {
    background: var(--primary-brand);
    color: var(--white);
}

.fhc-card.fhc-selected .fhc-card-compare-btn {
    background: var(--primary-brand);
    color: var(--white);
    border-color: var(--primary-brand);
}

/* ── Brak wyników ────────────────────────────────────────── */

.fhc-no-results { display: none; text-align: center; padding: 80px 0; }
.fhc-no-results.fhc-visible { display: block; }
.fhc-no-results svg { width: 44px; height: 44px; margin: 0 auto; color: var(--gray-300); }
.fhc-no-results p { margin-top: 14px; font-weight: 600; color: var(--neutral-700); font-size: 14px; }
.fhc-no-results small { display: block; color: var(--text-light-dark); font-size: 13px; margin-top: 4px; }

/* ── Paginacja ───────────────────────────────────────────── */

.fhc-pagination { margin-top: 24px; }

.fhc-pagination-btns {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
}

.fhc-page-btn {
    min-width: 36px; height: 36px;
    padding: 0 10px;
    font-size: 13px; font-weight: 500;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: var(--white);
    cursor: pointer;
    color: var(--neutral-700);
    font-family: var(--font-body);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-base), border-color var(--transition-base);
}

.fhc-page-btn:hover:not(:disabled):not(.fhc-page-active) {
    background: var(--warm-bg);
    border-color: var(--gray-300);
}

.fhc-page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.fhc-page-btn.fhc-page-active {
    background: var(--primary-brand);
    color: #fff;
    border-color: var(--primary-brand);
    font-weight: 600;
}

.fhc-page-dots {
    padding: 0 4px;
    color: var(--text-light-dark);
}

.fhc-pagination-info {
    text-align: center;
    font-size: 12px;
    color: var(--text-light-dark);
    margin-top: 8px;
}

/* ── Modal overlay ────────────────────────────────────────── */

.fhc-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(26, 23, 20, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.fhc-modal-overlay.fhc-visible {
    display: flex;
    animation: fhc-overlayIn 0.25s ease;
}

@keyframes fhc-overlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Modal panel */
.fhc-modal {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: 0 32px 96px rgba(0, 0, 0, 0.18), 0 8px 28px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 1140px;
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-top: 3px solid var(--primary-brand);
    animation: fhc-modalIn 0.35s cubic-bezier(0.23, 1, 0.32, 1);
}

@keyframes fhc-modalIn {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Modal header */
.fhc-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 32px;
    border-bottom: 1px solid var(--warm-border);
    flex-shrink: 0;
}

.fhc-modal-title-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.fhc-comparison-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.4px;
    line-height: 1.2;
}

.fhc-modal-subtitle {
    font-size: 12px;
    color: var(--text-light-dark);
    font-weight: 400;
    letter-spacing: 0.1px;
}

.fhc-modal-close {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--warm-border);
    background: #ffffff;
    cursor: pointer;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: background var(--transition-base), border-color var(--transition-base), color var(--transition-base), transform var(--transition-base);
}

.fhc-modal-close:hover {
    background: #ffffff;
    border-color: var(--neutral-700);
    color: var(--text-primary);
    transform: rotate(90deg);
}

/* Table container inside modal — scrollable */
.fhc-table-container {
    overflow: auto;
    flex: 1;
    min-height: 0;
}

/* ── Tabela porównawcza ──────────────────────────────────── */

.fhc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.fhc-table th,
.fhc-table td {
    border-bottom: 1px solid var(--warm-border);
    border-right: 1px solid var(--warm-border);
    padding: 13px 18px;
    vertical-align: middle;
}

.fhc-table th:last-child,
.fhc-table td:last-child {
    border-right: none;
}

.fhc-table thead th {
    background: #faf9f7;
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--neutral-700);
    font-size: 12px;
    position: sticky;
    top: 0;
    z-index: 2;
    box-shadow: 0 1px 0 var(--warm-border);
}

.fhc-table thead th:first-child {
    text-align: left;
    min-width: 150px;
    position: sticky;
    left: 0;
    z-index: 3;
    background: #faf9f7;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light-dark);
}

.fhc-table thead th:not(:first-child) {
    text-align: center;
    min-width: 210px;
    padding: 0;
}

.fhc-table tbody tr {
    transition: background 0.12s ease;
}

.fhc-table tbody tr:last-child td {
    border-bottom: none;
}

.fhc-table tbody tr:hover {
    background: rgba(240, 237, 230, 0.45);
}

.fhc-table tbody td:first-child {
    background: #faf9f7;
    font-weight: 600;
    font-size: 12px;
    color: var(--neutral-700);
    position: sticky;
    left: 0;
    z-index: 1;
    border-right: 2px solid var(--warm-border);
    min-width: 200px;
    width: 200px;
}

.fhc-table tbody td:not(:first-child) {
    text-align: center;
    color: var(--text-primary);
    line-height: 1.5;
    max-width: 300px;
}

.fhc-table-section-row td {
    background: rgba(51, 153, 255, 0.04) !important;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 10px;
    color: var(--primary-brand);
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 10px 18px;
    border-bottom: 1px solid rgba(51, 153, 255, 0.18);
    border-top: 1px solid rgba(51, 153, 255, 0.1);
}

.fhc-row-diff td:not(:first-child) {
    background: rgb(248 249 255) !important;
}

.fhc-row-diff td:first-child {
        background: rgb(248 249 255) !important;
}


/* Product thumb in table header */
.fhc-product-thumb {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px 12px 12px;
}

.fhc-product-thumb img {
    width: 88px;
    height: 88px;
    object-fit: contain;
    border-radius: var(--radius-md);
    background: #ffffff;
    border: 1px solid var(--warm-border);
    padding: 8px;
    box-shadow: var(--shadow-sm);
}

.fhc-product-thumb-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    text-align: center;
    line-height: 1.4;
    max-width: 180px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.fhc-remove-from-table {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 500;
    color: #b91c1c;
    cursor: pointer;
    background: rgba(220, 38, 38, 0.07);
    border: 1px solid rgba(220, 38, 38, 0.18);
    border-radius: var(--radius-full);
    font-family: var(--font-body);
    padding: 4px 12px;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.fhc-remove-from-table::before {
    content: '×';
    font-size: 14px;
    line-height: 1;
    font-weight: 400;
}

.fhc-remove-from-table:hover {
    background: rgba(220, 38, 38, 0.14);
    border-color: rgba(220, 38, 38, 0.35);
    color: #991b1b;
}

.fhc-error-msg {
    text-align: center;
    padding: 80px 24px;
    color: #dc2626;
    font-size: 14px;
    line-height: 1.6;
}

/* ── Sticky bar ──────────────────────────────────────────── */

#fhc-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--gray-200);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
    z-index: 9999;
    transform: translateY(100%);
    transition: transform var(--transition-slide);
}

#fhc-bar.fhc-visible { transform: translateY(0); }

.fhc-bar-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
}

#fhc-slots { display: flex; gap: 8px; flex: 1; min-width: 0; overflow-x: auto; }

.fhc-slot {
    display: flex; align-items: center; gap: 6px;
    background: var(--warm-bg);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 5px 10px;
    flex-shrink: 0;
}

.fhc-slot img { width: 32px; height: 32px; object-fit: contain; }

.fhc-slot-name {
    font-size: 11px; font-weight: 500;
    color: var(--neutral-700);
    overflow: hidden; white-space: nowrap;
    text-overflow: ellipsis; max-width: 80px;
}

.fhc-slot-remove {
    background: none; border: none; cursor: pointer;
    padding: 0 2px; color: var(--text-light-dark);
    line-height: 1; font-size: 13px;
    transition: color var(--transition-base);
}

.fhc-slot-remove:hover { color: #dc2626; }

.fhc-bar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.fhc-bar-count { font-size: 13px; color: var(--text-muted); }

.fhc-slots-empty { font-size: 13px; color: var(--text-light-dark); padding: 4px 0; }

.fhc-compare-btn {
    height: 38px; padding: 0 20px;
    background: var(--primary-brand);
    color: #fff; border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-display);
    font-size: 13px; font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-base);
}

.fhc-compare-btn:hover:not(:disabled) { background: #1a7de6; }
.fhc-compare-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.fhc-bar-clear {
    height: 38px; padding: 0 14px;
    border: 1px solid var(--gray-200);
    background: var(--white);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--neutral-700);
    cursor: pointer;
    font-family: var(--font-body);
    transition: background var(--transition-base), border-color var(--transition-base);
}

.fhc-bar-clear:hover { background: var(--warm-bg); border-color: var(--gray-300); }

/* ── Toast ───────────────────────────────────────────────── */

#fhc-toast {
    position: fixed; bottom: 90px; right: 16px; z-index: 10000;
    padding: 12px 18px; border-radius: var(--radius-md);
    color: #fff; font-family: var(--font-body);
    font-size: 13px; font-weight: 500;
    box-shadow: var(--shadow-md);
    max-width: 280px;
    opacity: 0; transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
}

#fhc-toast.fhc-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
#fhc-toast.fhc-info    { background: var(--primary-brand); }
#fhc-toast.fhc-success { background: var(--emerald); }
#fhc-toast.fhc-error   { background: #dc2626; }

/* ── Responsywność ───────────────────────────────────────── */

@media (max-width: 900px) {
    .fhc-card-body {
        grid-template-columns: 1fr;
    }

    .fhc-card-image-col {
        border-right: none;
        border-bottom: 1px solid var(--warm-border);
        padding: 20px;
    }

    .fhc-card-image-wrap {
        max-width: 280px;
        margin: 0 auto;
    }

    .fhc-card-buy {
        max-width: 320px;
        width: 100%;
        margin: 0 auto;
    }
}

@media (max-width: 640px) {
    .fhc-filters-grid { grid-template-columns: 1fr; }

    .fhc-card-header { padding: 12px 16px; }
    .fhc-card-name { font-size: 14px; }

    .fhc-card-image-col { padding: 16px; }

    .fhc-card-price { font-size: 18px; }

    .fhc-bar-inner { padding: 10px 14px; flex-wrap: wrap; }
    .fhc-slot-name { max-width: 55px; }

    .fhc-lock-notice { flex-direction: column; align-items: flex-start; gap: 8px; }

    .fhc-modal-overlay { padding: 8px; }

    .fhc-modal {
        max-height: calc(100vh - 16px);
        border-radius: var(--radius-md);
    }

    .fhc-modal-header { padding: 14px 18px; }

    .fhc-comparison-title { font-size: 15px; }

    .fhc-product-thumb { padding: 12px 8px 10px; }

    .fhc-product-thumb img { width: 64px; height: 64px; }

    .fhc-product-thumb-name { font-size: 11px; max-width: 120px; }
}

@media (min-width: 641px) and (max-width: 900px) {
    .fhc-filters-grid { grid-template-columns: 1fr 1fr; }

    .fhc-card-body { grid-template-columns: 200px 1fr; }
}
