.sd_container {
    display: flex;
    width: 100%;
    background: #fff;
    border-radius: var(--wd-brd-radius);
}

.sd_sidebar {
    flex: 1;
    background: #000;
    color: #fff;
    padding: 20px;
    border-radius: var(--wd-brd-radius);
}

.sd_sidebar h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #fff;
}

.sd_sidebar nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sd_sidebar nav ul li {
    margin-bottom: 0;
}

.sd_sidebar nav ul li a {
    color: #fff;
    text-decoration: none;
    padding: 10px;
    display: block;
    border-radius: var(--wd-brd-radius);
    transition: background 0.3s;
}

.sd_sidebar nav ul li a:hover,
.sd_sidebar nav ul li a.active {
    background: var(--color-red);
}

.sd_content {
    flex: 3;
    padding: 20px;
    border: 1px solid var(--wd-bordered-brd, var(--brdcolor-gray-300));
    display: flex;
    flex-direction: column;
}

.sd_form-step {
    display: none;
}

.sd_form-step:target {
    display: block;
}

.sd_form-step h3 {
    text-transform: uppercase;
}

.sd_form-step h3 span {
    color: var(--color-red);
}

.sd_form-step h3 span::after {
    content: " • ";
    color: var(--color-gray-300);
    position: relative;
    top: -2px;
    padding-inline: 5px;
}

.sd_form-footer {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--wd-bordered-brd, var(--brdcolor-gray-300));
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sd_form-footer-right {
    margin-left: auto;
}

.sd_form-footer-right #rmc-verify {
    display: none;
}

/* Responsywność */
@media (max-width: 768px) {
    .sd_container {
        flex-direction: column;
    }

    .sd_sidebar {
        border-radius: 8px 8px 0 0;
    }

    .sd_content {
        border-radius: 0 0 8px 8px;
    }
}

/* Radio group */
.sd_radio-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.sd_radio-group.sd_radio-horizontal {
    gap: 0.5rem;
    grid-template-columns: 1fr;
}

.sd_radio-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    padding: 20px;
    border: 1px solid var(--wd-bordered-brd, var(--brdcolor-gray-300));
    cursor: pointer;
    transition: all 0.3s;
}

.sd_radio-option:hover {
    border-color: #999;
}

.sd_radio-horizontal .sd_radio-option {
    align-items: flex-start;
    padding: 0.5rem;
}

.sd_radio-group input[type="radio"] {
    display: none;
}

.sd_radio-group input[type="radio"]:checked+.sd_radio-option {
    border-color: var(--color-red);
    outline: 1px solid var(--color-red);
}

.sd_radio-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.sd_radio-horizontal .sd_radio-content {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    text-align: left;
}

.sd_radio-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 10px;
}

.sd_radio-horizontal .sd_radio-icon {
    width: 50px;
    height: 50px;
    margin-bottom: 0;
}

.sd_radio-option h4 {
    margin: 10px 0 5px;
    font-size: 18px;
}

.sd_radio-horizontal .sd_radio-option h4 {
    margin: 0;
    font-size: 16px;
}

.sd_radio-option p {
    font-size: 14px;
    color: #666;
    margin-bottom: 0;
}

/* Responsywność */
@media (max-width: 768px) {
    .sd_radio-group {
        grid-template-columns: 1fr;
    }
}

/* Canvas */
#roof_edges {
    width: 100%;
    aspect-ratio: 3 / 2;
    background: #eceff9;
    object-fit: contain;
    margin-bottom: 20px;
}

/* Popup */

/* Stylizacja popupu */
.popup {
    display: none;
    /* Na początku popup jest ukryty */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 99999999;
}

.popup-content {
    background-color: white;
    padding: 20px;
    border-radius: 0;
    width: 475px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    max-height: calc(100vh - 2 * 1.5rem);
    margin: 1.5rem 0;
    overflow-y: auto;
}

.popup input,
.popup select {
    width: 100%;
    margin-bottom: 10px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.popup button {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    background-color: #4CAF50;
    color: white;
    border: none;
    cursor: pointer;
}

.popup-content input::placeholder {
    color: var(--color-red);
}

.popup button:hover {
    background-color: #45a049;
}

.popup button#rmc-edge-cancel {
    background-color: #f44336;
}

.popup button#rmc-edge-cancel:hover {
    background-color: #e41c23;
}

/* Podsumowanie */
.rmc-summary-shape {
    padding: 1rem;
    border: 1px solid var(--wd-bordered-brd, var(--brdcolor-gray-300));
}

