/* ============================================================
   Produto Externo WooCommerce – Front-end Styles v2.1
   ============================================================ */

.pew-front-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px 60px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    color: #2c3338;
}

.pew-front-wrap *, .pew-front-wrap *::before, .pew-front-wrap *::after {
    box-sizing: border-box;
}

/* ── Grid ── */
.pew-front-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
    align-items: start;
}

@media (max-width: 860px) {
    .pew-front-grid { grid-template-columns: 1fr; }
}

/* ── Cards ── */
.pew-front-card {
    background: #fff;
    border: 1px solid #e2e4e8;
    border-radius: 12px;
    padding: 22px 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.pew-front-card:last-child { margin-bottom: 0; }

.pew-front-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #1d2327;
    margin: 0 0 18px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f1;
}

.pew-front-card-seo   { border-top: 3px solid #a4286a; }
.pew-front-card-submit {
    background: linear-gradient(135deg, #f8f4ff, #ede8ff);
    border: 2px dashed #96588a;
    text-align: center;
}

/* ── Fields ── */
.pew-front-field { margin-bottom: 18px; }
.pew-front-field:last-child { margin-bottom: 0; }

.pew-front-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #3c434a;
    margin-bottom: 7px;
}

.pew-front-field input[type="text"],
.pew-front-field input[type="url"],
.pew-front-field select,
.pew-front-field textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #c3c4c7;
    border-radius: 8px;
    font-size: 14px;
    color: #2c3338;
    background: #fafafa;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.pew-front-wrap select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2396588a' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}

.pew-front-field input:focus,
.pew-front-field select:focus,
.pew-front-field textarea:focus {
    border-color: #96588a;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(150, 88, 138, 0.15);
}

.pew-front-field textarea { resize: vertical; line-height: 1.6; }

.pew-req             { color: #d63638; margin-left: 2px; font-size: 15px; }
.pew-optional-label  { font-size: 12px; font-weight: 400; color: #8c8f94; }
.pew-hint            { font-size: 12px; color: #8c8f94; margin-top: 5px; display: block; }

/* ── Campo de Preço ── */
.pew-price-wrap {
    display: flex;
    align-items: center;
    border: 1.5px solid #c3c4c7;
    border-radius: 8px;
    background: #fafafa;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.pew-price-wrap:focus-within {
    border-color: #96588a;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(150, 88, 138, 0.15);
}

.pew-currency-symbol {
    padding: 10px 12px;
    background: #f0f0f1;
    border-right: 1.5px solid #c3c4c7;
    color: #3c434a;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    line-height: 1;
}

.pew-price-wrap input[type="text"] {
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    flex: 1;
    padding: 10px 14px;
    font-size: 15px;
    font-weight: 600;
    color: #2c3338;
    outline: none;
}

/* ── Char counter ── */
.pew-counter {
    display: block;
    font-size: 12px;
    color: #8c8f94;
    margin-top: 5px;
    text-align: right;
}
.pew-counter.over { color: #d63638; font-weight: 600; }

/* ── Alerts ── */
.pew-alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}
.pew-alert-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

/* ══════════════════════════════════════════
   IMAGEM PRINCIPAL
   IMPORTANTE: sem overflow:hidden para que
   o clique funcione corretamente
══════════════════════════════════════════ */
.pew-upload-area {
    border: 2px dashed #c3c4c7;
    border-radius: 10px;
    cursor: pointer;
    min-height: 180px;
    background: #fafafa;
    transition: border-color 0.2s, background 0.2s;
    position: relative;
    -webkit-user-select: none;
    user-select: none;
}

.pew-upload-area:hover,
.pew-upload-area.drag-over {
    border-color: #96588a;
    background: #f9f4fd;
}

.pew-upload-area.has-image {
    border-style: solid;
    border-color: #96588a;
}

.pew-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    pointer-events: none;
    text-align: center;
}

.pew-upload-icon { font-size: 40px; display: block; margin-bottom: 10px; }

.pew-upload-placeholder p {
    font-size: 14px;
    color: #3c434a;
    margin: 0 0 4px;
    font-weight: 500;
}

.pew-upload-hint { font-size: 12px; color: #8c8f94; }

#pew-main-preview {
    width: 100%;
    max-height: 260px;
    object-fit: cover;
    display: block;
    border-radius: 8px 8px 0 0;
    pointer-events: none;
}

/* Botão remover dentro da área */
#pew-main-remove {
    display: block;
    width: 100%;
    padding: 10px;
    background: #fef2f2;
    border: none;
    border-top: 1px solid #fca5a5;
    color: #991b1b;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 0 0 8px 8px;
    transition: background 0.2s;
    pointer-events: auto;
}
#pew-main-remove:hover { background: #fee2e2; }

/* ══════════════════════════════════════════
   GALERIA
══════════════════════════════════════════ */
.pew-gallery-front {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 9px;
    margin-bottom: 10px;
}

.pew-gal-slot {
    position: relative;
    aspect-ratio: 1;
    border: 2px dashed #c3c4c7;
    border-radius: 8px;
    cursor: pointer;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, background 0.2s;
    -webkit-user-select: none;
    user-select: none;
    /* SEM overflow:hidden — para que o clique funcione */
}

.pew-gal-slot:hover        { border-color: #96588a; background: #f9f4fd; }
.pew-gal-slot.has-image    { border-style: solid; border-color: #96588a; }

.pew-gal-placeholder {
    text-align: center;
    color: #c3c4c7;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    line-height: 1;
}
.pew-gal-placeholder span  { font-size: 22px; font-weight: 300; }
.pew-gal-placeholder small { font-size: 11px; font-weight: 600; }

.pew-gal-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
    border-radius: 6px;
    pointer-events: none;
}

.pew-gal-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(214,54,56,0.92);
    color: #fff;
    border: none;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    padding: 0;
    pointer-events: auto;
    transition: background 0.2s, transform 0.1s;
}
.pew-gal-remove:hover { background: #b32d2e; transform: scale(1.1); }

/* ── Botão publicar ── */
.pew-submit-btn {
    width: 100%;
    padding: 16px 20px;
    font-size: 17px;
    font-weight: 700;
    border-radius: 9px;
    background: linear-gradient(135deg, #96588a, #7b44a8);
    border: none;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(123,68,168,0.4);
    letter-spacing: 0.3px;
}
.pew-submit-btn:hover {
    background: linear-gradient(135deg, #7b44a8, #4f3799);
    box-shadow: 0 6px 20px rgba(79,55,153,0.5);
    transform: translateY(-1px);
}
.pew-submit-btn:active { transform: translateY(0); }
.pew-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.pew-submit-hint {
    font-size: 12px;
    color: #8c8f94;
    margin: 10px 0 0;
    text-align: center;
}

/* ── Chave de acesso ── */
.pew-key-wrap { display: flex; justify-content: center; padding: 60px 16px; }
.pew-key-box {
    background: #fff;
    border: 1px solid #e2e4e8;
    border-radius: 16px;
    padding: 40px 36px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}
.pew-key-icon { font-size: 48px; margin-bottom: 16px; display: block; }
.pew-key-box h2 { font-size: 22px; margin: 0 0 10px; color: #1d2327; }
.pew-key-box p  { color: #8c8f94; margin: 0 0 20px; }
.pew-key-form { display: flex; flex-direction: column; gap: 12px; }
.pew-key-form input {
    padding: 12px 16px;
    border: 1.5px solid #c3c4c7;
    border-radius: 8px;
    font-size: 15px;
    text-align: center;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.pew-key-form input:focus { border-color: #96588a; box-shadow: 0 0 0 3px rgba(150,88,138,0.15); }
.pew-key-form button {
    padding: 13px;
    background: linear-gradient(135deg, #96588a, #7b44a8);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
}
.pew-key-form button:hover { opacity: 0.9; }

/* ── Sucesso ── */
.pew-success-box {
    background: #fff;
    border: 1px solid #e2e4e8;
    border-radius: 16px;
    padding: 48px 40px;
    text-align: center;
    max-width: 500px;
    margin: 40px auto;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}
.pew-success-icon { font-size: 56px; display: block; margin-bottom: 16px; }
.pew-success-box h2 { font-size: 24px; color: #1d2327; margin: 0 0 12px; }
.pew-success-box p  { color: #8c8f94; margin: 0 0 28px; }
.pew-success-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.pew-btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}
.pew-btn-primary {
    background: linear-gradient(135deg, #96588a, #7b44a8);
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(123,68,168,0.35);
}
.pew-btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.pew-btn-secondary {
    background: #f0f0f1;
    color: #2c3338 !important;
    border: 1px solid #c3c4c7;
}
.pew-btn-secondary:hover { background: #e0e0e1; }

/* ── Loading ── */
.pew-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: pew-spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}
@keyframes pew-spin { to { transform: rotate(360deg); } }
