/* ========================================
   Product Suggestion - CSS (desktop original preserved, mobile fixes scoped)
   COM ADIÇÃO DE @font-face PARA 'email.otf' E APLICAÇÃO AO POPUP
   ======================================== */

/* 1) Carrega a fonte do child theme (URL fornecida) */
@font-face {
font-display:swap;
    font-family: 'EmailOTF';
    src: url('https://diamondjoiasoficial.com.br/wp-content/themes/astra-child/fonts/email.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Aplica somente ao conteúdo do popup (e filhos) para não alterar o site inteiro */
.ps-container,
.ps-container * ,
.ps-form-section,
.ps-message-preview,
.ps-product-info,
.ps-header,
.ps-preview-text,
.ps-form,
.ps-form input,
.ps-form-group label,
.ps-submit-btn {
    font-family: 'EmailOTF', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
}

/* ========================================
   BOTÃO DE SUGESTÃO
   (original)
   ======================================== */
.ps-suggestion-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    padding: 14px 28px !important;
    background: #fff !important;
    border: 1px solid #000 !important;
    color: #000 !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    letter-spacing: 1.5px !important;
    text-transform: uppercase !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    margin-top: 15px !important;
    border-radius: 0 !important;
    width: auto !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

.ps-suggestion-button:hover {
    background: #000 !important;
    color: #fff !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    border-color: #000 !important;
}

.ps-suggestion-button .ps-icon {
    font-size: 20px !important;
    line-height: 1 !important;
    display: inline-block !important;
}

.ps-suggestion-button .ps-text {
    line-height: 1 !important;
    display: inline-block !important;
}

/* ========================================
   OVERLAY DO POPUP
   ======================================== */
.ps-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    padding: 20px;
    box-sizing: border-box;
}

.ps-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   CONTAINER PRINCIPAL
   ======================================== */
.ps-container {
    background: white;
    border-radius: 0;
    max-width: 1000px;
    width: 100%;
    max-height: calc(100vh - 40px);
    position: relative;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.9) translateY(30px);
    transition: transform 0.4s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ps-overlay.active .ps-container {
    transform: scale(1) translateY(0);
}

/* ========================================
   BOTÃO DE FECHAR
   ======================================== */
.ps-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-weight: 300;
}

.ps-close:hover {
    background: #000;
    color: #fff;
    transform: rotate(90deg);
}

/* ========================================
   CONTEÚDO PRINCIPAL
   ======================================== */
.ps-content {
    display: flex;
    height: 100%;
    overflow: hidden;
}

/* ========================================
   SEÇÃO DO PRODUTO (ESQUERDA)
   ======================================== */
.ps-product-section {
    flex: 1;
    background: #f8f8f8;
    padding: 50px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
}

.ps-product-image-wrapper {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    overflow: hidden;
}

.ps-main-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.ps-main-image:hover {
    transform: scale(1.05);
}

/* Galeria de Miniaturas */
.ps-gallery-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.ps-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.ps-thumb:hover,
.ps-thumb.active {
    border-color: #000;
    opacity: 1;
    transform: scale(1.05);
}

/* Info do Produto */
.ps-product-info {
    text-align: center;
    margin-top: 20px;
    padding: 0 20px;
}

.ps-product-info h3 {
    font-size: 18px;
    font-weight: 400;
    color: #000;
    margin: 0 0 10px 0;
    letter-spacing: 1px;
    line-height: 1.4;
}

.ps-price {
    font-size: 16px;
    color: #000;
    font-weight: 400;
    margin: 0;
}

/* ========================================
   SEÇÃO DO FORMULÁRIO (DIREITA)
   ======================================== */
.ps-form-section {
    flex: 1;
    padding: 60px 50px 40px;
    background: white;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* Header */
.ps-header {
    text-align: center;
    margin-bottom: 30px;
}

.ps-logo {
    font-size: 22px;
    font-weight: 400;
    color: #000;
    margin: 0 0 15px 0;
    letter-spacing: 4px;
}

.ps-subtitle {
    font-size: 18px;
    color: #000;
    margin: 10px 0 8px;
    font-weight: 300;
    letter-spacing: 0.5px;
}

.ps-description {
    font-size: 13px;
    color: #666;
    margin: 0;
    line-height: 1.6;
}

/* ========================================
   PREVIEW DA MENSAGEM
   ======================================== */
.ps-message-preview {
    background: #f9f9f9;
    padding: 30px;
    margin: 25px 0;
    text-align: center;
    border-left: 4px solid #0abab5;
    position: relative;
}

.ps-preview-icon {
    font-size: 48px;
    margin-bottom: 15px;
    line-height: 1;
}

.ps-preview-text {
    font-size: 13px;
    line-height: 1.8;
    color: #333;
    margin: 0;
    font-family: 'Times New Roman', serif;
    font-style: italic;
}

.ps-preview-text span {
    font-weight: normal;
}

#psPreviewRecipient,
#psPreviewSender {
    text-decoration: underline;
    text-decoration-style: dotted;
}

