/*
 * =========================================================
 * === OSTATECZNA POPRAWKA STYLU PRZYCISKU OFERTY (ASTRA) ===
 * =========================================================
 *
 * Selektor ma 22 punkty siły (body + .class + button + .class)
 * i wygrywa z regułą Astry (np. .class + button + .class = 21 punktów)
 */

.calc-summary-widget .calc-btn-download-offer-pdf {
    display: block;
    width: 100%;
    margin-bottom: 10px;
    padding: 12px 20px;
    box-sizing: border-box;
    
    /* === STYL, KTÓRY CHCEMY WIDZIEĆ === */
    background-color: #ffffff;
    color: #007bff;
    border: 2px solid #007bff;
    
    font-size: 15px;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;

    /* Reset stylów Astry (nadpisujemy ich style) */
    border-width: 2px !important;
    font-family: inherit;
    line-height: 1.5em;
}

/* Efekt :hover (po najechaniu) */
.calc-summary-widget .calc-btn-download-offer-pdf:hover {
    background-color: #007bff;
    color: #ffffff;
}

/* Ikona wewnątrz przycisku */
.calc-summary-widget .calc-btn-download-offer-pdf i {
    margin-right: 8px;
}

/* ================================================== */
/* === STYLIZACJA WIDGETU ZAKŁADKI (PILLS V2) === */
/* ================================================== */

.kalkulator-tabs-wrapper {
    width: 100%;
    margin: 30px 0;
}

/* 1. Kontener nawigacji - szare tło */
.k-tabs-nav {
    display: inline-flex;
    flex-wrap: wrap;
    background-color: #f1f3f5;
    padding: 5px;
    border-radius: 50px;
    border-bottom: none;
    gap: 0;
}

.k-tab-link {
    font-size: 15px;
    font-weight: 600;
    color: #495057;
    background: transparent;
    border: none;
    padding: 10px 25px;
    cursor: pointer;
    border-radius: 40px;
    transition: all 0.3s ease;
}

.k-tab-link:hover {
    color: #000;
}

/* Aktywna "kapsułka" */
.k-tab-link.is-active {
    background-color: #007bff;
    color: #ffffff;
    box-shadow: 0 4px 6px rgba(0, 123, 255, 0.3);
}

/* 2. Treść */
.k-tabs-content {
    background: #ffffff;
    border: 1px solid #e9ecef;
    padding: 30px;
    border-radius: 10px;
    margin-top: 20px;
    box-shadow: none;
}

