/* Przycisk "Kup w pakiecie" */
#rk-open-btn.rk-pakiet-btn { background-color: transparent !important; color: #777 !important; border: 1px solid #e8e8e8 !important; box-shadow: none !important; font-family: inherit !important; }
#rk-open-btn.rk-pakiet-btn:hover, #rk-open-btn.rk-pakiet-btn:focus { background-color: #d32230 !important; color: #fff !important; border-color: #d32230 !important; }

/* Overlay */
#rk-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 2147483646; opacity: 0; pointer-events: none; transition: opacity .3s ease; }
#rk-overlay.rk-active { opacity: 1; pointer-events: all; }

/* Drawer */
#rk-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(600px, 100vw); background: #fff; z-index: 2147483647; transform: translateX(100%); transition: transform .35s cubic-bezier(.4,0,.2,1); display: flex; flex-direction: column; box-shadow: -3px 0 24px rgba(0,0,0,.15); font-family: inherit; }
#rk-drawer.rk-active { transform: translateX(0); }

/* Nagłówek */
.rk-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid #e8e8e8; flex-shrink: 0; }
.rk-drawer-title { font-size: 1.13rem; font-weight: 700; color: #353535; }
.rk-close-btn { background: none; border: none; cursor: pointer; font-size: 1.4rem; line-height: 1; color: #777; padding: 2px 8px; border-radius: 4px; transition: color .15s, background .15s; }
.rk-close-btn:hover { color: #353535; background: #f5f5f5; }

/* Body */
.rk-drawer-body { flex: 1; overflow-y: auto; padding: 22px 22px 28px; }

/* Kroki */
.rk-step { margin-bottom: 22px; }
.rk-label { display: flex; align-items: center; gap: 8px; font-size: 1rem; font-weight: 600; color: #353535; margin-bottom: 10px; }
.rk-num { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: #d32230; color: #fff; font-size: .80rem; font-weight: 700; flex-shrink: 0; }

/* Siatka typów dachu */
.rk-type-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; }
.rk-type-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 12px 8px; background: #fafafa; border: 2px solid #e8e8e8; border-radius: 8px; cursor: pointer; font-family: inherit; font-size: .9rem; color: #353535; transition: border-color .15s, background .15s; text-align: center; line-height: 1.3; }
.rk-type-btn:hover { border-color: #d32230; background: #fff; }
.rk-type-btn.rk-type-active { border-color: #d32230; background: #fff8f8; font-weight: 600; }
.rk-type-icon { font-size: 1.6rem; line-height: 1; }
.rk-type-label { font-size: .85rem; }

/* Select */
.rk-select-wrap select { width: 100%; padding: 9px 36px 9px 14px; font-family: inherit; font-size: 1rem; color: #353535; background: #fff; border: 1px solid #e8e8e8; border-radius: 4px; appearance: none; -webkit-appearance: none; cursor: pointer; outline: none; transition: border-color .2s; background-image: url('data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23555%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%226%209%2012%2015%2018%209%22%3E%3C%2Fpolyline%3E%3C%2Fsvg%3E'); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
.rk-select-wrap select:focus { border-color: #d32230; }

/* Checkboxy opcji */
.rk-options { display: flex; flex-direction: column; gap: 6px; }
.rk-opt-row { display: flex; align-items: center; gap: 12px; padding: 10px 13px; cursor: pointer; border: 1px solid #e8e8e8; border-radius: 4px; background: #fafafa; transition: border-color .15s, background .15s; user-select: none; }
.rk-opt-row:hover { border-color: #d32230; background: #fff; }
.rk-opt-row:has(input:checked) { border-color: #d32230; background: #fff8f8; }
.rk-opt-check { position: relative; flex-shrink: 0; }
.rk-opt-check input[type=checkbox]{ position: absolute; opacity: 0; width: 0; height: 0; }
.rk-opt-box { display: block; width: 18px; height: 18px; border: 1.5px solid #e8e8e8; border-radius: 3px; background: #fff; transition: all .15s; }
.rk-opt-check input:checked ~ .rk-opt-box { background: #d32230; border-color: #d32230; }
.rk-opt-check input:checked ~ .rk-opt-box::after { content: ''; display: block; margin: 3px auto 0; width: 5px; height: 9px; border: 2px solid #fff; border-top: none; border-left: none; transform: rotate(45deg); }
.rk-opt-info { flex: 1; }
.rk-opt-name { display: block; font-size: 1rem; font-weight: 500; color: #353535; }
.rk-opt-desc { display: block; font-size: .88rem; color: #999; margin-top: 1px; }
.rk-opt-price { font-size: 1rem; font-weight: 600; color: #353535; white-space: nowrap; flex-shrink: 0; }

/* Lista produktów */
#rk-product-list { display: flex; flex-direction: column; gap: 7px; }
.rk-prod-row { border: 1px solid #e8e8e8; border-radius: 4px; padding: 10px 13px; background: #fafafa; }
.rk-prod-row.is-opt { border-style: dashed; }
.rk-prod-header { margin-bottom: 3px; }
.rk-prod-thumb { width: 42px; height: 42px; border-radius: 4px; object-fit: contain; background: #fff; border: 1px solid #e8e8e8; flex-shrink: 0; }
.rk-prod-thumb-placeholder { background: #f0f0f0; }
.rk-prod-name { font-size: 1rem; font-weight: 500; color: #353535; }
a.rk-prod-name { text-decoration: underline; color: inherit; transition: color .15s; }
a.rk-prod-name:hover { color: #d32230; }
.rk-prod-total { font-size: 1rem; font-weight: 700; color: #353535; white-space: nowrap; }
.rk-prod-kolor { display: block; font-size: .88rem; color: #999; margin: 3px 0; }
.rk-prod-packs { display: flex; flex-wrap: wrap; gap: 4px; }
.rk-pack-tag { font-size: .82rem; background: #fff; border: 1px solid #e8e8e8; border-radius: 20px; padding: 2px 9px; color: #353535; }
.rk-badge-required { font-size: .75rem; background: #d32230; color: #fff; border-radius: 3px; padding: 1px 6px; margin-left: 6px; vertical-align: middle; }
.rk-badge-opt { font-size: .75rem; background: #f0f0f0; color: #777; border-radius: 3px; padding: 1px 6px; margin-left: 6px; vertical-align: middle; }

/* Podsumowanie */
.rk-summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 12px 16px; border-radius: 4px; background: #f9f9f9; border: 1px solid #e8e8e8; margin-bottom: 14px; gap: 2px 0; }
.rk-summary-lbl { font-size: 1rem; font-weight: 600; color: #353535; }
.rk-summary-price { display: flex; align-items: baseline; gap: 4px; }
#rk-total-price { font-size: 1.35rem; font-weight: 700; color: #d32230; }
#rk-currency { font-size: 1rem; font-weight: 600; color: #353535; }
.rk-per-m2 { width: 100%; font-size: .88rem; color: #999; text-align: right; margin-top: 2px; }

/* Sukces */
.rk-success-msg { padding: 14px 16px; border-radius: 4px; background: #f0faf0; border: 1px solid #b2dfb2; margin-bottom: 12px; display: none; }
.rk-success-msg span { font-size: 1rem; font-weight: 600; color: #2e7d32; display: block; margin-bottom: 10px; }
.rk-success-btns { display: flex; gap: 8px; }
.rk-success-btns .button { flex: 1; text-align: center; font-size: .9rem; }

/* Drawer footer responsive styles */
.rk-drawer-footer {
    padding: 22px;
    border-top: 1px solid #e8e8e8;
    background: #fff;
}
#rk-submit-btn {
    margin-top: 20px;
    width: 100%;
}
.rk-drawer-footer-contact {
    text-align: center;
    font-size: 13px;
    color: #777;
    margin-top: 12px;
}
.rk-drawer-footer-contact a {
    text-decoration: underline;
    color: #353535;
}

@media (max-width: 767px) {
    .rk-drawer-footer {
        padding: 12px 16px;
    }
    #rk-submit-btn {
        margin-top: 10px;
    }
    .rk-drawer-footer-contact {
        margin-top: 8px;
        line-height: 16px;
    }
}

/* Błąd */
.rk-error-msg { padding: 10px 14px; border-radius: 4px; background: #fff3f3; border: 1px solid #f5c6cb; color: #842029; font-size: .9rem; margin-top: 8px; }

/* Submit */
#rk-submit-btn { width: 100%; font-size: 1rem; }
#rk-submit-btn.rk-loading { opacity: .7; cursor: wait; }

/* Scroll lock */
body.rk-drawer-open { overflow: hidden; }

/* Ukrycie chatbota podczas otwartej szuflady */
body.rk-drawer-open #yourgpt-chatbot,
body.rk-drawer-open .yourgpt-chatbot-widget,
body.rk-drawer-open iframe[src*="yourgpt"],
body.rk-drawer-open [id^="yourgpt"] {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Miniaturki produktów */
.rk-prod-thumb {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid #ddd;
    background-color: #fff;
    flex-shrink: 0;
}
.rk-prod-thumb-placeholder {
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rk-prod-thumb-placeholder::after {
    content: "📷";
    font-size: 16px;
    color: #ccc;
}

/* Tooltipy */
.rk-tooltip {
    display: inline-block;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 50%;
    background-color: #007cba;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    cursor: help;
    margin-left: 5px;
    position: relative;
}
.rk-tooltip:hover::after {
    content: attr(data-tip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: pre-wrap;
    width: max-content;
    max-width: 200px;
    z-index: 9999;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    pointer-events: none;
    line-height: 1.4;
    font-family: sans-serif;
    text-align: left;
}
.rk-tooltip:hover::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
    z-index: 9999;
    pointer-events: none;
}

/* Kafelki Zestawów (Basic/Pro) */
.rk-bundles-grid {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: 10px;
}
.rk-bundle-card {
    display: flex;
    align-items: flex-start;
    padding: 10px 13px;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    background-color: #fafafa;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    margin: 0 !important;
}
.rk-bundle-card:hover {
    border-color: #d32230;
    background-color: #fff;
}
/* Obsługa sprawdzania radia bez pseudo-klasy :has (kompatybilność) - dodana z klasy w JS lub czysty CSS jeśli :has jest ok, ale lepiej bezpieczniej. Dla nowych przeglądarek :has jest OK */
.rk-bundle-card:has(input[type="radio"]:checked),
.rk-bundle-card.is-selected {
    border-color: #d32230;
    background-color: #fff8f8;
}
.rk-bundle-card input[type="radio"] {
    margin-top: 4px;
    margin-right: 12px;
    accent-color: #d32230;
    transform: scale(1.1);
}
.rk-bundle-content {
    flex: 1;
    min-width: 0;
}
.rk-bundle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}
.rk-bundle-header strong {
    font-size: 1rem;
    font-weight: 500;
    color: #353535;
}
.rk-bundle-prices {
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.rk-bundle-regular-price {
    font-size: 0.9rem;
    color: #999;
    text-decoration: line-through;
}
.rk-bundle-price {
    font-weight: 700;
    color: #353535;
    font-size: 1rem;
}
.rk-bundle-desc {
    font-size: 0.88rem;
    color: #999;
    margin-top: 2px;
}
.rk-bundle-items {
    margin: 6px 0 0 0;
    padding: 0 0 0 16px;
    font-size: 0.88rem;
    color: #555;
}
.rk-bundle-items li {
    margin-bottom: 2px;
}
.rk-bundle-thumb {
    width: 42px;
    height: 42px;
    border-radius: 4px;
    object-fit: contain;
    background: #fff;
    border: 1px solid #e8e8e8;
    flex-shrink: 0;
    margin-right: 12px;
}
