/* ─── PIK Newsletter Frontend — Mobile First ─── */

/* ═══ Fixed bottom bar ═══ */
.pik-nl-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1a1a1a;
    color: #fff;
    z-index: 99999;
    padding: 16px 0;
    box-shadow: 0 -2px 16px rgba(0,0,0,0.35);
    font-family: 'Fira Sans', Arial, Helvetica, sans-serif;
    transform: translateY(100%);
    transition: transform 0.4s ease;
}
.pik-nl-bar.visible {
    transform: translateY(0);
}
.pik-nl-bar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 40px 0 16px;
    position: relative;
}
.pik-nl-bar-text {
    margin-bottom: 10px;
}
.pik-nl-bar-text strong {
    font-size: 15px;
    display: block;
    margin-bottom: 2px;
}
.pik-nl-bar-text span {
    font-size: 12px;
    color: #ccc;
}
.pik-nl-close {
    position: absolute;
    top: -4px;
    right: 8px;
    background: none;
    border: none;
    color: #999;
    font-size: 26px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}
.pik-nl-close:hover {
    color: #fff;
}

/* ═══ Footer section (nad stopką) ═══ */
.pik-nl-footer-section {
    background: #f0f0f0;
    padding: 24px 0;
    font-family: 'Fira Sans', Arial, Helvetica, sans-serif;
    border-top: 1px solid #e0e0e0;
}
.pik-nl-footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
}
.pik-nl-footer-text {
    margin-bottom: 12px;
}
.pik-nl-footer-text strong {
    font-size: 17px;
    color: #1a1a1a;
    display: block;
    margin-bottom: 4px;
}
.pik-nl-footer-text span {
    font-size: 13px;
    color: #666;
}

