/* ==========================================================================
   NADA. — checkout (tela cheia por cima da loja, mesmos tokens do style.css)
   ========================================================================== */

.checkout { position: fixed; inset: 0; z-index: 120; visibility: hidden; }
.checkout.is-open { visibility: visible; }
.checkout__panel {
    position: absolute; inset: 0; display: flex; flex-direction: column;
    background: var(--cream); color: var(--pink);
    opacity: 0; transform: translateY(24px);
    transition: opacity .35s var(--ease), transform .45s var(--ease), visibility 0s .45s;
}
.checkout.is-open .checkout__panel { opacity: 1; transform: none; transition-delay: 0s; }
.checkout__panel:focus { outline: none; }
.show-mobile { display: none; }

/* Barra superior: mesma do site ---------------------------------------- */
.checkout__bar { flex: none; background: var(--pink); color: var(--cream); box-shadow: 0 6px 24px rgba(194, 9, 74, .18); position: relative; z-index: 2; }
.checkout__bar-inner {
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
    height: var(--header-h); max-width: 1160px; margin: 0 auto; padding: 0 var(--gutter);
}
.checkout__back { display: inline-flex; align-items: center; gap: 4px; justify-self: start; height: 44px; padding: 0 14px 0 6px; border-radius: 999px; transition: background-color .2s; }
.checkout__back:hover { background: rgba(255, 255, 255, .15); }
.checkout__logo img { width: 136px; height: auto; transition: transform .3s var(--ease); }
.checkout__logo:hover img { transform: rotate(-3deg) scale(1.04); }
.checkout__secure { justify-self: end; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; line-height: 1.1; }
.checkout__secure .icon { width: 20px; height: 20px; }

.checkout__scroll { flex: 1; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }

/* Layout --------------------------------------------------------------- */
.checkout__layout {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); gap: clamp(28px, 4vw, 56px);
    align-items: start; max-width: 1160px; padding-top: clamp(28px, 4vw, 48px); padding-bottom: 48px;
}
.checkout__layout[hidden] { display: none; }
.checkout__main { grid-column: 1; grid-row: 1; min-width: 0; }
.checkout__summary { grid-column: 2; grid-row: 1; position: sticky; top: 28px; }
.checkout__title { font-family: var(--font-heading); font-weight: 400; font-size: clamp(34px, 4vw, 48px); line-height: .98; margin-bottom: 20px; }

/* Etapas (barra de progresso) ----------------------------------------- */
.co-progress { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; font-size: 14px; text-transform: uppercase; letter-spacing: .02em; }
.co-progress li { display: flex; align-items: center; gap: 8px; opacity: .5; transition: opacity .3s; }
.co-progress li + li::before { content: ""; width: clamp(16px, 4vw, 40px); height: 2px; background: currentColor; border-radius: 2px; margin-right: 2px; }
.co-progress span {
    display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
    border: 2px solid var(--pink); font-family: var(--font-heading); font-size: 13px;
    transition: background-color .3s, color .3s;
}
.co-progress li.is-current, .co-progress li.is-done { opacity: 1; }
.co-progress li.is-current span, .co-progress li.is-done span { background: var(--pink); color: var(--cream); }

/* Cartões de etapa ----------------------------------------------------- */
.co-step {
    background: var(--cream-2); border: 2px solid var(--pink); border-radius: 16px;
    padding: 20px 24px; margin-bottom: 20px;
    transition: box-shadow .35s var(--ease), opacity .3s, transform .35s var(--ease);
}
.co-step.is-active { box-shadow: 8px 8px 0 var(--pink); padding-bottom: 26px; }
.co-step.is-pending { opacity: .55; border-style: dashed; }
.co-step__head { display: flex; align-items: center; gap: 12px; min-height: 32px; }
.co-step__num {
    position: relative; flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
    background: var(--pink); color: var(--cream); font-family: var(--font-heading); font-size: 16px;
}
.co-step__num .icon { position: absolute; width: 18px; height: 18px; stroke-width: 2.6; opacity: 0; transform: scale(.4); transition: opacity .25s, transform .35s var(--ease); }
.co-step.is-done:not(.is-active) .co-step__num { background: var(--good); }
.co-step.is-done:not(.is-active) .co-step__num > span { opacity: 0; }
.co-step.is-done:not(.is-active) .co-step__num .icon { opacity: 1; transform: none; }
.co-step.is-pending .co-step__num { background: transparent; color: var(--pink); border: 2px solid var(--pink); }
.co-step__title { flex: 1; font-family: var(--font-heading); font-weight: 400; font-size: clamp(22px, 2.2vw, 26px); line-height: 1; }
.co-step__edit { font-size: 14px; text-decoration: underline; text-underline-offset: 3px; padding: 6px 4px; display: none; }
.co-step.is-done:not(.is-active) .co-step__edit { display: inline-block; }
.co-step__summary { display: none; margin: 12px 0 0 44px; font-size: 15px; line-height: 1.45; color: var(--magenta); }
.co-step.is-done:not(.is-active) .co-step__summary { display: block; animation: fadeUp .35s var(--ease); }
.co-step__summary strong { color: var(--pink); }
.co-step__body { display: none; margin-top: 18px; }
.co-step.is-active .co-step__body { display: block; animation: fadeUp .4s var(--ease); }
.co-step__lead { font-size: 15px; margin-bottom: 18px; color: var(--magenta); }
.co-step__next { margin-top: 22px; }
.co-step__next .icon { width: 20px; height: 20px; }

