.papio-kafelki,
.papio-kafelki *,
.papio-kafelki *::before,
.papio-kafelki *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: 0;
    outline: 0;
    font: inherit;
    color: inherit;
    background: transparent;
    text-decoration: none;
    list-style: none;
    quotes: none;
    border-collapse: collapse;
    vertical-align: baseline;
    letter-spacing: normal;
    text-transform: none;
    line-height: 1.4;
    font-family: Arial, Helvetica, sans-serif;
}

.papio-kafelki button,
.papio-kafelki input,
.papio-kafelki textarea,
.papio-kafelki select {
    font: inherit;
    color: inherit;
}

.papio-kafelki a,
.papio-kafelki button {
    cursor: pointer;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f5f7fb;
    color: #1b2430;
}

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 30px 20px 50px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    gap: 20px;
}

.topbar h1 {
    font-size: 2.1rem;
    margin: 0;
}

.topbar-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.active-set-banner {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #edf7ef;
    border: 1px solid #cfead9;
    color: #0d7a40;
    font-size: 0.82rem;
    font-weight: 700;
}

.active-set-label,
.data-source-label,
.data-source-banner span {
    opacity: 0.75;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.7rem;
}

.data-source-card,
.data-source-banner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid #dfe6f0;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.8rem;
    color: #344054;
}

.data-source-card a,
.data-source-banner strong {
    color: #0f172a;
    text-decoration: none;
    font-weight: 700;
    word-break: break-all;
}

.data-source-banner {
    margin-bottom: 18px;
    width: fit-content;
}

.set-switcher-form,
.set-create-form {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #dfe6f0;
    border-radius: 10px;
    padding: 8px 10px;
}

.set-switcher-form label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #475467;
}

.set-switcher-form select,
.set-create-form input {
    border: 1px solid #d5dce7;
    border-radius: 8px;
    background: #fff;
    padding: 8px 10px;
    min-height: 36px;
}

.admin-link {
    display: inline-block;
    background: #1b2430;
    color: #fff;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 700;
}

.compare-panel,
.admin-box,
.copy-box {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(17, 24, 39, 0.08);
}

.compare-panel {
    padding: 26px 22px 18px;
}

.compare-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    gap: 20px;
}

.compare-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.papio-kafelki .compare-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 18px;
    min-height: 500px;
}

.papio-kafelki .product-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1 1 220px;
    max-width: 260px;
    background: linear-gradient(180deg, #ffffff 0%, #f7f9fd 100%);
    border: 1px solid #e1e7f0;
    border-radius: 16px;
    min-height: 450px;
    padding: 18px 18px 16px;
    position: relative;
    transition: transform 0.35s ease, box-shadow 0.2s ease, opacity 0.25s ease;
    touch-action: pan-y;
    user-select: none;
    will-change: transform, opacity;
}

@keyframes papioSlideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes papioSlideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.papio-kafelki.slide-next .product-card.visible {
    animation: papioSlideInRight 0.35s ease;
}

.papio-kafelki.slide-prev .product-card.visible {
    animation: papioSlideInLeft 0.35s ease;
}

.papio-kafelki .product-card.hidden {
    display: none;
}

.papio-kafelki .product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 32px rgba(31, 41, 55, 0.12);
}

.papio-kafelki .product-card.featured {
    border-color: var(--papio-accent, #0d7a40);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04), 0 0 0 1px var(--papio-accent, #0d7a40);
}

.papio-kafelki .product-card .badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--papio-accent, #0d7a40);
    color: #fff;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 6px 10px;
}

.papio-kafelki .card-top {
    padding-top: 18px;
}

.papio-kafelki .card-top {
    position: relative;
}

.papio-kafelki .card-top:before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255,255,255,0), rgba(13,122,64,0.12), rgba(255,255,255,0));
    pointer-events: none;
}

.papio-kafelki .product-name {
    font-size: 1.7rem;
    margin: 0 0 6px;
    font-weight: 700;
    line-height: 1.2;
    position: relative;
    z-index: 1;
}

.papio-kafelki .product-subtitle {
    margin: 0 0 12px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #53657d;
    text-transform: uppercase;
}

.papio-kafelki .product-price {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 14px;
}

.papio-kafelki .price-main {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--papio-accent, #0d7a40);
    display: inline-flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0;
}

.papio-kafelki .currency-symbol,
.papio-kafelki .old-price .currency-symbol {
    font-size: 0.72em;
    font-weight: 700;
    margin-left: 0.12em;
    vertical-align: baseline;
    line-height: 1;
}

