/* ============================================================
   BigFoto Mockup Creator — frontend
   1) Przycisk CTA na stronie produktu
   2) Samodzielna, pełnoekranowa strona kreatora
   ============================================================ */

/* ---------- 1. CTA na stronie produktu ---------- */
.bfmc-product-cta {
    margin: 18px 0;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9ff 0%, #fff5f7 100%);
    border: 1px solid #e7d6dd;
    border-radius: 14px;
    text-align: center;
}
.bfmc-product-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #1a1a2e;
    color: #fff !important;
    text-decoration: none !important;
    padding: 15px 34px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 50px;
    transition: transform .2s, background .2s, box-shadow .2s;
    box-shadow: 0 8px 24px rgba(26,26,46,.18);
}
.bfmc-product-cta-btn:hover { background: #e94560; transform: translateY(-2px); }
.bfmc-product-cta-btn .material-icons { font-size: 20px; }
.bfmc-product-cta-hint { margin: 12px 0 0; font-size: 13px; color: #6b7280; }

/* ---------- 2. Aplikacja kreatora ---------- */
body.bfmc-app {
    margin: 0;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f3f4f7;
    color: #1a1a2e;
    -webkit-font-smoothing: antialiased;
}
.bfmc-app * { box-sizing: border-box; }

.bfmc-app-header {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; padding: 12px 20px;
    background: #11111d; color: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,.15);
}
.bfmc-app-brand { display: flex; align-items: center; text-decoration: none; color: #fff; }
.bfmc-app-brand img { max-height: 38px; width: auto; display: block; }
.bfmc-app-brand span { font-weight: 800; font-size: 18px; letter-spacing: .5px; }
.bfmc-app-back {
    display: inline-flex; align-items: center; gap: 6px;
    color: #cfd0dc; text-decoration: none; font-size: 14px; font-weight: 600;
    padding: 8px 14px; border-radius: 50px; transition: background .2s, color .2s;
}
.bfmc-app-back:hover { background: rgba(255,255,255,.08); color: #fff; }
.bfmc-app-back .material-icons { font-size: 18px; }

.bfmc-app-root { min-height: calc(100vh - 62px); }

.bfmc-app-loading {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 16px; min-height: 60vh; color: #6b7280;
}
.bfmc-spinner {
    width: 42px; height: 42px; border-radius: 50%;
    border: 4px solid #e5e7eb; border-top-color: #e94560;
    animation: bfmcSpin .8s linear infinite;
}
@keyframes bfmcSpin { to { transform: rotate(360deg); } }

/* Układ: kanwa + panel */
.bfmc-stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 384px;
    gap: 24px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    align-items: start;
}
.bfmc-canvas-host { position: sticky; top: 86px; }
.bfmc-canvas-frame {
    background: repeating-conic-gradient(#ededed 0% 25%, #fff 0% 50%) 50% / 22px 22px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 16px;
    display: flex; align-items: center; justify-content: center;
    min-height: 360px;
    box-shadow: 0 10px 30px rgba(0,0,0,.06);
}
/* Wymiary kanwy ustawia Fabric (inline, w px) — tu tylko zachowanie i bezpiecznik szerokości. */
.bfmc-canvas-frame canvas { display: block; max-width: 100%; touch-action: none; }
.bfmc-canvas-tip { margin: 12px 4px 0; font-size: 12.5px; color: #6b7280; text-align: center; }

/* Panel boczny */
.bfmc-panel {
    background: #fff;
    border: 1px solid #ececf1;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,.05);
}
.bfmc-panel-head h1 { margin: 0 0 4px; font-size: 20px; font-weight: 800; line-height: 1.25; }
.bfmc-price { font-size: 18px; font-weight: 700; color: #e94560; margin-bottom: 4px; }
.bfmc-price del { color: #9ca3af; font-weight: 500; font-size: 15px; }

.bfmc-zones { display: flex; flex-direction: column; gap: 14px; margin: 18px 0; }

.bfmc-zone-card {
    border: 1px solid #e7e8ee; border-radius: 12px; padding: 14px;
    transition: border-color .2s, box-shadow .2s; cursor: pointer; background: #fafbfc;
}
.bfmc-zone-card.active { border-color: #1a1a2e; box-shadow: 0 0 0 3px rgba(26,26,46,.08); }
.bfmc-zone-card.filled { background: #fff; }
.bfmc-zone-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 14px; }
.bfmc-badge {
    font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px;
    padding: 3px 9px; border-radius: 50px;
}
.bfmc-badge.img { background: #dbeafe; color: #2563eb; }
.bfmc-badge.txt { background: #dcfce7; color: #16a34a; }

/* Dropzone */
.bfmc-dropzone {
    position: relative;
    border: 2px dashed #d1d5db; border-radius: 10px;
    padding: 22px 14px; text-align: center; cursor: pointer;
    transition: border-color .2s, background .2s; color: #6b7280;
}
.bfmc-dropzone:hover, .bfmc-dropzone.drag { border-color: #e94560; background: #fff5f7; color: #e94560; }
.bfmc-dropzone.loading { opacity: .6; pointer-events: none; }
.bfmc-dropzone .material-icons { font-size: 34px; display: block; margin: 0 auto 6px; }
.bfmc-dropzone-label { font-size: 13px; font-weight: 600; }
.bfmc-dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* Regulacja zdjęcia */
.bfmc-adjust { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.bfmc-slider { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: #4b5563; }
.bfmc-slider input[type=range] { width: 100%; accent-color: #e94560; }
.bfmc-adjust-actions { display: flex; gap: 8px; }
.bfmc-mini {
    flex: 1; border: 1px solid #d1d5db; background: #fff; border-radius: 8px;
    padding: 8px; font-size: 12px; font-weight: 600; cursor: pointer; color: #374151;
    transition: background .2s, border-color .2s;
}
.bfmc-mini:hover { background: #f3f4f6; border-color: #9ca3af; }

/* Tekst */
.bfmc-textinput {
    width: 100%; padding: 11px 14px; border: 1px solid #d1d5db; border-radius: 9px;
    font-family: inherit; font-size: 14px; outline: none; transition: border-color .2s;
}
.bfmc-textinput:focus { border-color: #1a1a2e; }
.bfmc-charcount { font-size: 11px; color: #9ca3af; text-align: right; margin-top: 4px; }

/* Zakup */
.bfmc-buy { border-top: 1px solid #eef0f3; padding-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.bfmc-variations { display: flex; flex-direction: column; gap: 10px; }
.bfmc-field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: #374151; }
.bfmc-field select, .bfmc-field input {
    padding: 11px 12px; border: 1px solid #d1d5db; border-radius: 9px;
    font-family: inherit; font-size: 14px; background: #fff;
}
.bfmc-qty-field input { width: 100px; }

.bfmc-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: none; border-radius: 50px; padding: 15px 24px; font-family: inherit;
    font-size: 15px; font-weight: 700; cursor: pointer; transition: transform .15s, background .2s, box-shadow .2s;
}
.bfmc-btn:disabled { opacity: .55; cursor: default; }
.bfmc-btn .material-icons { font-size: 19px; }
.bfmc-btn-primary { background: #e94560; color: #fff; box-shadow: 0 8px 22px rgba(233,69,96,.28); }
.bfmc-btn-primary:not(:disabled):hover { transform: translateY(-2px); background: #d63350; }
.bfmc-btn-ghost { background: #f3f4f6; color: #1a1a2e; }
.bfmc-btn-ghost:not(:disabled):hover { background: #e5e7eb; }
.bfmc-buy-note { margin: 2px 0 0; font-size: 12px; color: #6b7280; text-align: center; }

/* Przycisk pomocy „?" */
.bfmc-help-fab {
    position: fixed; left: 18px; bottom: 18px; z-index: 40;
    width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer;
    background: #11111d; color: #fff; font-size: 22px; font-weight: 800; font-family: inherit;
    box-shadow: 0 8px 22px rgba(0,0,0,.28); transition: transform .15s, background .2s;
}
.bfmc-help-fab:hover { background: #e94560; transform: translateY(-2px); }
@media (max-width: 600px) { .bfmc-help-fab { width: 42px; height: 42px; font-size: 20px; } }

/* Toast */
.bfmc-toast {
    position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
    background: #11111d; color: #fff; padding: 13px 22px; border-radius: 50px;
    font-size: 14px; font-weight: 600; z-index: 60; box-shadow: 0 10px 30px rgba(0,0,0,.3);
    max-width: 90vw; text-align: center;
}

/* Overlay + ekran sukcesu (kod) */
.bfmc-overlay {
    position: fixed; inset: 0; z-index: 70;
    background: rgba(15,15,26,.6); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.bfmc-success {
    position: relative; background: #fff; border-radius: 18px; padding: 30px 26px;
    max-width: 440px; width: 100%; text-align: center;
    box-shadow: 0 24px 70px rgba(0,0,0,.35); animation: bfmcPop .25s ease;
    max-height: 92vh; overflow-y: auto;
}
@keyframes bfmcPop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }
.bfmc-success-close {
    position: absolute; top: 12px; right: 16px; background: none; border: none;
    font-size: 28px; line-height: 1; color: #9ca3af; cursor: pointer;
}
.bfmc-success-close:hover { color: #e94560; }
.bfmc-success-preview { max-width: 200px; max-height: 200px; border-radius: 10px; border: 1px solid #e5e7eb; margin-bottom: 14px; }
.bfmc-success h2 { margin: 0 0 6px; font-size: 22px; font-weight: 800; }
.bfmc-success p { margin: 6px 0; color: #4b5563; font-size: 14px; }
.bfmc-code {
    font-size: 34px; font-weight: 800; letter-spacing: 3px; color: #1a1a2e;
    background: #f3f4f7; border: 2px dashed #c7c9d4; border-radius: 12px;
    padding: 14px; margin: 10px 0 14px; user-select: all;
}
.bfmc-success-note { background: #fff7ed; border: 1px solid #fde2c0; border-radius: 10px; padding: 12px; font-size: 13px; color: #92400e; }
.bfmc-success-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.bfmc-copy .material-icons { font-size: 18px; }

/* ---------- Responsywność ---------- */
@media (max-width: 980px) {
    .bfmc-stage { grid-template-columns: 1fr; gap: 18px; padding: 16px; }
    .bfmc-canvas-host { position: static; }
    .bfmc-canvas-frame { padding: 12px; }
}
@media (max-width: 600px) {
    .bfmc-app-back-label { display: none; }
    .bfmc-panel { padding: 16px; border-radius: 14px; }
    .bfmc-code { font-size: 28px; letter-spacing: 2px; }
    .bfmc-app-root { min-height: 0; }
}
