/* Checkout — matches refrence-template/index.html (Minimal Premium) */

.dpp-co {
    --co-primary: #ef394e;
    --co-primary-hover: #d6283b;
    --co-primary-light: rgba(239, 57, 78, 0.08);
    --co-bg-body: #fafafc;
    --co-bg-surface: #ffffff;
    --co-bg-summary: #f5f5f7;
    --co-text: #1d1d1f;
    --co-muted: #86868b;
    --co-border: #d2d2d7;
    --co-border-light: #e5e5ea;
    --co-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --co-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --co-shadow-btn: 0 12px 24px rgba(239, 57, 78, 0.25);
    --co-radius-sm: 8px;
    --co-radius-md: 12px;
    --co-radius-lg: 20px;
    --co-ease: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

body.dpp-checkout-page {
    background: var(--co-bg-body);
}

body.dpp-checkout-page .dv-container--narrow {
    max-width: 1480px;
    padding-inline: 32px;
}

body.dpp-checkout-page .dv-prose {
    max-width: none;
}

body.dpp-checkout-page .dv-page-hero {
    display: none;
}

body.dpp-checkout-page .dv-header,
body.dpp-checkout-page .dv-header.is-stuck {
    background: #fff;
}

body.dpp-checkout-page.has-bottom-nav .dv-bottom-nav {
    display: none !important;
}

.dpp-co {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 50vh;
    color: var(--co-text);
    -webkit-tap-highlight-color: transparent;
}

.dpp-co__test-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 1480px;
    margin: 16px auto 0;
    padding: 10px 20px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--co-primary);
    background: var(--co-primary-light);
    border-radius: var(--co-radius-sm);
}

.dpp-co__test-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--co-primary);
    flex: none;
}

.dpp-co__wrapper {
    width: 100%;
    max-width: 1480px;
    display: flex;
    gap: 48px;
    padding: 48px 32px;
    margin: 0 auto;
}

/* Summary (RTL: right column) */
.dpp-co__summary {
    width: 54%;
    flex: 1 1 54%;
    min-width: 0;
    background: var(--co-bg-surface);
    border-radius: var(--co-radius-lg);
    padding: 32px;
    box-shadow: var(--co-shadow-sm);
    height: fit-content;
    border: 1px solid rgba(0, 0, 0, 0.03);
    position: sticky;
    top: 40px;
}

.dpp-co__title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--co-text);
    letter-spacing: -0.5px;
}

.dpp-co__subtitle {
    font-size: 0.95rem;
    color: var(--co-muted);
    margin: -16px 0 32px;
    line-height: 1.7;
}

.dpp-co__divider {
    height: 1px;
    background: var(--co-border-light);
    margin: 20px 0;
}

/* Cart items */
.dpp-co__cart-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--co-border-light);
}

.dpp-co__cart-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
}

.dpp-co__cart-item.is-busy {
    opacity: 0.5;
    pointer-events: none;
}

.dpp-co__item-img {
    width: 64px;
    height: 64px;
    border-radius: var(--co-radius-md);
    object-fit: cover;
    background: #fff;
    padding: 2px;
    border: 1px solid var(--co-border-light);
    flex: none;
}

.dpp-co__item-img--empty {
    display: grid;
    place-items: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--co-muted);
}

.dpp-co__item-info {
    flex: 1;
    min-width: 0;
}

.dpp-co__item-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--co-text);
    margin-bottom: 4px;
    white-space: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    line-height: 1.5;
    max-height: calc(1.5em * 2);
}

.dpp-co a.dpp-co__item-name,
.dpp-co a.dpp-co__item-name:hover,
.dpp-co a.dpp-co__item-name:focus,
.dpp-co a.dpp-co__item-name:active,
.dv-main .dpp-co a.dpp-co__item-name,
.page-content .dpp-co a.dpp-co__item-name {
    color: var(--co-text) !important;
    text-decoration: none !important;
}

.dpp-co__item-price {
    font-size: 0.85rem;
    color: var(--co-muted);
}

.dpp-co__item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.dpp-co__qty-pill {
    display: flex;
    align-items: center;
    background: var(--co-bg-body);
    border-radius: 20px;
    padding: 4px 8px;
    border: 1px solid var(--co-border-light);
}

.dpp-co__qty-pill button {
    background: none;
    border: none;
    color: var(--co-text);
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    transition: 0.2s;
    padding: 0;
}

.dpp-co__qty-pill button:hover:not(:disabled) {
    background: var(--co-border-light);
}

