/* Plik: innerdor.css */

/* --- 1. PASEK NARZĘDZI (RIBBON) --- */
#innerdor-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;
}

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

.id-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;
}

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

.id-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;
}

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

.id-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;
}
.id-ribbon-group:last-child { border-right: none; }

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

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

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

.id-ribbon-checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    height: 32px;
    cursor: pointer;
}
.id-ribbon-checkbox-wrapper input {
    width: 16px; height: 16px; accent-color: #007bff;
}

/* --- SWATCHES W RIBBONIE (EIK) --- */
.id-ribbon-swatch-container {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    max-width: 300px;
    padding-bottom: 2px;
}
.id-ribbon-eik-swatch {
    width: 32px;
    height: 32px;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}
.id-ribbon-eik-swatch img {
    width: 100%; height: 100%; object-fit: cover;
}
.id-ribbon-eik-swatch.selected {
    border: 2px solid #007bff;
    box-shadow: 0 0 3px rgba(0,123,255,0.5);
}
.id-ribbon-eik-swatch span { display: none; } 

/* --- DROPDOWNY W PASKU Z MINIATURAMI --- */
.id-ribbon-dropdown-container { position: relative; display: inline-block; z-index: 9999; }
.id-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;
}
.id-ribbon-dropdown-btn:hover { background-color: #f0f0f0; }
.id-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;
}
.id-ribbon-dropdown-content.show { display: block; }

.id-ribbon-dropdown-item {
    padding: 8px 12px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; font-size: 13px; color: #333; border-bottom: 1px solid #f9f9f9; background-color: #fff;
}
.id-ribbon-dropdown-item:hover { background-color: #f0f7ff; }

/* Styl elementu w dropdownie bejcy */
.eik-swatch-item {
    justify-content: flex-start; /* Bejca po lewej */
    gap: 10px;
}
.eik-swatch-item.selected {
    background-color: #e8f0fe;
    font-weight: bold;
}

/* Nowe style dla miniaturek w dropdownie */
.dropdown-item-left {
    display: flex; align-items: center; gap: 10px;
}
.id-ribbon-dropdown-thumb {
    width: 30px; height: 30px; object-fit: contain; border: 1px solid #eee; border-radius: 3px;
}
.id-ribbon-dropdown-header {
    padding: 8px 12px; font-size: 11px; font-weight: 700; color: #888; background-color: #fafafa; border-top: 1px solid #eee; text-transform: uppercase;
}

.id-ribbon-action-btn {
    background-color: #28a745; color: white; border: none; border-radius: 4px; padding: 2px 8px; font-size: 16px; cursor: pointer; line-height: 1.2;
}
.id-ribbon-action-btn:hover { background-color: #218838; }


/* --- 2. GŁÓWNY UKŁAD (KOLUMNY) --- */
#innerdor-container {
    display: flex; flex-direction: column; height: 100%; overflow: visible !important; background-color: #fff; width: 100%;
}
#innerdor-columns-wrapper {
    display: flex; flex-grow: 1; height: 100%; overflow: hidden; position: relative; z-index: 1; width: 100%;
}

.innerdor-column {
    display: flex; flex-direction: column; padding: 20px; box-sizing: border-box; overflow-y: auto;
}

/* Lewa: ZDJĘCIE (MAX 1/3) */
#innerdor-gallery-col { 
    flex: 0 0 33%; 
    max-width: 33%;
    background-color: #fdfdfd; 
    border-right: 1px solid #e0e0e0; 
    position: relative; 
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 320px;
}

/* Prawa: KOSZYK (2/3) */
#innerdor-offer-col { 
    flex: 1; 
    background-color: #fafafa; 
    border-left: 1px solid #e0e0e0;
}

/* --- 3. WIDOK OBRAZU --- */
#innerdor-gallery-container {
    display: flex; flex-direction: row; align-items: flex-start; justify-content: center; width: 100%; height: 100%; gap: 10px; min-height: 300px;
}

.id-side-toolbar { 
    display: flex; flex-direction: column; gap: 8px; padding-top: 20px; z-index: 5; width: 60px; align-items: flex-end;
}

