/* Plik: style.css */

body {
    font-family: 'Inter', sans-serif; /* Domyślna czcionka Tailwind */
}

/* Style dla input[type=number] bez strzałek */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type=number] {
    -moz-appearance: textfield;
}

/* Style dla SVG, aby się dobrze skalowało */
#wk-rysunek-kontener svg {
     max-width: 100%;
     max-height: 400px; /* Ograniczenie wysokości rysunku */
     height: auto;
     display: block;
     margin: auto;
}

/* Style dla niestandardowych przycisków radio */
.wk-radio-label {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid #d1d5db; /* gray-300 */
    border-radius: 0.375rem; /* rounded-md */
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}
.wk-radio-label:hover {
    background-color: #f3f4f6; /* gray-100 */
}
.wk-radio-label input[type="radio"] {
    display: none;
}
.wk-radio-label input[type="radio"]:checked + span {
    font-weight: 600;
}
.wk-radio-label input[type="radio"]:checked + span::before {
     content: '✓';
     margin-right: 6px;
     color: #2563eb; /* blue-600 */
     font-weight: bold;
}
.wk-radio-label:has(input[type="radio"]:checked) {
     border-color: #2563eb; /* blue-600 */
     background-color: #eff6ff; /* blue-50 */
}

/* === NOWE STYLE: Miniatury zdjęć (Hover Zoom) === */
.wk-icon-thumb {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
    background-color: #fff;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.2s, box-shadow 0.2s;
    transform-origin: center center;
    position: relative;
    z-index: 10;
    flex-shrink: 0;
}

.wk-icon-thumb:hover {
    transform: scale(6);
    border-color: #475569;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    cursor: zoom-in;
}

/* Ustawienie przycisku Materiale */
.wk-material-button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    height: auto;
    min-height: 44px;
    border: 1px solid #cbd5e1; 
    border-radius: 6px; 
    background-color: #ffffff; 
    cursor: pointer; 
    transition: all 0.2s ease-in-out; 
    font-weight: 500; 
    color: #334155;
    overflow: visible !important; 
    position: relative;
}
.wk-material-button:hover:not(:disabled) { background-color: #f1f5f9; }
.wk-material-button.selected { border-color: #475569; background-color: #e2e8f0; color: #0f172a; font-weight: 700; }
.wk-material-button:disabled { background-color: #f3f4f6; color: #9ca3af; cursor: not-allowed; opacity: 0.7; }

/* Nagłówki akordeonu */
.accordion-button {
    background-color: #f3f4f6; 
    color: #374151; 
    cursor: pointer; 
    padding: 10px 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;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    overflow: visible !important;
    position: relative;
    z-index: 1;
}
.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-header-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* === NOWE STYLE: Kompaktowa lista opcji szkła === */
.wk-scrollable-list {
    max-height: 350px; /* Wysokość listy z przewijaniem */
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background-color: #f8fafc;
    margin-top: 8px;
}

.wk-compact-option {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
    font-size: 0.9rem;
    color: #334155;
    transition: background-color 0.2s;
}

.wk-compact-option:last-child {
    border-bottom: none;
}

.wk-compact-option:hover {
    background-color: #e2e8f0;
}

.wk-compact-option input[type="checkbox"] {
    margin-right: 12px;
    width: 16px;
    height: 16px;
    accent-color: #2563eb;
    cursor: pointer;
}

.wk-compact-option .label-text {
    flex-grow: 1;
    font-weight: 500;
}

.wk-compact-option .price-tag {
    font-size: 0.85em;
    color: #2563eb; /* Niebieski kolor ceny */
    font-weight: 600;
    white-space: nowrap;
}

/* === TOOLTIP INFORMACYJNY (UNIWERSALNY) === */
.wk-info-tooltip-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    z-index: 50;
}

.wk-info-icon {
    color: #2563eb; /* blue-600 */
    font-size: 1.3rem; 
    cursor: pointer;
    transition: color 0.2s;
}
.wk-info-icon.warning {
    color: #ea580c; /* orange-600 */
}
.wk-info-icon:hover {
    color: #1d4ed8; /* blue-700 */
}
.wk-info-icon.warning:hover {
    color: #c2410c; /* orange-700 */
}

.wk-tooltip-content {
    display: none; 
    position: absolute;
    bottom: 100%; 
    left: 50%;
    transform: translateX(-50%);
    width: 340px; 
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.2), 0 8px 16px -8px rgba(0, 0, 0, 0.1);
    padding: 16px;
    font-size: 0.8rem;
    line-height: 1.4;
    color: #334155;
    z-index: 1000;
    margin-bottom: 12px; 
    text-align: left;
    white-space: normal;
}

.wk-tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -8px;
    border-width: 8px;
    border-style: solid;
    border-color: #ffffff transparent transparent transparent;
}
.wk-tooltip-content::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -9px;
    border-width: 9px;
    border-style: solid;
    border-color: #cbd5e1 transparent transparent transparent;
}