.dpp-co__qty-pill button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.dpp-co__qty-pill span {
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.dpp-co__btn-remove {
    background: none;
    border: none;
    color: var(--co-primary);
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    opacity: 0.8;
    padding: 0;
}

.dpp-co__btn-remove:hover {
    opacity: 1;
}

.dpp-co__empty {
    text-align: center;
    color: var(--co-muted);
    font-size: 0.9rem;
    padding: 20px 0;
}

.dpp-co__empty p {
    margin: 0;
}

/* Discount */
.dpp-co__discount {
    display: flex;
    background: var(--co-bg-body);
    border: 1px solid var(--co-border-light);
    border-radius: var(--co-radius-sm);
    padding: 4px;
    margin-bottom: 8px;
    height: 48px;
}

.dpp-co__discount input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0 16px;
    outline: none;
    font-size: 0.9rem;
    color: var(--co-text);
    font-family: inherit;
    min-width: 0;
}

.dpp-co__discount button {
    background: var(--co-text);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0 20px;
    font-weight: 600;
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    transition: var(--co-ease);
    white-space: nowrap;
}

.dpp-co__discount button:hover:not(:disabled) {
    background: #000;
}

.dpp-co__discount button:disabled {
    opacity: 0.55;
    cursor: wait;
}

.dpp-co__summary:has(.dpp-co__coupon-applied:not([hidden])) .dpp-co__discount {
    display: none;
}

.dpp-co__coupon-applied {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    padding: 10px 14px;
    border-radius: var(--co-radius-sm);
    background: rgba(52, 199, 89, 0.1);
    border: 1px solid rgba(52, 199, 89, 0.25);
    font-size: 0.85rem;
    font-weight: 700;
    color: #34c759;
}

.dpp-co__coupon-applied button {
    border: 0;
    background: transparent;
    color: inherit;
    font-family: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: underline;
}

.dpp-co__msg-box {
    font-size: 0.8rem;
    min-height: 18px;
    margin-bottom: 20px;
}

.dpp-co__msg-box .text-success {
    color: #34c759;
}

.dpp-co__msg-box .text-error {
    color: var(--co-primary);
}

/* Cost rows */
.dpp-co__cost-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: var(--co-muted);
}

.dpp-co__cost-row--discount {
    color: var(--co-primary);
}

.dpp-co__cost-row--total {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--co-text);
    margin-top: 16px;
    margin-bottom: 0;
}

.dpp-co__cost-row--total span:last-child {
    transition: transform 0.3s ease, color 0.3s ease;
}

.dpp-co__cost-row--total.is-bump span:last-child {
    animation: dpp-co-bump 0.3s ease-out;
}

@keyframes dpp-co-bump {
    50% {
        transform: scale(1.05);
        color: var(--co-primary);
    }
}

/* Form section */
.dpp-co__form {
    width: 46%;
    flex: 1 1 46%;
    min-width: 0;
    padding-top: 16px;
}

.dpp-co__form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.dpp-co__input-group {
    position: relative;
    margin-bottom: 20px;
}

.dpp-co__input-group input {
    width: 100%;
    height: 56px;
    padding: 24px 16px 8px 48px;
    border: 1px solid var(--co-border);
    border-radius: var(--co-radius-sm);
    background: var(--co-bg-surface);
    font-size: 1rem;
    font-family: inherit;
    color: var(--co-text);
    outline: none;
    transition: var(--co-ease);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.01);
}

.dpp-co__input-group label {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--co-muted);
    pointer-events: none;
    transition: 0.2s ease;
    font-size: 0.95rem;
}

.dpp-co__input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--co-border);
    display: flex;
    transition: var(--co-ease);
}

.dpp-co__input-group input:focus,
.dpp-co__input-group input:not(:placeholder-shown) {
    border-color: var(--co-primary);
    box-shadow: 0 0 0 4px var(--co-primary-light);
}

.dpp-co__input-group input:focus ~ label,
.dpp-co__input-group input:not(:placeholder-shown) ~ label {
    top: 14px;
    font-size: 0.75rem;
    color: var(--co-primary);
}

.dpp-co__input-group input:not(:placeholder-shown):not(:focus) ~ label {
    color: var(--co-muted);
}

.dpp-co__input-group input:focus ~ .dpp-co__input-icon {
    color: var(--co-primary);
}

.dpp-co__field-error {
    position: absolute;
    bottom: -18px;
    right: 4px;
    font-size: 0.75rem;
    color: var(--co-primary);
    opacity: 0;
    transition: 0.2s;
}

.dpp-co__input-group.is-invalid input {
    border-color: var(--co-primary);
}

.dpp-co__input-group.is-invalid .dpp-co__field-error {
    opacity: 1;
}

