/* ============================================================
   Checkout page styles - mobile-first
   ============================================================ */

.co-page {
    max-width: 1080px;
    margin: 0 auto;
    padding: 8px 12px 24px;
    box-sizing: border-box;
}

.co-narrow {
    max-width: 640px;
}

/* ------------------------------------------------------------
   Empty / success states
   ------------------------------------------------------------ */
.co-empty,
.co-success {
    text-align: center;
    padding: 60px 24px;
    max-width: 520px;
    margin: 0 auto;
    box-sizing: border-box;
}

.co-empty-icon,
.co-success-icon {
    font-size: 56px;
    margin-bottom: 16px;
}

.co-empty-icon {
    color: #d4d4d4;
}

.co-success-icon {
    color: rgb(56, 142, 60);
}

.co-empty h2,
.co-success h2 {
    font-size: 20px;
    font-weight: 700;
    color: rgb(33, 37, 41);
    margin: 0 0 8px;
}

.co-empty p,
.co-success p {
    color: rgb(128, 128, 128);
    font-size: 14px;
    margin: 0 0 8px;
}

.co-success-order {
    color: rgb(33, 37, 41) !important;
    font-size: 15px !important;
    font-weight: 600;
}

.co-empty-btn,
.co-success-btn {
    display: inline-block;
    background: #000;
    color: #fff;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    padding: 10px 28px;
    margin-top: 10px;
    text-decoration: none;
}

.co-empty-btn:hover,
.co-success-btn:hover {
    color: #fff;
    background: #424649;
}

/* ------------------------------------------------------------
   Sections
   ------------------------------------------------------------ */
.co-form-error {
    background: rgb(253, 237, 237);
    border: 1px solid rgb(245, 198, 203);
    border-radius: 8px;
    color: #b02a37;
    font-size: 14px;
    padding: 10px 12px;
    margin: 0 0 12px;
    box-sizing: border-box;
}

.co-section {
    border: 1px solid #ececec;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 14px;
    box-sizing: border-box;
}

.co-section-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ececec;
}

/* ------------------------------------------------------------
   Customer information + address fields
   ------------------------------------------------------------ */
.co-field {
    margin-bottom: 12px;
}

.co-field label {
    display: block;
    color: rgb(66, 69, 83);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 5px;
}

.co-req {
    color: red;
}

.co-optional {
    color: rgb(148, 150, 159);
    font-weight: 400;
}

.co-input {
    width: 100%;
    border: 1px solid #d5d5d5;
    border-radius: 8px;
    background: #fff;
    color: rgb(33, 37, 41);
    font-family: 'Assistant', sans-serif;
    font-size: 15px;
    padding: 10px 12px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.15s ease-in-out;
}

.co-input:focus {
    border-color: #000;
}

.co-input.is-invalid {
    border-color: #dc3545;
}

.co-textarea {
    resize: vertical;
    min-height: 72px;
    line-height: 1.5;
}

.co-error {
    color: #dc3545;
    font-size: 12.5px;
    margin: 5px 0 0;
}

.co-alert {
    background: #fdecea;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 10px 14px;
    margin: 0 0 16px;
}

/* ------------------------------------------------------------
   Temporary payment return screen
   ------------------------------------------------------------ */
.co-center {
    text-align: center;
}

.co-return-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: #f0f5ff;
    color: #2874f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}

.co-return-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 8px;
    color: #212121;
}

.co-return-sub {
    font-size: 13.5px;
    line-height: 1.55;
    color: #666;
    margin: 0 auto 18px;
    max-width: 400px;
}

.co-return-meta {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    font-size: 13.5px;
    color: #555;
    margin: 0 0 22px;
}

.co-return-meta strong {
    color: #212121;
}

.co-return-actions {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin: 0 0 14px;
}

.co-btn {
    border: none;
    border-radius: 8px;
    padding: 12px 28px;
    font-size: 14.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}

.co-btn-success {
    background: #388e3c;
    color: #fff;
}

.co-btn-success:hover {
    background: #2e7d32;
}

.co-btn-danger {
    background: #fff;
    color: #d32f2f;
    border: 1.5px solid #d32f2f;
}

.co-btn-danger:hover {
    background: #fdecea;
}

.co-return-retry {
    font-size: 12.5px;
    margin: 4px 0 0;
}

.co-return-retry a {
    color: #2874f0;
    text-decoration: none;
}

.co-return-retry a:hover {
    text-decoration: underline;
}

.co-return-note {
    font-size: 12px;
    color: #999;
    margin: 0;
}

/* ------------------------------------------------------------
   Order summary
   ------------------------------------------------------------ */
.co-items {
    list-style: none;
    margin: 0 0 10px;
    padding: 0;
}

.co-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #ececec;
}

.co-item:first-child {
    padding-top: 0;
}

.co-item-img {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border: 1px solid #ececec;
    border-radius: 8px;
    object-fit: cover;
    display: block;
}

.co-item-info {
    flex: 1;
    min-width: 0;
}

.co-item-title {
    color: rgb(38, 38, 38);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    text-decoration: none;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    display: -webkit-box;
    overflow: hidden;
    text-overflow: ellipsis;
}

.co-item-title:hover {
    color: rgb(38, 38, 38);
}

.co-item-qty {
    display: block;
    color: rgb(128, 128, 128);
    font-size: 13px;
    margin-top: 3px;
}

.co-item-price {
    color: #000;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.co-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: rgb(66, 69, 83);
    font-size: 14px;
    padding: 6px 0;
}

.co-green {
    color: green;
    font-weight: 600;
}

.co-total {
    border-top: 1px dashed #d5d5d5;
    margin-top: 6px;
    padding-top: 12px;
    color: #000;
    font-size: 17px;
    font-weight: 700;
}

