/* =========================================================
   Purrap Packaging — home-page "Design Studio" chat + live mockup widget.
   Loaded only by index2.php (see includes/mockup-studio.php).
   ========================================================= */

.ms-fab {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1050;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border: 0;
    border-radius: 999px;
    background: var(--purrap-red, #A50201);
    color: #fff;
    font-family: var(--purrap-font-body, 'Inter', system-ui, sans-serif);
    font-weight: 600;
    font-size: .95rem;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
}
.ms-fab:hover { background: var(--purrap-red-dark, #7E0101); }
.ms-fab-dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: #7Cf79c; box-shadow: 0 0 0 3px rgba(124, 247, 156, .3);
}

.ms-panel {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1060;
    width: 390px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
    font-family: var(--purrap-font-body, 'Inter', system-ui, sans-serif);
    color: var(--purrap-charcoal, #161616);
}
.ms-hidden { display: none !important; }

.ms-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    background: var(--purrap-charcoal, #161616);
    color: #fff;
}
.ms-head strong { font-size: 1rem; font-weight: 700; }
.ms-head p { margin: 2px 0 0; font-size: .78rem; opacity: .75; }
.ms-close {
    border: 0; background: transparent; color: #fff;
    font-size: 1.5rem; line-height: 1; cursor: pointer; padding: 0 4px;
}

.ms-mock {
    background: #EFEBE3;
    border-bottom: 1px solid var(--purrap-border, #E4E4E4);
    padding: 12px;
}
.ms-mock svg { display: block; width: 100%; height: auto; }

.ms-body {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

.ms-msg {
    background: var(--purrap-sage, #EEF1EA);
    border-radius: 12px;
    padding: 10px 13px;
    font-size: .9rem;
    line-height: 1.45;
    margin-bottom: 14px;
}

.ms-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.ms-opt {
    border: 1px solid var(--purrap-border, #E4E4E4);
    background: #fff;
    border-radius: 9px;
    padding: 9px 14px;
    font-size: .88rem;
    cursor: pointer;
    font-family: inherit;
}
.ms-opt:hover { border-color: var(--purrap-charcoal, #161616); }
.ms-opt.is-active {
    border-color: var(--purrap-red, #A50201);
    background: #FCEBEB;
    color: var(--purrap-red-dark, #7E0101);
    font-weight: 600;
}
.ms-opt-chip { display: inline-flex; align-items: center; gap: 7px; }
.ms-chip {
    width: 14px; height: 14px; border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, .2); flex: 0 0 auto;
}

.ms-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.ms-field label { font-size: .8rem; color: var(--purrap-charcoal-soft, #4A4A4A); }
.ms-field input {
    border: 1px solid var(--purrap-border, #E4E4E4);
    border-radius: 9px;
    padding: 9px 11px;
    font-size: .9rem;
    font-family: inherit;
    width: 100%;
}
.ms-field input:focus { outline: 2px solid var(--purrap-red, #A50201); outline-offset: 0; border-color: transparent; }

.ms-swatches { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ms-swatch {
    width: 30px; height: 30px; border-radius: 50%;
    border: 2px solid var(--purrap-border, #E4E4E4);
    cursor: pointer; padding: 0;
}
.ms-swatch.is-active { outline: 2px solid var(--purrap-charcoal, #161616); outline-offset: 2px; }

.ms-file-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ms-file-btn {
    display: inline-flex; align-items: center; gap: 7px;
    border: 1px solid var(--purrap-border, #E4E4E4);
    border-radius: 9px; padding: 8px 13px;
    font-size: .85rem; cursor: pointer; background: #fff;
}
.ms-file-name { font-size: .8rem; color: var(--purrap-charcoal-soft, #4A4A4A); }

.ms-sublabel { font-size: .8rem; color: var(--purrap-charcoal-soft, #4A4A4A); margin: 16px 0 7px; }
.ms-hint { font-size: .78rem; color: var(--purrap-charcoal-soft, #4A4A4A); margin: 8px 0 0; line-height: 1.4; }

.ms-error {
    color: var(--purrap-red-dark, #7E0101);
    font-size: .82rem;
    margin: 8px 0 0;
}

.ms-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}
.ms-btn {
    flex: 1;
    border: 0;
    border-radius: 9px;
    padding: 11px 14px;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}
.ms-btn-primary { background: var(--purrap-red, #A50201); color: #fff; }
.ms-btn-primary:hover { background: var(--purrap-red-dark, #7E0101); }
.ms-btn-primary:disabled { opacity: .55; cursor: default; }
.ms-btn-ghost { background: #fff; border: 1px solid var(--purrap-border, #E4E4E4); flex: 0 0 auto; }

.ms-progress {
    display: flex;
    gap: 6px;
    justify-content: center;
    padding: 10px 0 14px;
}
.ms-progress span {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--purrap-border, #E4E4E4);
}
.ms-progress span.is-done { background: var(--purrap-red, #A50201); }

.ms-success { text-align: center; padding: 10px 4px 6px; }
.ms-success .ms-check {
    width: 52px; height: 52px; border-radius: 50%;
    background: #E8F6EC; color: #1E7A3C;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem; margin: 0 auto 12px;
}
.ms-success h4 { margin: 0 0 6px; font-size: 1.05rem; }
.ms-success p { margin: 0; font-size: .88rem; color: var(--purrap-charcoal-soft, #4A4A4A); line-height: 1.5; }
.ms-dl {
    display: inline-block;
    margin-top: 14px;
    font-size: .85rem;
    color: var(--purrap-red-dark, #7E0101);
    background: none;
    border: 0;
    cursor: pointer;
    text-decoration: underline;
    font-family: inherit;
}

@media (max-width: 480px) {
    .ms-panel { right: 8px; left: 8px; bottom: 8px; width: auto; max-height: calc(100vh - 16px); }
    .ms-fab { right: 12px; bottom: 12px; }
}
