:root {
    --bg: #f3f4f6;
    --card: #ffffff;
    --ink: #1f2937;
    --muted: #9ca3af;
    --border: #e5e7eb;
    --blue: #2563eb;
    --blue-light: #dbeafe;
    --green: #22c55e;
    --green-btn: #d4e4bc;
    --green-btn-active: #6bae2e;
    --green-btn-hover: #5c9628;
    --green-total: #16a34a;
    --red: #ef4444;
    --star: #fbbf24;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Rubik", "Inter", system-ui, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.5;
    font-size: 14px;
}

img {
    display: block;
    max-width: 100%;
}

button,
input,
select {
    font: inherit;
}

.checkout-page {
    min-height: 100vh;
}

.checkout-topline {
    height: 4px;
    background: var(--blue);
}

.checkout-header {
    background: var(--card);
    padding: 16px 20px;
}

.checkout-header__inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.checkout-header__logo {
    height: 40px;
    width: auto;
}

.checkout-header__secure {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #374151;
}

.checkout-header__secure svg {
    width: 14px;
    height: 14px;
    color: #6b7280;
}

.checkout-layout {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px 48px;
    display: grid;
    gap: 24px;
}

@media (min-width: 900px) {
    .checkout-layout {
        grid-template-columns: minmax(0, 1fr) 340px;
        align-items: start;
    }
}

.checkout-steps {
    display: grid;
    gap: 16px;
}

.step-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.step-card.is-collapsed {
    padding: 16px 20px;
}

.step-card.is-collapsed .step-card__body {
    display: none;
}

.step-card__head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.step-card.is-collapsed .step-card__head {
    opacity: 0.45;
}

.step-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    background: #e5e7eb;
    color: #6b7280;
}

.step-card.is-active .step-badge {
    background: var(--blue);
    color: #fff;
}

.step-card__title {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
}

.step-card__subtitle {
    margin: 2px 0 0;
    font-size: 12px;
    color: var(--muted);
}

.step-card__body {
    padding: 0 20px 20px 60px;
}

.step-intro {
    margin: 0 0 18px;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.6;
}

.field {
    margin-bottom: 14px;
}

.field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.field label .req {
    color: var(--red);
}

.field input,
.field select {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 11px 12px;
    background: #fff;
    color: var(--ink);
    font-size: 14px;
}

.field input::placeholder {
    color: #9ca3af;
}