.co-summary-compact {
    padding-top: 10px;
    padding-bottom: 10px;
}

/* ------------------------------------------------------------
   Payment methods
   ------------------------------------------------------------ */
.co-payments {
    list-style: none;
    margin: 0;
    padding: 0;
}

.co-payment {
    border: 1px solid #ececec;
    border-radius: 14px;
    margin-bottom: 14px;
    box-sizing: border-box;
    transition: border-color 0.15s ease-in-out;
}

.co-payment:last-child {
    margin-bottom: 0;
}

.co-payment:has(input:checked) {
    border-color: #000;
    background: #f6f8ff;
}

.co-payment:hover:not(:has(input:checked)) {
    border-color: #c7c7c7;
}

.co-payment-label {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    box-sizing: border-box;
}

.co-payment:has(input:checked) .co-payment-label::after {
    content: "\2713";
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #388e3c;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 22px;
    text-align: center;
    margin-left: auto;
}

.co-payment input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: #000;
    flex-shrink: 0;
    margin: 0;
}

.co-payment input[type="radio"]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(40, 116, 240, 0.35);
    border-radius: 50%;
}

.co-payment-icon {
    color: #000;
    font-size: 19px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.co-payment-logo {
    height: 24px;
    width: auto;
    max-width: 72px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

.co-payment.is-placeholder .co-payment-logo {
    opacity: 0.45;
}

.co-payment-name {
    flex: 1;
    color: rgb(33, 37, 41);
    font-size: 15px;
    font-weight: 600;
}

.co-payment.is-placeholder .co-payment-label {
    cursor: not-allowed;
}

.co-payment.is-placeholder .co-payment-icon,
.co-payment.is-placeholder .co-payment-name {
    opacity: 0.45;
}

.co-coming-soon {
    background: #f4f4f5;
    border-radius: 6px;
    color: rgb(128, 128, 128);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    white-space: nowrap;
}

/* ------------------------------------------------------------
   Sticky bottom CTA (same pattern as product page .product-addtocart-style-0)
   ------------------------------------------------------------ */
.co-sticky-cta {
    z-index: 99999;
    padding: 10px 16px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    bottom: 0;
    position: sticky;
    flex-shrink: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    background: #fff;
}

/* ------------------------------------------------------------
   Submit (matches the Cart page Place Order button)
   ------------------------------------------------------------ */
.co-submit {
    margin-top: 2px;
    background: #000;
    border: 0.8px solid #000;
    border-radius: 15px;
    color: #fff;
    font-family: 'Assistant', sans-serif;
    font-size: 16px;
    font-weight: 700;
    line-height: 24px;
    padding: 0 20px;
    height: 54px;
    width: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    transition: background-color 0.15s ease-in-out;
}

.co-submit:hover {
    background: #424649;
}

.co-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.co-submit[aria-busy="true"] {
    gap: 10px;
}

.co-submit-loader {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: co-spin 0.7s linear infinite;
    flex-shrink: 0;
}

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

/* ------------------------------------------------------------
   Order success page
   ------------------------------------------------------------ */
.co-success-delivery,
.co-success-row {
    color: rgb(33, 37, 41) !important;
    font-size: 15px !important;
}

.co-success-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 6px;
}

.co-success-actions .co-empty-btn {
    margin-top: 0;
}

.co-track-btn {
    display: inline-block;
    background: #fff;
    color: #000;
    border: 1.5px solid #000;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    padding: 10px 28px;
    text-decoration: none;
    box-sizing: border-box;
}

.co-track-btn:hover {
    color: #000;
    background: #f2f2f2;
}

.co-success-anim {
    margin-bottom: 16px;
}

.co-checkmark {
    width: 84px;
    height: 84px;
    display: block;
    margin: 0 auto;
    border-radius: 50%;
}

.co-checkmark-circle {
    stroke: rgb(56, 142, 60);
    stroke-width: 2;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: co-stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.co-checkmark-check {
    stroke: rgb(56, 142, 60);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: co-stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes co-stroke {
    100% {
        stroke-dashoffset: 0;
    }
}

/* ------------------------------------------------------------
   Payment return screen (client components)
   ------------------------------------------------------------ */
.pr-razorpay {
    margin-top: 4px;
}

.pr-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e3e3e3;
    border-top-color: #2874f0;
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: co-spin 0.8s linear infinite;
}

.pr-note {
    color: #666;
    font-size: 13.5px;
    line-height: 1.55;
    max-width: 420px;
    margin: 0 auto 16px;
}

.pr-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 0 12px;
}

.pr-actions {
    margin-top: 2px;
}

.pr-btn {
    border: none;
    border-radius: 8px;
    padding: 12px 28px;
    font-size: 14.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

.pr-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.pr-success {
    background: #388e3c;
    color: #fff;
}

.pr-success:hover:not(:disabled) {
    background: #2e7d32;
}

.pr-failed {
    background: #fff;
    color: #d32f2f;
    border: 1.5px solid #d32f2f;
}

.pr-failed:hover:not(:disabled) {
    background: #fdecea;
}

.pr-again {
    background: none;
    border: none;
    color: #2874f0;
    font-size: 12.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: underline;
    padding: 4px 8px;
}

.pr-again:hover {
    text-decoration: none;
}

/* ------------------------------------------------------------
   Desktop layout
   ------------------------------------------------------------ */
@media (min-width: 768px) {
    .co-layout {
        display: flex;
        align-items: flex-start;
        gap: 20px;
    }

    .co-col {
        flex: 1;
        min-width: 0;
    }

    .co-col:last-child {
        flex: 0 0 360px;
    }

    .co-submit {
        display: block;
    }

    .co-submit[aria-busy="true"] {
        display: flex;
    }
}
