/**
 * CENNIK.CSS - Style dla strony cennika i kalkulatora
 * Wersja: 2.0 (Premium Rebrand)
 */

/* ============================================
   WSKAŹNIK WYKORZYSTANIA
   ============================================ */

.calculator-usage {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-5) var(--space-6);
    background: linear-gradient(135deg, var(--bg-soft) 0%, var(--border) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-8);
    box-shadow: var(--shadow-sm);
}

.usage-label {
    font-size: var(--font-sm);
    font-weight: var(--font-semibold);
    color: var(--text-muted);
}

.usage-dots {
    display: flex;
    gap: var(--space-3);
}

.usage-dot {
    width: 16px;
    height: 16px;
    border-radius: var(--radius-full);
    background-color: var(--border);
    border: 2px solid var(--text-muted);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.usage-dot.used {
    background-color: var(--brand);
    border-color: var(--brand-hover);
    box-shadow: 0 0 12px rgba(43, 89, 166, 0.4);
    transform: scale(1.15);
}

.usage-dot.used::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: var(--bg);
    border-radius: var(--radius-full);
}

.usage-count {
    font-size: var(--font-base);
    font-weight: var(--font-bold);
    color: var(--text);
    margin-left: var(--space-2);
    padding: var(--space-1) var(--space-3);
    background: var(--bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

/* ============================================
   HERO PRICING
   ============================================ */

.hero-pricing {
    padding: var(--space-20) 0;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-hover) 100%);
    color: var(--bg);
    text-align: center;
}

@media (min-width: 1024px) {
    .hero-pricing {
        padding: var(--space-24) 0;
    }
}

.hero-pricing__title {
    font-size: var(--font-4xl);
    color: var(--bg);
    margin-bottom: var(--space-4);
}

@media (min-width: 768px) {
    .hero-pricing__title {
        font-size: var(--font-5xl);
    }
}

.hero-pricing__subtitle {
    font-size: var(--font-lg);
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: var(--space-8);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 768px) {
    .hero-pricing__subtitle {
        font-size: var(--font-xl);
    }
}

/* ============================================
   CALCULATOR
   ============================================ */

.calculator-section {
    background-color: var(--bg-soft);
}

.calculator-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

.calculator-intro {
    text-align: center;
    margin-bottom: var(--space-12);
}

.calculator-intro p {
    font-size: var(--font-lg);
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto;
}

/* ============================================
   CATEGORY SECTIONS (Rozwijane)
   ============================================ */

.category-section {
    margin-bottom: var(--space-8);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg);
    box-shadow: var(--shadow-sm);
}

.category-header {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-hover) 100%);
    color: var(--bg);
    padding: var(--space-6) var(--space-8);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all var(--transition-base);
    user-select: none;
    min-height: 64px;
}

.category-header:hover {
    background: linear-gradient(135deg, var(--brand-hover) 0%, #1d4178 100%);
}

.category-header h3 {
    margin: 0;
    font-size: var(--font-xl);
    font-weight: var(--font-semibold);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--bg);
}

.category-header h3 i {
    font-size: var(--font-2xl);
}

@media (max-width: 640px) {
    .category-header h3 {
        font-size: var(--font-base);
    }
    
    .category-header {
        padding: var(--space-5) var(--space-6);
    }
}

.category-toggle {
    font-size: var(--font-3xl);
    font-weight: var(--font-light);
    transition: transform var(--transition-base);
    color: var(--bg);
}

.category-section.active .category-toggle {
    transform: rotate(45deg);
}

.category-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.category-section.active .category-body {
    max-height: 2000px;
    overflow: visible;
}

.category-table-wrapper {
    padding: 0;
}

/* ============================================
   MOBILE CARD LAYOUT (< 768px)
   ============================================ */