/* Campos --------------------------------------------------------------- */
.co-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.co-col-2 { grid-column: 1 / -1; }
.co-field > span:first-child { font-weight: 600; }
.co-field em { opacity: .7; font-weight: 500; }
.co-field input, .co-field select { background: #fff; font-size: 16px; min-height: 52px; }
.co-field select {
    width: 100%; padding: 14px 40px 14px 16px; color: var(--pink); border: 2px solid var(--pink); border-radius: 10px; outline: none;
    appearance: none; -webkit-appearance: none; cursor: pointer; transition: box-shadow .2s;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e94e72' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center / 18px;
}
.co-field select:focus { box-shadow: 4px 4px 0 var(--pink); }
.co-field select:invalid { color: rgba(233, 78, 114, .5); }
.co-field input[readonly] { background: var(--cream); }
.co-field__error { display: none; font-size: 13px; color: var(--magenta); font-weight: 600; }
.co-field.is-invalid .co-field__error:not(:empty) { display: block; animation: fadeUp .25s var(--ease); }
.co-field.is-invalid select { border-color: var(--magenta); background-color: #ffe6ea; }
.co-field.is-valid input { border-color: var(--good); }
.co-field__hint { font-size: 13px; }
.co-field__hint button { text-decoration: underline; font-weight: 700; }
.co-field__wrap { position: relative; display: block; }
.co-field__spin { position: absolute; right: 14px; top: 50%; margin-top: -11px; width: 22px; height: 22px; }
.co-field__spin .icon { width: 22px; height: 22px; stroke-width: 2.4; animation: spin .8s linear infinite; }

.co-cep { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.co-field--cep { width: min(240px, 100%); }
.co-cep__help { margin-top: 42px; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }

.co-address { margin-top: 18px; animation: fadeUp .4s var(--ease); }
.co-address__found {
    display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding: 12px 14px;
    background: var(--mint); color: var(--magenta); border-radius: 10px; font-size: 15px;
}
.co-address__found .icon { width: 20px; height: 20px; flex: none; }

.co-check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 15px; width: fit-content; position: relative; }
.co-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.co-check__box {
    display: grid; place-items: center; width: 22px; height: 22px; border: 2px solid var(--pink); border-radius: 6px; background: #fff;
    transition: background-color .2s;
}
.co-check__box .icon { width: 16px; height: 16px; stroke-width: 2.8; color: var(--cream); opacity: 0; }
.co-check input:checked + .co-check__box { background: var(--pink); }
.co-check input:checked + .co-check__box .icon { opacity: 1; }
.co-check input:focus-visible + .co-check__box { outline: 2px solid var(--purple); outline-offset: 2px; }

/* Opções (frete / pagamento) ------------------------------------------ */
.co-shipping, .co-pay { border: 0; margin: 0; padding: 0; min-width: 0; }
.co-shipping { margin-top: 22px; }
.co-shipping legend { font-weight: 600; font-size: 15px; margin-bottom: 8px; padding: 0; }
.co-option {
    position: relative; display: flex; align-items: center; gap: 14px; padding: 16px 18px; cursor: pointer;
    background: #fff; border: 2px solid var(--pink); border-radius: 12px;
    transition: background-color .2s, box-shadow .25s var(--ease);
}
.co-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.co-option__radio { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--pink); display: grid; place-items: center; }
.co-option__radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--pink); transform: scale(0); transition: transform .25s var(--ease); }
.co-option input:checked ~ .co-option__radio::after { transform: scale(1); }
.co-option input:focus-visible ~ .co-option__radio { outline: 2px solid var(--purple); outline-offset: 2px; }
.co-option__icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--blush); }
.co-option__icon .icon { width: 22px; height: 22px; }
.co-option__text { flex: 1; display: grid; gap: 2px; min-width: 0; }
.co-option__text strong { font-size: 16px; }
.co-option__text small { font-size: 14px; color: var(--magenta); }
.co-option__price { font-weight: 700; }
.co-option.is-active { background: var(--blush); box-shadow: 4px 4px 0 var(--pink); }
.co-free { color: var(--good); font-weight: 700; text-transform: uppercase; font-size: 14px; letter-spacing: .03em; }

