/**
 * Número Magia — Componentes UI
 * Todos os elementos reutilizáveis: botões, cards, badges,
 * sticky CTA mobile, order bump, selos de garantia.
 *
 * @package NumeroMagia
 */

/* ═══════════════════════════════════════════════════════════════════════════════
   BOTÕES
═══════════════════════════════════════════════════════════════════════════════ */

.nm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: var(--nm-font-sans);
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: var(--nm-transition);
    border-radius: var(--nm-radius-pill);
    -webkit-appearance: none;
}

/* Tamanhos */
.nm-btn--sm  { font-size: 13px; padding: 10px 22px; }
.nm-btn--md  { font-size: 15px; padding: 14px 32px; } /* padrão */
.nm-btn--lg  { font-size: 17px; padding: 18px 44px; }
.nm-btn--full { width: 100%; }

/* Dourado — CTA principal */
.nm-btn--primary {
    background: var(--nm-gold-mid);
    color: #fff;
}
.nm-btn--primary:hover {
    background: var(--nm-gold);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(217,119,6,.3);
}
.nm-btn--primary:active { transform: translateY(0); }

/* Roxo — ação secundária */
.nm-btn--secondary {
    background: var(--nm-purple-light);
    color: var(--nm-purple-dark);
    border: 1.5px solid transparent;
}
.nm-btn--secondary:hover {
    background: #DDD6FE;
    color: var(--nm-purple-dark);
}

/* Outline — alternativa */
.nm-btn--outline {
    background: transparent;
    color: var(--nm-purple);
    border: 1.5px solid var(--nm-purple);
}
.nm-btn--outline:hover {
    background: var(--nm-purple-xlight);
    color: var(--nm-purple);
}

/* Ghost — para fundos escuros */
.nm-btn--ghost {
    background: transparent;
    color: #fff;
    border: 1.5px solid rgba(255,255,255,.35);
}
.nm-btn--ghost:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
    border-color: rgba(255,255,255,.6);
}

/* Estado de carregamento */
.nm-btn--loading {
    pointer-events: none;
    opacity: .7;
}
.nm-btn--loading::after {
    content: '';
    display: inline-block;
    width: 14px; height: 14px;
    margin-left: 8px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: nm-spin .7s linear infinite;
}

@keyframes nm-spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════════════════════════
   BADGES E TAGS
═══════════════════════════════════════════════════════════════════════════════ */

.nm-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--nm-font-sans);
    font-size: var(--nm-text-xs);
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--nm-radius-pill);
    white-space: nowrap;
}