/* ========================================
   FORMULÁRIO
   ======================================== */
.ps-form {
    width: 100%;
}

.ps-form-group {
    margin-bottom: 18px;
}

.ps-form-group label {
    display: block;
    font-size: 11px;
    color: #666;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 500;
}

.ps-form input[type="text"],
.ps-form input[type="email"] {
    width: 100%;
    padding: 12px 14px;
    border: none;
    border-bottom: 1px solid #ddd;
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background: transparent;
    font-family: inherit;
    border-radius: 0;
}

.ps-form input:focus {
    outline: none;
    border-bottom-color: #000;
    background: white;
}

.ps-form input::placeholder {
    color: #bbb;
    font-size: 13px;
}

/* ========================================
   BOTÃO DE ENVIO
   ======================================== */
.ps-submit-btn {
    width: 100%;
    background: #000;
    color: white;
    padding: 16px 30px;
    border: none;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 20px;
    border-radius: 0;
}

.ps-submit-btn:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.ps-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.ps-submit-btn.loading {
    color: transparent;
    pointer-events: none;
    position: relative;
}

.ps-submit-btn.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: psSpin 0.8s linear infinite;
}

@keyframes psSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   MENSAGENS
   ======================================== */
.ps-success-message {
    background: #f0fff4;
    color: #059669;
    padding: 20px;
    text-align: center;
    font-weight: 400;
    border: 1px solid #059669;
    margin-top: 20px;
    animation: psSlideDown 0.4s ease;
    line-height: 1.6;
}

.ps-success-message strong {
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
}

.ps-success-message a {
    color: #059669;
    text-decoration: underline;
    font-size: 13px;
}

.ps-success-message a:hover {
    color: #047857;
}

.ps-error-message {
    background: #fef2f2;
    color: #dc2626;
    padding: 16px;
    text-align: center;
    font-weight: 400;
    border: 1px solid #dc2626;
    margin-top: 20px;
    animation: psSlideDown 0.4s ease;
    font-size: 14px;
}

@keyframes psSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   RESPONSIVO (original)
   ======================================== */
@media (max-width: 900px) {
    .ps-container {
        max-height: 95vh;
    }
    
    .ps-content {
        flex-direction: column;
    }
    
    .ps-product-section {
        padding: 35px 30px 25px;
        max-height: 350px;
    }
    
    .ps-product-image-wrapper {
        max-width: 250px;
    }
    
    .ps-form-section {
        padding: 35px 30px 25px;
    }
    
    .ps-message-preview {
        padding: 20px;
        margin: 20px 0;
    }
    
    .ps-preview-icon {
        font-size: 36px;
    }
    
    .ps-preview-text {
        font-size: 12px;
    }
    
    .ps-close {
        top: 15px;
        right: 15px;
        width: 36px;
        height: 36px;
        font-size: 22px;
    }
}

