/* Plik: ytterdor.css */

/* --- 1. PASEK NARZĘDZI (RIBBON) --- */
#ytterdor-ribbon-container {
    background-color: #fff;
    border-bottom: 1px solid #d1d5db;
    width: 100%;
    display: flex;
    flex-direction: column;
    padding: 0;
    margin-bottom: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    z-index: 100; 
    position: relative;
    overflow: visible !important;
}

.yt-ribbon-tabs {
    display: flex;
    background-color: #f1f1f1;
    border-bottom: 1px solid #e0e0e0;
    padding: 0 10px;
    gap: 2px;
}

.yt-ribbon-tab {
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    border-top: 3px solid transparent;
    border-left: 1px solid transparent;
    border-right: 1px solid transparent;
}

.yt-ribbon-tab:hover { background-color: #e1e1e1; color: #000; }

.yt-ribbon-tab.active {
    background-color: #fff;
    color: #007bff;
    border-top-color: #007bff;
    border-bottom: 1px solid #fff;
    border-left-color: #e0e0e0;
    border-right-color: #e0e0e0;
    margin-bottom: -1px;
    z-index: 2;
}

#ytterdor-ribbon-content {
    padding: 10px 20px;
    min-height: 64px;
    background-color: #fff;
    display: flex;
    align-items: center; 
    gap: 20px;
    overflow: visible !important;
}

.yt-ribbon-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-right: 20px;
    border-right: 1px solid #eee;
    justify-content: center;
    height: 100%;
    flex-shrink: 0;
}
.yt-ribbon-group:last-child { border-right: none; }