@media (max-width: 767px) {
    /* Ukryj strukturę tabeli, ale zachowaj tr jako karty */
    .price-calculator {
        width: 100%;
    }
    
    .price-calculator thead {
        display: none;
    }
    
    .price-calculator tbody {
        display: block;
        width: 100%;
    }
    
    /* Pokaż karty zamiast tabeli */
    .calculator-row {
        display: block !important;
        background: var(--bg);
        border: 2px solid var(--border);
        border-radius: var(--radius-lg);
        padding: var(--space-5);
        margin-bottom: var(--space-4);
        transition: all var(--transition-fast);
        box-shadow: var(--shadow-sm);
        width: 100%;
    }
    
    .calculator-row.selected {
        border-color: var(--brand);
        background: var(--brand-tint);
        box-shadow: 0 4px 12px rgba(43, 89, 166, 0.15);
    }
    
    /* Wszystkie TD jako block */
    .calculator-row td {
        display: block !important;
        width: 100% !important;
        padding: 0 !important;
    }
    
    /* Ukryj kolumnę "service-name" na mobile (duplikat) */
    .calculator-row .service-name {
        display: none !important;
    }
    
    /* Checkbox + Label */
    .calculator-row .service-checkbox {
        margin-bottom: var(--space-3);
    }
    
    .calculator-row .checkbox-wrapper {
        display: flex !important;
        align-items: flex-start;
        gap: var(--space-3);
        margin-bottom: var(--space-2);
    }
    
    .calculator-row .checkbox-wrapper input[type="checkbox"] {
        flex-shrink: 0;
        width: 22px;
        height: 22px;
        margin: 2px 0 0 0;
        cursor: pointer;
    }
    
    .calculator-row .checkbox-wrapper label {
        display: block !important;
        flex: 1;
        font-size: var(--font-base);
        font-weight: var(--font-semibold);
        color: var(--text);
        cursor: pointer;
        line-height: 1.4;
        visibility: visible !important;
        opacity: 1 !important;
        /* DEBUG - powinno być widoczne */
        min-height: 20px;
        background: transparent;
    }
    
    /* Opis usługi - poza labelem, pod checkboxem */
    .calculator-row .service-checkbox .service-desc {
        display: block !important;
        font-size: var(--font-xs);
        color: var(--text-muted);
        margin-left: 34px;
        margin-top: var(--space-1);
        line-height: 1.5;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Cena */
    .calculator-row .service-price {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        padding: var(--space-3) var(--space-4);
        background: var(--bg-soft);
        border-radius: var(--radius-md);
        margin-bottom: var(--space-4);
        border: 1px solid var(--border);
    }
    
    .calculator-row .service-price::before {
        content: 'Cena za m²:';
        font-size: var(--font-sm);
        color: var(--text-muted);
        font-weight: var(--font-medium);
    }
    
    /* Input metrów */
    .calculator-row .service-meters {
        margin-bottom: 0;
    }
    
    .calculator-row .service-meters::before {
        content: 'Powierzchnia (m²)';
        display: block;
        font-size: var(--font-sm);
        color: var(--text-muted);
        margin-bottom: var(--space-2);
        font-weight: var(--font-medium);
    }
    
    .calculator-row .meter-input {
        width: 100%;
        font-size: var(--font-base);
        padding: var(--space-4);
    }
}

/* Desktop - normalna tabela */
@media (min-width: 768px) {
    .price-calculator {
        display: table;
    }
    
    .price-calculator thead {
        display: table-header-group;
    }
    
    .price-calculator tbody {
        display: table-row-group;
    }
    
    .calculator-row {
        display: table-row !important;
    }
    
    .calculator-row td {
        display: table-cell !important;
    }
    
    /* Ukryj wrapper ale pokaż sam checkbox na desktop */
    .calculator-row .checkbox-wrapper {
        display: block !important;
    }
    
    .calculator-row .checkbox-wrapper label {
        display: none !important;
    }
    
    .calculator-row .checkbox-wrapper input[type="checkbox"] {
        display: inline-block !important;
        margin: 0 !important;
    }
    
    .calculator-row .service-checkbox .service-desc {
        display: none !important;
    }
    
    /* Pokaż nazwę i opis w service-name td na desktop */
    .calculator-row .service-name {
        display: table-cell !important;
    }
    
    .service-name .service-name-desktop {
        display: block;
        font-weight: 500;
    }
    
    .service-name .service-desc-desktop {
        display: block;
        font-size: 0.875rem;
        color: var(--text-muted);
        margin-top: 0.25rem;
    }
}

/* ============================================
   CALCULATOR TABLE
   ============================================ */

.calculator-table-container {
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    box-shadow: var(--shadow-md);
}

@media (max-width: 768px) {
    .calculator-table-container {
        padding: var(--space-6);
        overflow-x: auto;
    }
}

.price-calculator {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.price-calculator thead {
    background: var(--text);
}

.price-calculator thead th {
    color: var(--bg);
    padding: var(--space-4) var(--space-6);
    text-align: left;
    font-weight: var(--font-semibold);
    font-size: var(--font-sm);
    border-bottom: 2px solid var(--border);
}

.price-calculator thead th:last-child {
    text-align: right;
}

.price-calculator tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background-color var(--transition-fast);
}

.price-calculator tbody tr:hover {
    background-color: var(--bg-soft);
}

.price-calculator tbody tr.selected {
    background-color: var(--brand-tint);
}

.price-calculator td {
    padding: var(--space-4) var(--space-6);
}

/* Checkbox column */
.service-checkbox {
    text-align: center;
    vertical-align: middle;
}

.service-check {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--brand);
}