.nm-badge--purple  { background: var(--nm-purple-light);  color: #4C1D95; }
.nm-badge--gold    { background: var(--nm-gold-light);    color: var(--nm-gold-dark); }
.nm-badge--green   { background: var(--nm-success-light); color: #065F46; }
.nm-badge--blue    { background: var(--nm-info-light);    color: #1E40AF; }
.nm-badge--orange  { background: #FFEDD5;                 color: #9A3412; }
.nm-badge--navy    { background: var(--nm-navy-light);    color: var(--nm-navy); }

/* Sale badge WooCommerce */
.nm-sale-badge {
    display: inline-block;
    background: var(--nm-purple);
    color: #fff;
    font-size: var(--nm-text-xs);
    font-weight: 700;
    padding: 4px 12px;
    border-radius: var(--nm-radius-pill);
    letter-spacing: .04em;
    text-transform: uppercase;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   CARDS
═══════════════════════════════════════════════════════════════════════════════ */

.nm-card {
    background: var(--nm-bg-white);
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius-lg);
    padding: 28px 24px;
    transition: var(--nm-transition);
}

.nm-card:hover {
    box-shadow: var(--nm-shadow-md);
    border-color: rgba(109,40,217,.18);
}

.nm-card--soft {
    background: var(--nm-bg-soft);
    border-color: transparent;
}

.nm-card--dark {
    background: rgba(255,255,255,.05);
    border-color: rgba(255,255,255,.1);
}

/* Produto da loja */
.nm-product-card {
    background: var(--nm-bg-white);
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius-lg);
    overflow: hidden;
    transition: var(--nm-transition);
}

.nm-product-card:hover {
    box-shadow: var(--nm-shadow-lg);
    transform: translateY(-3px);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   TRUST ROW — Ícones de segurança em linha
═══════════════════════════════════════════════════════════════════════════════ */

.nm-trust-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.nm-trust-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: var(--nm-text-sm);
    color: var(--nm-text-soft);
}

.nm-trust-item::before {
    content: '✓';
    color: #86EFAC;
    font-weight: 700;
    font-size: 11px;
}

.nm-trust-item--dark { color: rgba(255,255,255,.5); }
.nm-trust-item--dark::before { color: #86EFAC; }

/* ═══════════════════════════════════════════════════════════════════════════════
   ORDER BUMP — Caixa de oferta adicional no checkout
═══════════════════════════════════════════════════════════════════════════════ */

.nm-order-bump {
    position: relative;
    background: var(--nm-gold-xlight);
    border: 2px dashed var(--nm-gold-mid);
    border-radius: var(--nm-radius-lg);
    padding: 24px 28px;
    margin-top: 28px;
    cursor: pointer;
    transition: background .2s ease;
}

.nm-order-bump:hover {
    background: var(--nm-gold-light);
}

.nm-order-bump__badge {
    position: absolute;
    top: -12px;
    left: 20px;
    background: var(--nm-gold-mid);
    color: #fff;
    font-family: var(--nm-font-sans);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 3px 12px;
    border-radius: var(--nm-radius-pill);
}

.nm-order-bump__inner {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.nm-order-bump__check {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border: 2px solid var(--nm-gold-mid);
    border-radius: 5px;
    background: var(--nm-bg-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    margin-top: 2px;
    transition: background .15s, border-color .15s;
    user-select: none;
}

.nm-order-bump__check--active {
    background: var(--nm-gold-mid);
    border-color: var(--nm-gold-mid);
}

.nm-order-bump__title {
    font-family: var(--nm-font-serif);
    font-size: 18px;
    font-weight: 600;
    color: var(--nm-gold-dark);
    margin-bottom: 4px;
    line-height: 1.3;
}

.nm-order-bump__desc {
    font-size: var(--nm-text-sm);
    color: #78350F;
    line-height: 1.6;
    margin-bottom: 10px;
}

.nm-order-bump__price {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nm-order-bump__price-old {
    font-size: var(--nm-text-sm);
    color: var(--nm-text-soft);
    text-decoration: line-through;
}

.nm-order-bump__price-new {
    font-family: var(--nm-font-serif);
    font-size: 22px;
    font-weight: 700;
    color: var(--nm-gold);
}

.nm-order-bump__price-label {
    font-size: 11px;
    color: var(--nm-gold);
    font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   GARANTIA — Selo circular
═══════════════════════════════════════════════════════════════════════════════ */

.nm-guarantee {
    display: flex;
    align-items: center;
    gap: 28px;
    background: var(--nm-bg-white);
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius-xl);
    padding: 32px;
}

.nm-guarantee__seal {
    flex-shrink: 0;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: var(--nm-purple-xlight);
    border: 3px solid var(--nm-purple);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px;
}

.nm-guarantee__days {
    font-family: var(--nm-font-serif);
    font-size: 30px;
    font-weight: 700;
    color: var(--nm-purple);
    line-height: 1;
}

.nm-guarantee__label {
    font-size: 9px;
    font-weight: 600;
    color: var(--nm-purple);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-top: 2px;
    line-height: 1.3;
}

.nm-guarantee__title {
    font-family: var(--nm-font-serif);
    font-size: clamp(18px, 2vw, 22px);
    font-weight: 600;
    color: var(--nm-text);
    margin-bottom: 8px;
}

.nm-guarantee__text {
    font-size: var(--nm-text-sm);
    color: var(--nm-text-muted);
    line-height: 1.65;
}

@media (max-width: 640px) {
    .nm-guarantee {
        flex-direction: column;
        text-align: center;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   STICKY CTA — Mobile only
   Aparece na parte inferior da tela após scroll inicial
═══════════════════════════════════════════════════════════════════════════════ */

.nm-sticky-cta {
    display: none; /* Mostrado apenas por JS + @media */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--nm-navy);
    border-top: 2px solid var(--nm-gold-mid);
    padding: 10px 20px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    z-index: var(--nm-z-sticky);
    transition: transform .3s var(--nm-ease);
}

.nm-sticky-cta--hidden {
    transform: translateY(100%);
}

.nm-sticky-cta__info {}

.nm-sticky-cta__price {
    font-family: var(--nm-font-serif);
    font-size: 22px;
    font-weight: 700;
    color: #FCD34D;
    line-height: 1;
}

.nm-sticky-cta__sub {
    font-size: 10px;
    color: rgba(255,255,255,.5);
    margin-top: 2px;
}

@media (max-width: 768px) {
    .nm-sticky-cta { display: flex; }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   SECURITY STRIP — Faixa de selos de segurança
═══════════════════════════════════════════════════════════════════════════════ */

.nm-security-strip {
    background: var(--nm-bg-gray);
    border-top: 1px solid var(--nm-border);
    padding: 18px 5%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 24px;
}

.nm-security-strip__item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--nm-text-muted);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   FORMULÁRIOS — Gravity Forms override
═══════════════════════════════════════════════════════════════════════════════ */

/* Barra de progresso */
.gf_progressbar_wrapper {
    margin-bottom: 28px;
}

.gf_progressbar {
    background: var(--nm-border);
    border-radius: var(--nm-radius-pill);
    height: 6px;
    overflow: hidden;
}

.gf_progressbar_percentage {
    background: var(--nm-purple);
    height: 100%;
    border-radius: var(--nm-radius-pill);
    transition: width .4s var(--nm-ease);
}

/* Campos */
.gform_wrapper input[type="text"],
.gform_wrapper input[type="email"],
.gform_wrapper input[type="tel"],
.gform_wrapper input[type="date"],
.gform_wrapper input[type="time"],
.gform_wrapper select,
.gform_wrapper textarea {
    border: 1px solid var(--nm-border-mid) !important;
    border-radius: var(--nm-radius-md) !important;
    padding: 12px 16px !important;
    font-family: var(--nm-font-sans) !important;
    font-size: var(--nm-text-base) !important;
    color: var(--nm-text) !important;
    width: 100% !important;
    transition: border-color .15s, box-shadow .15s !important;
    -webkit-appearance: none !important;
}

.gform_wrapper input:focus,
.gform_wrapper select:focus,
.gform_wrapper textarea:focus {
    border-color: var(--nm-purple) !important;
    outline: none !important;
    box-shadow: var(--nm-shadow-focus) !important;
}

/* Labels */
.gform_wrapper label.gfield_label {
    font-family: var(--nm-font-sans) !important;
    font-size: var(--nm-text-sm) !important;
    font-weight: 500 !important;
    color: var(--nm-text) !important;
    margin-bottom: 6px !important;
}

/* Botão de submit */
.gform_wrapper input[type="submit"],
.gform_wrapper button[type="submit"] {
    background: var(--nm-gold-mid) !important;
    color: #fff !important;
    font-family: var(--nm-font-sans) !important;
    font-size: var(--nm-text-base) !important;
    font-weight: 500 !important;
    padding: 16px 40px !important;
    border-radius: var(--nm-radius-pill) !important;
    border: none !important;
    cursor: pointer !important;
    width: 100% !important;
    transition: var(--nm-transition) !important;
}

.gform_wrapper input[type="submit"]:hover,
.gform_wrapper button[type="submit"]:hover {
    background: var(--nm-gold) !important;
    transform: translateY(-1px) !important;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   DIVIDER ORNAMENTAL
═══════════════════════════════════════════════════════════════════════════════ */

.nm-divider {
    text-align: center;
    font-size: 14px;
    color: var(--nm-purple-mid);
    letter-spacing: 10px;
    margin: 12px 0;
    opacity: .4;
    user-select: none;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   TOAST / NOTIFICAÇÃO
═══════════════════════════════════════════════════════════════════════════════ */

.nm-toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--nm-navy);
    color: #fff;
    font-size: var(--nm-text-sm);
    padding: 12px 24px;
    border-radius: var(--nm-radius-pill);
    z-index: var(--nm-z-toast);
    opacity: 0;
    transition: opacity .3s, transform .3s var(--nm-ease);
    pointer-events: none;
    white-space: nowrap;
}

.nm-toast--visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
