

#km-konfigurator {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    max-width: 1400px;
    margin: 20px auto 0;
    padding-top: 10px;
    color: #333;
    line-height: 1.5;
}

#km-konfigurator *,
#km-konfigurator *::before,
#km-konfigurator *::after {
    box-sizing: border-box;
}

.km-header {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.km-step {
    flex: 1;
    min-width: 240px;
    padding: 16px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #fafafa;
    font-size: 15px;
    font-weight: 500;
}

.km-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #4a7c59;
    color: #fff;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 700;
    margin-right: 8px;
}

.km-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.km-products-panel {
    flex: 3;
    min-width: 0;
}

.km-cart-panel {
    flex: 2;
    min-width: 320px;
    border: 2px solid #4a7c59;
    border-radius: 12px;
    padding: 24px;
    background: #fff;
    position: sticky;
    top: var(--km-sticky-offset, 32px);
    max-height: calc(100vh - var(--km-sticky-offset, 32px) - 24px);
    overflow-y: auto;
}

.km-filters {
    margin-bottom: 16px;
}

.km-filters h3 {
    font-size: 16px;
    margin: 0 0 10px;
    font-weight: 600;
}

.km-filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.km-search-input {
    flex: 1;
    min-width: 200px;
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.km-search-input:focus {
    outline: none;
    border-color: #4a7c59;
    box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.15);
}

.km-attribute-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.km-attr-filter {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 140px;
    flex: 1;
    max-width: 200px;
}

.km-attr-filter label {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.km-attr-filter-select {
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 13px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s;
}

.km-attr-filter-select:focus {
    outline: none;
    border-color: #4a7c59;
    box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.15);
}

.km-advanced-filters-wrap {
    margin-top: 10px;
}

.km-advanced-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: none;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
}

.km-advanced-toggle:hover {
    border-color: #4a7c59;
    color: #4a7c59;
    background: #f0f7f2;
}

.km-advanced-toggle.km-toggle-open {
    border-color: #4a7c59;
    color: #4a7c59;
}

.km-toggle-arrow {
    font-size: 10px;
    transition: transform 0.2s;
}

.km-advanced-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    padding: 12px;
    background: #f9fafb;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.km-products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.km-product-card {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.km-product-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border-color: #c0c0c0;
}

.km-product-card.km-added {
    border-color: #4a7c59;
    background: #f4faf6;
}

.km-product-image {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.km-product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.km-product-info {
    padding: 12px;
    flex-grow: 1;
}

.km-product-name {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 8px;
    line-height: 1.3;
}

.km-product-variant {
    font-size: 13px;
}

.km-variant-select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
}

.km-variant-select:disabled {
    opacity: 1;
    color: #333;
    background: #fff;
    cursor: not-allowed;
    -webkit-text-fill-color: #333;
}

.km-variant-select--single {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: none;
    padding-right: 8px;
    pointer-events: none;
    cursor: default;
    color: #111;
    -webkit-text-fill-color: #111;
    opacity: 1;
}

.km-variant-select--single::-ms-expand {
    display: none;
}

.km-variant-select--single:disabled {
    color: #111;
    -webkit-text-fill-color: #111;
    border-color: #ccc;
    background-color: #fff;
}

.km-variant-select--single option {
    color: #111;
}

.km-single-price {
    font-weight: 600;
    color: #4a7c59;
}

.km-btn-add {
    display: block;
    width: calc(100% - 24px);
    margin: 0 12px 12px;
    padding: 10px;
    background: #4a7c59;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.km-btn-add:hover:not(:disabled) {
    background: #3a6347;
}

.km-btn-add:disabled {
    background: #a0c4ad;
    cursor: default;
}

.km-cart-title {
    font-size: 20px;
    margin: 0 0 20px;
    font-weight: 700;
    color: #4a7c59;
}

.km-cart-empty {
    color: #999;
    text-align: center;
    padding: 40px 20px;
    font-size: 14px;
    line-height: 1.6;
}

.km-cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.km-cart-item:last-child {
    border-bottom: none;
}

.km-cart-item-number {
    font-weight: 700;
    font-size: 14px;
    color: #999;
    min-width: 24px;
}