.papio-kafelki .price-decimal,
.papio-kafelki .old-price-decimal {
    display: inline-block;
    font-size: 0.7em;
    margin-left: 0.08em;
    font-weight: 700;
    vertical-align: baseline;
}

.papio-kafelki .old-price {
    font-size: 1rem;
    text-decoration: line-through;
    color: #8893a3;
    display: inline-flex;
    align-items: baseline;
    flex-wrap: wrap;
}

.papio-kafelki .product-description-wrap {
    display: flex;
    align-items: stretch;
    margin: 0 0 16px;
}

.papio-kafelki .product-description {
    margin: 0;
    width: 100%;
    padding: 0;
    color: #667085;
    font-size: 0.86rem;
    line-height: 1.5;
    min-height: 94px;
    display: flex;
    align-items: center;
}

.papio-kafelki .product-description.empty {
    visibility: hidden;
}

.papio-kafelki .feature-list {
    list-style: none;
    padding: 0;
    margin: 0 0 18px;
}

.papio-kafelki .feature-list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
    color: #344054;
    font-size: 0.95rem;
}

.papio-kafelki .feature-list li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--papio-accent, #0d7a40);
    font-weight: 800;
}

.papio-kafelki .card-actions {
    margin-top: auto;
}

.papio-kafelki .cta-button {
    display: block;
    width: 100%;
    background: linear-gradient(180deg, var(--papio-accent, #0d7a40) 0%, var(--papio-accent, #0d7a40) 100%);
    color: #fff;
    text-decoration: none;
    text-align: center;
    border-radius: 10px;
    padding: 14px 18px;
    font-weight: 700;
    font-size: 1rem;
}

.papio-kafelki .pager {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding-top: 10px;
}

.papio-kafelki .page-btn,
.papio-kafelki .nav-btn {
    background: #eef3fb;
    border: 1px solid #d9e1f2;
    color: #1b2430;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
}

.papio-kafelki .page-btn.active {
    background: #1b2430;
    color: #fff;
    border-color: #1b2430;
}

.papio-kafelki .mobile-controls {
    display: none;
}

.papio-kafelki .mobile-nav {
    display: none;
}

@media (max-width: 767px) {
    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .papio-kafelki {
        position: relative;
        padding-left: 52px;
        padding-right: 52px;
    }

    .papio-kafelki .compare-grid {
        grid-template-columns: 1fr;
        min-height: 440px;
    }

    .papio-kafelki .product-card {
        min-height: 420px;
        display: none;
    }

    .papio-kafelki .product-card.visible {
        display: flex;
    }

    .papio-kafelki .product-card.dragging {
        display: flex !important;
        opacity: 1 !important;
        z-index: 3;
    }

    .compare-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .papio-kafelki .mobile-nav {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        z-index: 5;
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        border: 1px solid rgba(17, 24, 39, 0.12);
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
        color: #111827;
        font-size: 2rem;
        line-height: 1;
        cursor: pointer;
        padding: 0;
    }

    .papio-kafelki .mobile-prev {
        left: 10px;
    }

    .papio-kafelki .mobile-next {
        right: 10px;
    }

    .papio-kafelki .mobile-controls {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-top: 18px;
    }

    .papio-kafelki .mobile-page-counter {
        font-weight: 700;
        color: #344054;
    }

    .papio-kafelki .nav-btn {
        padding: 10px 14px;
    }

    .papio-kafelki .pager {
        display: none;
    }
}

.admin-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 16px 50px;
}

.admin-box {
    padding: 18px;
}

.admin-shell {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 18px;
    min-height: 700px;
}

.product-side,
.editor-panel {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 18px;
}

.product-side {
    display: flex;
    flex-direction: column;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.panel-head h3,
.editor-head h3 {
    margin: 0;
    font-size: 1.1rem;
}

.mini-btn {
    background: #1b2430;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 10px;
    font-weight: 700;
    cursor: pointer;
}

.product-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
}

.product-list li {
    border: 1px solid #dfe6f0;
    border-radius: 12px;
    background: #fff;
    cursor: grab;
}

.product-list li:active {
    cursor: grabbing;
}

.product-list li.selected {
    border-color: #0d7a40;
    box-shadow: 0 0 0 2px rgba(13, 122, 64, 0.12);
}

.product-list button {
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    padding: 12px 12px;
    cursor: pointer;
    color: #1b2430;
}

.product-list .drag-handle {
    display: inline-block;
    font-size: 1rem;
    margin-right: 8px;
    color: #6b7280;
}

.product-list strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.product-list small {
    display: block;
    color: #53657d;
}

.product-list .state-pill {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    background: #edf7ef;
    color: #0d7a40;
}

.product-list .state-pill.hidden {
    background: #fff1f1;
    color: #a62828;
}

.card-image-wrap {
    width: 100%;
    margin-bottom: 12px;
    border-radius: 12px;
    overflow: hidden;
    background: #f2f6fb;
    border: 1px solid #e5e7eb;
}

.card-image {
    display: block;
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.editor-panel {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.editor-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
}

.editor-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.full {
    grid-column: 1 / -1;
}

label {
    font-weight: 700;
    color: #344054;
}

input, textarea, button {
    font: inherit;
}

input, textarea {
    width: 100%;
    border: 1px solid #d5dce7;
    border-radius: 10px;
    padding: 11px 12px;
    background: #fff;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

.primary-btn,
.secondary-btn,
.tool-btn {
    border: none;
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 700;
    cursor: pointer;
}

.primary-btn {
    background: #0d7a40;
    color: #fff;
}

.secondary-btn,
.tool-btn {
    background: #eef3fb;
    color: #1b2430;
    border: 1px solid #d9e1f2;
}

.color-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.color-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.15);
    cursor: pointer;
}

.color-swatch.active {
    box-shadow: 0 0 0 2px #111827, 0 0 0 5px rgba(17, 24, 39, 0.08);
}

.buttons-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.status {
    margin-top: 18px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #edf8f2;
    color: #0d7a40;
    border: 1px solid #cfead9;
    display: none;
}

.status.error {
    background: #fff1f1;
    color: #a62828;
    border-color: #f0c8c8;
}

.json-box {
    margin-top: 8px;
    padding-top: 14px;
    border-top: 1px solid #e5e7eb;
}

.tiny-note {
    margin: 0 0 12px;
    font-size: 0.78rem;
    color: #475467;
    background: #f3f6fb;
    border: 1px solid #dfe6f0;
    border-radius: 8px;
    padding: 8px 10px;
}

.json-box textarea {
    min-height: 150px;
    background: #0f172a;
    color: #e2e8f0;
    border-color: #0f172a;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.8rem;
}

.table-wrap {
    margin-top: 24px;
    overflow-x: auto;
}

.product-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.product-table th,
.product-table td {
    text-align: left;
    padding: 12px 10px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
}

.product-table th {
    background: #f8fafc;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #465266;
}

.inline-btn {
    display: inline-block;
    background: #eef3fb;
    border: 1px solid #d9e1f2;
    border-radius: 8px;
    padding: 8px 12px;
    text-decoration: none;
    color: #1b2430;
    font-weight: 700;
    margin-right: 8px;
    margin-bottom: 6px;
}

.delete-btn {
    background: #fdecec;
    border-color: #f2c3c3;
    color: #9b2c2c;
}

.copy-box {
    margin-top: 28px;
    padding: 22px 20px;
}

.copy-box textarea {
    min-height: 230px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.8rem;
    background: #0f172a;
    color: #e2e8f0;
    border-color: #0f172a;
}

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

    .form-grid {
        grid-template-columns: 1fr;
    }
}

.buttons-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.status {
    margin-top: 18px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #edf8f2;
    color: #0d7a40;
    border: 1px solid #cfead9;
    display: none;
}

.status.error {
    background: #fff1f1;
    color: #a62828;
    border-color: #f0c8c8;
}

.table-wrap {
    margin-top: 24px;
    overflow-x: auto;
}

.product-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.product-table th,
.product-table td {
    text-align: left;
    padding: 12px 10px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
}

.product-table th {
    background: #f8fafc;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #465266;
}

.inline-btn {
    display: inline-block;
    background: #eef3fb;
    border: 1px solid #d9e1f2;
    border-radius: 8px;
    padding: 8px 12px;
    text-decoration: none;
    color: #1b2430;
    font-weight: 700;
    margin-right: 8px;
    margin-bottom: 6px;
}

.delete-btn {
    background: #fdecec;
    border-color: #f2c3c3;
    color: #9b2c2c;
}

.copy-box {
    margin-top: 28px;
    padding: 22px 20px;
}

.copy-box textarea {
    min-height: 230px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.8rem;
    background: #0f172a;
    color: #e2e8f0;
    border-color: #0f172a;
}

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