.dpp-co__secure {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--co-bg-summary);
    border-radius: var(--co-radius-sm);
    padding: 16px;
    margin-bottom: 24px;
    font-size: 0.85rem;
    color: var(--co-muted);
}

.dpp-co__secure svg {
    flex: none;
    color: var(--co-text);
}

.dpp-co__errors {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: var(--co-radius-sm);
    background: var(--co-primary-light);
    color: var(--co-primary);
    font-size: 0.85rem;
    line-height: 1.6;
}

.dpp-co__submit {
    width: 100%;
    height: 60px;
    background: var(--co-primary);
    color: #fff;
    border: none;
    border-radius: var(--co-radius-md);
    font-size: 1.1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    box-shadow: var(--co-shadow-btn);
    transition: var(--co-ease);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.dpp-co__submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(239, 57, 78, 0.3);
}

.dpp-co__submit:active:not(:disabled) {
    transform: translateY(0);
}

.dpp-co__submit:disabled,
.dpp-co__submit.is-loading {
    pointer-events: none;
    opacity: 0.9;
}

.dpp-co__spinner {
    display: none;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: dpp-co-spin 1s linear infinite;
}

.dpp-co__submit.is-loading .dpp-co__submit-text {
    display: none;
}

.dpp-co__submit.is-loading .dpp-co__spinner {
    display: block;
}

@keyframes dpp-co-spin {
    to {
        transform: rotate(360deg);
    }
}

.dpp-co__ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: dpp-co-ripple 0.6s linear;
    pointer-events: none;
}

@keyframes dpp-co-ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Toast */
.dpp-co__toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--co-text);
    color: #fff;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--co-shadow-md);
    transition: 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1000;
    pointer-events: none;
}

.dpp-co__toast.is-show {
    transform: translateX(-50%) translateY(0);
}

.dpp-co__toast.is-success svg {
    color: #34c759;
}

.dpp-co__toast.is-error svg {
    color: var(--co-primary);
}

/* Desktop — wider layout, more breathing room */
@media (min-width: 801px) {
    .dpp-co__summary {
        padding: 44px;
    }

    .dpp-co__form {
        padding-top: 24px;
    }

    .dpp-co__cart-item {
        display: grid;
        grid-template-columns: 56px minmax(0, 1fr);
        grid-template-rows: auto auto;
        gap: 10px 16px;
        align-items: start;
        padding-bottom: 20px;
        margin-bottom: 20px;
    }

    .dpp-co__item-img,
    .dpp-co__item-img--empty {
        grid-row: 1 / 3;
        width: 56px;
        height: 56px;
    }

    .dpp-co__item-info {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
    }

    .dpp-co__item-actions {
        grid-column: 2;
        grid-row: 2;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 14px;
    }

    .dpp-co__item-name {
        font-size: 1rem;
        -webkit-line-clamp: 2;
    }

    .dpp-co__item-price {
        font-size: 0.9rem;
    }
}

/* Mobile */
@media (max-width: 800px) {
    body.dpp-checkout-page {
        background: var(--co-bg-surface);
    }

    .dpp-co__test-banner {
        margin-top: 0;
        border-radius: 0;
    }

    .dpp-co__wrapper {
        flex-direction: column;
        padding: 0;
        gap: 0;
    }

    .dpp-co__summary {
        width: 100%;
        background: var(--co-bg-summary);
        border-radius: 0 0 24px 24px;
        border: none;
        border-bottom: 1px solid var(--co-border-light);
        padding: 24px 20px;
        box-shadow: none;
        position: relative;
        top: 0;
    }

    .dpp-co__form {
        width: 100%;
        padding: 32px 20px 40px;
    }

    .dpp-co__form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .dpp-co__cart-item {
        align-items: flex-start;
        gap: 12px;
        padding-bottom: 16px;
        margin-bottom: 16px;
    }

    .dpp-co__item-img,
    .dpp-co__item-img--empty {
        display: none !important;
    }

    .dpp-co__item-info {
        flex: 1;
        min-width: 0;
        padding-left: 4px;
    }

    .dpp-co__item-price {
        font-size: 0.85rem;
        margin-top: 2px;
    }

    .dpp-co__item-actions {
        flex: none;
        align-self: center;
    }

    .dpp-co__title {
        font-size: 1.3rem;
        margin-bottom: 16px;
    }
}

/* Cart page reuse */
.dpp-cart.dpp-co .dpp-co__wrapper {
    max-width: 960px;
}

.dpp-cart.dpp-co .dpp-co__summary {
    width: 100%;
    position: relative;
    top: 0;
}

.dpp-cart.dpp-co .dpp-co__form {
    display: none;
}