.km-cart-item-image {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f5f5f5;
}

.km-cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.km-cart-item-details {
    flex: 1;
    min-width: 0;
}

.km-cart-item-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.km-cart-item-variant {
    display: block;
    font-size: 12px;
    color: #777;
}

.km-cart-item-seeds {
    display: block;
    font-size: 11px;
    color: #4a7c59;
    margin-top: 2px;
    font-weight: 500;
}

.km-cart-item-qty {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
}

.km-cart-item-qty label {
    font-weight: 600;
    color: #777;
}

.km-qty-input {
    width: 48px;
    padding: 4px 6px;
    border: 1px solid #ccc;
    border-radius: 6px;
    text-align: center;
    font-size: 13px;
}

.km-cart-item-price {
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
    min-width: 70px;
    text-align: right;
}

.km-btn-remove {
    background: none;
    border: none;
    font-size: 20px;
    color: #ccc;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.2s;
}

.km-btn-remove:hover {
    color: #e53935;
}

.km-seeds-summary {
    margin-top: 12px;
    padding: 10px 14px;
    background: #f0f7f2;
    border: 1px solid #c8e6c9;
    border-radius: 8px;
    font-size: 13px;
    color: #333;
    line-height: 1.4;
    text-align: center;
}

.km-seeds-summary strong {
    color: #2e7d32;
}

.km-seeds-icon {
    font-size: 14px;
}

.km-discount-bar {
    margin-bottom: 16px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #f0f7f2 0%, #e8f5e9 100%);
    border: 1px solid #c8e6c9;
    border-radius: 10px;
}

.km-discount-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 14px;
    color: #555;
}

.km-discount-info.km-discount-active {
    color: #2e7d32;
}

.km-discount-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #4a7c59;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.km-discount-info-text {
    font-size: 13px;
    line-height: 1.4;
}

.km-discount-next {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
    line-height: 1.4;
}

.km-discount-next strong {
    color: #4a7c59;
}

.km-discount-next.km-discount-max {
    color: #2e7d32;
    font-weight: 600;
}

.km-discount-progress {
    height: 6px;
    background: #d5e8d4;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

.km-discount-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #66bb6a, #4a7c59);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.km-discount-tiers-dots {
    display: flex;
    justify-content: space-between;
    gap: 4px;
}

.km-tier-dot {
    flex: 1;
    text-align: center;
    font-size: 10px;
    line-height: 1.3;
    color: #999;
    opacity: 0.6;
    transition: all 0.3s;
}

.km-tier-dot.km-tier-active {
    color: #2e7d32;
    opacity: 1;
    font-weight: 600;
}

.km-tier-dot-qty {
    display: block;
    font-size: 10px;
}

.km-tier-dot-pct {
    display: block;
    font-size: 11px;
    font-weight: 700;
}

.km-tier-dot.km-tier-active .km-tier-dot-pct {
    color: #4a7c59;
}

.km-price-old {
    text-decoration: line-through;
    color: #999;
    font-weight: 400;
    font-size: 12px;
}

.km-price-new {
    color: #2e7d32;
    font-weight: 700;
    font-size: 14px;
}

.km-cart-summary {
    padding: 16px 0 8px;
    border-top: 2px solid #eee;
    margin-top: 8px;
}

.km-summary-line {
    display: flex;
    justify-content: space-between;
    font-size: 15px;
    margin-bottom: 4px;
}

.km-summary-subtotal {
    font-size: 13px;
    color: #888;
}

.km-summary-subtotal .km-price-original {
    text-decoration: line-through;
}

.km-summary-discount {
    font-size: 14px;
    color: #2e7d32;
}

.km-price-discount {
    color: #2e7d32;
    font-weight: 700;
}

.km-summary-total {
    font-size: 18px;
    font-weight: 700;
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px solid #e0e0e0;
}

.km-btn-primary {
    display: block;
    width: 100%;
    padding: 14px;
    margin-top: 16px;
    background: #a8762a;
    color: #fff;
    border: 2px solid #a8762a;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.km-btn-primary:hover:not(:disabled) {
    background: #8f6321;
    border-color: #8f6321;
}

.km-btn-primary:active:not(:disabled) {
    transform: scale(0.98);
}