/* Service name */
.service-name {
    font-weight: var(--font-medium);
    color: var(--text);
}

.service-name label {
    cursor: pointer;
    display: block;
}

.service-desc {
    font-size: var(--font-xs);
    color: var(--text-muted);
    font-weight: normal;
    display: block;
    margin-top: var(--space-1);
}

.service-price {
    color: var(--brand);
    font-weight: var(--font-semibold);
    white-space: nowrap;
}

.service-input {
    width: 150px;
}

.meter-input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: var(--font-base);
    transition: border-color var(--transition-fast);
    min-height: 44px;
}

.meter-input:enabled {
    border-color: var(--brand);
}

.meter-input:disabled {
    background-color: var(--bg-soft);
    cursor: not-allowed;
    opacity: 0.6;
}

.meter-input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-tint);
}

.service-total {
    text-align: right;
    font-weight: var(--font-semibold);
    color: var(--text);
    white-space: nowrap;
}

/* ============================================
   TOTAL SECTION
   ============================================ */

.total-section {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-8);
    background: linear-gradient(135deg, var(--text) 0%, #0a0e14 100%);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-4);
}

@media (min-width: 640px) {
    .total-section {
        flex-direction: row;
        gap: var(--space-8);
    }
}

.total-label {
    font-size: var(--font-xl);
    font-weight: var(--font-bold);
    color: var(--bg);
}

.total-value {
    font-size: var(--font-3xl);
    font-weight: var(--font-extrabold);
    color: var(--cta);
}

/* ============================================
   LABOR INFO
   ============================================ */

.labor-info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-6);
    background: var(--brand-tint);
    border-left: 4px solid var(--brand);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-8);
}

.labor-info i {
    flex-shrink: 0;
    color: var(--brand);
    font-size: var(--font-xl);
}

.labor-info p {
    margin: 0;
    color: var(--text);
    font-size: var(--font-sm);
    font-weight: var(--font-medium);
}

/* ============================================
   DISCLAIMER
   ============================================ */

.calculator-disclaimer {
    display: flex;
    gap: var(--space-4);
    padding: var(--space-6);
    background: #fff3cd;
    border-left: 4px solid var(--warning);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-8);
}

.calculator-disclaimer i {
    flex-shrink: 0;
    color: #856404;
    font-size: var(--font-xl);
}

.calculator-disclaimer p {
    margin: 0;
    color: #856404;
    line-height: var(--leading-relaxed);
    font-size: var(--font-sm);
}

/* ============================================
   ACTIONS
   ============================================ */

.calculator-actions {
    display: flex;
    gap: var(--space-4);
    justify-content: flex-end;
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .calculator-actions {
        flex-direction: column;
    }
    
    .calculator-actions .btn {
        width: 100%;
    }
}

/* ============================================
   SPINNER
   ============================================ */

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: var(--radius-full);
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   LIMIT POPUP
   ============================================ */

.limit-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.limit-popup.active {
    display: flex;
}

.limit-popup__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.limit-popup__content {
    position: relative;
    z-index: 1;
    max-width: 600px;
    width: 90%;
    background: var(--bg);
    border-radius: var(--radius-xl);
    padding: var(--space-12) var(--space-8);
    text-align: center;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.4s ease-out;
}

@media (min-width: 640px) {
    .limit-popup__content {
        padding: var(--space-16) var(--space-12);
    }
}

.limit-popup__close {
    position: absolute;
    top: var(--space-6);
    right: var(--space-6);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-soft);
    border: none;
    border-radius: var(--radius-full);
    font-size: var(--font-3xl);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.limit-popup__close:hover {
    background: var(--border);
    color: var(--text);
    transform: rotate(90deg);
}

.limit-popup__icon {
    margin-bottom: var(--space-8);
}

.limit-popup__icon i {
    color: var(--warning);
    font-size: 64px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

.limit-popup__content h2 {
    font-size: var(--font-2xl);
    color: var(--text);
    margin-bottom: var(--space-6);
}

@media (min-width: 640px) {
    .limit-popup__content h2 {
        font-size: var(--font-3xl);
    }
}

.limit-popup__text {
    font-size: var(--font-base);
    color: var(--text-muted);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-4);
}

@media (min-width: 640px) {
    .limit-popup__text {
        font-size: var(--font-lg);
    }
}

