/* Plik: koszyk.css */
/* ZAKTUALIZOWANO 2025-09-22 v4 (REORDEROWANIE PRZYCISKAMI): Dodano style dla przycisków "+" i "-" do zmiany kolejności. */
/* ZAKTUALIZOWANO 2025-09-27 (EDYCJA Z KOSZYKA): Dodano styl dla podświetlania edytowanego produktu. */

#koszyk-view {
    width: 100%;
    padding: 25px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background-color: #f8f9fa;
}

#koszyk-view h1 {
    margin-top: 0;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 15px;
}

.cart-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex-grow: 1;
    overflow-y: auto;
    padding: 5px;
    min-height: 50vh;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background-color: #fff;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: background-color 0.3s ease, border-left 0.3s ease;
    border-left: 4px solid transparent;
}

.cart-item.drawing-item {
    background-color: #f8f9fa;
    border-left-color: #6c757d;
}

.cart-item.marked-item {
    background-color: #fffde7; 
    border-left: 4px solid #fbc02d; 
}

.cart-item.is-editing {
    background-color: #ffebee; 
    border-left: 4px solid #c62828; 
    border-color: #ffcdd2;
}


.cart-item-marker {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mark-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #fbc02d;
}


.cart-item-info {
    flex-grow: 1;
    min-width: 0;
}

.cart-item-title {
    font-size: 1.1em;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.position-container {
    display: inline-flex;
    align-items: center;
    font-weight: bold;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: #f8f9fa;
    overflow: hidden;
}

.position-input {
    width: 40px;
    height: 30px;
    text-align: center;
    font-weight: bold;
    border: none;
    background-color: transparent;
    font-size: 1em;
    -moz-appearance: textfield;
}
.position-input::-webkit-outer-spin-button,
.position-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.position-input:focus {
    outline: none;
    background-color: #fff;
}

.position-controls {
    display: flex;
    flex-direction: column;
    height: 30px;
}

.position-btn {
    width: 22px;
    height: 15px;
    border: none;
    background-color: #e9ecef;
    cursor: pointer;
    color: #343a40;
    font-weight: bold;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    border-left: 1px solid #ced4da;
}
.position-btn:hover {
    background-color: #dee2e6;
}
.position-btn.up {
    border-bottom: 1px solid #ced4da;
}

.nazwa-input {
    font-weight: bold;
    font-size: 1em;
    border: none;
    border-bottom: 1px dashed #ccc;
    padding: 5px;
    width: 80%;
    background-color: transparent;
    transition: border-color 0.2s, background-color 0.2s;
}
.nazwa-input:focus {
    outline: none;
    border-bottom: 1px solid #007bff;
    background-color: #f8f9fa;
}


.cart-item-details {
    font-size: 0.9em;
    color: #6c757d;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-left: 25px;
}

.cart-item-details span::after {
    content: '|';
    margin-left: 10px;
    color: #dee2e6;
}

.cart-item-details span:last-child::after {
    content: '';
}

.komentarz-input {
    width: 95%;
    margin-top: 10px;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    font-family: inherit;
    font-size: 0.9em;
    min-height: 40px;
    resize: vertical;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap; 
    justify-content: flex-end;
}

.cart-item-actions label {
    font-size: 0.8em;
    color: #6c757d;
    white-space: nowrap;
}

.cart-item-actions input {
    width: 70px;
    padding: 5px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.cart-item-actions .edit-btn {
    background-color: #ff9800;
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 16px;
    line-height: 28px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color: 0.2s;
}
.cart-item-actions .edit-btn:hover {
    background-color: #f57c00;
}


.cart-item-actions .usun-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 20px;
    line-height: 28px;
    cursor: pointer;
    font-weight: bold;
    margin-left: 10px;
}

.foring-input-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.foring-input-container label {
    font-size: 0.8em;
    font-weight: bold;
    color: #0056b3;
    margin-left: 4px;
}

.foring-input-container .dimension-input-wrapper {
    display: flex;
    align-items: center;
}
.foring-input-container .foring-input {
    width: 60px;
    -moz-appearance: textfield;
}
.foring-input-container .foring-input::-webkit-outer-spin-button,
.foring-input-container .foring-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.foring-input-container .dimension-controls {
    display: flex;
}
.foring-input-container .dim-btn {
    width: 28px;
    height: 30px;
    font-size: 20px;
    font-weight: bold;
    border: 1px solid #ccc;
    background-color: #f8f9fa;
    cursor: pointer;
}
.foring-input-container .dim-btn:hover {
    background-color: #e9ecef;
}
.foring-input-container .dim-btn.minus {
    border-radius: 4px 0 0 4px;
    border-right: none;
}
.foring-input-container .dim-btn.plus {
    border-radius: 0 4px 4px 0;
}


.cart-summary {
    border-top: 2px solid #dee2e6;
    padding-top: 20px;
    margin-top: auto;
    width: 50%;
    align-self: flex-end;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 1.1em;
}

.summary-line.total {
    font-weight: bold;
    font-size: 1.4em;
    margin-top: 10px;
}

.cart-actions-top {
    margin-bottom: 20px;
}

.cart-actions-bottom {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed #ccc;
}

.cart-actions-top.przyciski-akcji .przycisk-eksportu {
    width: auto;
    background-color: #6c757d;
}

.cart-header-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap; 
}

