/* Plik: web-koszyk.css */
/* Wersja: 2.6 (LØKEN & OPTIMA EXPORT BLOCKS + NAKŁADKA ROTACJI EKRANU) */

/* === NAKŁADKA WYMUSZAJĄCA OBRÓT TELEFONU W KOSZYKU === */
#wk-rotate-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background-color: #1e293b; 
    color: white;
    z-index: 2147483647; 
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
}

#wk-rotate-overlay i {
    font-size: 5rem;
    color: #16a34a; 
    margin-bottom: 20px;
    animation: rotatePhoneAnim 2s ease-in-out infinite;
}

@keyframes rotatePhoneAnim {
    0% { transform: rotate(0deg); }
    50% { transform: rotate(-90deg); }
    100% { transform: rotate(-90deg); }
}

@media screen and (max-width: 768px) and (orientation: portrait) {
    body.wk-cart-open #wk-rotate-overlay {
        display: flex !important;
    }
    body.wk-cart-open #webkalkulator-app {
        display: none !important; 
    }
    body.wk-cart-open {
        background-color: #1e293b !important;
    }
}

/* === NOWE: Logo Aplikacji === */
.wk-app-logo {
    margin-bottom: 16px; 
}
.wk-app-logo img {
    height: 80px; 
    width: auto;
    opacity: 0.8;
}

/* === Przyciski === */

/* Przycisk Główny (ZIELONY - Vindu Butikken) */
.wk-button-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    line-height: 1.5;
    /* ZIELONY */
    background-color: #16a34a; /* green-600 */
    color: white;
    border-color: #16a34a;
}
.wk-button-primary:not(:disabled):hover {
    background-color: #15803d; /* green-700 */
}
.wk-button-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Przycisk Drugorzędny (Szary) */
.wk-button-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    line-height: 1.5;
    background-color: #f3f4f6; /* gray-100 */
    color: #374151; /* gray-700 */
    border-color: #d1d5db; /* gray-300 */
}
.wk-button-secondary:not(:disabled):hover {
    background-color: #e5e7eb; /* gray-200 */
}
.wk-button-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Przycisk Niebezpieczny (Czerwony) */
.wk-button-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    line-height: 1.5;
    background-color: #dc2626; /* red-600 */
    color: white;
    border-color: #dc2626;
}
.wk-button-danger:not(:disabled):hover {
    background-color: #b91c1c; /* red-700 */
}
.wk-button-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* === Przełącznik Widoku (Vis Handlekurv) === */
.wk-view-switcher {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

#wk-show-cart-btn {
    background-color: #ffffff;
    color: #16a34a; 
    border-color: #ffffff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
#wk-show-cart-btn:hover {
    background-color: #f0fdf4; 
    color: #15803d;
}
#wk-show-cart-btn i {
    color: #16a34a; 
}

/* === Struktura Koszyka === */
#web-koszyk-view {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.wk-koszyk-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 16px;
}
.wk-koszyk-header h1 {
    flex-grow: 1;
    text-align: center;
}

.wk-koszyk-logo {
    height: 60px; 
    width: auto;
}

.wk-koszyk-klient-box {
    display: flex;
    gap: 20px;
    align-items: stretch;
    padding: 20px;
    background-color: #f9fafb; 
    border: 1px solid #e5e7eb; 
    border-radius: 8px;
}

.wk-klient-opcje {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.klient-opcja-grupa {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.klient-opcja-grupa label {
    font-size: 0.9rem;
    cursor: pointer;
    color: #374151;
    font-weight: 500;
}

#wk-global-offer-nr,
#wk-deres-ref {
    width: 100%;
    padding: 8px;
    border: 1px solid #d1d5db; 
    border-radius: 6px;
    font-size: 1rem;
}

.wk-koszyk-lista-klasa {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 200px;
}

/* === Elementy Koszyka === */
.wk-koszyk-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background-color: #ffffff;
    padding: 16px;
    border-radius: 6px;
    border: 1px solid #e5e7eb; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.wk-koszyk-item-img {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    background-color: #f3f4f6; 
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5em;
    color: #9ca3af; 
    overflow: hidden;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.wk-koszyk-item-img img { 
    display: none;
}

.wk-koszyk-item-info {
    flex-grow: 1;
}

.wk-koszyk-item-title {
    font-size: 1.125rem; 
    font-weight: 600;
    color: #1f2937; 
}

.wk-koszyk-item-details {
    font-size: 0.875rem; 
    color: #6b7280; 
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin-top: 4px;
}
.wk-koszyk-item-details span::after {
    content: '|';
    margin-left: 12px;
    color: #e5e7eb; 
}
.wk-koszyk-item-details span:last-child::after {
    content: '';
}

.wk-koszyk-item-ref {
    flex-shrink: 0;
    min-width: 120px;
    margin-right: 16px;
}

.wk-koszyk-item-price {
    flex-shrink: 0;
    text-align: right;
    min-width: 150px;
}

.wk-koszyk-item-price .unit-price {
    font-size: 0.875rem;
    color: #6b7280;
}
.wk-koszyk-item-price .line-price {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
}

.wk-koszyk-item-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wk-koszyk-item-actions input {
    width: 60px;
    padding: 5px;
    text-align: center;
    border: 1px solid #d1d5db;
    border-radius: 4px;
}

/* === Podsumowanie Koszyka === */
.wk-koszyk-summary {
    border-top: 2px solid #e5e7eb; 
    padding-top: 16px;
    margin-top: auto;
    width: 100%;
    max-width: 450px;
    align-self: flex-end;
}

.wk-summary-line {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 1rem;
    color: #374151; 
}
.wk-summary-line.total {
    font-weight: 700;
    font-size: 1.25rem; 
    color: #111827; 
    margin-top: 8px;
}

.wk-koszyk-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 16px;
}