.limit-popup__cta {
    margin: var(--space-8) 0;
    font-size: var(--font-lg);
    padding: var(--space-5) var(--space-10);
}

@media (max-width: 640px) {
    .limit-popup__cta {
        width: 100%;
    }
}

.limit-popup__note {
    font-size: var(--font-sm);
    color: var(--text-muted);
    margin-top: var(--space-8);
    padding-top: var(--space-8);
    border-top: 1px solid var(--border);
}

/* ============================================
   EMAIL POPUP
   ============================================ */

.email-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.email-popup.active {
    display: flex;
}

.email-popup__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
}

.email-popup__content {
    position: relative;
    z-index: 1;
    max-width: 500px;
    width: 90%;
    background-color: var(--bg);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    box-shadow: var(--shadow-xl);
}

@media (min-width: 640px) {
    .email-popup__content {
        padding: var(--space-12);
    }
}

.email-popup__close {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-soft);
    border-radius: var(--radius-full);
    font-size: var(--font-3xl);
    color: var(--text-muted);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.email-popup__close:hover {
    background-color: var(--error);
    color: var(--bg);
}

.email-popup__content h3 {
    font-size: var(--font-xl);
    margin-bottom: var(--space-4);
    text-align: center;
}

@media (min-width: 640px) {
    .email-popup__content h3 {
        font-size: var(--font-2xl);
    }
}

.email-popup__content p {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: var(--space-8);
}

.popup-icon {
    text-align: center;
    margin-bottom: var(--space-6);
}

.popup-icon i {
    color: var(--success);
    font-size: 48px;
}

/* ============================================
   INSTITUTIONS SECTION
   ============================================ */

.institutions-section {
    background-color: var(--bg-soft);
}

.institutions-box {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    padding: var(--space-12);
    background: var(--bg);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

@media (max-width: 640px) {
    .institutions-box {
        padding: var(--space-8);
    }
}

.institutions-box h2 {
    font-size: var(--font-2xl);
    margin-bottom: var(--space-6);
    color: var(--text);
}

@media (min-width: 640px) {
    .institutions-box h2 {
        font-size: var(--font-3xl);
    }
}

.institutions-box p {
    font-size: var(--font-base);
    color: var(--text-muted);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-8);
}

@media (min-width: 640px) {
    .institutions-box p {
        font-size: var(--font-lg);
    }
}

/* ============================================
   CONSULTATIONS & COURSES
   ============================================ */

.consultations-section {
    background-color: var(--bg);
}

.services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-8);
    max-width: 900px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.service-box {
    background: var(--bg);
    padding: var(--space-10);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    text-align: center;
    border: 1px solid var(--border);
    transition: all var(--transition-base);
}

.service-box:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
    border-color: var(--brand);
}

.service-icon {
    font-size: 48px;
    margin-bottom: var(--space-6);
}

.service-icon i {
    color: var(--brand);
    font-size: 48px;
}

.service-box h3 {
    font-size: var(--font-xl);
    margin-bottom: var(--space-5);
    color: var(--text);
}

@media (min-width: 640px) {
    .service-box h3 {
        font-size: var(--font-2xl);
    }
}

.service-box p {
    color: var(--text-muted);
    margin-bottom: var(--space-6);
}

.service-box .price {
    font-size: var(--font-3xl);
    font-weight: var(--font-extrabold);
    color: var(--brand);
    margin-bottom: var(--space-6);
    display: block;
}
/* ============================================
   MOBILE FIX - Dodaj to NA KOŃCU cennik.css
   ============================================ */

/* MOBILE - FORCE LABELS TO SHOW */
@media (max-width: 767px) {
    /* FORCE checkbox wrapper label to be visible */
    .calculator-row .checkbox-wrapper label {
        display: block !important;
        flex: 1 !important;
        font-size: 14px !important;
        font-weight: 600 !important;
        color: #111827 !important;
        cursor: pointer !important;
        line-height: 1.4 !important;
        visibility: visible !important;
        opacity: 1 !important;
        min-height: 20px !important;
        background: transparent !important;
        /* TEST - czerwone tło żeby zobaczyć czy działa */
        /* background: rgba(255,0,0,0.1) !important; */
    }
    
    /* FORCE service desc to show */
    .calculator-row .service-checkbox .service-desc {
        display: block !important;
        font-size: 12px !important;
        color: #6B7280 !important;
        margin-left: 34px !important;
        margin-top: 4px !important;
        line-height: 1.5 !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* DESKTOP - hide labels (tylko dla pewności) */
@media (min-width: 768px) {
    .calculator-row .checkbox-wrapper label {
        display: none !important;
    }
}