html, body {
    margin: 0;
    padding: 0;
}

:root {
    --ink: #111111;
    --muted: #6b7280;
    --line: #d9dce1;
    --panel: #fafafa;
    --accent: #111111;
}

* {
    box-sizing: border-box;
}

body.cart-page {
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
    background: #ffffff;
}

.checkout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 540px;
}

.checkout-main {
    padding: 28px 40px 48px;
}

.checkout-side {
    background: var(--panel);
    border-left: 1px solid var(--line);
    padding: 40px 38px;
}

.checkout-inner {
    max-width: 640px;
    margin-left: auto;
}

.cart-store-card {
    margin-bottom: 28px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
}

.cart-store-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.cart-store-logo-wrap {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: #fff;
    flex-shrink: 0;
}

.cart-store-logo,
.cart-store-logo-fallback {
    width: 100%;
    height: 100%;
    display: block;
}

.cart-store-logo {
    object-fit: cover;
}

.cart-store-logo-fallback {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #ececec, #d8d8d8);
    color: var(--ink);
    font-size: 22px;
    font-weight: 700;
}

.cart-store-label {
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.cart-store-name {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.1;
}

.section-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.field-wrap {
    margin-bottom: 12px;
}

.field,
.select,
.textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px 14px;
    font-size: 17px;
    color: var(--ink);
    background: #fff;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.field:focus,
.select:focus,
.textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.06);
}

.textarea {
    min-height: 110px;
    resize: vertical;
}

.grid-two,
.grid-three {
    display: grid;
    gap: 12px;
}

.grid-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-three {
    grid-template-columns: 1.05fr 1.05fr 1fr;
}

.errors,
.flash-error,
.flash-success {
    margin-bottom: 18px;
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 14px;
}

.errors,
.flash-error {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}

.flash-success {
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #15803d;
}

.errors ul {
    margin: 0;
    padding-left: 18px;
}

.cart-item {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: start;
    margin-bottom: 24px;
}

.cart-thumb-wrap {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--line);
    overflow: visible;
}

.cart-thumb-wrap img,
.fallback-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 14px;
}

.fallback-thumb {
    background: linear-gradient(135deg, #ececec, #d8d8d8);
}

.qty-badge {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    background: var(--ink);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

.item-title {
    margin: 4px 0 3px;
    font-size: 20px;
    font-weight: 500;
    line-height: 1.25;
}

.item-meta {
    color: var(--muted);
    font-size: 15px;
}

.item-price {
    font-size: 17px;
    white-space: nowrap;
    padding-top: 8px;
}

.item-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}

.qty-control {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    overflow: hidden;
    background: white;
}

.qty-btn {
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    color: var(--ink);
    font-size: 18px;
    cursor: pointer;
}

.qty-value {
    min-width: 34px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
}

.remove-btn {
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.summary {
    display: grid;
    gap: 14px;
}

.summary-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 14px;
}

.clear-cart-btn {
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.summary-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-top: 8px;
}

.summary-total-label {
    font-size: 16px;
    font-weight: 700;
}

.summary-total-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.summary-total-price small {
    color: var(--muted);
    font-size: 14px;
}

.summary-total-price strong {
    font-size: 20px;
}

.primary-btn {
    width: 100%;
    margin-top: 24px;
    border: none;
    border-radius: 14px;
    background: var(--accent);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    padding: 16px 18px;
    cursor: pointer;
}

.primary-btn:hover {
    filter: brightness(0.95);
}

.payment-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 14px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.payment-divider::before,
.payment-divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: var(--line);
}

.mercadopago-btn {
    width: 100%;
    min-height: 54px;
    border: 1px solid #1594f6;
    border-radius: 14px;
    background: #009ee3;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 18px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.mercadopago-btn:hover {
    filter: brightness(0.98);
    box-shadow: 0 12px 26px rgba(0, 158, 227, 0.18);
    transform: translateY(-1px);
}

.mercadopago-mark {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: #ffffff;
    color: #007eb5;
    display: inline-grid;
    place-items: center;
    font-size: 12px;
    font-weight: 800;
}

.cart-feedback {
    position: fixed;
    right: 22px;
    bottom: 22px;
    background: var(--accent);
    color: #fff;
    padding: 12px 16px;
    border-radius: 999px;
    box-shadow: 0 14px 34px rgba(23, 23, 23, 0.18);
    font-size: 13px;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
    z-index: 50;
}

.cart-feedback.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.empty-state {
    max-width: 520px;
    padding: 48px 40px;
}

.empty-state a {
    color: var(--ink);
}

.payment-return {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.payment-return-card {
    width: min(100%, 620px);
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #ffffff;
    padding: 34px;
    text-align: center;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
}

.payment-return-status {
    width: 58px;
    height: 58px;
    margin: 0 auto 18px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-size: 30px;
    font-weight: 800;
}

.payment-return-status.is-approved {
    background: #dcfce7;
    color: #15803d;
}

.payment-return-status.is-pending {
    background: #fef3c7;
    color: #b45309;
}

.payment-return-status.is-rejected {
    background: #fee2e2;
    color: #b91c1c;
}

.payment-return-title {
    margin: 0;
    font-size: 34px;
    line-height: 1.08;
}

.payment-return-copy {
    max-width: 480px;
    margin: 14px auto 24px;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.55;
}

.payment-return-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0 0 24px;
    text-align: left;
}

.payment-return-metric {
    min-height: 78px;
}

.payment-return-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

@media (max-width: 1024px) {
    .checkout {
        grid-template-columns: 1fr;
    }

    .checkout-side {
        border-left: none;
        border-top: 1px solid var(--line);
    }
}

@media (max-width: 640px) {
    .checkout-main,
    .checkout-side {
        padding: 22px 18px 32px;
    }

    .grid-two,
    .grid-three,
    .cart-item {
        grid-template-columns: 1fr;
    }

    .item-price {
        padding-top: 0;
    }

    .cart-store-brand {
        align-items: flex-start;
    }

    .payment-return-card {
        padding: 26px 18px;
    }

    .payment-return-title {
        font-size: 28px;
    }

    .payment-return-grid {
        grid-template-columns: 1fr;
    }
}