.km-btn-primary:disabled {
    background: #ccc;
    border-color: #ccc;
    cursor: default;
}

.km-beta-note {
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px solid #e9d7b8;
    border-radius: 8px;
    background: #fff9ef;
    color: #5e4b2d;
    font-size: 13px;
    line-height: 1.45;
}

.km-beta-note strong {
    color: #4d3d24;
}

.km-cart-message {
    margin-top: 12px;
}

.km-msg-success {
    padding: 12px 16px;
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    border-radius: 8px;
    color: #2e7d32;
    font-size: 14px;
}

.km-msg-success a {
    color: #1b5e20;
    font-weight: 600;
    text-decoration: underline;
}

.km-msg-error {
    padding: 12px 16px;
    background: #fbe9e7;
    border: 1px solid #ef9a9a;
    border-radius: 8px;
    color: #c62828;
    font-size: 14px;
}

.km-product-count {
    font-size: 13px;
    color: #777;
    margin-bottom: 10px;
}

.km-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.km-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s;
}

.km-page-btn:hover:not(:disabled):not(.km-page-active) {
    background: #f0f7f2;
    border-color: #4a7c59;
    color: #4a7c59;
}

.km-page-btn.km-page-active {
    background: #4a7c59;
    border-color: #4a7c59;
    color: #fff;
    font-weight: 700;
    cursor: default;
}

.km-page-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.km-page-prev,
.km-page-next {
    font-size: 13px;
    font-weight: 600;
}

.km-page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 36px;
    color: #999;
    font-size: 14px;
}

.km-skeleton {
    pointer-events: none;
}

.km-skeleton-image {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
    background-size: 200% 100%;
    animation: km-shimmer 1.5s infinite;
}

.km-skeleton-info {
    padding: 12px;
}

.km-skeleton-line {
    border-radius: 4px;
    background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
    background-size: 200% 100%;
    animation: km-shimmer 1.5s infinite;
}

.km-skeleton-title {
    height: 14px;
    width: 80%;
    margin-bottom: 8px;
}

.km-skeleton-price {
    height: 12px;
    width: 50%;
}

.km-skeleton-btn {
    height: 36px;
    margin: 0 12px 12px;
    border-radius: 8px;
}

@keyframes km-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.km-loading,
.km-empty,
.km-error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 15px;
}

.km-error {
    color: #c62828;
}

.km-flying-seed {
    position: fixed;
    z-index: 99999;
    pointer-events: none;
    will-change: transform, opacity, left, top;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.km-cart-bounce {
    animation: km-bounce-cart 0.6s ease;
}

@keyframes km-bounce-cart {
    0%   { transform: scale(1); }
    30%  { transform: scale(1.3); }
    50%  { transform: scale(0.9); }
    70%  { transform: scale(1.15); }
    100% { transform: scale(1); }
}

body.km-modal-open {
    overflow: hidden;
}

.km-product-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
}

.km-product-modal.km-product-modal-open {
    display: block;
}

.km-product-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.km-product-modal-dialog {
    position: relative;
    width: min(1000px, calc(100% - 32px));
    max-height: calc(100vh - 40px);
    margin: 20px auto;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
    overflow: auto;
}

.km-product-modal-close {
    position: sticky;
    top: 0;
    float: right;
    margin: 10px 10px 0 0;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 999px;
    background: #f2f2f2;
    color: #333;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    z-index: 4;
}

.km-product-modal-close:hover {
    background: #e7e7e7;
}

.km-product-modal-content {
    padding: 22px 22px 24px;
}

.km-modal-head {
    display: grid;
    grid-template-columns: minmax(260px, 34%) 1fr;
    gap: 22px;
}

.km-modal-image-wrap {
    background: #f7f7f7;
    border: 1px solid #ececec;
    border-radius: 12px;
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.km-modal-image {
    width: 100%;
    max-height: 360px;
    object-fit: contain;
    padding: 14px;
}

.km-modal-title {
    margin: 0 0 12px;
    font-size: 24px;
    line-height: 1.25;
}

.km-modal-description {
    color: #3f3f3f;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 14px;
}

.km-modal-description p:first-child {
    margin-top: 0;
}

.km-modal-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #4a7c59;
    color: #fff;
    background: #4a7c59;
    border-radius: 9px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
}

