/* ==============================
   BASE
   ============================== */

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

#inkodus_return_form {
    width: 100%;
    height: 100%;
    overflow: hidden;
    padding: 0;
    margin: 0;
    font-size: 18px;
    line-height: 1.4;
}

.return_form-control {
    padding: 0;
    margin: 0;
    width: 100%;
    counter-reset: list-item;
    list-style-type: none;
}

.return_form-item {
    counter-increment: list-item;
    margin-bottom: 25px;
}

.return_form-item:before {
    content: counter(list-item) ")";
    margin-right: 0.2em;
}

.return_form-item--hidden { display: none; }
.return_form-item--active { display: block; }

/* ==============================
   FORM INPUTS
   ============================== */

.return_form-input,
.return_form-select,
.order-type-select,
.return_form-input-name,
.return_form-input-pickup {
    margin-top: 10px;
    border: 2px solid #C2C2C2;
    background-color: #fff;
    width: 100%;
    font-size: 16px;
    padding: 14px 10px;
    white-space: normal;
    box-sizing: border-box;
    cursor: pointer;
}

.return_form-input,
.return_form-select,
.order-type-select {
    max-width: 500px;
}

.return_form-select,
.order-type-select {
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    text-overflow: ellipsis;
    overflow: hidden;
}

.return_form-select option,
.order-type-select option {
    white-space: normal;
    word-wrap: break-word;
}

.return_form-input-name {
    max-width: 243px;
    margin-right: 10px;
}

.return_form-input-pickup {
    max-width: 200px;
    margin-right: 10px;
}

.return_invalid_field {
    border: 2px solid red;
}

.js-condition {
    accent-color: #000000;
    width: 18px;
    height: 18px;
    cursor: pointer;
    vertical-align: middle;
}

/* ==============================
   RETURN TABLE (desktop)
   ============================== */

.return-table-wrapper {
    width: 100%;
}

.return-table {
    width: 100%;
    border: 1px solid #c2c2c2;
    border-collapse: collapse;
    table-layout: fixed;
}

.return-table-header th {
    font-weight: 600;
    text-align: center;
    background: #fff;
    padding: 12px 8px;
}

.return-table-footer td {
    font-weight: bold;
    background: #f5f5f5;
    text-align: center;
}

.return-table th,
.return-table td {
    border-right: 1px solid #c2c2c2;
    border-bottom: 1px solid #c2c2c2;
    padding: 10px;
    vertical-align: middle;
    line-height: 1.2;
    word-wrap: break-word;
}

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

.return-table th:nth-child(1),
.return-table td:nth-child(1) { width: 130px; text-align: center; }

.return-table th:nth-child(2),
.return-table td:nth-child(2) { width: auto; text-align: left; }

.return-table th:nth-child(3),
.return-table td:nth-child(3) { width: 200px; text-align: center; }

.return-table th:nth-child(4),
.return-table td:nth-child(4) { width: 100px; text-align: center; }

.return-table th:nth-child(5),
.return-table td:nth-child(5) { width: 100px; text-align: center; }

.return-product-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
}

.return-product-cell img {
    width: 60px;
    height: auto;
    flex-shrink: 0;
}

.return-item-title {
    flex: 1;
    min-width: 0;
}

.return-item-name {
    font-weight: 500;
    word-break: break-word;
}

.return-item-variant {
    display: block;
    font-size: 14px;
    color: #777;
    line-height: 1.2;
    margin-top: 2px;
    word-break: break-word;
}

.qty-control {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.qty-control button {
    width: 44px;
    height: 40px;
    background: #333;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    padding: 0;
}

.qty-control input {
    width: 48px;
    height: 40px;
    text-align: center;
    border: 1px solid #c2c2c2;
    border-left: none;
    border-right: none;
    font-size: 16px;
    padding: 0;
    -moz-appearance: textfield;
}

.qty-control input::-webkit-outer-spin-button,
.qty-control input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

.return-form-total-amount {
    font-size: 1.75rem;
    margin: 25px 0;
    text-align: right;
}

#return-form-item-label {
    display: inline-block;
    margin-bottom: 10px;
}

#return-form-empty-field {
    background-color: #fff;
    border: 1px solid #fff;
    border-right: 1px solid #c2c2c2;
}

.bundle-notice {
    font-size: 12px;
    color: #c0392b;
    margin-top: 4px;
}

.bundle-row {
    background: #fff8f8;
}

/* ==============================
   TABLET (≤1024px)
   ============================== */