.id-size-btn { 
    padding: 6px 5px; font-size: 11px; 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; 
}
.id-size-btn:hover { border-color: #007bff; color: #007bff; background-color: #f0f7ff; }
.id-size-btn.active { background-color: #333 !important; color: #fff !important; border-color: #333 !important; }

#innerdor-image-wrapper { 
    flex-grow: 1; display: flex; justify-content: center; align-items: center; height: 100%; position: relative; border: none; background: transparent;
}
#innerdor-image { 
    max-height: 70vh; max-width: 100%; width: auto; height: auto; object-fit: contain; filter: drop-shadow(0 10px 20px rgba(0,0,0,0.1));
}

#innerdor-view-toggles {
    position: absolute; top: 10px; right: 10px; display: flex; gap: 5px;
}
.id-view-toggle-btn {
    padding: 6px 12px; font-size: 11px; background-color: rgba(255,255,255,0.8); border: 1px solid #ccc; border-radius: 4px; cursor: pointer; font-weight: bold;
}
.id-view-toggle-btn:hover { background-color: #fff; }

/* --- 4. GALERIA --- */
#innerdor-gallery-view-container {
    width: 100%; height: 100%; overflow-y: auto; padding: 20px; box-sizing: border-box; display: none;
}
#innerdor-container.gallery-mode #innerdor-gallery-view-container { display: block; }
#innerdor-container.gallery-mode #innerdor-columns-wrapper { display: none; }

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

.id-gallery-item {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}
.id-gallery-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    border-color: #007bff;
}

.id-gallery-img-wrapper {
    width: 100%;
    aspect-ratio: 1/1.5;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    overflow: hidden;
    background-color: #f9f9f9;
    border-radius: 4px;
}
.id-gallery-img { max-width: 95%; max-height: 95%; object-fit: contain; }

.id-gallery-name { font-weight: 700; font-size: 15px; margin-bottom: 5px; color: #333; text-align: center; }
.id-gallery-price { color: #007bff; font-size: 13px; font-weight: 600; }
.id-gallery-tag { font-size: 10px; background-color: #eee; padding: 2px 6px; border-radius: 4px; color: #666; margin-top: 5px; text-transform: uppercase; }

/* --- 5. KOSZYK --- */

#innerdor-price-display {
    margin-top: 0;
    padding: 10px;
    background-color: #e8f4fd;
    border: 1px solid #b6d4fe;
    border-radius: 4px;
    margin-bottom: 12px;
}

.innerdor-price-line {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    font-size: 13px;
    line-height: 1.3;
}

.innerdor-price-line.total-net {
    border-top: 1px solid #b6d4fe;
    margin-top: 6px;
    padding-top: 6px;
    font-weight: bold;
}

.innerdor-price-line.total-gross {
    font-weight: 800;
    font-size: 16px;
    color: #0d47a1;
}

/* PRZYCISKI - NORMALNA WYSOKOŚĆ */
.przyciski-akcji-compact {
    display: flex;
    gap: 8px; /* Normalny odstęp */
    margin-top: 10px;
    margin-bottom: 15px;
    width: 100%;
}

.przyciski-akcji-compact button {
    flex: 1; /* Równe szerokości */
    padding: 10px 5px; /* Normalny padding (wysokość ok 36-40px) */
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    border: 1px solid #ccc;
    font-size: 13px; /* Czytelna czcionka */
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background-color: #fff;
    color: #333;
    transition: filter 0.2s;
}
.przyciski-akcji-compact button:hover {
    filter: brightness(0.95);
}

/* Kolory przycisków */
.przyciski-akcji-compact button#innerdor-add-to-local-offer {
    background-color: #f8f9fa; 
    border-color: #ccc;
    flex-grow: 1.2; /* Troszkę szerszy */
}
.przyciski-akcji-compact button#innerdor-add-to-main-cart {
    background-color: #28a745; 
    color: white; 
    border-color: #28a745;
    flex-grow: 1.2; /* Troszkę szerszy */
}
.przyciski-akcji-compact button#innerdor-export-pdf-z-cena {
    background-color: #007bff; 
    color: white; 
    border-color: #007bff;
    font-size: 12px;
}
.przyciski-akcji-compact button#innerdor-export-pdf-bez-ceny {
    background-color: #6c757d; 
    color: white; 
    border-color: #6c757d;
    font-size: 12px;
}