.yt-ribbon-label {
    font-size: 10px;
    text-transform: uppercase;
    color: #888;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.yt-ribbon-row { display: flex; gap: 8px; align-items: center; }

.ribbon-select {
    padding: 6px 8px;
    font-size: 13px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #f9f9f9;
    cursor: pointer;
    min-width: 100px;
    height: 32px;
    box-sizing: border-box;
}
.ribbon-select:focus { outline: 2px solid #007bff40; border-color: #007bff; }

.ribbon-text-search {
    padding: 6px 8px; font-size: 13px; border: 1px solid #ccc; border-radius: 4px; background-color: #fff; width: 130px; height: 32px; box-sizing: border-box;
}

.ribbon-color-picker {
    width: 32px; height: 32px; padding: 2px; border: 1px solid #ccc; border-radius: 4px; background-color: #fff; cursor: default; box-sizing: border-box;
}
.ribbon-color-picker::-webkit-color-swatch-wrapper { padding: 0; }
.ribbon-color-picker::-webkit-color-swatch { border: none; border-radius: 2px; }

.ribbon-dim-input {
    width: 60px; padding: 6px 4px; font-size: 13px; border: 1px solid #ccc; border-radius: 4px; height: 32px; box-sizing: border-box; text-align: center; font-weight: 600;
}
.ribbon-dim-separator { color: #888; font-weight: bold; font-size: 14px; }

/* DROPDOWNY */
.ribbon-dropdown-container { position: relative; display: inline-block; z-index: 9999; }
.ribbon-dropdown-btn {
    padding: 6px 12px; font-size: 13px; font-weight: 600; border: 1px solid #ccc; border-radius: 4px; background-color: #f9f9f9; cursor: pointer; min-width: 160px; height: 32px; display: flex; justify-content: space-between; align-items: center; color: #333; user-select: none; box-sizing: border-box;
}
.ribbon-dropdown-btn:hover { background-color: #f0f0f0; }
.ribbon-dropdown-content {
    display: none; position: absolute; background-color: #fff; min-width: 280px; box-shadow: 0px 8px 24px rgba(0,0,0,0.2); z-index: 10000; border: 1px solid #ddd; border-radius: 6px; padding: 0; top: 100%; left: 0; max-height: 500px; overflow-y: auto; margin-top: 4px;
}
.ribbon-dropdown-content.show { display: block; }
.ribbon-dropdown-category {
    padding: 8px 12px; background-color: #f8f9fa; font-size: 11px; font-weight: 700; color: #6c757d; text-transform: uppercase; border-bottom: 1px solid #eee; border-top: 1px solid #eee;
}
.ribbon-dropdown-category:first-child { border-top: none; }
.ribbon-checkbox-item {
    padding: 8px 12px; display: flex; align-items: center; cursor: pointer; font-size: 13px; color: #333; border-bottom: 1px solid #f9f9f9; background-color: #fff;
}
.ribbon-checkbox-item:hover { background-color: #f0f7ff; }
.ribbon-checkbox-item input { margin-right: 10px; accent-color: #007bff; width: 16px; height: 16px; cursor: pointer; }
.ribbon-checkbox-price { color: #007bff; font-size: 11px; font-weight: 600; margin-left: auto; }

/* PALETA KOLORÓW */
#ribbon-palette-dropdown {
    position: absolute; top: 100%; left: auto; background: #fff; border: 1px solid #ccc; border-radius: 4px; box-shadow: 0 4px 10px rgba(0,0,0,0.15); z-index: 10001; padding: 8px; display: none; width: 260px;
}
#ribbon-palette-dropdown.show { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.palette-item {
    display: flex; flex-direction: column; align-items: center; cursor: pointer; padding: 6px 4px; border: 1px solid transparent; border-radius: 4px; transition: background 0.2s;
}
.palette-item:hover { background-color: #f0f0f0; border-color: #ddd; }
.palette-color-box {
    width: 30px; height: 30px; border: 1px solid #ccc; border-radius: 3px; margin-bottom: 4px; box-shadow: inset 0 0 2px rgba(0,0,0,0.1);
}
.palette-item span { font-size: 10px; text-align: center; line-height: 1.2; color: #333; word-break: break-word; }

/* --- 3. GŁÓWNY UKŁAD (KOLUMNY) --- */
#ytterdor-container {
    display: flex; flex-direction: column; height: 100%; overflow: visible !important; background-color: #fff; width: 100%;
}
#ytterdor-columns-wrapper {
    display: flex; flex-grow: 1; height: 100%; overflow: hidden; position: relative; z-index: 1; width: 100%;
}
.ytterdor-column {
    display: flex; flex-direction: column; padding: 20px; box-sizing: border-box; overflow-y: auto;
}

/* Dynamiczne kolumny - Galeria zabiera wolne miejsce */
#ytterdor-gallery-col { 
    flex: 1; 
    background-color: #fdfdfd; 
    border-right: 1px solid #e0e0e0; 
    position: relative; 
    min-width: 350px;
}
#ytterdor-options-col { 
    flex: 0 0 25%; 
    border-right: 1px solid #e0e0e0; 
    background-color: #fff; 
    min-width: 300px;
}
#ytterdor-offer-col { 
    flex: 0 0 25%; 
    background-color: #fafafa; 
    min-width: 300px;
}

/* --- GALERIA / ZDJĘCIA --- */
#ytterdor-dimension-display {
    font-size: 1.4em; color: #333; font-weight: 700; margin: 5px 0 15px 0; text-align: center; height: 30px; line-height: 30px;
}
#ytterdor-gallery-container {
    display: flex; flex-direction: row; align-items: flex-start; justify-content: center; width: 100%; height: 100%; gap: 10px; min-height: 300px;
}
#ytterdor-image-wrapper {
    flex-grow: 1; display: flex; justify-content: center; align-items: flex-start; padding-top: 20px; height: 100%;
}
.ytterdor-image-part-wrapper {
    display: flex; align-items: flex-start; justify-content: center; width: 100%; height: 100%;
}
#ytterdor-image-main, #ytterdor-image-handle {
    max-height: 65vh; max-width: 100%; width: auto; height: auto; object-fit: contain; transition: transform 0.3s ease; filter: drop-shadow(0 10px 20px rgba(0,0,0,0.15));
}
#ytterdor-image-main.flipped { transform: scaleX(-1); }

.yt-side-toolbar { display: flex; flex-direction: column; gap: 8px; padding-top: 20px; z-index: 5; }
.yt-side-toolbar.left { align-items: flex-end; width: 70px; }
.yt-side-toolbar.right { align-items: flex-start; width: 50px; }