@media (max-width: 600px) {
    .ps-overlay {
        padding: 0;
    }
    
    .ps-container {
        max-height: 100vh;
        border-radius: 0;
    }
    
    .ps-product-section {
        padding: 25px 20px 20px;
        max-height: 280px;
    }
    
    .ps-product-image-wrapper {
        max-width: 200px;
    }
    
    .ps-gallery-thumbs {
        gap: 8px;
    }
    
    .ps-thumb {
        width: 50px;
        height: 50px;
    }
    
    .ps-form-section {
        padding: 30px 20px 20px;
    }
    
    .ps-logo {
        font-size: 18px;
        letter-spacing: 3px;
    }
    
    .ps-subtitle {
        font-size: 16px;
    }
    
    .ps-description {
        font-size: 12px;
    }
    
    .ps-message-preview {
        padding: 18px;
        margin: 18px 0;
    }
    
    .ps-preview-icon {
        font-size: 32px;
        margin-bottom: 12px;
    }
    
    .ps-preview-text {
        font-size: 11px;
        line-height: 1.7;
    }
    
    .ps-form input[type="text"],
    .ps-form input[type="email"] {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .ps-form-group {
        margin-bottom: 15px;
    }
    
    .ps-submit-btn {
        padding: 14px 24px;
        font-size: 12px;
        letter-spacing: 1.5px;
    }
    
    .ps-close {
        top: 10px;
        right: 10px;
        width: 32px;
        height: 32px;
        font-size: 20px;
    }
    
    .ps-suggestion-button {
        width: 100%;
        justify-content: center;
        font-size: 11px;
        padding: 12px 20px;
    }
}

/* ========================================
   OVERRIDE: mostrar APENAS o emoji de presente
   (coloque esse bloco ao final para garantir precedence)
   ======================================== */

/* Reset visual do botão de sugestão para exibir apenas o emoji */
.ps-suggestion-button {
    /* remove estilos herdados que criam caixa/forma/espaçamento */
    all: unset;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    /* garantir dimensões reduzidas */
    padding: 0 !important;
    margin: 0 !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    box-sizing: content-box !important;

    /* remover qualquer fundo/borda/sombra */
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
    outline: none !important;
    cursor: pointer !important;

    /* para evitar transform/hover que mudem visual */
    transition: none !important;
}

/* Esconder texto e elementos extras dentro do botão */
.ps-suggestion-button .ps-text,
.ps-suggestion-button .ps-label,
.ps-suggestion-button .ps-button-text,
.ps-suggestion-button .ps-cta,
.ps-suggestion-button .ps-hidden,
.ps-suggestion-button .badge,
.ps-suggestion-button svg,
.ps-suggestion-button img:not(.ps-icon) {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Mostrar somente o ícone (emoji) */
.ps-suggestion-button .ps-icon,
.ps-suggestion-button .icon,
.ps-suggestion-button > span.ps-icon,
.ps-suggestion-button > span.emoji,
.ps-suggestion-button .gift-icon {
    display: inline-block !important;
    visibility: visible !important;
    width: auto !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
    background: transparent !important;
    border: none !important;
    font-size: 28px !important; /* ajuste conforme o tamanho desejado */
    text-align: center !important;
}

/* Garantir que pseudo-elementos não apareçam */
.ps-suggestion-button::before,
.ps-suggestion-button::after,
.ps-suggestion-button .ps-icon::before,
.ps-suggestion-button .ps-icon::after {
    display: none !important;
    content: none !important;
}

/* Remover hover/focus que adicionem fundo ou borda */
.ps-suggestion-button:hover,
.ps-suggestion-button:focus,
.ps-suggestion-button:active {
    background: transparent !important;
    transform: none !important;
    box-shadow: none !important;
    color: inherit !important;
}

/* Caso exista um wrapper externo com borda/caixa, removemos também */
.ps-suggestion-button-wrapper,
.ps-suggestion-button-container,
.ps-suggestion-wrap,
.ps-suggestion-box {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Ajustes responsivos para emoji */
@media (max-width: 900px) {
    .ps-suggestion-button .ps-icon { font-size: 26px !important; }
}
@media (max-width: 600px) {
    .ps-suggestion-button .ps-icon { font-size: 22px !important; }
}

/* Fallback: se o emoji estiver dentro de um <img>, force exibição e remova bordas */
.ps-suggestion-button img.ps-icon,
.ps-suggestion-button img.gift-icon {
    display: inline-block !important;
    width: auto !important;
    height: auto !important;
    max-width: 40px !important;
    max-height: 40px !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ========================================
   MOBILE FIXES (SCOPEADO) - aplica SÓ em telas <= 900px
   Mantém o layout de desktop exatamente como estava.
   ======================================== */
@media (max-width: 900px) {

    /* Forçar overlay/popup a ocupar tela móvel corretamente */
    .ps-overlay {
        padding: 0 !important;
    }

    .ps-overlay .ps-container {
        width: 100% !important;
        max-width: 980px !important;
        max-height: 100vh !important;
        height: 100vh !important;
        border-radius: 0 !important;
        transform: none !important;
        display: flex !important;
        flex-direction: column !important;
        box-sizing: border-box !important;
        overflow: hidden !important; /* scroll interno controlado por seções */
    }

    /* Conteúdo principal deve ser rolável por coluna no mobile */
    .ps-content {
        flex-direction: column !important;
        height: 100% !important;
        overflow: hidden !important;
    }

    /* Seções: fazer as duas ocupar 100% da largura e rolar internamente quando necessário */
    .ps-product-section,
    .ps-form-section {
        width: 100% !important;
        max-height: 50vh !important; /* metade da tela para mostrar produto + preview */
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* Imagem principal maior e com altura limitada para evitar imagens minúsculas */
    .ps-product-image-wrapper {
        max-width: 100% !important;
        width: 100% !important;
        aspect-ratio: auto !important;
        padding: 10px 20px !important;
        box-sizing: border-box !important;
        display:flex !important;
        justify-content:center !important;
        align-items:center !important;
        background: transparent !important;
    }

    .ps-main-image {
        width: auto !important;
        max-width: 90% !important;
        height: auto !important;
        max-height: 260px !important; /* ajuste conforme preferir */
        object-fit: contain !important;
        margin: 0 auto !important;
    }

    /* Miniaturas roláveis e maiores */
    .ps-gallery-thumbs {
        display: flex !important;
        gap: 8px !important;
        margin-top: 12px !important;
        padding: 8px 16px !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        justify-content: flex-start !important;
    }

    .ps-gallery-thumbs .ps-thumb {
        min-width: 64px !important;
        min-height: 64px !important;
        width: 64px !important;
        height: 64px !important;
        object-fit: cover !important;
        opacity: 1 !important;
        border: 2px solid transparent !important;
    }

    /* Header / título e descrição mais compactos no mobile */
    .ps-header {
        padding: 12px 20px !important;
    }

    .ps-logo {
        font-size: 18px !important;
        letter-spacing: 3px !important;
        margin-bottom: 6px !important;
    }

    .ps-subtitle {
        font-size: 15px !important;
        margin: 6px 0 8px !important;
    }

    .ps-description {
        font-size: 13px !important;
        color: #666 !important;
        margin-bottom: 6px !important;
    }

    /* Preview da mensagem: ocupa toda a largura e escala o conteúdo */
    .ps-message-preview {
        padding: 16px !important;
        margin: 14px 16px !important;
        border-left-width: 6px !important;
    }

    .ps-preview-icon {
        font-size: 36px !important;
        margin-bottom: 8px !important;
    }

    .ps-preview-text {
        font-size: 13px !important;
        line-height: 1.5 !important;
    }

    /* Campos do formulário: aumentar espaçamento para tocar melhor */
    .ps-form {
        padding: 0 16px 120px 16px !important; /* padding-bottom para abrir espaço para botão fixo */
        box-sizing: border-box !important;
    }

    .ps-form-group {
        margin-bottom: 18px !important;
    }

    .ps-form-group label {
        font-size: 12px !important;
        margin-bottom: 8px !important;
    }

    .ps-form input[type="text"],
    .ps-form input[type="email"] {
        padding: 12px 10px !important;
        font-size: 15px !important;
    }

    /* Tornar o botão de envio sempre visível no mobile (fixed) */
    .ps-submit-btn {
        position: fixed !important;
        left: 16px !important;
        right: 16px !important;
        bottom: 16px !important;
        z-index: 9999999 !important;
        width: auto !important;
        display: block !important;
        margin: 0 !important;
        padding: 16px 20px !important;
        border-radius: 6px !important;
        box-shadow: 0 8px 20px rgba(0,0,0,0.15) !important;
    }

    /* Ajustes do botão de fechar para não sobrepor o conteúdo */
    .ps-close {
        top: 12px !important;
        right: 12px !important;
        width: 40px !important;
        height: 40px !important;
        z-index: 10000001 !important;
    }

    /* Garantir que o container do produto não tenha espaçamentos que deixem imagens pequenas */
    .ps-product-info {
        padding: 8px 16px 18px 16px !important;
        text-align: center !important;
    }

    .ps-product-info h3 {
        font-size: 18px !important;
        margin: 8px 0 6px !important;
    }

    .ps-price {
        font-size: 16px !important;
        margin-bottom: 6px !important;
    }

    /* Mensagens de sucesso/erro: garantir espaço acima do botão fixo */
    .ps-success-message, .ps-error-message {
        margin-bottom: 72px !important;
    }

    /* Evitar que elementos internos criem largura extra no mobile */
    .ps-container * {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

}

/* Pequenos retoques adicionais para telas muito pequenas */
@media (max-width: 420px) {
    .ps-main-image { max-height: 220px !important; }
    .ps-preview-icon { font-size: 30px !important; }
    .ps-logo { font-size: 16px !important; }
    .ps-submit-btn { padding: 14px 16px !important; }
}