/* ====================================
   PORÓWNYWARKA FINANSOWA - FINAL FIX
   Kompatybilna z Bootstrap 5 + jQuery UI
   ==================================== */

/* RESET */
.pf-comparator {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0 auto;
    max-width: 100%;
    position: relative;
}

.pf-comparator *,
.pf-comparator *::before,
.pf-comparator *::after {
    box-sizing: border-box;
}

/* ====================================
   SUWAKI - jQuery UI SLIDER
   ==================================== */

.pf-sliders {
    background: white;
    padding: 1.5rem;
}

/* Kontener suwaka */
.pf-slider {
    height: 10px !important;
    background: #e9ecef !important;
    border: none !important;
    border-radius: 5px !important;
    position: relative !important;
    margin-top: 1rem !important;
    cursor: pointer !important;
}

/* Range (wypełnienie zielone) */
.pf-slider .ui-slider-range {
    position: absolute !important;
    background: linear-gradient(90deg, #198754, #157347) !important;
    height: 100% !important;
    border-radius: 5px !important;
    z-index: 1 !important;
    border: none !important;
}

/* Handle (okrągły uchwyt) */
.pf-slider .ui-slider-handle {
    position: absolute !important;
    width: 28px !important;
    height: 28px !important;
    background: white !important;
    border: 4px solid #198754 !important;
    border-radius: 50% !important;
    top: -9px !important;
    margin-left: -14px !important;
    cursor: grab !important;
    outline: none !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2) !important;
    transition: all 0.2s ease !important;
    z-index: 2 !important;
}

.pf-slider .ui-slider-handle:hover,
.pf-slider .ui-slider-handle:focus {
    transform: scale(1.2) !important;
    box-shadow: 0 4px 15px rgba(25, 135, 84, 0.5) !important;
}

.pf-slider .ui-slider-handle:active {
    cursor: grabbing !important;
    transform: scale(1.25) !important;
}

/* Nadpisania jQuery UI domyślnych */
.pf-slider.ui-widget-content {
    border: none !important;
    background: #e9ecef !important;
}

.pf-slider .ui-state-default,
.pf-slider .ui-widget-content .ui-state-default {
    border: 4px solid #198754 !important;
    background: white !important;
}

.pf-slider .ui-state-hover,
.pf-slider .ui-state-focus {
    border-color: #198754 !important;
    background: white !important;
}

.pf-slider .ui-widget-header {
    background: linear-gradient(90deg, #198754, #157347) !important;
    border: none !important;
}

/* Labels i inputy */
.pf-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.pf-label {
    font-weight: 600;
    color: #212529;
    font-size: 1rem;
}

/* ====================================
   OFERTY - Bootstrap Cards
   ==================================== */

.pf-offers-list {
    margin-top: 2rem;
}

.pf-offer {
    position: relative;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
    overflow: visible !important; /* WAŻNE dla wstążki */
}

.pf-offer:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.15) !important;
}

/* PROMOWANE - żółta wstążka */
.pf-offer.pf-promoted {
    border-color: #ffc107 !important;
    border-width: 3px !important;
    overflow: visible !important;
}

.pf-offer.pf-promoted::before {
    content: 'PROMOWANE';
    position: absolute;
    top: 20px;
    right: -40px;
    background: linear-gradient(135deg, #ffc107, #ff9800);
    color: #000;
    padding: 6px 50px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    transform: rotate(45deg);
    z-index: 100;
    box-shadow: 0 3px 10px rgba(255, 193, 7, 0.5);
    white-space: nowrap;
}

/* POLECANE - zielony badge */
.pf-offer.pf-recommended::after {
    content: '⭐ POLECAMY';
    position: absolute;
    top: 15px;
    left: 15px;
    background: #198754;
    color: white;
    padding: 6px 12px;
    border-radius: 0.375rem;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(25, 135, 84, 0.3);
}

/* NIEDOSTĘPNE */
.pf-offer.pf-unavailable {
    opacity: 0.6;
    background: #f8f9fa !important;
    border-style: dashed !important;
    border-color: #adb5bd !important;
}

.pf-offer.pf-unavailable:hover {
    opacity: 0.75;
    transform: none;
    cursor: not-allowed;
}

.pf-offer.pf-unavailable .pf-logo-image {
    filter: grayscale(100%);
}

/* ====================================
   KOMPONENTY
   ==================================== */

/* Numer */
.pf-number {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #198754, #157347);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(25, 135, 84, 0.3);
    flex-shrink: 0;
}

.pf-unavailable .pf-number {
    background: #6c757d;
    box-shadow: none;
}

/* Logo */
.pf-logo-image {
    max-width: 140px;
    max-height: 90px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.pf-company-name {
    font-size: 0.875rem;
    font-weight: 700;
    color: #212529;
    text-align: center;
    margin-top: 0.5rem;
    line-height: 1.3;
}

/* Koszty */
.pf-cost-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
}

.pf-cost-value {
    font-size: 1.35rem;
    font-weight: 700;
}

.pf-cost-unit {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 400;
}

/* Counter */
.pf-counter {
    text-align: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 0.375rem;
    border: 1px solid #e9ecef;
}

.pf-counter-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #212529;
    display: block;
}

.pf-counter-label {
    font-size: 0.625rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-top: 0.25rem;
}

/* ====================================
   SZCZEGÓŁY
   ==================================== */

.pf-offer-details {
    background: #f8f9fa;
    border-top: 2px solid #e9ecef;
    padding: 1.5rem;
}

.pf-detail-row {
    padding: 1rem 0;
    border-bottom: 1px solid #e9ecef;
}

.pf-detail-row:last-child {
    border-bottom: none;
}

.pf-detail-label {
    font-weight: 700;
    color: #212529;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.pf-detail-label i {
    margin-right: 0.5rem;
}

.pf-detail-value {
    font-weight: 600;
    color: #198754;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

/* ====================================
   RESPONSIVE
   ==================================== */

@media (max-width: 767.98px) {
    /* Ukryj wstążkę na mobile */
    .pf-offer.pf-promoted::before {
        display: none;
    }
    
    /* Pokaż badge zamiast wstążki */
    .pf-offer.pf-promoted::after {
        content: '⭐ PROMOWANE';
        position: absolute;
        top: 10px;
        right: 10px;
        background: #ffc107;
        color: #000;
        padding: 4px 8px;
        border-radius: 0.25rem;
        font-size: 10px;
        font-weight: 700;
        z-index: 10;
    }
    
    .pf-logo-image {
        max-width: 100px;
        max-height: 60px;
    }
    
    .pf-cost-value {
        font-size: 1.1rem;
    }
}

/* ====================================
   LOADER
   ==================================== */

.pf-loader {
    margin: 2rem 0;
    text-align: center;
}

/* ====================================
   FIXES
   ==================================== */

/* Fix overflow dla card */
.pf-comparator .card {
    overflow: visible !important;
}

.pf-comparator .card-body {
    overflow: visible !important;
}

/* Fix dla Bootstrap row */
.pf-comparator .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Fix dla number input */
.pf-comparator input[type="number"] {
    -moz-appearance: textfield;
}

.pf-comparator input[type="number"]::-webkit-outer-spin-button,
.pf-comparator input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ====================================
   ACCESSIBILITY
   ==================================== */

.pf-slider .ui-slider-handle:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 3px;
}

/* ====================================
   PRINT
   ==================================== */

@media print {
    .pf-sliders,
    .pf-actions,
    .pf-counter {
        display: none !important;
    }
    
    .pf-offer {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}