.rmc-summary-shape h4 {
    font-weight: 400;
    color: var(--wd-text-color);
    margin: 0;
}

.rmc-summary-shape h4 strong {
    font-weight: 700;
}

.rmc-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 1rem 0;
}

@media (max-width: 600px) {
    .rmc-summary-grid {
        grid-template-columns: 1fr;
    }
}

.rmc-summary-grid .rmc-summary-edge {
    padding: 1rem;
    border: 1px solid var(--wd-bordered-brd, var(--brdcolor-gray-300));
}

.rmc-summary-grid .rmc-summary-edge h4 {
    color: var(--wd-text-color);
    margin: 0 0 0.5rem;
}

.rmc-summary-grid .rmc-summary-edge p {
    margin: 0;
}

.rmc-summary-products {
    padding: 1rem;
    border: 1px solid var(--wd-bordered-brd, var(--brdcolor-gray-300));
    margin: 0 0 20px;
}

.rmc-summary-products h4 {
    color: var(--wd-text-color);
    margin: 0 0 0.5rem;
}

.rmc-summary-products ul {
    margin-bottom: 20px;
}

.rmc-summary-products ul:last-child {
    margin-bottom: 0;
}

.rmc-summary-products li {
    margin-bottom: 0.1rem;
}

.rmc-summary-products li:last-child {
    margin-bottom: 0;
}

#rmc-summary-cart {
    margin: 0 0 20px;
}

#rmc-summary-cart:empty {
    display: none;
}

button:is(.rmc-add-to-cart,.sd_btn-primary) {
    color: var(--btn-accented-color, #fff);
    background-color: var(--btn-accented-bgcolor, rgb(192, 30, 41));
}

button:is(.rmc-add-to-cart,.sd_btn-primary):hover {
    color: var(--btn-accented-color-hover, #fff);
    background-color: var(--btn-accented-bgcolor-hover, rgb(168, 25, 25));
}

button:is(.rmc-add-to-cart,.sd_btn-primary):disabled {
    opacity: 0.6;
    cursor: not-allowed !important;
}

.rmc-error-notice {
    color: var(--color-red);
    margin-top: 1rem;
    border: 1px solid var(--color-red);
    padding: 1rem;
}

.rmc-success-notice {
    color: var(--notices-success-bg);
    margin-top: 1rem;
    border: 1px solid var(--notices-success-bg);
    padding: 1rem;
}

.rmc-info-notice {
    color: var(--wd-text-color);
    margin-top: 1rem;
    border: 1px solid var(--wd-bordered-brd, var(--brdcolor-gray-300));
    padding: 1rem;
}

/* Grupa pól formularza */
.sd_input-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 15px;
    padding: 10px;
    background: white;
    border: 1px solid #ddd;
    transition: all 0.3s ease;
}

.sd_input-group:hover {
    border-color: var(--color-red);
}

/* Etykiety pól */
.sd_input-group label {
    font-size: 16px;
    margin-bottom: 5px;
}

/* Opis pod etykietą */
.sd_input-group p {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

/* Obrazki objaśniające */
.sd_input-image {
    max-width: 100%;
    height: auto;
    margin: 10px 0;
}

/* Responsywność */
@media (min-width: 768px) {
    .sd_input-group {
        flex-direction: row;
        align-items: center;
        gap: 15px;
    }

    .sd_input-group label {
        flex: 1;
        margin-bottom: 0;
    }

    .sd_input-group p {
        flex: 2;
        margin-bottom: 0;
    }

    .sd_input-group input {
        flex: 1;
    }

    .sd_input-image {
        max-width: 120px;
        height: auto;
    }
}

.sd_edge-table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 25px;
}

.sd_edge-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
}

.sd_edge-table :is(th, td) {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
    background: #fff;
    font-size: 15px;
}

.sd_edge-table th {
    text-transform: none;
}

.sd_option-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.sd_option-table tr {
    border: 1px solid var(--brdcolor-gray-300);
}

.sd_option-table :is(th, td) {
    border: 0;
}

.sd_option-table img {
    max-width: 120px;
}

.sd_option-table .sd_inner-table {
    margin: 0;
    margin-left: auto;
    width: 250px;
}

.sd_option-table .sd_inner-table tr {
    border: 0;
}

.sd_option-table .sd_inner-table :is(th, td) {
    padding: 10px;
    border: 0;
    border-bottom: 1px solid var(--brdcolor-gray-300);
    text-align: center;
}

