/* Ruby Rose — carrinho, checkout PIX e páginas locais (mobile-first) */
:root {
    --rr-pink: #ef5172;
    --rr-pink-dark: #d63d5d;
    --rr-pix: #32BCAD;
    --rr-ink: #2b2b2b;
    --rr-muted: #707070;
    --rr-line: #ececec;
    --rr-green: #1f9d55;
    --rr-bg: #f7f7f9;
    --rr-radius: 12px;
}

.rr-wrap {
    max-width: 1040px;
    margin: 0 auto;
    padding: 18px 16px 56px;
    color: var(--rr-ink);
    font-size: 15px;
    line-height: 1.45;
}

.rr-wrap h1 {
    font-size: 22px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    margin: 0 0 4px;
}

.rr-sub {
    color: var(--rr-muted);
    font-size: 13px;
    margin-bottom: 16px;
}

.rr-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 18px;
    align-items: start;
}

.rr-card {
    background: #fff;
    border: 1px solid var(--rr-line);
    border-radius: var(--rr-radius);
    padding: 14px;
}

.rr-card + .rr-card { margin-top: 12px; }

.rr-h2 {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--rr-ink);
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rr-h2 .rr-num {
    width: 20px; height: 20px; border-radius: 50%;
    background: var(--rr-pink); color: #fff; font-size: 11px;
    display: inline-flex; align-items: center; justify-content: center;
    flex: 0 0 auto;
}

/* ---------- item do carrinho ---------- */
.rr-item {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--rr-line);
}
.rr-item:last-child { border-bottom: 0; }
.rr-item img {
    width: 64px; height: 64px; object-fit: contain;
    border: 1px solid var(--rr-line); border-radius: 8px; background: #fff; flex: 0 0 auto;
}
.rr-item .rr-info { flex: 1 1 auto; min-width: 0; }
.rr-item .rr-name {
    font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--rr-ink);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.rr-item .rr-meta { font-size: 11.5px; color: var(--rr-muted); margin-top: 3px; }