.wk-tooltip-image {
    width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    margin-top: 10px;
    display: block;
}

.wk-tooltip-title {
    font-weight: 700;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: #1e293b;
    display: block;
}
.wk-tooltip-subtitle {
    font-weight: 600;
    margin-top: 8px;
    margin-bottom: 4px;
    color: #334155;
    display: block;
}

/* === ZMIANA: Pokazywanie tooltipa tylko na desktopie przy hover === */
@media (hover: hover) {
    .wk-info-tooltip-container:hover .wk-tooltip-content {
        display: block;
    }
}

/* Na wszystkich urządzeniach pokazujemy, gdy jest klasa .active (dodawana przez JS na klik) */
.wk-info-tooltip-container.active .wk-tooltip-content {
    display: block;
}

/* === ZMIANA: Responsywność Tooltipa na Mobile (Fix wyskakujących tooltipów) === */
@media (max-width: 640px) {
    .wk-tooltip-content {
        /* Przełączenie na position fixed na środku ekranu */
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        bottom: auto; /* Resetujemy bottom */
        
        width: 90vw; /* 90% szerokości ekranu */
        max-width: 340px;
        margin: 0;
        
        z-index: 9999; /* Bardzo wysoki z-index, żeby przykryć wszystko */
        border: 1px solid #94a3b8;
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
    }
    
    /* Ukrywamy strzałki na mobile, bo tooltip jest "okienkiem" */
    .wk-tooltip-content::after,
    .wk-tooltip-content::before {
        display: none;
    }
}

/* === NOWE: OSTRZEŻENIE O SZKLE I INFO O LINJERING === */
.wk-safety-glass-warning {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    padding: 8px;
    background-color: #fff7ed; /* orange-50 */
    border: 1px dashed #fdba74; /* orange-300 */
    border-radius: 6px;
    color: #c2410c; /* orange-700 */
    font-size: 0.9rem;
    font-weight: 600;
}

/* NOWE: Stan sukcesu (zielony) */
.wk-safety-glass-warning.success {
    background-color: #f0fdf4; /* green-50 */
    border-color: #86efac; /* green-300 */
    color: #15803d; /* green-700 */
    border-style: solid;
}

/* NOWE: Małe przyciski akcji wewnątrz ostrzeżenia */
.wk-btn-xs {
    padding: 3px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    color: #334155;
    transition: all 0.2s;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.wk-btn-xs:hover {
    background-color: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}

.wk-btn-xs-danger {
    color: #dc2626;
    border-color: #fca5a5;
    background-color: #fff1f2;
}
.wk-btn-xs-danger:hover {
    background-color: #fee2e2;
    border-color: #f87171;
    color: #b91c1c;
}

/* INFO O LINJERINGU W RAMCE OBOK */
#wk-panel-alignment-wrapper {
    flex-grow: 1; /* Rozciągnij na dostępną szerokość */
    justify-content: space-between; /* Tekst po lewej, ikona po prawej */
    height: 38px; /* Ta sama wysokość co input */
}

/* === NOWE STYLE DLA SZPROSÓW (Sprosser Grid) === */
.wk-sprosse-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
}

.wk-sprosse-card {
    cursor: pointer;
    display: block;
}

.wk-sprosse-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background-color: #fff;
    overflow: hidden;
    transition: all 0.2s ease-in-out;
    height: 100%;
}

.wk-sprosse-card:hover .wk-sprosse-card-content {
    border-color: #94a3b8;
    background-color: #f8fafc;
}

.wk-sprosse-img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    background-color: #f1f5f9;
}

.wk-sprosse-img-placeholder {
    width: 100%;
    height: 80px;
}

.wk-sprosse-label {
    padding: 8px 4px;
    font-size: 0.75rem; /* text-xs */
    font-weight: 600;
    text-align: center;
    color: #334155;
    line-height: 1.2;
}