/* ===========================================================
   PéDireito · Checkout PIX
   Esconde widget WhatsApp, badges "Esgotado", botão Shopify
   e injeta carrinho flutuante + modal de checkout.
   =========================================================== */

/* --- Esconder WhatsApp flutuante e popup (seletores amplos) --- */
.sticky-chat,
.sticky-chat-toggle,
.sticky-chat-wrapper,
.wa-chat-widget,
.wa-chat-widget-send,
.wa-chat-button,
.whatsapp-chat,
.whatsapp-button,
.chat-button,
.chat-content,
.chat-header,
.chat-text,
[class*="whatsapp" i],
[id*="whatsapp" i],
[class*="wa-chat" i],
[id*="wa-chat" i],
a[href*="wa.me"],
a[href*="api.whatsapp"],
form[action*="wa.me"],
form[action*="api.whatsapp"] {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}
/* Esconde também o checkbox toggle e seu label irmão */
input[type="checkbox"][id*="chat" i],
input[type="checkbox"][id*="chat" i] ~ label,
input[type="checkbox"][id*="chat" i] + label,
label[for*="chat" i] {
    display: none !important;
}

/* --- Esconder badges "Esgotado" --- */
.product-badges__badge--rectangle,
.product-card__sold-out-badge,
[class*="sold-out-badge"] {
    display: none !important;
}

/* --- Esconder botão original do Shopify (não funciona) --- */
.lot-size-selector__add-btn,
.product-form__buttons button[type="submit"],
.shopify-payment-button,
accelerated-checkout-component,
[ref="acceleratedCheckoutButtonContainer"] {
    display: none !important;
}

/* --- Esconder ícone do carrinho original (uso o meu) --- */
.header-actions__cart-icon,
cart-icon-component {
    display: none !important;
}

/* --- LIBERAR todos os botões de tamanho (anular "indisponível") --- */
/* Remove a linha diagonal aplicada pelo Shopify via :after */
.lot-size-selector__size-btn[data-unavailable="true"]::after,
.lot-size-selector__size-btn[data-unavailable="true"]::before {
    display: none !important;
    content: none !important;
}
/* Remove o estado desabilitado visual e funcional */
.lot-size-selector__size-btn[data-unavailable="true"],
.lot-size-selector__size-btn:disabled,
.lot-size-selector__size-btn[disabled] {
    cursor: pointer !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}
/* Quando selecionado, manter o destaque */
.lot-size-selector__size-btn[data-selected="true"] {
    border-color: #000 !important;
    background: #000 !important;
    color: #fff !important;
}

/* ===========================================================
   BOTÃO "Comprar com PIX" (injetado em cada produto)
   =========================================================== */