#cart-header-summary {
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    padding: 15px 10px;
    margin-bottom: 20px;
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

#cart-header-summary .summary-item {
    text-align: center;
    border-right: 1px solid #e9ecef;
    padding: 0 20px;
    flex-grow: 1;
    flex-basis: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#cart-header-summary .summary-item:last-child {
    border-right: none;
}

#cart-header-summary .summary-label {
    display: block;
    font-size: 0.9em;
    color: #6c757d;
    margin-bottom: 4px;
    text-transform: uppercase;
}

#cart-header-summary .summary-value {
    display: block;
    font-size: 1.6em;
    font-weight: 600;
    color: #343a40;
}

#cart-header-summary .summary-item.price-summary .summary-value {
    color: #0056b3;
    font-weight: 700;
}


.cart-info-box {
    background-color: #fff;
    padding: 20px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.client-box {
    flex: 1 1 400px;
}

.offer-details-box {
    flex: 2 1 500px;
}


.cart-info-box h3,
#klient-selection-container-global .accordion {
    margin-top: 0;
    font-size: 1.1em;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

#klient-selection-container-global .accordion {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    width: 100%;
    text-align: left;
    cursor: pointer;
}
#klient-selection-container-global .accordion:after {
    content: '+';
    float: right;
}
#klient-selection-container-global .accordion.active:after {
    content: '−';
}

#klient-selection-container-global .panel {
    padding: 10px 0;
    background-color: transparent;
    border: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

#custom-client-fields {
    display: none;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #ccc;
}

#custom-client-fields .opcja-grupa {
    margin-bottom: 10px;
}

#custom-client-fields label {
    font-size: 0.9em;
    margin-bottom: 4px;
    display: block;
}

#custom-client-fields input {
    width: 100%;
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.cart-info-box label {
    display: block;
    font-weight: 600;
    margin-top: 10px;
    margin-bottom: 4px;
    font-size: 0.9em;
}

.cart-info-box input[type="text"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 14px;
}

.offer-details-inline {
    display: flex;
    gap: 20px;
}
.offer-detail-item {
    flex: 1;
}

.cart-offer-info {
   display: none; 
}

#gdrive-link-box {
    background-color: #fff;
    padding: 15px 20px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 60px;
    box-sizing: border-box;
}
#gdrive-link-container {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-grow: 1;
}
#gdrive-link-text {
    font-family: monospace;
    font-size: 14px;
    color: #0056b3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60vw;
}
#copy-gdrive-link-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 24px;
    color: #007bff;
    padding: 5px;
    line-height: 1;
}
#copy-gdrive-link-btn:hover {
    color: #0056b3;
}
#joke-container {
    font-style: italic;
    color: #6c757d;
    text-align: center;
    flex-grow: 1;
}

#global-pdf-btn-price {
    background-color: #007bff;
}
#global-pdf-btn-price:hover {
    background-color: #0069d9;
}

#foringer-calculator {
    margin-top: 20px;
    padding: 20px;
    border: 1px solid #b3d7ff;
    border-radius: 8px;
    background-color: #f0f8ff;
}
#foringer-calculator h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #0056b3;
}
#foringer-calculator p {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 0.9em;
    color: #495057;
}
#calculate-foringer-btn {
    background-color: #007bff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto;
    padding: 10px 20px;
}
#foringer-result-container {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed #99caff;
}
.report-section {
    margin-bottom: 25px;
}
.report-section h3 {
    color: #004085;
    border-bottom: 2px solid #b3d7ff;
    padding-bottom: 5px;
    margin-bottom: 15px;
}
.report-section ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}
.report-section li {
    font-size: 1em;
    padding: 8px 5px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
}
.report-section li:last-child {
    border-bottom: none;
}
.report-section li span {
    color: #495057;
}


.report-assumptions {
    background-color: #e2e3e5;
    border: 1px solid #ced4da;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    font-size: 0.9em;
}
.report-assumptions h4 {
    margin-top: 0;
    color: #343a40;
}
.cutting-plan-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 15px;
}
.cutting-plan-item {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.plan-item-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
    font-size: 0.9em;
}
.plan-item-header .waste {
    color: #dc3545;
    font-weight: bold;
}
.progress-bar-container {
    width: 100%;
    background-color: #e9ecef;
    border-radius: 4px;
    height: 20px;
    position: relative;
    margin-bottom: 10px;
    overflow: hidden;
}
.progress-bar {
    background-color: #28a745;
    height: 100%;
}
.progress-bar-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: bold;
    color: #343a40;
    text-shadow: none;
}
.cuts-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}
.cut-piece {
    background-color: #007bff;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 500;
}