.co-pay { display: grid; gap: 12px; }
.co-pay__method { border: 2px solid var(--pink); border-radius: 12px; background: #fff; overflow: hidden; transition: box-shadow .25s var(--ease); }
.co-pay__method .co-option { border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.co-pay__method.is-active { box-shadow: 4px 4px 0 var(--pink); }
.co-pay__method.is-active .co-option { background: var(--blush); }
.co-pay__slot { padding: 16px 18px; border-top: 2px dashed rgba(233, 78, 114, .35); font-size: 15px; color: var(--magenta); animation: fadeUp .3s var(--ease); }

.co-pay__submit { margin-top: 20px; }
.co-pay__submit .icon { width: 20px; height: 20px; }
.co-pay__submit.is-loading { pointer-events: none; opacity: .85; }
.co-pay__submit.is-loading .icon { animation: spin .8s linear infinite; }
.co-pay__msg { margin-top: 10px; text-align: center; }
.co-legal { font-size: 13px; text-align: center; opacity: .85; margin-top: 4px; }
.co-legal a { text-decoration: underline; }

/* Resumo do pedido ----------------------------------------------------- */
.co-summary { background: var(--cream-2); border: 2px solid var(--pink); border-radius: 16px; box-shadow: 8px 8px 0 var(--pink); }
.co-summary__toggle { display: none; }
.co-summary__body { padding: 24px; }
.co-summary__title { font-family: var(--font-heading); font-weight: 400; font-size: 26px; margin-bottom: 8px; }
.co-summary__items { display: grid; }
.co-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1.5px solid rgba(233, 78, 114, .2); }
.co-item__img { position: relative; width: 64px; height: 64px; }
.co-item__frame { display: block; width: 100%; height: 100%; background: var(--pink); padding: 2px; clip-path: url(#clip-flower8); }
.co-item__img img { width: 100%; height: 100%; object-fit: cover; clip-path: url(#clip-flower8); }
.co-item__qty {
    position: absolute; top: -4px; right: -6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
    background: var(--purple); color: #fff; font-size: 12px; font-weight: 700; line-height: 22px; text-align: center;
}
.co-item__title { font-weight: 700; font-size: 15px; line-height: 1.25; }
.co-item__meta { font-size: 13px; opacity: .85; margin-top: 2px; }
.co-item__price { font-weight: 700; text-align: right; white-space: nowrap; }
.co-item__price s { display: block; font-weight: 500; font-size: 13px; opacity: .6; }
.co-summary__edit { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.co-summary__edit .icon { width: 16px; height: 16px; }
.co-summary__totals { margin: 16px 0 0; display: grid; gap: 10px; }
.co-summary__totals > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.co-summary__totals dt small { font-size: 13px; opacity: .75; }
.co-summary__totals dd { margin: 0; font-weight: 700; }
.co-summary__totals [data-co-discount] { color: var(--good); }
.co-summary__total { padding-top: 14px; margin-top: 4px; border-top: 2px solid var(--pink); }
.co-summary__total dt { font-family: var(--font-heading); font-size: 22px; }
.co-summary__total dd { font-family: var(--font-heading); font-weight: 400; font-size: 26px; }
.co-trust { display: grid; gap: 10px; margin-top: 22px; padding: 16px; border-radius: 12px; background: var(--blush); font-size: 14px; }
.co-trust li { display: flex; align-items: center; gap: 10px; }
.co-trust .icon { width: 20px; height: 20px; }
.co-summary__sticker { top: -46px; right: -34px; }
.co-summary__sticker .sticker__text { font-size: 17px; }

/* Pedido concluído ----------------------------------------------------- */
.co-done { max-width: 640px; padding-top: clamp(48px, 8vw, 90px); padding-bottom: 60px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; animation: fadeUp .5s var(--ease); }
.co-done[hidden] { display: none; }
.co-done__sticker { position: relative; margin-bottom: 8px; }
.co-done__sticker .sticker__text { font-size: 22px; }
.co-done__title { font-family: var(--font-heading); font-weight: 400; font-size: clamp(40px, 6vw, 64px); line-height: .98; }
.co-done__title:focus { outline: none; }
.co-done__order { font-size: 18px; }
.co-done__card:empty { display: none; }
.co-done__card { width: 100%; text-align: left; background: var(--cream-2); border: 2px solid var(--pink); border-radius: 16px; box-shadow: 8px 8px 0 var(--pink); padding: 20px 24px; margin: 8px 0 16px; line-height: 1.5; color: var(--magenta); }
.co-done__card strong { color: var(--pink); }
.co-done.is-pix { padding-top: clamp(28px, 5vw, 56px); }
.co-done.is-pix .co-done__sticker { display: none; }
.co-done.is-pix .co-done__title { font-size: clamp(34px, 5vw, 52px); }

/* PIX: QR Code + copia e cola */
.co-pix { display: grid; gap: 14px; justify-items: center; text-align: center; padding-bottom: 16px; margin-bottom: 14px; border-bottom: 2px dashed var(--blush); }
.co-pix__qr { width: min(240px, 70vw); aspect-ratio: 1; background: #fff; border: 2px solid var(--pink); border-radius: 12px; padding: 8px; }
.co-pix__qr:empty { background: #fff linear-gradient(90deg, #fff 0, var(--cream) 50%, #fff 100%) 0 0 / 200% 100%; animation: coPixLoad 1.2s linear infinite; }
.co-pix__qr[hidden] { display: none; }
.co-pix__qr svg { display: block; width: 100%; height: 100%; }
.co-pix__total { font-size: 18px; margin: 0; }
.co-pix__code { display: grid; gap: 6px; width: 100%; text-align: left; font-size: 14px; }
.co-pix__code textarea { width: 100%; resize: none; font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--magenta); background: #fff; border: 2px solid var(--pink); border-radius: 10px; padding: 10px 12px; word-break: break-all; }
.co-pix__status { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin: 0; font-size: 15px; }
.co-pix__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--pink-hot); animation: coPixPulse 1.4s ease-in-out infinite; }
.co-pix__timer { opacity: .75; font-variant-numeric: tabular-nums; }
@keyframes coPixPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }
@keyframes coPixLoad { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .co-pix__dot, .co-pix__qr:empty { animation: none; } }

.checkout__foot { padding: 20px var(--gutter) 32px; text-align: center; font-size: 13px; opacity: .8; }
.checkout__foot p { display: inline-flex; align-items: center; gap: 6px; }
.checkout__foot .icon { width: 16px; height: 16px; }

/* Responsivo ----------------------------------------------------------- */
@media (max-width: 900px) {
    .show-mobile { display: inline; }
    .checkout__back span { display: none; }
    .checkout__back { padding: 0; width: 44px; justify-content: center; }
    .checkout__logo img { width: 104px; }
    .checkout__secure { font-size: 12px; gap: 6px; text-align: left; }

    .checkout__layout { grid-template-columns: minmax(0, 1fr); padding-top: 0; gap: 0; }
    .checkout__summary, .checkout__main { grid-column: 1; grid-row: auto; }
    .checkout__summary { position: relative; top: 0; margin: 0 calc(var(--gutter) * -1) 24px; border-width: 0 0 2px; border-radius: 0; box-shadow: none; }
    .co-summary__sticker { display: none; }
    .co-summary__toggle {
        display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px;
        padding: 14px var(--gutter); background: var(--blush); font-size: 15px;
    }
    .co-summary__toggle-label { display: inline-flex; align-items: center; gap: 8px; text-decoration: underline; text-underline-offset: 3px; }
    .co-summary__toggle-label .icon { width: 20px; height: 20px; }
    .co-summary__toggle .co-summary__chev { width: 16px; height: 16px; transition: transform .3s var(--ease); }
    .co-summary__toggle[aria-expanded="true"] .co-summary__chev { transform: rotate(180deg); }
    .co-summary__toggle strong { font-family: var(--font-heading); font-weight: 400; font-size: 20px; }
    .co-summary__body { display: none; padding: 8px var(--gutter) 20px; }
    .co-summary.is-expanded .co-summary__body { display: block; animation: fadeUp .3s var(--ease); }
    .co-summary__title { display: none; }
    .checkout__title { margin-top: 4px; }
}

@media (max-width: 560px) {
    .co-grid { grid-template-columns: 1fr; }
    .co-step { padding: 18px 16px; }
    .co-step.is-active { box-shadow: 5px 5px 0 var(--pink); }
    .co-step__summary { margin-left: 0; }
    .co-progress { font-size: 12px; gap: 6px; }
    .co-progress span { width: 22px; height: 22px; font-size: 12px; }
    .co-option { padding: 14px; gap: 12px; }
    .co-cep__help { margin-top: 0; }
    .co-step__next { font-size: 15px; padding: 12px 18px; }
    .co-field--cep { width: 100%; }
}