.km-modal-cta:hover {
    background: #3a6347;
    border-color: #3a6347;
    color: #fff;
}

.km-modal-sections {
    margin-top: 18px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.km-modal-section {
    border: 1px solid #ececec;
    border-radius: 10px;
    padding: 14px;
    background: #fafafa;
}

.km-modal-section h4 {
    margin: 0 0 10px;
    font-size: 15px;
    color: #4a7c59;
}

.km-modal-loading,
.km-modal-empty {
    margin: 0;
    color: #7c7c7c;
    font-size: 14px;
}

.km-modal-attr-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.km-modal-attr-item {
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 8px;
    padding: 8px 10px;
}

.km-modal-attr-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #666;
    margin-bottom: 4px;
}

.km-modal-attr-values {
    display: block;
    font-size: 13px;
    color: #333;
    line-height: 1.4;
}

.km-product-card {
    cursor: pointer;
}

.km-product-card .km-btn-add,
.km-product-card .km-variant-select {
    cursor: auto;
}

.km-modal-section #o-gatunku,
.km-modal-section #parametry {
    margin: 0;
}

.km-modal-section .has-text-align-center {
    text-align: left !important;
}

.km-modal-section #o-gatunku .wp-block-heading {
    display: none;
}

.km-modal-section #o-gatunku p {
    margin: 0 0 8px;
    font-size: 15px;
    line-height: 1.5;
}

.km-modal-section #o-gatunku p:last-child {
    margin-bottom: 0;
}

.km-mobile-view-set {
    display: none;
}

.km-mobile-toggle-btn {
    display: none;
}

@media (max-width: 900px) {
    #km-konfigurator {
        padding-bottom: 84px;
    }

    .km-mobile-toggle-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin: 0 0 10px;
        padding: 9px 14px;
        border: 1px solid #d0d0d0;
        border-radius: 8px;
        background: #fff;
        color: #444;
        font-size: 13px;
        font-weight: 700;
        letter-spacing: 0.2px;
    }

    .km-mobile-collapsible {
        overflow: hidden;
        transition: max-height 0.25s ease, opacity 0.2s ease, margin 0.2s ease;
        max-height: 2200px;
        opacity: 1;
    }

    .km-mobile-collapsible.km-collapsed {
        max-height: 0;
        opacity: 0;
        margin: 0;
        pointer-events: none;
    }

    .km-mobile-collapsible.km-expanded {
        max-height: 2200px;
        opacity: 1;
    }

    .km-layout {
        flex-direction: column;
    }

    .km-cart-panel {
        position: static;
        max-height: none;
        min-width: auto;
    }

    .km-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .km-product-modal-dialog {
        width: calc(100% - 20px);
        max-height: calc(100vh - 20px);
        margin: 10px auto;
    }

    .km-modal-head {
        grid-template-columns: 1fr;
    }

    .km-modal-image-wrap {
        min-height: 220px;
    }

    .km-modal-title {
        font-size: 22px;
    }

    .km-mobile-view-set {
        position: fixed;
        left: 12px;
        right: 70px;
        bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        z-index: 9999;
        display: block;
        width: auto;
        padding: 12px 16px;
        border: none;
        border-radius: 8px;
        background: #2f5d3a;
        color: #fff;
        font-size: 15px;
        font-weight: 700;
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
    }

    .km-mobile-view-set:active {
        transform: translateY(1px);
    }
}

@media (max-width: 500px) {
    .km-header {
        flex-direction: column;
    }

    .km-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .km-cart-panel {
        padding: 16px;
    }

    .km-cart-item {
        flex-wrap: wrap;
    }

    .km-product-modal-content {
        padding: 8px 12px 16px;
    }

    .km-product-modal-close {
        margin: 8px 8px 0 0;
    }

    .km-modal-image-wrap {
        min-height: 180px;
    }

    .km-modal-title {
        font-size: 19px;
    }

    .km-modal-description {
        font-size: 14px;
    }

    .km-modal-cta {
        width: 100%;
    }

    .km-modal-attr-grid {
        grid-template-columns: 1fr;
    }
}