/* === Style interfejsu === */
.color-swatch { display: inline-block; width: 16px; height: 16px; border: 1px solid #ccc; border-radius: 50%; margin-right: 5px; vertical-align: middle; }

input[type="radio"]:checked + label { 
    border-color: #16a34a; 
    background-color: #f0fdf4; 
}

.radio-label-button { 
    padding: 8px 12px;
    border: 1px solid #d1d5db; 
    border-radius: 6px; 
    cursor: pointer; 
    display: inline-flex; 
    align-items: center; 
    transition: all 0.2s ease-in-out; 
    background-color: #fff;
    min-height: 38px;
    flex-wrap: wrap;
    line-height: 1.2;
    width: 100%;
}
.radio-label-button:hover { background-color: #f9fafb; }

.wk-checkbox-label {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid #d1d5db; 
    border-radius: 0.375rem; 
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    width: 100%; 
}
.wk-checkbox-label:hover {
    background-color: #f3f4f6; 
}
.wk-checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    height: 16px;
    width: 16px;
    accent-color: #16a34a;
}
.wk-checkbox-label input[type="checkbox"]:checked + span {
    font-weight: 600;
}
.wk-checkbox-label:has(input[type="checkbox"]:checked) {
     border-color: #16a34a; 
     background-color: #f0fdf4; 
}

.accordion-button { background-color: #f3f4f6; color: #374151; cursor: pointer; padding: 12px 16px; width: 100%; border: 1px solid #d1d5db; border-radius: 6px; text-align: left; outline: none; font-size: 1rem; font-weight: 500; transition: background-color 0.2s ease; display: flex; justify-content: space-between; align-items: center; }
.accordion-button:hover { background-color: #e5e7eb; }
.accordion-button.active { background-color: #e5e7eb; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.accordion-button .icon::before { content: '+'; font-weight: bold; font-size: 1.2em; transition: transform 0.2s ease; display: inline-block; }
.accordion-button.active .icon::before { content: '−'; }

.accordion-panel {
    padding: 0;
    background-color: white;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease-out;
    border: 0px solid #d1d5db;
    border-top: none;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
}
.accordion-panel.open {
    border-width: 1px;
}
.accordion-content {
    padding: 16px;
}

.range-slider-group { margin-bottom: 1rem; }
.range-slider-group .label-container { display: flex; justify-content: flex-start; align-items: center; margin-bottom: 4px; }
.range-value { font-weight: 600; color: #15803d; }
.dimension-input-container { display: flex; align-items: center; }

.dimension-input-stepper {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-right: 1rem;
}
.dimension-input-stepper input[type="number"] {
    width: 70px;
    text-align: center;
    border-left: none;
    border-right: none;
    border-radius: 0;
    padding-left: 2px;
    padding-right: 2px;
    height: 38px; 
    border-top: 1px solid #d1d5db;
    border-bottom: 1px solid #d1d5db;
}
.dim-stepper-btn {
    width: 30px;
    height: 38px;
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    line-height: 1;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    transition: background-color 0.2s;
}

.dim-stepper-btn.dim-btn-plus {
    background-color: #dcfce7; 
    color: #15803d; 
    border-color: #86efac; 
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: none; 
}
.dim-stepper-btn.dim-btn-plus:hover {
    background-color: #bbf7d0; 
}

.dim-stepper-btn.dim-btn-minus {
    background-color: #f3f4f6; 
    color: #4b5563; 
    border-color: #d1d5db; 
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}
.dim-stepper-btn.dim-btn-minus:hover {
    background-color: #e5e7eb; 
}

.valgfri-input { 
    display: none; 
    margin-top: 8px;
    border: 1px solid #d1d5db; 
    border-radius: 4px; 
    padding: 4px 8px;
    width: 100%;
}
input[type="radio"][value="valgfri"]:checked + label + .valgfri-input { 
    display: inline-block; 
}

.wk-tech-item-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}
.wk-tech-edit-btn {
    background: none;
    border: none;
    padding: 4px;
    margin: 0;
    cursor: pointer;
    color: #9ca3af; 
    font-size: 1.25rem;
    line-height: 1;
}
.wk-tech-edit-btn:hover {
    color: #16a34a;
}

.wk-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.wk-modal.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}

.wk-modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.wk-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
}

.wk-logistics-wrapper {
    animation: modalSlideIn 0.4s ease-out;
}

.wk-pallet-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.wk-pallet-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}