/* MDF Kalkulator — front v1.1 */
.mdfk-app {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 900px;
    margin: 0 auto;
    color: #222;
    line-height: 1.5;
}
.mdfk-app .mdfk-title { font-size: 22px; font-weight: 500; margin: 0 0 0.5rem; }
.mdfk-app h3 { font-size: 18px; font-weight: 500; margin: 0 0 1rem; }
.mdfk-app h4 { font-size: 14px; font-weight: 500; margin: 0 0 0.75rem; }
.mdfk-sub { font-size: 13px; color: #666; margin: 0 0 1.25rem; }

/* Catalog */
.mdfk-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 1.5rem; background: #fff; }
.mdfk-table th, .mdfk-table td { padding: 9px 14px; text-align: left; border-bottom: 1px solid #eee; }
.mdfk-table thead th { font-weight: 500; font-size: 11px; color: #666; background: #fafafa; text-transform: uppercase; letter-spacing: 0.5px; }
.mdfk-table td.num, .mdfk-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.mdfk-table td.center, .mdfk-table th.center { text-align: center; }
.mdfk-table tbody tr { cursor: pointer; transition: background 0.12s; }
.mdfk-table tbody tr:hover { background: #fafafa; }
.mdfk-table tbody tr.active { background: #e6f1fb; }
.mdfk-table tbody tr.active td { color: #042c53; }

.mdfk-pill { display: inline-block; font-size: 11px; padding: 2px 10px; border-radius: 999px; background: #f0f0f0; color: #666; font-weight: 500; }
.mdfk-pill.mat { background: #f1efe8; color: #5f5e5a; }
.mdfk-pill.polysk { background: #eeedfe; color: #3c3489; }

/* Przycisk podglądu zdjęcia w tabeli katalogu */
.mdfk-app .mdfk-img-btn {
    all: unset;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    color: #555;
    font-size: 13px;
    padding: 0;
/*     border: 1px solid #ddd; */
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    color: #555;
/*     background: #fff; */
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.mdfk-app .mdfk-img-btn:hover {
    background: #e6f1fb;
    border-color: #185fa5;
    color: #185fa5;
}

/* Lightbox */
#mdfk-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
}
#mdfk-lightbox.active {
    display: block;
}
.mdfk-lb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.80);
    cursor: pointer;
}
.mdfk-lb-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 8px;
    padding: 12px;
    max-width: 90vw;
    max-height: 90vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}
.mdfk-lb-box img {
    display: block;
	max-width: min(40vw, 1200px);
	max-height: /*90vh*/60vh;
    object-fit: contain;
    border-radius: 4px;
}
.mdfk-lb-close {
    all: unset;
    box-sizing: border-box;
    position: absolute;
    top: -14px;
    right: -14px;
    width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    padding: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    color: #333;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.mdfk-lb-close:hover {
    background: #fee;
    border-color: #b91c1c;
    color: #b91c1c;
}

.mdfk-info {
    background: #fffaeb; border-left: 3px solid #ef9f27; padding: 12px 16px;
    font-size: 13px; line-height: 1.6; margin-bottom: 1.5rem; color: #633806;
    border-radius: 0 6px 6px 0;
}
.mdfk-info strong { color: #412402; }

/* Calculator */
.mdfk-calc { background: #fff; border: 1px solid #eee; border-radius: 12px; padding: 1.5rem; margin-bottom: 1.5rem; }
.mdfk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 1rem; }
.mdfk-field label { display: block; font-size: 12px; color: #666; margin-bottom: 4px; font-weight: 500; }
.mdfk-field input, .mdfk-field select {
    width: 100%; box-sizing: border-box; padding: 8px 10px;
    border: 1px solid #ddd; border-radius: 6px; font-size: 14px;
    font-family: inherit; background: #fff;
    transition: border-color 0.12s, box-shadow 0.12s;
}
.mdfk-field input:focus, .mdfk-field select:focus {
    outline: none; border-color: #185fa5;
    box-shadow: 0 0 0 3px rgba(24, 95, 165, 0.15);
}

.mdfk-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 1rem 0; }
.mdfk-rc { background: #fafafa; padding: 12px 14px; border-radius: 8px; }
.mdfk-rc .lab { font-size: 12px; color: #666; margin-bottom: 4px; }
.mdfk-rc .val { font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; }

/* Buttons */
.mdfk-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 18px; background: #fff;
    border: 1px solid #ddd; border-radius: 8px;
    font-size: 14px; font-family: inherit; font-weight: 500;
    cursor: pointer; color: #222;
    transition: all 0.15s;
}
.mdfk-btn:hover { background: #fafafa; border-color: #999; }
.mdfk-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.mdfk-btn .ico { font-size: 16px; font-weight: bold; }
.mdfk-btn.primary { background: #185fa5; color: #fff; border-color: #185fa5; }
.mdfk-btn.primary:hover { background: #0c447c; border-color: #0c447c; }
.mdfk-btn.success { background: #0f6e56; color: #fff; border-color: #0f6e56; }
.mdfk-btn-link {
    background: none; border: none; color: #b91c1c; cursor: pointer;
    font-size: 13px; padding: 4px 0; text-decoration: underline;
    font-family: inherit;
}
.mdfk-btn-link:hover { color: #7f1d1d; }

/* Cart */
.mdfk-cart { background: #fff; border: 1px solid #eee; border-radius: 12px; padding: 1.5rem; }
.mdfk-cart-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.mdfk-cart-head h3 { margin: 0; }
.mdfk-cart-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 1rem; }
.mdfk-cart-table th, .mdfk-cart-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid #eee; }
.mdfk-cart-table thead th { font-weight: 500; font-size: 11px; color: #666; background: #fafafa; text-transform: uppercase; letter-spacing: 0.5px; }
.mdfk-cart-table td.num, .mdfk-cart-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.mdfk-del {
    background: none; border: 1px solid #ddd; border-radius: 6px;
    width: 28px; height: 28px; cursor: pointer;
    font-size: 18px; line-height: 1; color: #999;
    transition: all 0.12s;
}
.mdfk-del:hover { background: #fee; border-color: #b91c1c; color: #b91c1c; }

.mdfk-summary { padding-top: 0.75rem; border-top: 1px solid #eee; }
.mdfk-summary .row {
    display: flex; justify-content: space-between;
    padding: 6px 0; font-size: 14px;
}
.mdfk-summary .row span:first-child { color: #666; }
.mdfk-summary .row span:last-child { font-variant-numeric: tabular-nums; font-weight: 500; }
.mdfk-brutto { background: #e1f5ee; padding: 16px 20px; border-radius: 8px; margin-top: 0.75rem; display: flex; justify-content: space-between; align-items: center; }
.mdfk-brutto .lab { font-size: 13px; color: #0f6e56; font-weight: 500; }
.mdfk-brutto .val { font-size: 26px; font-weight: 600; color: #085041; font-variant-numeric: tabular-nums; }

.mdfk-actions { display: flex; gap: 12px; margin-top: 1.25rem; flex-wrap: wrap; }

/* Form */
.mdfk-form { margin-top: 1.5rem; padding: 1.25rem; background: #fafafa; border-radius: 8px; border: 1px solid #eee; }
.mdfk-checkbox { display: flex; align-items: flex-start; gap: 8px; margin-top: 0.5rem; font-size: 13px; cursor: pointer; line-height: 1.5; }
.mdfk-checkbox input { margin-top: 2px; }

.mdfk-status { margin-top: 1rem; padding: 10px 14px; border-radius: 6px; font-size: 13px; min-height: 1em; }
.mdfk-status:empty { display: none; }
.mdfk-status.success { background: #e1f5ee; color: #085041; }
.mdfk-status.error { background: #fceaea; color: #791f1f; }

.mdfk-disclaimer {
    font-size: 11px; color: #999; font-style: italic;
    margin-top: 1.25rem; line-height: 1.5;
    padding-top: 0.75rem; border-top: 1px dashed #eee;
}

@media (max-width: 600px) {
    .mdfk-table th, .mdfk-table td,
    .mdfk-cart-table th, .mdfk-cart-table td { padding: 7px 6px; font-size: 12px; }
    .mdfk-brutto .val { font-size: 22px; }
    .mdfk-actions { flex-direction: column; }
    .mdfk-actions .mdfk-btn { width: 100%; justify-content: center; }
}

/* reCAPTCHA badge — pozwól pokazać się na stronie */
.grecaptcha-badge { z-index: 999 !important; }

/* =========================================================================
 * Style panelu admina — pola zdjęć w meta boxie
 * ========================================================================= */
.mdfk-media-fields {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #ddd;
}
.mdfk-media-fields > p {
    font-size: 13px;
    margin: 0 0 12px;
    color: #1d2327;
}
.mdfk-media-row {
    margin-bottom: 16px;
    padding: 12px 14px;
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
}
.mdfk-media-row label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 8px;
    color: #1d2327;
}
.mdfk-media-preview {
    margin-bottom: 8px;
    min-height: 10px;
}
.mdfk-media-preview img {
    display: block;
    max-width: 80px;
    max-height: 80px;
    border: 1px solid #ddd;
    border-radius: 3px;
    object-fit: cover;
}
.mdfk-media-clear {
    margin-left: 6px !important;
}

@media (max-width: 420px) {
#mdfk-cart-wrap #mdfk-cart-body tr td button.mdfk-del[type="button"], #mdfk-cart-wrap.mdfk-cart td,#mdfk-cart-wrap.mdfk-cart {
    padding: 0;
}
}