.k-tab-pane { display: none; }
.k-tab-pane.is-active { display: block; animation: fadeIn 0.4s ease; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Mobile */
@media (max-width: 767px) {
    .k-tabs-nav {
        display: flex;
        width: 100%;
        border-radius: 10px;
    }
    .k-tab-link {
        flex: 1;
        text-align: center;
        border-radius: 8px;
        margin-bottom: 2px;
    }
}

/* === Style dla Tooltipów Opcji (Wersja v2.3 - Biały Dymek) === */
.calc-layout-tiles .calculator-field-wrapper .calc-option-item {
    position: relative !important;
    overflow: visible !important;
}

.calc-layout-tiles .calc-option-tooltip {
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 5;
    cursor: help;
}

.calc-layout-tiles .calc-option-tooltip .eicon-info-circle-o {
    font-size: 18px;
    color: #007bff;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 3px rgba(0,0,0,0.2);
    display: block;
}

.calc-layout-tiles .calc-option-tooltip .calc-tooltip-content {
    display: none; 
    position: absolute;
    top: 110%; 
    left: 0;
    right: auto;
    background-color: #fff;
    color: #333 !important;
    border: 1px solid #ddd;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 13px;
    line-height: 1.4;
    width: 250px;
    z-index: 10;
    text-align: left;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    pointer-events: none;
}

.calc-layout-tiles .calc-option-tooltip .calc-tooltip-content::after {
    content: "";
    position: absolute;
    bottom: 100%; 
    left: 10px;
    right: auto;
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent #fff transparent;
}

.calc-option-tooltip:hover .calc-tooltip-content {
    display: block; 
}

.calc-layout-list .calc-option-tooltip {
    display: inline-block; 
    position: relative; 
    margin-left: 5px;
    vertical-align: middle;
}
.calc-layout-list .calc-option-tooltip .eicon-info-circle-o {
    font-size: 1em; 
    color: #007bff;
    background: none; 
    box-shadow: none;
    border-radius: 0;
}
.calc-layout-list .calc-option-tooltip .calc-tooltip-content {
    top: auto;
    bottom: 125%; 
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    background-color: #fff;
    color: #333 !important;
    border: 1px solid #ddd;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}
.calc-layout-list .calc-option-tooltip .calc-tooltip-content::after {
    top: 100%; 
    bottom: auto;
    left: 50%;
    margin-left: -5px;
    right: auto;
    border-color: #fff transparent transparent transparent;
}

/* ================================================== */
/* === NOWY STYL: Przełącznik (Segmented Control) v2 === */
/* ================================================== */
.calc-layout-tiles.calc-layout-switch .calculator-field-wrapper {
    display: flex !important;
    flex-wrap: nowrap;
    grid-gap: 0;
    border: 2px solid #007bff; 
    border-radius: 5px;
    overflow: hidden;
}

.calc-layout-tiles.calc-layout-switch .calc-option-item {
    margin: 0 !important;
    padding: 0 !important;
    flex: 1;
}

.calc-layout-tiles.calc-layout-switch .calc-label {
    display: block;
    width: 100%;
    padding: 12px 10px;
    margin: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background-color: #ffffff;
    color: #007bff;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calc-layout-tiles.calc-layout-switch .calc-option-item + .calc-option-item .calc-label {
    border-left: 2px solid #007bff;
}

.calc-layout-tiles.calc-layout-switch .calc-label:hover {
    background-color: #f0f7ff;
}

.calc-layout-tiles.calc-layout-switch .calc-label.is-active {
    background-color: #007bff;
    color: #ffffff;
    box-shadow: none;
}

.calc-layout-tiles.calc-layout-switch .calc-label img,
.calc-layout-tiles.calc-layout-switch .calc-label i {
    display: block;
    margin: 0 auto 5px auto;
}

.calc-layout-tiles.calc-layout-switch .calc-label.is-active i {
    color: #ffffff; 
}

/* --- Style dla innych widgetów --- */
.is-conditionally-disabled {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.is-conditionally-disabled .calc-label { cursor: not-allowed; }

.calc-option-item .calc-label.is-active {
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

.calc-layout-tiles .calculator-field-wrapper {
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}
.calc-layout-tiles .calc-label {
    border: 2px solid #eee;
    border-radius: 5px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: block;
}
.calc-layout-tiles .calc-label:hover { border-color: #ccc; }
.calc-layout-tiles img { max-width: 100%; height: auto; margin-bottom: 5px; }

.calculator-field-wrapper:not(.calc-number-field-wrapper) input[type="radio"].calc-input-field,
.calculator-field-wrapper:not(.calc-number-field-wrapper) input[type="checkbox"].calc-input-field {
    opacity: 0;
    position: absolute;
    z-index: -1;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* --- Stylizacja Listy Rozwijanej (<select>) --- */
.calculator-field-wrapper select.calc-input-field {
    display: inline-block;
    width: 100%;
    padding: 12px 30px 12px 11px;
    font-size: 16px;
    color: #333;
    background-color: #f9f9f9;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23444" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
}
.is-conditionally-disabled select.calc-input-field { background-color: #eee; cursor: not-allowed; }

/* ================================================== */
/* === STYLIZACJA POLA NUMERYCZNEGO (Siatka Grid) === */
/* ================================================== */

.calc-number-field-wrapper .calc-label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.calc-number-input-wrapper {
    display: grid !important;
    grid-template-columns: auto 1fr auto !important;
    align-items: stretch !important;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #f9f9f9;
    width: 100% !important;
}

.calc-number-input-wrapper .calc-prefix {
    padding: 0 10px;
    color: #555;
    background-color: #eee;
    display: flex !important;
    align-items: center !important;
    flex: none !important;
    border-right: 1px solid #ccc;
    border-radius: 5px 0 0 5px;
    grid-column: 1 !important;
}

.calc-number-input-wrapper .calc-suffix {
    padding: 0 10px;
    color: #555;
    background-color: #eee;
    display: flex !important;
    align-items: center !important;
    flex: none !important;
    border-left: 1px solid #ccc;
    border-radius: 0 5px 5px 0;
    grid-column: 3 !important;
}

.calc-number-field-wrapper input.calc-number-field {
    padding: 12px 10px !important;
    font-size: 16px !important;
    color: #333 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    display: block !important;
    width: 100% !important;
    min-width: 40px !important;
    margin: 0 !important;
    flex: none !important; 
    grid-column: 2 !important;
    opacity: 1 !important;
    position: static !important;
    z-index: auto !important;
    height: auto !important;
    overflow: visible !important;
    clip: auto !important;
}

/* --- Stylizacja Walidacji (Błędu) --- */
.calc-validation-message {
    color: #d9534f;
    font-size: 14px;
    margin-top: 5px;
    min-height: 1.2em;
}

.calc-number-input-wrapper.has-error {
     border-color: #d9534f !important;
     box-shadow: 0 0 3px rgba(217, 83, 79, 0.5) !important;
}

/* --- Wyświetlacz Ceny --- */
.calculator-price-display-wrapper {
    padding: 15px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 18px;
    color: #333;
}
.calculator-price-display-wrapper .price-value {
    font-size: 28px;
    font-weight: bold;
    color: #007bff;
}
.calculator-price-display-wrapper .price-suffix {
    font-size: 16px;
    color: #555;
    margin-left: 5px;
}
.calculator-price-display-wrapper .calc-loading-spinner {
    font-style: italic;
    color: #777;
}

/* --- Badges (Etykiety terminów) --- */
.calc-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.calc-badge.badge-term-std { background-color: #e0e0e0; color: #333; }
.calc-badge.badge-term-exp { background-color: #ffebee; color: #c62828; border: 1px solid #ffcdd2; }
.calc-badge.badge-term-eco { background-color: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }

/* Ulepszona tabela */
.calc-price-table th { text-transform: uppercase; font-size: 12px; color: #777; letter-spacing: 0.5px; }
.calc-price-table td { vertical-align: middle; }
.calc-price-table .col-price { font-weight: bold; color: #333; font-size: 17px; }
.calc-price-table tr.is-selected { background-color: #f0f9ff !important; border-left: 4px solid #007bff; }
.calc-btn-select { border-radius: 50%; width: 30px; height: 30px; padding: 0; display: flex; align-items: center; justify-content: center; }

/* ================================================== */
/* === STYLIZACJA MACIERZY ( STYLE) === */
/* ================================================== */

.calc-matrix-container {
    overflow-x: auto;
}

.calc-matrix-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 4px;
    margin-top: 15px;
    font-size: 14px;
}

.calc-matrix-table th {
    background-color: #f8f9fa;
    padding: 12px;
    text-align: center;
    font-weight: 600;
    color: #555;
    border-radius: 4px;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.calc-matrix-table td.col-qty {
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 4px;
    font-weight: bold;
    color: #333;
    text-align: center;
    vertical-align: middle;
    width: 15%;
}

.calc-matrix-table td.col-price-cell {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    padding: 10px 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    vertical-align: middle;
}

.calc-matrix-table td.col-price-cell:hover {
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.calc-matrix-table td.col-price-cell.is-selected {
    background-color: #007bff;
    border-color: #007bff;
    color: #fff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.3);
}

.calc-matrix-table .price-main {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1.2;
}

.calc-matrix-table .date-sub {
    font-size: 11px;
    color: #888;
}

.calc-matrix-table td.col-price-cell.is-selected .price-main,
.calc-matrix-table td.col-price-cell.is-selected .date-sub {
    color: #fff;
}

/* === NOWE STYLE: Cena za sztukę === */
.calc-matrix-table .price-per-piece {
    font-size: 11px;
    font-weight: 500;
    color: #555;
    margin-top: 5px;
    border-top: 1px dashed #eee;
    padding-top: 4px;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.calc-matrix-table td.col-empty {
    text-align: center;
    color: #ccc;
    background-color: #fcfcfc;
    border: 1px dashed #eee;
    border-radius: 4px;
}

/* ================================================== */
/* === KOLOROWANIE KOLUMN (NAGŁÓWKI) === */
/* ================================================== */

.calc-matrix-table th[class*="th-mode-"] {
    border-top: 4px solid #ccc;
    background-color: #f9f9f9;
    color: #555;
    position: relative;
    text-align: center;
}

.calc-matrix-table th.th-mode-standard { border-top-color: #007bff; color: #007bff; background-color: #f0f7ff; }
.calc-matrix-table th.th-mode-ekspres, .calc-matrix-table th.th-mode-express { border-top-color: #dc3545; color: #dc3545; background-color: #fff5f5; }
.calc-matrix-table th.th-mode-eko, .calc-matrix-table th.th-mode-ekonomiczny, .calc-matrix-table th.th-mode-eco { border-top-color: #28a745; color: #28a745; background-color: #f0fff4; }

/* === PODSUMOWANIE (SIDEBAR) === */
.calc-summary-widget {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    border: 1px solid #eee;
    position: sticky;
    top: 20px; 
}

.calc-summary-title {
    font-size: 18px;
    margin-bottom: 15px;
    border-bottom: 2px solid #f1f1f1;
    padding-bottom: 10px;
}

.calc-summary-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    font-size: 14px;
}

.calc-summary-list li {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    color: #555;
}

.calc-summary-list li .label { font-weight: 600; }
.calc-summary-list li.summary-highlight { color: #007bff; margin-top: 10px; border-top: 1px dashed #eee; padding-top: 5px;}

.calc-summary-divider {
    border-top: 1px solid #eee;
    margin: 15px 0;
}

.calc-summary-price-box {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 20px;
}

.calc-summary-price-box .label { font-size: 14px; color: #777; }
.calc-summary-price-box .value { font-size: 24px; font-weight: bold; color: #333; }

/* ================================================== */
/* ZMIANA: PRZYCISK "DODAJ DO KOSZYKA / ZAMAWIAM"     */
/* Zmieniono kolor z pomarańczowego na niebieski      */
/* ================================================== */
.calc-summary-btn {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    background-color: #007bff; /* Zamieniono #ff6b00 na #007bff */
    color: #ffffff; /* Dodano biały tekst */
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.calc-summary-btn:hover { 
    background-color: #0056b3; /* Ciemniejszy niebieski po najechaniu */
}

/* --- Cena BRUTTO w podsumowaniu --- */
.calc-price-gross-row {
    margin-top: -15px;
    padding-top: 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 15px;
}

.calc-summary-total-gross {
    font-size: 14px;
    color: #777;
    font-weight: normal;
}

.calc-price-gross-row .label {
    font-size: 13px;
    color: #999;
}

/* --- Sekcja "Własny Nakład" --- */
.calc-custom-qty-section {
    background-color: #fff;
    padding: 15px;
    border: 1px solid #eee;
    border-bottom: none;
    border-radius: 5px 5px 0 0;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.calc-custom-qty-section label { font-weight: 600; color: #333; }
.calc-custom-input-group { display: flex; gap: 5px; }
.calc-custom-qty-input { padding: 8px 12px; border: 1px solid #ccc; border-radius: 4px; width: 120px; }
.calc-btn-calc-custom { padding: 8px 15px; background-color: #333; color: #fff; border: none; border-radius: 4px; cursor: pointer; font-weight: bold; }
.calc-btn-calc-custom:hover { background-color: #000; }

tr.calc-row-custom td { background-color: #fff8e1 !important; border-top: 2px solid #ffc107; border-bottom: 2px solid #ffc107; }
tr.calc-row-custom td.col-qty { color: #ff6b00; }

tr.calc-row-custom td.col-price-cell.is-selected .price-main,
tr.calc-row-custom td.col-price-cell.is-selected .date-sub {
    color: #333 !important;
}

tr.calc-row-custom td.col-price-cell.is-selected {
    border-color: #ff6b00 !important;
    box-shadow: 0 0 0 2px rgba(255, 107, 0, 0.3) !important;
    background-color: #fff8e1 !important;
}

.calc-formula-hidden { display: none !important; }

.calc-section-label {
    display: block;
    width: 100%;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
    font-size: 16px;
    grid-column: 1 / -1; 
    flex-basis: 100%;
}

/* ================================================== */
/* === STYLIZACJA WIDGETU FORMUŁY === */
/* ================================================== */
.calculator-formula-wrapper {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #fff;
    border: 1px dashed #ccc;
    border-radius: 5px;
}

.calc-formula-label { display: block; font-weight: bold; color: #333; font-size: 15px; margin-bottom: 5px; }
.calc-formula-result { font-size: 18px; font-weight: bold; color: #007bff; }
.calc-formula-suffix { font-size: 14px; color: #666; margin-left: 3px; }

/* ================================================== */
/* === STYLIZACJA PREFLIGHT UPLOAD === */
/* ================================================== */
.calc-upload-wrapper { width: 100%; margin-bottom: 15px; }

.calc-dropzone {
    border: 2px dashed #007bff;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    background-color: #f8f9fa;
    transition: background-color 0.2s;
}
.calc-dropzone:hover { background-color: #e9ecef; }
.calc-dropzone.drag-active { background-color: #e3f2fd; border-color: #0056b3; }
.calc-dropzone-icon { font-size: 40px; color: #007bff; margin-bottom: 10px; }
.calc-dropzone-text { font-size: 16px; font-weight: 500; color: #555; }
.calc-file-input { display: none; }

.calc-upload-status { margin-top: 15px; padding: 10px; border-radius: 5px; font-size: 14px; }

.calc-upload-progress-bar { width: 100%; background: #eee; height: 10px; border-radius: 5px; margin-bottom: 10px; }
.calc-upload-progress-inner { width: 0%; height: 10px; background: #007bff; border-radius: 5px; transition: width 0.3s; }

.calc-upload-status-message .calc-loading { color: #007bff; display: block; padding: 10px; }
.calc-upload-status-message .calc-loading i { margin-right: 8px; }

.calc-upload-status-message .calc-error { background-color: #fff5f5; border: 1px solid #f5c6cb; color: #721c24; display: block; padding: 10px; }
.calc-upload-status-message .calc-error ul { margin-top: 5px; margin-bottom: 0; }

.calc-upload-status-message .calc-success { background-color: #f0fff4; border: 1px solid #c8e6c9; color: #155724; display: block; padding: 10px; }

.calc-btn-force-accept { display: block; width: 100%; margin-top: 10px; padding: 8px; background: #dc3545; color: #fff; border: none; border-radius: 4px; cursor: pointer; font-weight: bold; }
.calc-btn-force-accept:hover { background: #c82333; }

/* ================================================== */
/* === STYLIZACJA RAPORTU PREFLIGHT (v2) === */
/* ================================================== */
.calc-preflight-title { font-size: 16px; display: block; margin-bottom: 10px; }
.calc-preflight-title i { margin-right: 5px; }

.calc-preflight-report-list { list-style: none; padding-left: 0; margin: 0; font-size: 13px; border-top: 1px dashed #ddd; padding-top: 10px; }
.calc-error .calc-preflight-report-list { border-top: 1px dashed #f5c6cb; }
.calc-success .calc-preflight-report-list { border-top: 1px dashed #c8e6c9; }
.calc-preflight-report-list li { display: flex; justify-content: space-between; padding: 3px 0; }
.calc-preflight-report-list .report-label { color: #555; font-weight: 500; }
.calc-preflight-report-list .report-value { font-weight: bold; }

.calc-preflight-report-list li.status-ok .report-value { color: #155724; }
.calc-preflight-report-list li.status-error .report-value { color: #721c24; }

.calc-preflight-file-info {
    display: flex;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    margin-top: 0; 
    border: 1px solid #ddd;
    position: relative;
    z-index: 10; 
}
.calc-preflight-file-info i { font-size: 24px; margin-right: 12px; color: #555; flex-shrink: 0; }
.calc-preflight-file-preview-image { width: 40px; height: 40px; margin-right: 12px; border: 1px solid #eee; background: #fff; flex-shrink: 0; }
.calc-preflight-file-preview-image img { width: 100%; height: 100%; object-fit: cover; }

.calc-preflight-file-info .file-details { flex-grow: 1; min-width: 0; }
.calc-preflight-file-info .file-name { font-size: 14px; font-weight: 500; color: #007bff; text-decoration: none; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calc-preflight-file-info .file-name:hover { text-decoration: underline; }

.calc-btn-delete-file { background: #f44336; color: white !important; border: none; padding: 6px 12px; font-size: 12px; font-weight: bold; border-radius: 3px; cursor: pointer; margin-left: 10px; flex-shrink: 0; }
.calc-btn-delete-file:hover { background: #d32f2f; }
.calc-btn-delete-file:disabled { background: #ccc; cursor: not-allowed; }

/* ================================================== */
/* === STYLIZACJA DLA RABATÓW === */
/* ================================================== */
.price-value-old { text-decoration: line-through; font-weight: 400; font-size: 18px; color: #999; margin-left: 10px; }
.calc-matrix-table .price-old { display: block; text-decoration: line-through; font-weight: 400; font-size: 13px; color: #dc3545; line-height: 1.1; }
.calc-matrix-table td.col-price-cell.is-selected .price-old { color: #fff; opacity: 0.7; }
.calc-summary-list li.summary-discount { color: #555; margin-top: 10px; border-top: 1px dashed #eee; padding-top: 5px; font-size: 13px; }
.calc-summary-list li.summary-discount .val.price-old { text-decoration: line-through; font-weight: 400; color: #777; }
.calc-summary-list li.summary-discount-label { color: #28a745; font-weight: bold; margin-bottom: 10px; font-size: 14px; }

/* ================================================== */
/* === PODGLĄDY 3D PLIKÓW (WERSJA ZAKTUALIZOWANA) === */
/* ================================================== */
.calc-preview-container {
    perspective: 1200px;
    margin: 30px auto 60px auto; 
    width: 200px;
    max-width: 100%;
    aspect-ratio: var(--calc-preview-aspect, 5 / 7);
    position: relative;
    z-index: 50; 
    cursor: pointer;
}

.calc-3d-flyer {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateY(-15deg) rotateX(10deg);
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 10px 10px 30px rgba(0,0,0,0.3);
}

.calc-preview-container:hover .calc-3d-flyer { transform: rotateY(180deg) rotateX(0deg) scale(1.05); }

.calc-3d-flyer-face {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden; 
    backface-visibility: hidden;
    display: block;
    border-radius: 2px;
    background: #fff; 
}

.calc-3d-flyer-face img { width: 100%; height: 100%; object-fit: cover; border-radius: 2px; }
.calc-3d-flyer-face.face-front { transform: rotateY(0deg); }
.calc-3d-flyer-face.face-back { transform: rotateY(180deg); }

.calc-3d-flyer-face.face-back.is-empty {
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
    text-align: center;
    padding: 20px;
}
.calc-3d-flyer-face.face-back.is-empty::after { content: 'Tył ulotki (Strona 2)'; }

/* === STYLE DLA FLIPBOOK (StPageFlip) === */
.calc-turnjs-container,
.calc-flipbook-container {
    width: 100% !important;
    max-width: 600px;
    margin: 15px auto;
    aspect-ratio: auto !important;
    perspective: none !important;
    cursor: default !important;
}

#calc-flipbook-instance {
    width: 100%;
    /* POPRAWKA: Usunięto błąd niezamkniętego komentarza, który psuł kaskadę CSS */
    /* height: 100%; */
}

#calc-flipbook-instance .turn-page { background-color: #fdfdfd; box-shadow: inset 0 0 5px rgba(0,0,0,0.1); }
#calc-flipbook-instance .turn-page-wrapper { top: 0px; left: 0px; }

/* === STYL DLA LINKU DO PROJEKTU W KOSZYKU === */
.link-pobierz-projekt {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
    padding: 5px 10px;
    background-color: #f6f6f6;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #2fb5d2 !important; 
    font-weight: bold;
    text-decoration: none !important;
    font-size: 13px;
    transition: all 0.2s;
}

.link-pobierz-projekt:hover {
    background-color: #e9f7fa;
    border-color: #2fb5d2;
    color: #2fb5d2;
}

.link-pobierz-projekt i { font-size: 16px; }