.pix-buy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px 24px;
    background: #009c3b;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.15s, background 0.2s;
    margin-top: 12px;
    font-family: inherit;
}
.pix-buy-btn:hover { background: #007a2e; transform: translateY(-1px); }
.pix-buy-btn:active { transform: translateY(0); }
.pix-buy-btn[disabled] { background: #aaa; cursor: not-allowed; }

.pix-buy-btn::before {
    content: "";
    display: inline-block;
    width: 22px; height: 22px;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'><path d='M5.283 18.36c.704 0 1.368-.275 1.867-.774l2.5-2.5a.638.638 0 0 1 .883 0l2.5 2.5a2.674 2.674 0 0 0 3.733 0l4.084-4.084-2.503-2.503a4.111 4.111 0 0 1-1.117 1.117l-2.467 2.466a.866.866 0 0 1-1.224 0l-2.5-2.5a2.674 2.674 0 0 0-3.733 0l-2.5 2.5a.866.866 0 0 1-1.224 0L1.084 11.49a4.111 4.111 0 0 1-1.117-1.117L4.05 14.456c.5.5 1.163.774 1.866.774l-.633 3.13zm14.435-9.84a4.118 4.118 0 0 1-1.117 1.117l-2.467-2.466a.866.866 0 0 0-1.224 0l-2.5 2.5a2.674 2.674 0 0 1-3.733 0l-2.5-2.5a.866.866 0 0 0-1.224 0L2.969 9.494a4.118 4.118 0 0 1 1.117-1.117L5.967 6.494a2.674 2.674 0 0 1 3.733 0l2.5 2.5a.866.866 0 0 0 1.224 0l2.5-2.5a2.674 2.674 0 0 1 3.733 0l1.884 1.883zM7.05 4.494l-3.083 3.083A2.668 2.668 0 0 0 5.283 8.46c.703 0 1.367-.275 1.866-.774l2.5-2.5a.866.866 0 0 1 1.224 0l2.5 2.5c.499.499 1.163.774 1.867.774s1.367-.275 1.866-.774l2.5-2.5a.866.866 0 0 1 1.224 0l1.883 1.883A2.668 2.668 0 0 0 20.717 4.494l-1.884-1.884a2.674 2.674 0 0 0-3.733 0l-2.5 2.5a.866.866 0 0 1-1.224 0l-2.5-2.5a2.674 2.674 0 0 0-3.733 0z'/></svg>") no-repeat center / contain;
}

/* ===========================================================
   CARRINHO FLUTUANTE (FAB)
   =========================================================== */
.pix-fab {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9998;
    background: #009c3b;
    color: #fff;
    border: none;
    width: 60px; height: 60px;
    border-radius: 50%;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s;
}
.pix-fab:hover { transform: scale(1.05); }
.pix-fab svg { width: 26px; height: 26px; fill: #fff; }
.pix-fab__count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ffdf00;
    color: #000;
    border-radius: 999px;
    min-width: 22px;
    height: 22px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.pix-fab__count[data-empty="true"] { display: none; }

/* ===========================================================
   DRAWER LATERAL
   =========================================================== */
.pix-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}
.pix-drawer-backdrop[data-open="true"] {
    opacity: 1;
    pointer-events: auto;
}

.pix-drawer {
    position: fixed;
    top: 0; right: 0;
    width: min(420px, 100vw);
    height: 100vh;
    background: #fff;
    z-index: 10000;
    box-shadow: -10px 0 30px rgba(0,0,0,0.2);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.pix-drawer[data-open="true"] { transform: translateX(0); }

.pix-drawer__header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.pix-drawer__title { font-size: 18px; font-weight: 700; margin: 0; color: #000; }
.pix-drawer__close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    line-height: 1;
    padding: 0 8px;
}

.pix-drawer__body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}
.pix-drawer__empty {
    text-align: center;
    color: #888;
    padding: 60px 20px;
    font-size: 14px;
}

.pix-drawer__item {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid #f1f1f1;
}
.pix-drawer__item img {
    width: 70px; height: 70px;
    object-fit: cover;
    border-radius: 6px;
    background: #f5f5f5;
}
.pix-drawer__item-info { flex: 1; min-width: 0; }
.pix-drawer__item-title {
    font-size: 14px;
    font-weight: 600;
    color: #000;
    margin: 0 0 4px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pix-drawer__item-meta {
    font-size: 12px;
    color: #777;
    margin-bottom: 6px;
}
.pix-drawer__item-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.pix-drawer__qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 999px;
    overflow: hidden;
}
.pix-drawer__qty button {
    width: 28px; height: 28px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #555;
}
.pix-drawer__qty button:hover { background: #f5f5f5; }
.pix-drawer__qty span {
    min-width: 28px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
}
.pix-drawer__item-price {
    font-size: 14px;
    font-weight: 700;
    color: #000;
}
.pix-drawer__item-remove {
    background: none;
    border: none;
    color: #c00;
    font-size: 11px;
    cursor: pointer;
    padding: 0;
    margin-left: 6px;
}

.pix-drawer__footer {
    border-top: 1px solid #eee;
    padding: 20px;
    background: #fafafa;
}
.pix-drawer__total {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: 700;
    color: #000;
    margin-bottom: 14px;
}
.pix-drawer__checkout {
    width: 100%;
    padding: 14px;
    background: #009c3b;
    color: #fff;
    border: none;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    letter-spacing: 0.4px;
}
.pix-drawer__checkout:hover { background: #007a2e; }
.pix-drawer__checkout:disabled { background: #aaa; cursor: not-allowed; }

/* ===========================================================
   MODAL CHECKOUT PIX (form + QR code)
   =========================================================== */
.pix-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.pix-modal[data-open="true"] { display: flex; }

.pix-modal__box {
    background: #fff;
    width: min(480px, 100%);
    max-height: 92vh;
    border-radius: 14px;
    overflow-y: auto;
    box-shadow: 0 30px 80px rgba(0,0,0,0.4);
}
.pix-modal__head {
    padding: 18px 24px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.pix-modal__head h3 { margin: 0; font-size: 18px; color: #000; }
.pix-modal__close {
    background: none; border: none; font-size: 26px; cursor: pointer;
    color: #666; line-height: 1; padding: 0 6px;
}
.pix-modal__body { padding: 22px 24px; }

.pix-form label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #444;
    margin-bottom: 5px;
    margin-top: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.pix-form input,
.pix-form select {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    background: #fff;
    color: #000;
}
.pix-form input:focus,
.pix-form select:focus { outline: 2px solid #009c3b; border-color: #009c3b; }
.pix-form .pix-row {
    display: flex;
    gap: 10px;
}
.pix-form .pix-row > div { flex: 1; }

.pix-form__submit {
    width: 100%;
    margin-top: 22px;
    padding: 14px;
    background: #009c3b;
    color: #fff;
    border: none;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    cursor: pointer;
}
.pix-form__submit:hover { background: #007a2e; }
.pix-form__submit:disabled { background: #aaa; cursor: not-allowed; }

.pix-form__total {
    text-align: center;
    margin-bottom: 10px;
    padding: 14px;
    background: #f8f8f8;
    border-radius: 10px;
    font-size: 14px;
    color: #444;
}
.pix-form__total strong {
    display: block;
    font-size: 24px;
    color: #009c3b;
    margin-top: 4px;
}

/* Tela do QR code (depois de gerar) */
.pix-qr {
    text-align: center;
}
.pix-qr h4 { color: #000; margin: 0 0 10px; font-size: 16px; }
.pix-qr p { color: #555; font-size: 13px; margin: 6px 0; }
.pix-qr img {
    width: 240px; height: 240px;
    margin: 14px auto;
    display: block;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px;
    background: #fff;
}
.pix-qr__code {
    background: #f5f5f5;
    padding: 12px;
    border-radius: 8px;
    font-family: ui-monospace, "Cascadia Code", Menlo, monospace;
    font-size: 11px;
    word-break: break-all;
    margin: 12px 0;
    color: #000;
    text-align: left;
    border: 1px dashed #ccc;
    max-height: 90px;
    overflow-y: auto;
}
.pix-qr__copy {
    width: 100%;
    padding: 12px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 8px;
}
.pix-qr__copy:hover { background: #333; }
.pix-qr__status {
    margin-top: 16px;
    padding: 12px;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 8px;
    color: #6b4f00;
    font-size: 13px;
    text-align: center;
}
.pix-qr__status.is-paid {
    background: #e8f5e9;
    border-color: #81c784;
    color: #1b5e20;
    font-weight: 700;
}

.pix-error {
    background: #ffebee;
    border: 1px solid #ef9a9a;
    color: #c62828;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin: 12px 0;
}

@media (max-width: 480px) {
    .pix-modal__body { padding: 16px; }
    .pix-form .pix-row { flex-direction: column; gap: 0; }
}