.yt-size-btn { 
    padding: 6px 10px; font-size: 12px; font-weight: 600; border: 1px solid #ccc; border-radius: 4px; background-color: #fff; color: #333; cursor: pointer; transition: all 0.2s; width: 100%; text-align: center; 
}
.yt-size-btn:hover:not(:disabled) { border-color: #007bff; color: #007bff; background-color: #f0f7ff; }
.yt-size-btn:disabled { background-color: #f0f0f0; color: #ccc; border-color: #e0e0e0; cursor: not-allowed; text-decoration: line-through; }
.yt-size-btn.active { background-color: #333 !important; color: #fff !important; border-color: #333 !important; }

.yt-tool-btn { width: 36px; height: 36px; border: 1px solid #ccc; border-radius: 4px; background-color: #fff; color: #555; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 18px; transition: all 0.2s; }
.yt-tool-btn:hover { background-color: #f0f0f0; color: #000; }

/* --- PASTE BOX --- */
#ytterdor-gallery-paste-box {
    width: 100%; height: 60vh; border: 3px dashed #007bff; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; background-color: #f4f7f9; padding: 20px; box-sizing: border-box; margin-top: 20px;
}
#ytterdor-gallery-paste-content { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; cursor: text; font-size: 1.2em; color: #555; font-weight: bold; text-align: center; outline: none; }
#ytterdor-gallery-clear-paste-btn { margin-top: 15px; padding: 8px 15px; background-color: #dc3545; color: white; border: none; border-radius: 5px; cursor: pointer; font-weight: bold; }

/* --- OPCJE KONFIGURATORA --- */
#ytterdor-options-col .ytterdor-option-group { margin-bottom: 15px; }
#ytterdor-options-col .ytterdor-option-group label { display: block; font-weight: 600; margin-bottom: 5px; font-size: 13px; }
#ytterdor-options-col select, 
#ytterdor-options-col input[type="text"], 
#ytterdor-options-col input[type="number"] { width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; }

#ytterdor-options-col .accordion { background-color: #f1f1f1; color: #444; cursor: pointer; padding: 12px; width: 100%; border: none; text-align: left; outline: none; font-size: 14px; font-weight: 600; transition: 0.4s; border-bottom: 1px solid #ddd; border-top: 1px solid #ddd; margin-top: -1px; }
#ytterdor-options-col .accordion.active, #ytterdor-options-col .accordion:hover { background-color: #e9ecef; }
#ytterdor-options-col .accordion:after { content: '+'; font-size: 16px; color: #777; font-weight: bold; float: right; }
#ytterdor-options-col .accordion.active:after { content: "−"; }
#ytterdor-options-col .panel { padding: 15px; background-color: white; max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out; border-left: 1px solid #ddd; border-right: 1px solid #ddd; }

#ytterdor-price-display { margin-top: auto; padding: 15px; background-color: #e8f4fd; border: 1px solid #b6d4fe; border-radius: 5px; flex-shrink: 0; }
.ytterdor-price-line { display: flex; justify-content: space-between; padding: 4px 0; font-size: 14px; }
.ytterdor-price-line.total { font-weight: bold; font-size: 18px; color: #0d47a1; border-top: 1px solid #b6d4fe; margin-top: 10px; padding-top: 10px; }

/* Przyciski akcji */
.przyciski-akcji { display: flex; gap: 10px; margin-bottom: 15px; }
.przyciski-akcji button { flex-grow: 1; padding: 10px; border-radius: 5px; border: 1px solid #ccc; cursor: pointer; font-weight: bold; }
.przycisk-glowny { background-color: #28a745; color: white; border-color: #28a745; }
#ytterdor-add-to-main-cart { background-color: #007bff; color: white; border-color: #007bff; }

#ytterdor-view-switcher { display: flex; gap: 5px; margin-bottom: 15px; }
.ytterdor-type-btn { flex-grow: 1; padding: 6px; border: 1px solid #ccc; background: #fff; border-radius: 4px; cursor: pointer; font-weight: 600; color: #555; }
.ytterdor-type-btn.selected { background-color: #333; color: #fff; border-color: #333; }

/* --- KOSZYK LOKALNY --- */
.ytterdor-pozycja-oferty {
    display: flex;
    flex-direction: column;
    padding: 10px 0;
    border-bottom: 1px solid #e9e9e9;
    gap: 5px;
}

.ytterdor-pozycja-gora {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.ytterdor-pozycja-info {
    flex: 1;
    min-width: 0;
}

.ytterdor-pozycja-tytul {
    display: flex;
    align-items: center;
    font-size: 13px;
    line-height: 1.3;
}
.ytterdor-pozycja-tytul strong {
    margin-right: 5px;
    white-space: nowrap;
}
.ytterdor-nazwa-input {
    width: 100%;
    border: none;
    border-bottom: 1px dashed #ccc;
    background: transparent;
    font-weight: 600;
    padding: 0 5px;
    font-size: 13px;
}

.ytterdor-pozycja-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    position: relative;
}

.ytterdor-pozycja-akcje {
    display: flex;
    flex-direction: row;
    gap: 5px;
    align-items: flex-end;
    margin-top: 15px;
}

.ytterdor-kontrolka-grupa {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ytterdor-kontrolka-grupa label {
    font-size: 9px;
    text-transform: uppercase;
    color: #777;
    margin-bottom: 2px;
    font-weight: 600;
}

.ytterdor-kontrolka-grupa input {
    width: 60px !important;
    height: 24px;
    padding: 2px 4px;
    font-size: 12px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 3px;
    background-color: #fff;
}

.ytterdor-przycisk-usun {
    position: absolute;
    top: -5px;
    right: -5px;
    background: none;
    border: none;
    color: #dc3545;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
}
.ytterdor-przycisk-usun:hover { color: #c82333; }

.ytterdor-pozycja-detale {
    font-size: 11px;
    color: #666;
    margin-top: 2px;
}
.ytterdor-pozycja-detale span::after { content: " | "; color: #ccc; }
.ytterdor-pozycja-detale span:last-child::after { content: ""; }

.ytterdor-pozycja-dol {
    width: 100%;
    margin-top: 5px;
}
.ytterdor-oferta-input-komentarz {
    width: 100%;
    padding: 5px;
    font-size: 11px;
    border: 1px solid #eee;
    background-color: #fcfcfc;
    border-radius: 3px;
    resize: vertical;
    min-height: 30px;
    box-sizing: border-box;
}
.oferta-screenshot-container { margin-top: 8px; }
.oferta-screenshot-thumb { max-width: 120px; max-height: 80px; border: 1px solid #ccc; border-radius: 4px; }

#ytterdor-offer-summary {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    font-size: 13px;
}
#ytterdor-export-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
}
#ytterdor-export-container input {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* --- WIDOK GALERII --- */
#ytterdor-container.ddf-view #ytterdor-options-col { 
    flex: 1 1 100% !important; 
    max-width: 100% !important;
    padding-right: 15px; 
}
#ytterdor-container.ddf-view #ytterdor-gallery-col, 
#ytterdor-container.ddf-view #ytterdor-offer-col { 
    display: none !important; 
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 10px;
}

.gallery-item {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.gallery-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-color: #007bff;
}

.gallery-img-wrapper {
    width: 100%;
    aspect-ratio: 1/1.6;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    overflow: hidden;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.gallery-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.gallery-info {
    text-align: center;
    width: 100%;
}

.gallery-name {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 4px;
    color: #333;
}

.gallery-price {
    color: #007bff;
    font-size: 13px;
    font-weight: 600;
}
.gallery-type-badge {
    font-size: 10px;
    background-color: #eee;
    padding: 2px 6px;
    border-radius: 4px;
    color: #666;
    margin-top: 4px;
    display: inline-block;
}

.tech-preview-box {
    border: 1px solid #ccc;
    background-color: #f9f9f9;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 15px;
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.tech-preview-box h4 { margin-top: 0; margin-bottom: 0; font-size: 14px; color: #333; }
#ytterdor-tech-preview-content { font-family: "Courier New", monospace; font-size: 12px; color: #444; line-height: 1.5; white-space: pre-wrap; flex-grow: 1; margin-top: 10px; }

/* --- ZAKTUALIZOWANO 2025-11-25: CSS DLA BESLAG --- */
#beslag-list-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); /* Mniejsze kafelki */
    gap: 15px;
    padding: 10px;
}

.beslag-item {
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}
.beslag-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}

.beslag-img-wrapper {
    width: 100%;
    height: 100px; /* Stała, mniejsza wysokość */
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    overflow: hidden;
    background-color: #fff;
}

.beslag-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.beslag-info {
    text-align: center;
    width: 100%;
    margin-bottom: 8px;
}

.beslag-name {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    display: block;
    margin-bottom: 4px;
    line-height: 1.2;
}

.beslag-price {
    font-size: 12px;
    color: #007bff;
    font-weight: bold;
}

.beslag-add-btn {
    width: 100%;
    padding: 6px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    color: #555;
    font-size: 14px;
    transition: background 0.2s;
}
.beslag-add-btn:hover {
    background-color: #28a745;
    color: #fff;
    border-color: #28a745;
}