/* ═══ Form (shared — mobile first) ═══ */
.pik-nl-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.pik-nl-form input[type="text"],
.pik-nl-form input[type="email"] {
    padding: 12px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Fira Sans', Arial, Helvetica, sans-serif;
    font-size: 16px; /* 16px zapobiega zoom na iOS */
    width: 100%;
    box-sizing: border-box;
    background: #fff;
    color: #1a1a1a;
    -webkit-appearance: none;
}
.pik-nl-bar .pik-nl-form input[type="text"],
.pik-nl-bar .pik-nl-form input[type="email"] {
    border-color: #444;
    background: #2a2a2a;
    color: #fff;
}
.pik-nl-bar .pik-nl-form input::placeholder {
    color: #888;
}
.pik-nl-submit {
    background: var(--pik-nl-color, #f7a919);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-family: 'Fira Sans', Arial, Helvetica, sans-serif;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
    width: 100%;
    -webkit-appearance: none;
}
.pik-nl-submit:hover {
    background: var(--pik-nl-color, #f7a919);
    filter: brightness(0.85);
}
.pik-nl-submit:disabled {
    background: #666;
    cursor: not-allowed;
}

/* Consents */
.pik-nl-consents {
    margin-top: 10px;
}
.pik-nl-consents label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 11px;
    line-height: 1.4;
    margin-bottom: 6px;
    cursor: pointer;
}
.pik-nl-bar .pik-nl-consents label {
    color: #bbb;
}
.pik-nl-footer-section .pik-nl-consents label {
    color: #666;
}
.pik-nl-consents input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}
.pik-nl-consents a {
    text-decoration: underline;
}
.pik-nl-bar .pik-nl-consents a {
    color: #ddd;
}
.pik-nl-footer-section .pik-nl-consents a {
    color: var(--pik-nl-color, #f7a919);
}

/* Messages (inline under form) */
.pik-nl-msg {
    margin-top: 8px;
    font-size: 13px;
    min-height: 18px;
}
.pik-nl-msg.success { color: #00a32a; }
.pik-nl-msg.error { color: #d63638; }
.pik-nl-bar .pik-nl-msg.success { color: #66cc66; }
.pik-nl-bar .pik-nl-msg.error { color: #ff6b6b; }

/* ═══ Modal popup (potwierdzenie, zapis, wypisanie) ═══ */
.pik-nl-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.pik-nl-modal-overlay.visible {
    opacity: 1;
}
.pik-nl-modal {
    background: #fff;
    border-radius: 14px;
    padding: 36px 28px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 8px 40px rgba(0,0,0,0.25);
    font-family: 'Fira Sans', Arial, Helvetica, sans-serif;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}
.pik-nl-modal-overlay.visible .pik-nl-modal {
    transform: scale(1);
}
.pik-nl-modal-icon {
    font-size: 52px;
    margin-bottom: 12px;
    line-height: 1;
}
.pik-nl-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 10px;
}
.pik-nl-modal-msg {
    font-size: 15px;
    color: #444;
    line-height: 1.5;
    margin: 0 0 24px;
}
.pik-nl-modal-btn {
    background: var(--pik-nl-color, #f7a919);
    color: #fff;
    border: none;
    padding: 12px 40px;
    border-radius: 8px;
    font-family: 'Fira Sans', Arial, Helvetica, sans-serif;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s;
}
.pik-nl-modal-btn:hover {
    background: var(--pik-nl-color, #f7a919);
    filter: brightness(0.85);
}

/* ═══ Mini notification bubble (prawy dolny róg) ═══ */
.pik-nl-bubble {
    position: fixed;
    bottom: 120px;
    right: 150px;
    z-index: 99998;
    font-family: 'Fira Sans', Arial, Helvetica, sans-serif;
    transform: translateX(calc(100% + 200px));
    transition: transform 0.4s cubic-bezier(.34,1.56,.64,1);
    visibility: hidden;
    filter: drop-shadow(0 4px 16px rgba(0,0,0,0.2));
}
.pik-nl-bubble.visible {
    transform: translateX(0);
    visibility: visible;
}
.pik-nl-bubble-inner {
    background: #fff;
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    min-width: 240px;
    max-width: 320px;
    position: relative;
    border: 1px solid #e8e8e8;
}
.pik-nl-bubble-icon {
    width: 48px;
    height: 48px;
    background: var(--pik-nl-color, #f7a919);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}
.pik-nl-bubble-icon svg {
    width: 26px;
    height: 26px;
    fill: #fff;
}
.pik-nl-bubble-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background: #e53935;
    border-radius: 50%;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}
.pik-nl-bubble-text {
    flex: 1;
}
.pik-nl-bubble-text strong {
    display: block;
    font-size: 15px;
    color: #1a1a1a;
    margin-bottom: 2px;
}
.pik-nl-bubble-text span {
    font-size: 12px;
    color: var(--pik-nl-color, #f7a919);
    font-weight: 600;
}
.pik-nl-bubble-close {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: #666;
    border: 2px solid #fff;
    border-radius: 50%;
    color: #fff;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}
.pik-nl-bubble-close:hover {
    background: #333;
}

/* ═══ Full popup (modal z formularzem + podgląd) ═══ */
.pik-nl-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
}
.pik-nl-popup-overlay.visible {
    opacity: 1;
    visibility: visible;
}
.pik-nl-popup {
    background: #fff;
    border-radius: 16px;
    max-width: 780px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 12px 60px rgba(0,0,0,0.3);
    font-family: 'Fira Sans', Arial, Helvetica, sans-serif;
    transform: scale(0.92) translateY(20px);
    transition: transform 0.3s ease;
    position: relative;
}
.pik-nl-popup-overlay.visible .pik-nl-popup {
    transform: scale(1) translateY(0);
}
.pik-nl-popup-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    z-index: 2;
    padding: 4px;
    line-height: 1;
}
.pik-nl-popup-close:hover {
    color: #333;
}
.pik-nl-popup-body {
    display: flex;
    flex-direction: column;
}
/* Lewa kolumna — formularz */
.pik-nl-popup-form-col {
    padding: 32px 24px 28px;
}
.pik-nl-popup-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 8px;
}
.pik-nl-popup-header-icon {
    width: 52px;
    height: 52px;
    background: var(--pik-nl-color, #f7a919);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.pik-nl-popup-header-icon svg {
    width: 28px;
    height: 28px;
    fill: #fff;
}
.pik-nl-popup-header h3 {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.2;
}
.pik-nl-popup-desc {
    font-size: 15px;
    color: #555;
    line-height: 1.5;
    margin: 12px 0 20px;
}
.pik-nl-popup-social {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #eee;
    font-size: 13px;
    color: #888;
}
.pik-nl-popup-social strong {
    color: #1a1a1a;
    font-size: 14px;
}
/* Prawa kolumna — podgląd */
.pik-nl-popup-preview-col {
    background: #f6f6f8;
    border-top: 1px solid #eee;
    padding: 20px;
}
.pik-nl-popup-preview-label {
    font-size: 13px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}
.pik-nl-popup-preview-frame {
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.pik-nl-popup-preview-bar {
    background: #e8e8e8;
    padding: 6px 12px;
    border-bottom: 1px solid #d0d0d0;
    display: flex;
    align-items: center;
    gap: 4px;
}
.pik-nl-popup-preview-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.pik-nl-popup-preview-iframe {
    width: 100%;
    height: 280px;
    border: none;
    display: block;
    pointer-events: none;
}
.pik-nl-popup-no-preview {
    padding: 30px 20px;
    text-align: center;
    color: #aaa;
    font-size: 14px;
}

/* Formularz wewnątrz popup */
.pik-nl-popup .pik-nl-fields {
    flex-direction: column;
}
.pik-nl-popup .pik-nl-form input[type="text"],
.pik-nl-popup .pik-nl-form input[type="email"] {
    width: 100%;
    font-size: 16px;
}
.pik-nl-popup .pik-nl-submit {
    width: 100%;
}

/* ═══ Mobile/Tablet: ukryj podgląd newslettera w popup ═══ */
@media (max-width: 1023px) {
    .pik-nl-popup-preview-col {
        display: none !important;
    }
}

/* ═══ Desktop (>=768px) ═══ */
@media (min-width: 768px) {
    .pik-nl-fields {
        flex-direction: row;
        align-items: center;
    }
    .pik-nl-form input[type="text"],
    .pik-nl-form input[type="email"] {
        width: 220px;
        font-size: 14px;
    }
    .pik-nl-submit {
        width: auto;
        font-size: 14px;
    }
    .pik-nl-bar-inner {
        padding: 0 20px;
    }
    .pik-nl-footer-inner {
        padding: 0 20px;
    }
    .pik-nl-bar-text strong {
        font-size: 16px;
    }
    .pik-nl-footer-text strong {
        font-size: 18px;
    }
    /* Popup desktop — side by side */
    .pik-nl-popup-body {
        flex-direction: row;
    }
    .pik-nl-popup-form-col {
        flex: 1;
        padding: 36px 30px 32px;
    }
    .pik-nl-popup-preview-col {
        display: none; /* podgląd dopiero od 1024px */
    }
    .pik-nl-popup .pik-nl-fields {
        flex-direction: column;
    }
    .pik-nl-popup .pik-nl-form input[type="text"],
    .pik-nl-popup .pik-nl-form input[type="email"] {
        width: 100%;
        font-size: 15px;
    }
    .pik-nl-popup .pik-nl-submit {
        width: 100%;
    }
}

/* ═══ Desktop wide (>=1024px): podgląd newslettera w popup ═══ */
@media (min-width: 1024px) {
    .pik-nl-popup-preview-col {
        display: block !important;
        flex: 0 0 340px;
        border-top: none;
        border-left: 1px solid #eee;
        border-radius: 0 16px 16px 0;
        padding: 24px;
    }
    .pik-nl-popup-preview-iframe {
        height: 380px;
    }
}
