/* Shop Pro — Gift Wrapper */

/* ── Overlay ─────────────────────────────────────────────────────────── */
.shoppro-gw-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

body.shoppro-gw-body-open {
    overflow: hidden !important;
}

/* ── Modal ───────────────────────────────────────────────────────────── */
.shoppro-gw-modal {
    background: #fff;
    border-radius: var(--shoppro-gw-radius, 12px);
    width: 100%;
    max-width: 460px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
}

/* ── Header ──────────────────────────────────────────────────────────── */
.shoppro-gw-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.shoppro-gw-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
}

.shoppro-gw-close {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    font-size: 24px;
    line-height: 1;
    padding: 0 0 0 12px !important;
    margin: 0 !important;
    cursor: pointer;
    color: #6b7280;
    transition: color .15s;
    flex-shrink: 0;
}

.shoppro-gw-close:hover { color: #111; }

/* ── Body ────────────────────────────────────────────────────────────── */
.shoppro-gw-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

/* ── Lista de embalagens ─────────────────────────────────────────────── */
.shoppro-gw-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ── Item ────────────────────────────────────────────────────────────── */
.shoppro-gw-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    outline: none;
    user-select: none;
}

.shoppro-gw-item:hover {
    border-color: #9ca3af;
}

.shoppro-gw-item:focus-visible {
    box-shadow: 0 0 0 3px var(--shoppro-gw-color, #16a34a)44;
}

/* ── Thumbnail ───────────────────────────────────────────────────────── */
.shoppro-gw-thumb {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
}

.shoppro-gw-thumb img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

/* ── Info ────────────────────────────────────────────────────────────── */
.shoppro-gw-info {
    flex: 1;
    min-width: 0;
}

.shoppro-gw-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}

.shoppro-gw-desc {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Preço ───────────────────────────────────────────────────────────── */
.shoppro-gw-price {
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.shoppro-gw-price .woocommerce-Price-amount {
    color: inherit !important;
    font-size: inherit !important;
}

/* ── Mensagem ────────────────────────────────────────────────────────── */
.shoppro-gw-message-wrap {
    margin-top: 16px;
}

.shoppro-gw-message-label {
    display: block !important;
    float: none !important;
    width: auto !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    margin-bottom: 6px !important;
    padding: 0 !important;
    text-align: left !important;
    color: inherit !important;
}

.shoppro-gw-message {
    width: 100% !important;
    box-sizing: border-box !important;
    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
    padding: 8px 12px !important;
    font-size: 14px !important;
    resize: vertical;
    min-height: 72px;
    font-family: inherit;
    line-height: 1.5;
}

.shoppro-gw-message:focus {
    border-color: var(--shoppro-gw-color, #16a34a) !important;
    outline: none !important;
    box-shadow: 0 0 0 3px var(--shoppro-gw-color, #16a34a)22 !important;
}

.shoppro-gw-char-count {
    display: block;
    text-align: right;
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
}

/* ── Footer ──────────────────────────────────────────────────────────── */
.shoppro-gw-footer {
    padding: 16px 20px;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
    display: flex;
    gap: 10px;
}

.shoppro-gw-submit.button {
    flex: 1;
    width: auto;
    text-align: center !important;
    padding: 10px 20px !important;
    font-size: 15px !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    display: block !important;
}

/* Quando não há botão "Remover", o submit (flex:1) já ocupa 100% naturalmente */

.shoppro-gw-remove.button {
    flex: 0 0 auto;
    text-align: center !important;
    padding: 10px 20px !important;
    font-size: 14px !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    box-shadow: none !important;
    white-space: nowrap;
}

.shoppro-gw-submit:disabled {
    opacity: .45;
    cursor: not-allowed;
    pointer-events: none;
}

/* ── Botão de abertura ───────────────────────────────────────────────── */
.shoppro-gw-button-wrap {
    margin: 0;
}

.shoppro-gw-open.button {
    width: 100%;
    text-align: center;
    box-sizing: border-box;
    display: block !important;
}

/* Estado "adicionado": cores vêm do style="" inline (shoppro_button_style),
   já configuráveis no painel — não sobrescrever aqui. */

/* ── "🎁 Embalagem: 1" em uma linha só ───────────────────────────────────
   woocommerce_get_item_data gera <dl class="variation"><dt>🎁 Embalagem:</dt>
   <dd>1</dd></dl>; por padrão dt/dd são blocos (cada um em sua linha).
   sanitize_html_class() remove o emoji e o espaço de "🎁 Embalagem", então
   a classe gerada é "variation-Embalagem". */
.variation-Embalagem {
    display: inline !important;
    margin: 0 !important;
    font-weight: normal;
    color: #6b7280;
}
.variation-Embalagem p {
    display: inline;
    margin: 0;
}

/* ── Mobile: popup centralizado (igual desktop), mensagem menor ───────── */
@media (max-width: 520px) {
    .shoppro-gw-message {
        height: 50px;
        min-height: 50px;
    }
}