.field input:focus,
.field select:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.phone-field {
    display: flex;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.phone-field:focus-within {
    border-color: var(--blue);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.phone-field__prefix {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    border-right: 1px solid #d1d5db;
    background: #f9fafb;
    font-size: 13px;
    color: #374151;
    white-space: nowrap;
}

.phone-field__prefix img {
    width: 20px;
    height: 14px;
    object-fit: cover;
    border-radius: 2px;
}

.phone-field input {
    border: 0;
    border-radius: 0;
    box-shadow: none !important;
    flex: 1;
}

.phone-field input:focus {
    box-shadow: none;
}

.form-grid-2 {
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr 1fr;
}

@media (max-width: 600px) {
    .form-grid-2 {
        grid-template-columns: 1fr;
    }

    .step-card__body {
        padding-left: 20px;
    }
}

.btn-next {
    width: 100%;
    margin-top: 8px;
    border: 0;
    border-radius: 999px;
    padding: 14px 18px;
    background: var(--green-btn);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: not-allowed;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s ease, opacity 0.2s ease;
    opacity: 0.75;
}

.btn-next.is-ready {
    background: var(--green-btn-active);
    cursor: pointer;
    opacity: 1;
}

.btn-next.is-ready:hover {
    background: var(--green-btn-hover);
}

.btn-next:disabled {
    pointer-events: none;
}

.address-fields {
    animation: fadeIn 0.25s ease;
}

.link-btn {
    display: inline-block;
    margin-bottom: 14px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.link-btn:hover {
    text-decoration: underline;
}

.address-card {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    border: 1.5px solid var(--ink);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 18px;
}

.address-card__inner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
    cursor: pointer;
}

.address-card__inner input {
    margin-top: 3px;
    accent-color: var(--ink);
}

.address-card__line {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}

.address-card__line--muted {
    font-weight: 400;
    color: #4b5563;
    margin-top: 2px;
}

.address-card__actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.icon-btn {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn svg {
    width: 16px;
    height: 16px;
}

.icon-btn:hover {
    background: #f3f4f6;
    color: var(--ink);
}

.icon-btn--danger:hover {
    background: #fef2f2;
    color: var(--red);
}

.shipping-title {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 600;
}

.shipping-options {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}

.shipping-option {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    background: #fff;
}

.shipping-option.is-selected {
    border-color: var(--blue);
    background: #eff6ff;
}

.shipping-option input {
    accent-color: var(--blue);
}

.shipping-option__info {
    min-width: 0;
}

.shipping-option__name {
    font-size: 14px;
    font-weight: 700;
}

.shipping-option__prazo {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

.shipping-option__logo {
    width: 48px;
    height: auto;
    object-fit: contain;
}

.shipping-option__price {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.shipping-option__price.is-free {
    color: var(--green-total);
}

.shipping-view {
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn-next svg {
    width: 18px;
    height: 18px;
}

.payment-pix-only {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1.5px solid var(--blue);
    border-radius: 8px;
    background: #eff6ff;
    margin-bottom: 16px;
}

.payment-pix-only__icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #dcfce7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.payment-pix-only__title {
    font-weight: 600;
    font-size: 14px;
}

.payment-pix-only__desc {
    font-size: 12px;
    color: var(--muted);
}

.payment-pix-only .payment-tag {
    margin-left: auto;
}

.payment-tag {
    background: var(--green);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    flex-shrink: 0;
}

.checkout-layout--pix {
    grid-template-columns: 1fr;
    max-width: 480px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}

.pix-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
}

.pix-card__title {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 800;
}

.pix-card__subtitle {
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 14px;
}

.pix-state {
    text-align: center;
    padding: 32px 16px;
    color: var(--muted);
}

.pix-state--error {
    color: var(--red);
}

.pix-qr-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.pix-qr-image,
.pix-qr-canvas {
    width: 220px;
    height: 220px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}

.pix-copy label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

.pix-copy__row {
    display: flex;
    gap: 8px;
}

.pix-copy__row input {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 12px;
    background: #f9fafb;
}

.pix-copy__btn {
    border: 0;
    border-radius: 8px;
    padding: 0 16px;
    background: var(--blue);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.pix-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 18px;
    padding: 14px;
    background: #f9fafb;
    border-radius: 8px;
    font-size: 15px;
}

.pix-total strong {
    color: var(--green-total);
    font-size: 18px;
}

.pix-status {
    margin: 16px 0 0;
    text-align: center;
    font-size: 13px;
    color: var(--muted);
}

.pix-status.is-paid {
    color: var(--green-total);
    font-weight: 700;
}

.sidebar {
    display: grid;
    gap: 16px;
}

.summary-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 18px;
}

.summary-card__title {
    margin: 0 0 16px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.summary-product {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.summary-product img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.summary-product__info {
    flex: 1;
    min-width: 0;
}

.summary-product__name {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.summary-product__price {
    margin-top: 4px;
    font-size: 13px;
    color: #374151;
}

.qty-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-top: 12px;
    background: #f3f4f6;
    border-radius: 6px;
    overflow: hidden;
    width: fit-content;
}

.qty-control button {
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    font-size: 18px;
    color: #6b7280;
    cursor: pointer;
}

.qty-control button:hover {
    background: #e5e7eb;
}

.qty-control span {
    min-width: 36px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
}

.remove-link {
    display: inline-block;
    margin-top: 10px;
    font-size: 12px;
    color: var(--red);
    text-decoration: none;
    cursor: pointer;
    background: none;
    border: 0;
    padding: 0;
}

.remove-link:hover {
    text-decoration: underline;
}

.summary-totals {
    margin-top: 16px;
    background: #f9fafb;
    border-radius: 6px;
    padding: 14px;
    display: grid;
    gap: 8px;
}

.summary-totals__row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.summary-totals__row--total {
    font-size: 15px;
    font-weight: 800;
}

.summary-totals__row--total span:last-child {
    color: var(--green-total);
    font-size: 17px;
}

.trust-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 18px;
    display: grid;
    gap: 16px;
}

.trust-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px 12px;
    align-items: start;
}

.trust-item__stars {
    grid-column: 1 / -1;
    color: var(--star);
    font-size: 13px;
    letter-spacing: 1px;
    line-height: 1;
}

.trust-item__icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fef3c7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.trust-item__title {
    font-size: 13px;
    font-weight: 700;
    margin: 0;
}

.trust-item__text {
    font-size: 12px;
    color: #6b7280;
    margin: 2px 0 0;
    line-height: 1.5;
}

.hidden {
    display: none !important;
}