.sd_option-table .sd_inner-table tr:last-child :is(th, td) {
    border: 0;
    padding-bottom: 0;
}

/* Responsywność dla ekranów poniżej 600px */
@media screen and (max-width: 600px) {
    .sd_edge-table thead {
        display: none;
    }

    .sd_edge-table tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #ddd;
    }

    .sd_edge-table tr:last-child {
        margin-bottom: 0;
    }

    .sd_edge-table td {
        display: block;
        text-align: right;
        position: relative;
        padding-left: 51%;
        border: none;
        border-bottom: 1px solid #eee;
    }

    .sd_edge-table td::before {
        position: absolute;
        left: 0;
        width: 50%;
        padding-left: 15px;
        font-weight: bold;
        text-align: left;
    }

    .sd_edge-table td:nth-of-type(1)::before {
        content: "Status:";
    }

    .sd_edge-table td:nth-of-type(2)::before {
        content: "Krawędź:";
    }

    .sd_edge-table td:nth-of-type(3)::before {
        content: "Długość (m):";
    }

    .sd_edge-table td:nth-of-type(4)::before {
        content: "Rodzaj krawędzi:";
    }

    .sd_edge-table td:nth-of-type(5)::before {
        content: "Wywinięcie (m):";
    }
}

.sd_txt-right {
    text-align: right;
}

.sd_txt-center {
    text-align: center;
}

.custom-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.custom-checkbox input[type="checkbox"] {
    /* Ukrywamy domyślny checkbox */
    appearance: none;
    -webkit-appearance: none;
    background-color: #fff;
    border: 2px solid #ccc;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    cursor: pointer;
}

.custom-checkbox input[type="checkbox"]:checked {
    background-color: #0073aa;
    /* przykładowy kolor */
    border-color: #0073aa;
}

.custom-checkbox input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

.number-input {
    display: inline-flex;
    align-items: center;
}

.number-input button {
    width: 35px;
    height: 35px;
    min-height: unset;
    border: 1px solid #ccc;
    background-color: #f5f5f5;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0;
}

.number-input input[type="number"] {
    text-align: center;
    width: 50px;
    height: 35px;
    margin: 0;
    padding: 0;
    border: 1px solid #ccc;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    background: var(--wd-form-bg);
    -moz-appearance: textfield;
}

.sd_input-col :not(.number-input) input[type="number"] {
    width: 100%;
    border-radius: 0;
    background: var(--wd-form-bg);
    border: 1px solid #ccc;
    -moz-appearance: textfield;
}

.sd_input-col .number-input input[type="number"] {
    width: 100px;
}

:is(.number-input, .sd_input-col) input[type=number]::-webkit-outer-spin-button,
:is(.number-input, .sd_input-col) input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.sd_input-col {
    width: 100%;
}

.sd_input-col label {
    margin-bottom: 10px;
}

.sd_input-col label strong {
    cursor: pointer;
}

.sd_input-group .sd_input-image {
    max-width: 120px;
    height: auto;
}

.sd_checkbox-row {
    flex-direction: column;
    margin-bottom: 15px;
    padding: 10px;
    border: 1px solid #ddd;
    transition: all 0.3s ease;
}

.sd_checkbox-row:hover {
    border-color: var(--color-red);
}

.sd_checkbox-main {
    display: flex;
    align-items: center;
    gap: 15px;
}

.sd_checkbox-main p {
    font-size: 14px;
    color: #666;
    margin-bottom: 0;
}

.sd_checkbox-main label {
    cursor: pointer;
}

@media screen and (max-width: 767px) {
    .sd_checkbox-main {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        gap: 0;
    }

    .sd_checkbox-main .sd_input-image {
        max-width: 120px;
        height: auto;
        margin-bottom: 10px;
    }

    .sd_input-col {
        width: 100%;
    }

    .sd_group-table {
        width: 100%;
        margin-top: 10px;
    }
}

@media screen and (max-width: 679px) {
    .sd_group-table img {
        max-width: 80px;
    }
}

@media screen and (max-width: 600px) {
    .sd_option-table > tbody > tr > td {
        display: block;
        text-align: center;
    }

    .sd_option-table > tbody > tr > td:nth-child(2) {
        padding-top: 0;
        padding-bottom: 0;
    }

    .sd_option-table > tbody > tr:not(:last-child) > td:nth-child(3) {
        padding-bottom: 30px;
    }

    .sd_option-table .sd_inner-table {
        width: 100%;
        margin: 0 auto;
    }

    .sd_option-table .sd_inner-table th {
        padding-top: 0;
    }
}