/* Input Referencji */
#innerdor-ref-nr {
    width: 100%;
    padding: 8px;
    font-size: 13px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-bottom: 10px;
    box-sizing: border-box;
    height: 32px;
}

/* Lista produktów */
#innerdor-offer-list-display {
    padding-top: 0;
}

.pozycja-oferty { 
    display: flex; 
    flex-direction: column;
    padding: 10px; 
    border-bottom: 1px solid #ccc; 
    background: #fff;
    margin-bottom: 8px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    position: relative; /* WAŻNE dla pozycjonowania X */
}

/* SEPARATOR GRUPY PRODUKTÓW */
.product-group-separator {
    border: 0;
    height: 1px;
    background-color: #333;
    margin: 5px 0 15px 0;
    opacity: 0.5;
}

.pozycja-oferty-gora {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-right: 30px; /* Miejsce na przycisk X, żeby tekst nie wchodził pod niego */
}

.pozycja-oferty-info {
    flex-grow: 1;
    font-size: 14px;
    line-height: 1.3;
    margin-right: 15px;
}
.pozycja-oferty-info strong { color: #000; font-weight: 700; margin-right: 5px; font-size: 14px; }
.pozycja-oferty-info span { color: #555; font-size: 13px; }

/* STYL MINIATURKI */
.koszyk-thumb {
    height: 36px; /* Wyższa */
    width: auto;
    max-width: 50px;
    object-fit: contain;
    border: 1px solid #ddd;
    border-radius: 3px;
    background-color: #fff;
    margin-right: 10px;
    transition: transform 0.2s ease;
    cursor: pointer;
}
.koszyk-thumb:hover {
    transform: scale(5);
    z-index: 1000;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
    border: 1px solid #999;
}

/* STYL PRZYCISKU X (Absolutny w prawym górnym rogu) */
.btn-remove-absolute {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    border: 1px solid #ffcdd2;
    color: #d32f2f;
    border-radius: 4px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
}
.btn-remove-absolute:hover {
    background-color: #ffebee;
    border-color: #d32f2f;
}
.btn-remove-absolute i {
    font-size: 16px;
    font-weight: bold;
}

/* NOWE: Split layout dla inputów i komentarza */
.pozycja-oferty-row-split {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    width: 100%;
}

.pozycja-oferty-inputs-col {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.pozycja-oferty-dol {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    flex-wrap: wrap; 
}

.pozycja-oferty-comment-col {
    flex-grow: 1;
    display: flex;
}

.kontrolka-grupa { 
    display: flex; 
    align-items: center; 
    gap: 5px; 
}

.kontrolka-grupa label { 
    font-size: 11px; 
    text-transform: uppercase; 
    margin: 0; 
    color: #666; 
    font-weight: 700; 
    white-space: nowrap;
}

.kontrolka-grupa input[type="number"] { 
    width: 75px; 
    padding: 4px; 
    text-align: center; 
    border: 1px solid #ccc; 
    border-radius: 3px; 
    height: 30px; 
    box-sizing: border-box; 
    font-size: 13px; 
    font-weight: 600;
}

.komentarz-input-innerdor { 
    width: 100%; 
    padding: 4px 6px; 
    font-size: 12px; 
    border: 1px solid #eee; 
    background-color: #fcfcfc; 
    border-radius: 3px; 
    resize: vertical; 
    min-height: 30px; /* Dopasowane do inputów */
    height: 100%;
    box-sizing: border-box; 
    display: block; 
}
.komentarz-input-innerdor:focus { height: 60px; border-color: #aaa; background-color: #fff; }

.terskel-controls-wrapper { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 15px; 
    margin-top: 5px; 
    width: 100%; 
    padding: 5px; 
    background: #f9f9f9; 
    border-radius: 4px; 
    border-top: 1px dashed #e0e0e0;
}
.terskel-control-compact { display: flex; align-items: center; gap: 6px; }
.terskel-control-compact label { font-size: 11px; color: #555; margin: 0; }
.quantity-picker { display: flex; align-items: center; }
.quantity-btn { width: 22px; height: 22px; border: 1px solid #ccc; background-color: #fff; font-size: 14px; padding: 0; line-height: 1; }
.terskel-quantity-input { width: 30px; height: 22px; font-size: 12px; padding: 0; border: 1px solid #ccc; text-align: center; }