/* =========================================================
   PEDIDOPOP DEMO ENGINE — 6.0.15.1
   Loja real + painel compacto + loader ao alterar tema
========================================================= */

/* BASE */
body.pp-demo-full-store {
    background: var(--pp-store-bg, #f7f8fb) !important;
}
body.pp-demo-full-store .pp-store-page {
    min-height: 100vh;
}
.pp-store-header {
    position: relative;
}

/* PAINEL ABERTO */
.pp-demo-overlay {
    position: fixed;
    top: 14px;
    right: 14px;
    width: min(330px, calc(100vw - 28px));
    z-index: 99999;
    background: rgba(255, 255, 255, 0.95);
    color: #111827;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 22px;
    box-shadow: 0 20px 70px rgba(15, 23, 42, 0.22);
    padding: 14px;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    font-family: Manrope, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.pp-demo-overlay * {
    box-sizing: border-box;
}

/* CABEÇALHO DO PAINEL */
.pp-demo-overlay-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}
.pp-demo-overlay-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    color: #111827;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.pp-demo-overlay h2 {
    margin: 8px 0 0;
    font-size: 17px;
    line-height: 1.14;
    color: #111827;
}

/* BOTÃO FECHAR PAINEL */
.pp-demo-toggle {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 14px;
    background: #111827;
    color: #ffffff;
    cursor: pointer;
    font-weight: 900;
    box-shadow: none;
}

/* GRUPOS */
.pp-demo-control-group {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}
.pp-demo-control-group strong {
    display: block;
    margin-bottom: 8px;
    color: #344054;
    font-size: 12px;
}

/* LISTAS */
.pp-demo-segments,
.pp-demo-themes {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

/* BOTÕES DE SEGMENTO E TEMA */
.pp-demo-segment,
.pp-demo-theme {
    padding: 9px 10px;
    border: 1px solid rgba(15, 23, 42, 0.11);
    border-radius: 14px;
    background: #ffffff;
    color: #111827;
    cursor: pointer;
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.05);
    transition: 0.16s ease;
}
.pp-demo-segment {
    display: flex;
    align-items: center;
    gap: 6px;
}
.pp-demo-segment span {
    font-size: 17px;
    line-height: 1;
}
.pp-demo-theme span {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 6px;
    border-radius: 999px;
    background: currentColor;
    vertical-align: -1px;
}
.pp-demo-segment:hover,
.pp-demo-theme:hover,
.pp-demo-segment.is-active,
.pp-demo-theme.is-active {
    transform: translateY(-1px);
    border-color: #111827;
    box-shadow: 0 12px 24px rgba(17, 24, 39, 0.14);
}
.pp-demo-segment.is-active,
.pp-demo-theme.is-active {
    background: #f3f4f6;
}

/* BOTÃO CONVERSÃO */
.pp-demo-lead {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 46px;
    margin-top: 12px;
    border-radius: 16px;
    background: #111827;
    color: #ffffff !important;
    text-decoration: none;
    font-weight: 950;
    box-shadow: none;
}

/* BOTÃO FECHADO — ALTERAR TEMA */
.pp-demo-mini-label {
    position: absolute;
    top: 14px;
    right: 14px;
    bottom: auto;
    z-index: 30;
    display: none;
    border: 0;
    border-radius: 999px;
    background: #111827;
    color: #ffffff;
    padding: 12px 16px;
    font-family: Manrope, system-ui;
    font-weight: 900;
    letter-spacing: 0.02em;
    box-shadow: none;
}
.pp-demo-full-store.pp-demo-overlay-closed .pp-demo-overlay {
    display: none;
}
.pp-demo-full-store.pp-demo-overlay-closed .pp-demo-mini-label {
    display: block;
}

/* LOADING DO BOTÃO DE TEMA */
.pp-demo-theme.is-loading {
    position: relative;
    opacity: 0.72;
    pointer-events: none;
}
.pp-demo-theme.is-loading::after {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-left: 7px;
    border-radius: 999px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    vertical-align: -2px;
    animation: ppDemoSpin 0.7s linear infinite;
}
.pp-demo-theme:disabled {
    cursor: wait;
}
@keyframes ppDemoSpin {
    to { transform: rotate(360deg); }
}

/* LOADER CENTRAL AO ALTERAR TEMA */
.pp-theme-loader {
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-family: Manrope, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body.pp-demo-theme-loading .pp-theme-loader {
    display: flex;
}
.pp-theme-loader-spinner {
    width: 46px;
    height: 46px;
    border: 4px solid #e5e7eb;
    border-top-color: #111827;
    border-radius: 999px;
    animation: ppDemoSpin 0.7s linear infinite;
}
.pp-theme-loader-text {
    margin-top: 14px;
    color: #111827;
    font-size: 15px;
    font-weight: 900;
    text-align: center;
}

/* MOBILE */
@media (max-width: 760px) {
    .pp-demo-overlay {
        top: calc(env(safe-area-inset-top, 0px) + 10px);
        right: 10px;
        left: 10px;
        bottom: auto;
        width: auto;
        max-height: 58vh;
        overflow: auto;
        border-radius: 22px;
        z-index: 99999;
    }
    .pp-demo-mini-label {
        position: absolute;
        top: 12px;
        right: 12px;
        bottom: auto;
        z-index: 30;
        background: #111827;
        color: #ffffff;
    }
    .pp-demo-segment,
    .pp-demo-theme {
        flex: 1 1 calc(50% - 6px);
        justify-content: center;
        text-align: center;
    }
    .pp-demo-overlay h2 {
        font-size: 15px;
    }
}