@media screen and (max-width: 1024px) {
    .return-table th,
    .return-table td {
        padding: 8px 6px;
        font-size: 14px;
    }

    .return-table th:nth-child(1),
    .return-table td:nth-child(1) { width: 90px; }

    .return-table th:nth-child(3),
    .return-table td:nth-child(3) { width: 140px; }

    .return-table th:nth-child(4),
    .return-table td:nth-child(4) { width: 80px; }

    .return-table th:nth-child(5),
    .return-table td:nth-child(5) { width: 90px; }

    .return-product-cell img { width: 50px; }

    .qty-control button {
        width: 36px;
        height: 36px;
        font-size: 22px;
    }

    .qty-control input {
        width: 40px;
        height: 36px;
        font-size: 14px;
    }

    .return-form-total-amount {
        font-size: 1.5rem;
        margin: 20px 0;
    }
}

/* ==============================
   SMALL TABLET / LARGE PHONE (≤768px)
   Switch table to stacked card layout
   ============================== */

@media screen and (max-width: 768px) {
    .return-table {
        border: none;
        table-layout: auto;
    }

    .return-table-header { display: none; }

    .return-table,
    .return-table tbody,
    .return-table tr,
    .return-table td {
        display: block;
        width: 100%;
    }

    .return-table tr.return-item-row {
        margin-bottom: 16px;
        border: 1px solid #c2c2c2;
        border-radius: 8px;
        overflow: hidden;
        background: #fff;
    }

    .return-table td {
        border: none;
        border-bottom: 1px solid #ececec;
        padding: 12px 14px;
        text-align: left;
        font-size: 15px;
        width: 100%;
    }

    .return-table td:last-child {
        border-bottom: none;
    }

    .return-table td.return-col-product,
    .return-table td:nth-child(2) {
        padding: 14px;
    }

    .return-table td.return-col-product:before,
    .return-table td:nth-child(2):before {
        content: none;
    }

    .return-product-cell {
        gap: 12px;
        align-items: flex-start;
    }

    .return-product-cell img {
        width: 72px;
    }

    .return-table td.return-col-sku,
    .return-table td.return-col-qty,
    .return-table td.return-col-price,
    .return-table td.return-col-total {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .return-table td.return-col-sku:before,
    .return-table td.return-col-qty:before,
    .return-table td.return-col-price:before,
    .return-table td.return-col-total:before {
        content: attr(data-label);
        font-weight: 600;
        color: #555;
        flex: 0 0 auto;
    }

    .return-table td.return-col-total {
        font-weight: 600;
        background: #fafafa;
    }

    .qty-control {
        margin-left: auto;
    }

    .return-table-footer { display: block; }

    .return-table-footer tr {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        background: #f5f5f5;
        padding: 1px 14px;
        border-radius: 8px;
        border: 1px solid #c2c2c2;
        margin-bottom: 16px;
    }

    .return-table-footer td {
        display: inline-block;
        width: auto;
        background: transparent;
        font-weight: bold;
        padding: 0;
        border: none;
        text-align: left;
        font-size: 16px;
    }

    .return-table-footer td:before { content: none; }
    #return-form-empty-field { display: none; }
    .return-table-footer td:nth-child(4) { display: none; }
    .return-table-footer td#return-total-sum { text-align: right; }

    .return-form-total-amount {
        font-size: 1.5rem;
        margin: 16px 0;
        text-align: center;
    }
}


@media screen and (max-width: 600px) {
    #inkodus_return_form { font-size: 16px; }

    .return_form-input-name,
    .return_form-input-pickup {
        max-width: 100%;
        margin-right: 0;
        margin-top: 8px;
        display: block;
    }

    .return_form-input,
    .return_form-select,
    .order-type-select {
        max-width: 100%;
    }

    .return_form-select,
    .order-type-select {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        display: block !important;
    }
}

/* ==============================
   SMALL PHONE (≤480px)
   ============================== */

@media screen and (max-width: 480px) {
    .return-table td {
        padding: 10px 12px;
        font-size: 14px;
    }

    .return-product-cell img { width: 60px; }

    .qty-control button {
        width: 40px;
        height: 38px;
        font-size: 22px;
    }

    .qty-control input {
        width: 44px;
        height: 38px;
        font-size: 14px;
    }

    .return-form-total-amount { font-size: 1.25rem; }

    .return-table-footer td {
        padding: 10px 12px;
        font-size: 15px;
    }
}