.rr-item .rr-price { font-size: 15px; font-weight: 700; color: var(--rr-pink); white-space: nowrap; }
.rr-item .rr-del {
    border: 0; background: transparent; color: #bcbcbc; font-size: 18px;
    line-height: 1; cursor: pointer; padding: 4px;
}
.rr-item .rr-del:hover { color: #c62828; }

/* ---------- totais ---------- */
.rr-line { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 13.5px; }
.rr-line .rr-green { color: var(--rr-green); font-weight: 600; }
.rr-total {
    display: flex; justify-content: space-between; align-items: baseline;
    border-top: 1px solid var(--rr-line); margin-top: 8px; padding-top: 10px;
    font-size: 15px; font-weight: 700;
}
.rr-total b { font-size: 21px; color: var(--rr-ink); }
.rr-pix-line { font-size: 12px; color: var(--rr-muted); margin-top: 2px; }
.rr-pix-line strong { color: var(--rr-pix); }

/* ---------- botões ---------- */
.rr-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; min-height: 46px; padding: 12px 16px;
    border: 0; border-radius: 10px; cursor: pointer;
    background: var(--rr-pink); color: #fff;
    font-size: 14px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
    text-decoration: none; transition: filter .15s, background .15s;
}
.rr-btn:hover { background: var(--rr-pink-dark); color: #fff; text-decoration: none; }
.rr-btn:disabled { opacity: .55; cursor: not-allowed; }
.rr-btn.ghost { background: #fff; color: var(--rr-ink); border: 1px solid var(--rr-line); }
.rr-btn.ghost:hover { background: #fafafa; color: var(--rr-ink); }
.rr-btn.pix { background: var(--rr-pix); }
.rr-btn.pix:hover { background: #29a99b; }

/* ---------- formulário ---------- */
.rr-field { margin-bottom: 10px; }
.rr-field label {
    display: block; font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .5px; color: var(--rr-muted); margin-bottom: 4px;
}
.rr-field input, .rr-field select {
    width: 100%; height: 42px; border: 1px solid var(--rr-line); border-radius: 9px;
    padding: 0 11px; font-size: 15px; color: var(--rr-ink); background: #fff;
}
.rr-field input:focus, .rr-field select:focus {
    outline: 0; border-color: var(--rr-pink); box-shadow: 0 0 0 3px rgba(239, 81, 114, .12);
}
.rr-field.err input { border-color: #e57373; background: #fff7f7; }
.rr-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rr-row3 { display: grid; grid-template-columns: 110px 1fr 70px; gap: 10px; }

/* ---------- pagamento ---------- */
.rr-pay {
    display: flex; align-items: center; gap: 12px;
    border: 2px solid var(--rr-pix); border-radius: 12px; padding: 12px;
    background: #f2fbfa;
}
.rr-pay img, .rr-pay svg { width: 34px; height: 34px; flex: 0 0 auto; }
.rr-pay .rr-pay-t { font-size: 14px; font-weight: 700; }
.rr-pay .rr-pay-s { font-size: 12px; color: var(--rr-muted); }
.rr-pay .rr-check { margin-left: auto; color: var(--rr-pix); font-size: 20px; font-weight: 700; }

/* ---------- PIX gerado ---------- */
.rr-pixbox { text-align: center; }
.rr-qr {
    width: 100%; max-width: 236px; aspect-ratio: 1/1; margin: 6px auto 12px;
    border: 1px solid var(--rr-line); border-radius: 10px; padding: 8px; background: #fff;
    display: flex; align-items: center; justify-content: center;
}
.rr-qr canvas, .rr-qr img, .rr-qr svg { width: 100% !important; height: auto !important; display: block; }
.rr-copy {
    display: flex; gap: 8px; margin: 10px 0 6px;
}
.rr-copy input {
    flex: 1 1 auto; min-width: 0; height: 40px; border: 1px solid var(--rr-line);
    border-radius: 9px; padding: 0 10px; font-size: 11px; color: var(--rr-muted); background: #fafafa;
}
.rr-copy button {
    flex: 0 0 auto; height: 40px; padding: 0 14px; border: 0; border-radius: 9px;
    background: var(--rr-pix); color: #fff; font-size: 12px; font-weight: 700;
    text-transform: uppercase; cursor: pointer; white-space: nowrap;
}
.rr-timer {
    display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
    color: var(--rr-muted); background: #fff7e6; border: 1px solid #ffe2b3;
    padding: 5px 10px; border-radius: 20px; margin-top: 6px;
}
.rr-status {
    margin-top: 12px; font-size: 13px; color: var(--rr-muted);
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.rr-dot {
    width: 9px; height: 9px; border-radius: 50%; background: #f0ad4e;
    animation: rr-pulse 1.4s infinite;
}
@keyframes rr-pulse { 0%,100% { opacity: 1 } 50% { opacity: .25 } }
.rr-aviso {
    margin-top: 12px; padding: 10px 12px; border-radius: 9px; font-size: 12.5px;
    background: #fff7f8; border: 1px solid #ffd9e0; color: #8a3b4c;
}
.rr-aviso.ok { background: #f2fbf5; border-color: #cdeada; color: #216b45; }

/* ---------- estados ---------- */
.rr-empty { text-align: center; padding: 34px 10px; color: var(--rr-muted); }
.rr-empty .rr-ico { font-size: 34px; margin-bottom: 8px; }
.rr-ok-box { text-align: center; padding: 8px 4px 4px; }
.rr-ok {
    width: 68px; height: 68px; margin: 4px auto 12px; border-radius: 50%;
    background: var(--rr-green); color: #fff; display: flex; align-items: center;
    justify-content: center; font-size: 34px;
}
.rr-skel { height: 12px; border-radius: 6px; background: #efefef; animation: rr-sk 1.2s infinite; }
@keyframes rr-sk { 0%,100% { opacity: .55 } 50% { opacity: 1 } }

/* ---------- modal (1 produto por pedido) ---------- */
.rr-modal-bg {
    position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 99999;
    display: flex; align-items: center; justify-content: center; padding: 18px;
}
.rr-modal {
    background: #fff; border-radius: 14px; max-width: 380px; width: 100%;
    padding: 20px 18px 16px; box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
    text-align: center;
}
.rr-modal h3 { font-size: 16px; margin: 0 0 8px; color: var(--rr-ink); }
.rr-modal p { font-size: 13.5px; color: var(--rr-muted); margin: 0 0 16px; line-height: 1.5; }
.rr-modal .rr-acoes { display: grid; gap: 8px; }

/* ---------- toast ---------- */
.rl-toast-wrap {
    position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
    z-index: 99999; display: flex; flex-direction: column; gap: 8px; pointer-events: none;
    width: calc(100% - 24px); max-width: 380px;
}
.rl-toast {
    background: #2b2b2b; color: #fff; border-radius: 10px; padding: 11px 14px;
    font-size: 13px; box-shadow: 0 12px 30px rgba(0, 0, 0, .25);
    display: flex; gap: 9px; align-items: flex-start; animation: rl-in .22s ease-out;
}
.rl-toast strong { display: block; font-size: 13px; margin-bottom: 1px; }
.rl-toast .rl-ico { font-weight: 700; }
.rl-toast.rl-ok { background: #1f7a4d; }
.rl-toast.rl-err { background: #b3261e; }
@keyframes rl-in { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }

/* ---------- dropdown do carrinho no header ---------- */
.cart .cart-dropdown { min-width: 300px; }
.cart .cart-dropdown .items { max-height: 300px; overflow: auto; }
.rl-item { display: flex; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--rr-line); align-items: flex-start; text-align: left; }
.rl-item img { width: 48px; height: 48px; object-fit: contain; border: 1px solid var(--rr-line); border-radius: 6px; background: #fff; flex: 0 0 auto; }
.rl-item .rl-info { flex: 1 1 auto; min-width: 0; }
.rl-item .rl-name { font-size: 11.5px; line-height: 1.3; color: var(--rr-ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rl-item .rl-qtd { font-size: 11px; color: var(--rr-muted); margin-top: 2px; }
.rl-item .rl-price { font-size: 12.5px; font-weight: 700; color: var(--rr-pink); margin-top: 2px; }
.rl-item .rl-del { border: 0; background: transparent; color: #b5b5b5; cursor: pointer; font-size: 14px; padding: 2px 4px; }
.cart-items { transition: transform .15s; }
.cart-items.rl-pop { transform: scale(1.3); }

/* ---------- busca ---------- */
.rl-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.rl-card-prod { border: 1px solid var(--rr-line); border-radius: 10px; overflow: hidden; background: #fff; }
.rl-card-prod a { color: inherit; text-decoration: none; }
.rl-card-prod .rl-cpimg img { width: 100%; height: 130px; object-fit: contain; padding: 8px; }
.rl-card-prod .rl-cpname { font-size: 11.5px; line-height: 1.3; padding: 0 8px; min-height: 44px; text-transform: uppercase; font-weight: 600; }
.rl-card-prod .rl-cpprice { padding: 6px 8px 10px; font-size: 14px; font-weight: 700; color: var(--rr-pink); }
.rl-card-prod .rl-cpprice small { display: block; font-size: 10.5px; color: var(--rr-muted); font-weight: 400; }

/* ---------- carrinho: quantidade, limite e frete ---------- */
.rr-chip {
    margin-left: auto; font-size: 10.5px; font-weight: 700; letter-spacing: .3px;
    text-transform: uppercase; color: var(--rr-muted); background: #f4f4f6;
    border-radius: 20px; padding: 3px 9px;
}
.rr-item .rr-price { align-self: flex-start; }
.rr-stepper {
    display: inline-flex; align-items: center; gap: 0; margin-top: 7px;
    border: 1px solid var(--rr-line); border-radius: 9px; overflow: hidden; background: #fff;
}
.rr-stepper .rr-step {
    width: 32px; height: 30px; border: 0; background: #fff; color: var(--rr-ink);
    font-size: 16px; line-height: 1; cursor: pointer; padding: 0;
}
.rr-stepper .rr-step:hover { background: #fafafa; color: var(--rr-pink); }
.rr-stepper .rr-qtd {
    min-width: 34px; text-align: center; font-size: 13.5px; font-weight: 700;
    border-left: 1px solid var(--rr-line); border-right: 1px solid var(--rr-line);
    padding: 0 6px; line-height: 30px;
}

.rr-limite { padding: 2px 0 0; }
.rr-limite-top {
    display: flex; justify-content: space-between; gap: 10px;
    font-size: 12.5px; color: var(--rr-muted); margin-bottom: 6px;
}
.rr-limite-top strong { color: var(--rr-ink); }
.rr-bar { height: 8px; border-radius: 6px; background: #f0f0f3; overflow: hidden; }
.rr-bar i { display: block; height: 100%; border-radius: 6px; background: var(--rr-pix); transition: width .25s; }
.rr-limite-obs { font-size: 11px; color: var(--rr-muted); margin-top: 6px; }
.rr-limite.rr-limite-cheio .rr-bar i { background: var(--rr-pink); }
.rr-limite.rr-limite-cheio .rr-limite-top { color: var(--rr-pink-dark); font-weight: 700; }

.rr-frete-box {
    display: flex; align-items: center; gap: 10px; margin-top: 12px;
    background: #f3fbf5; border: 1px solid #d9ecdd; border-radius: var(--rr-radius);
    padding: 11px 13px;
}
.rr-frete-ic { flex: 0 0 auto; display: flex; align-items: center; }
.rr-frete-tx { min-width: 0; }
.rr-frete-tx strong {
    display: block; font-size: 13px; color: #0f8a3d; text-transform: none; letter-spacing: 0;
}
.rr-frete-tx span { display: block; font-size: 12px; color: var(--rr-muted); margin-top: 2px; }
.rr-frete-tx span strong { display: inline; color: var(--rr-ink); font-size: 12px; }

.rr-prazo { color: var(--rr-ink); }
.rr-prazo strong { color: var(--rr-ink); }
.rr-prazo-box {
    display: flex; align-items: center; gap: 8px; margin-top: 10px;
    background: #f3fbf5; border: 1px solid #d9ecdd; border-radius: 9px;
    padding: 9px 11px; font-size: 12.5px; color: var(--rr-muted);
}
.rr-prazo-box strong { color: var(--rr-ink); }

/* botão de compra da PDP: texto em caixa alta como o resto do tema */
form.unit-grid .btn-cart {
    text-transform: uppercase;
    letter-spacing: .4px;
    font-weight: 600;
}

/* bloco de frete grátis injetado na PDP (troca_frete.py) */
.rr-pdp-frete {
    display: flex; align-items: center; gap: 10px; margin: 12px 0;
    background: #f3fbf5; border: 1px solid #d9ecdd; border-radius: 12px; padding: 11px 13px;
    color: #2b2b2b; font-size: 13px; line-height: 1.35;
}
.rr-pdp-frete svg { flex: 0 0 auto; }
.rr-pdp-frete .t { min-width: 0; }
.rr-pdp-frete .t b { display: block; color: #0f8a3d; font-size: 13.5px; }
.rr-pdp-frete .t span { display: block; color: #707070; font-size: 12px; margin-top: 2px; }
.rr-pdp-frete .t span b { display: inline; color: #2b2b2b; font-size: 12px; }

@media (max-width: 900px) {
    .rr-grid { grid-template-columns: 1fr; }
    .rl-cards { grid-template-columns: repeat(2, 1fr); }
    .rr-wrap { padding: 14px 12px 44px; }
    .rr-wrap h1 { font-size: 19px; }
    .rr-card { padding: 12px; }
    .rr-total b { font-size: 19px; }
    .rr-row3 { grid-template-columns: 96px 1fr 64px; }
    .rr-item img { width: 56px; height: 56px; }
}

@media (max-width: 420px) {
    .rr-row2 { grid-template-columns: 1fr; }
    .rr-qr { max-width: 210px; }
}

/* ---------- sacola lateral (abre quando adiciona ao carrinho) ---------- */
html.rr-dw-aberto, html.rr-dw-aberto body { overflow: hidden; }

.rr-dw-bg {
    position: fixed; inset: 0; background: rgba(24, 14, 18, .48);
    opacity: 0; visibility: hidden; transition: opacity .2s ease; z-index: 99998;
}
.rr-dw-bg.on { opacity: 1; visibility: visible; }

.rr-dw {
    position: fixed; top: 0; right: 0; bottom: 0; width: 392px; max-width: 93vw;
    display: flex; flex-direction: column; background: #fff; color: var(--rr-ink);
    font-size: 15px; line-height: 1.45; z-index: 99999;
    box-shadow: -14px 0 44px rgba(0, 0, 0, .18);
    transform: translateX(103%); transition: transform .26s cubic-bezier(.32, .72, .28, 1);
    visibility: hidden;
}
.rr-dw.on { transform: none; visibility: visible; }

.rr-dw-head {
    flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
    gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--rr-line); background: #fff;
}
.rr-dw-head strong {
    display: flex; align-items: center; gap: 8px; font-size: 12.5px;
    text-transform: uppercase; letter-spacing: .5px;
}
.rr-dw-head .rr-chip { margin-left: 0; }
.rr-dw-x {
    flex: 0 0 auto; border: 0; background: transparent; color: #9a9a9a;
    font-size: 19px; line-height: 1; cursor: pointer; padding: 2px 5px;
}
.rr-dw-x:hover { color: var(--rr-pink); }

.rr-dw-body { flex: 1 1 auto; overflow-y: auto; padding: 2px 16px 8px; -webkit-overflow-scrolling: touch; }
.rr-dw-body .rr-item img { width: 58px; height: 58px; }
.rr-dw-body .rr-item .rr-name { font-size: 12px; }

.rr-dw-foot {
    flex: 0 0 auto; border-top: 1px solid var(--rr-line); background: #fff;
    padding: 11px 16px 14px;
}
.rr-dw-foot .rr-frete-box { margin: 0 0 10px; padding: 9px 11px; }
.rr-dw-foot .rr-frete-tx strong { font-size: 12.5px; }
.rr-dw-foot .rr-frete-tx span { font-size: 11.5px; }
.rr-dw-foot .rr-limite { margin-bottom: 8px; }
.rr-dw-foot .rr-limite-obs { display: none; }
.rr-dw-foot .rr-total {
    margin-top: 6px; padding-top: 8px; font-size: 14px;
}
.rr-dw-foot .rr-total b { font-size: 20px; }
.rr-dw-obs { font-size: 11px; color: var(--rr-muted); margin-top: 2px; }
.rr-dw-acoes { display: grid; gap: 7px; margin-top: 10px; }
.rr-dw-acoes .rr-btn { min-height: 44px; font-size: 13px; }
.rr-dw-ver {
    display: block; margin-top: 9px; text-align: center; font-size: 11.5px;
    font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
    color: var(--rr-muted); text-decoration: underline;
}
.rr-dw-ver:hover { color: var(--rr-pink); }

@media (max-width: 420px) {
    .rr-dw { width: 100%; max-width: 100%; }
    .rr-dw-body { padding: 2px 12px 6px; }
    .rr-dw-foot { padding: 10px 12px 12px; }
    .rr-dw-body .rr-item img { width: 52px; height: 52px; }
}
