/* =========================================================
   CHECKOUT PAGE
========================================================= */

.checkout-page-container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 40px 0 70px;
}

.checkout-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}

.checkout-page-header span {
    display: block;
    margin-bottom: 5px;
    color: #315efb;
    font-size: 13px;
    font-weight: 600;
}

.checkout-page-header h1 {
    margin: 0;
    color: #0f172a;
    font-size: 34px;
}

.checkout-back-cart {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid #dbe4f0;
    border-radius: 10px;
    background: #ffffff;
    color: #334155;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.checkout-back-cart:hover {
    border-color: #315efb;
    color: #315efb;
}

.checkout-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    align-items: start;
    gap: 28px;
}

.checkout-form-card,
.checkout-summary-card {
    border: 1px solid #dbe4f0;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.checkout-form-card {
    padding: 26px;
}

.checkout-summary-card {
    position: sticky;
    top: 105px;
    padding: 24px;
}

.checkout-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.checkout-section-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 11px;
    background: #eef4ff;
    color: #315efb;
    font-size: 17px;
}

.checkout-section-title h2 {
    margin: 0 0 3px;
    color: #0f172a;
    font-size: 20px;
}

.checkout-section-title p {
    margin: 0;
    color: #64748b;
    font-size: 12px;
}

.checkout-form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.checkout-form-group {
    margin-bottom: 17px;
}

.checkout-form-group label {
    display: block;
    margin-bottom: 7px;
    color: #334155;
    font-size: 13px;
    font-weight: 600;
}

.checkout-form-group label span {
    color: #ef4444;
}

.checkout-form-group input,
.checkout-form-group textarea {
    width: 100%;
    padding: 0 13px;
    border: 1px solid #ccd7e6;
    border-radius: 9px;
    outline: none;
    background: #ffffff;
    color: #1e293b;
    font-family: inherit;
    font-size: 13px;
}

.checkout-form-group input {
    height: 45px;
}

.checkout-form-group textarea {
    padding-top: 12px;
    padding-bottom: 12px;
    resize: vertical;
}

.checkout-form-group input:focus,
.checkout-form-group textarea:focus {
    border-color: #315efb;
    box-shadow: 0 0 0 3px rgba(49, 94, 251, 0.1);
}

.delivery-area-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.delivery-area-option {
    display: flex !important;
    align-items: center;
    gap: 10px;
    margin: 0 !important;
    padding: 13px;
    border: 1px solid #ccd7e6;
    border-radius: 10px;
    cursor: pointer;
}

.delivery-area-option:has(input:checked) {
    border-color: #315efb;
    background: #f8faff;
}

.delivery-area-option input {
    width: auto;
    height: auto;
    accent-color: #315efb;
}

.delivery-area-option span {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.delivery-area-option span strong {
    color: #0f172a;
}

.delivery-area-option span small {
    color: #64748b;
    font-size: 11px;
}

[hidden] {
    display: none !important;
}

.checkout-payment-section {
    margin-top: 12px;
    padding-top: 22px;
    border-top: 1px solid #edf2f7;
}

.payment-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    border: 1px solid #315efb;
    border-radius: 11px;
    background: #f8faff;
    cursor: pointer;
}

.payment-option input {
    accent-color: #315efb;
}

.payment-option-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: #ffffff;
    color: #315efb;
}

.payment-option-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.payment-option-content strong {
    color: #0f172a;
    font-size: 13px;
}

.payment-option-content small {
    color: #64748b;
    font-size: 11px;
}

.place-order-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 48px;
    margin-top: 22px;
    border: 1px solid #315efb;
    border-radius: 10px;
    background: #315efb;
    color: #ffffff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.place-order-btn:hover {
    background: #2449d8;
}

.checkout-summary-card h2 {
    margin: 0 0 20px;
    color: #0f172a;
    font-size: 21px;
}

.checkout-products {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.checkout-product-item {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
}

.checkout-product-image {
    position: relative;
    width: 62px;
    height: 62px;
    overflow: visible;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    background: #f8fafc;
}

.checkout-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 9px;
}

.checkout-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #94a3b8;
}

.checkout-product-quantity {
    position: absolute;
    top: -8px;
    right: -8px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: #315efb;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
}

.checkout-product-info h3 {
    margin: 0 0 4px;
    color: #0f172a;
    font-size: 13px;
    line-height: 1.35;
}

.checkout-product-info p {
    margin: 0;
    color: #64748b;
    font-size: 11px;
}

.checkout-product-subtotal {
    color: #0f172a;
    font-size: 13px;
    white-space: nowrap;
}

.checkout-summary-divider {
    height: 1px;
    margin: 18px 0;
    background: #edf2f7;
}

.checkout-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 7px 0;
    color: #64748b;
    font-size: 13px;
}

.checkout-summary-row strong {
    color: #0f172a;
}

.checkout-summary-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.checkout-summary-total span {
    color: #0f172a;
    font-size: 16px;
    font-weight: 700;
}

.checkout-summary-total strong {
    color: #315efb;
    font-size: 24px;
}

.checkout-security-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding: 11px 12px;
    border-radius: 9px;
    background: #f8fafc;
    color: #64748b;
    font-size: 11px;
}

.checkout-security-note i {
    color: #22c55e;
}

.checkout-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    padding: 12px 15px;
    border-radius: 9px;
    font-size: 13px;
}

.checkout-alert-error {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #dc2626;
}

/* Responsive */

@media (max-width: 900px) {
    .checkout-layout {
        grid-template-columns: 1fr;
    }

    .checkout-summary-card {
        position: static;
    }
}

@media (max-width: 650px) {
    .checkout-page-container {
        width: min(100% - 20px, 1180px);
        padding-top: 24px;
    }

    .checkout-page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .checkout-form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .delivery-area-options {
        grid-template-columns: 1fr;
    }

    .checkout-form-card,
    .checkout-summary-card {
        padding: 18px;
    }
}

/* =========================================================
   ORDER SUCCESS PAGE
========================================================= */

.order-success-page {
    width: min(760px, calc(100% - 32px));
    margin: 0 auto;
    padding: 75px 0 80px;
}

.order-success-card {
    padding: 35px;
    border: 1px solid #dbe4f0;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.08);
}

.order-success-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 82px;
    height: 82px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: #ecfdf3;
    color: #16a34a;
    font-size: 38px;
}

.order-success-card > h1 {
    margin: 0 0 8px;
    color: #0f172a;
    font-size: 30px;
    text-align: center;
}

.order-success-message {
    margin: 0 auto 25px;
    color: #64748b;
    font-size: 14px;
    text-align: center;
}

.order-number-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    margin-bottom: 25px;
    padding: 16px;
    border: 1px dashed #a9bdfb;
    border-radius: 11px;
    background: #f6f8ff;
}

.order-number-box span {
    color: #64748b;
    font-size: 12px;
}

.order-number-box strong {
    color: #315efb;
    font-size: 18px;
}

.order-success-info {
    margin-bottom: 25px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

.order-success-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 12px 15px;
    border-bottom: 1px solid #edf2f7;
    font-size: 13px;
}

.order-success-info-row:last-child {
    border-bottom: none;
}

.order-success-info-row span {
    color: #64748b;
}

.order-success-info-row strong {
    color: #0f172a;
    text-align: right;
}

.status-unpaid {
    color: #dc2626 !important;
}

.status-pending {
    color: #d97706 !important;
}

.order-success-products {
    margin-bottom: 25px;
}

.order-success-products h2 {
    margin: 0 0 14px;
    color: #0f172a;
    font-size: 19px;
}

.order-success-product {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 13px 0;
    border-bottom: 1px solid #edf2f7;
}

.order-success-product-info h3 {
    margin: 0 0 4px;
    color: #0f172a;
    font-size: 14px;
}

.order-success-product-info p {
    margin: 0;
    color: #64748b;
    font-size: 12px;
}

.order-success-product > strong {
    color: #0f172a;
    font-size: 14px;
}

.order-success-total {
    padding: 18px;
    border-radius: 12px;
    background: #f8fafc;
}

.order-success-total > div {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 7px 0;
    color: #64748b;
    font-size: 13px;
}

.order-success-total strong {
    color: #0f172a;
}

.order-success-grand-total {
    margin-top: 8px;
    padding-top: 14px !important;
    border-top: 1px solid #dbe4f0;
}

.order-success-grand-total span {
    color: #0f172a;
    font-size: 15px;
    font-weight: 700;
}

.order-success-grand-total strong {
    color: #315efb;
    font-size: 21px;
}

.order-success-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 25px;
}

.success-home-btn,
.success-shop-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.success-home-btn {
    border: 1px solid #dbe4f0;
    background: #ffffff;
    color: #334155;
}

.success-shop-btn {
    border: 1px solid #315efb;
    background: #315efb;
    color: #ffffff;
}

.success-home-btn:hover {
    border-color: #315efb;
    color: #315efb;
}

.success-shop-btn:hover {
    background: #2449d8;
}

@media (max-width: 600px) {
    .order-success-page {
        width: min(100% - 20px, 760px);
        padding-top: 30px;
    }

    .order-success-card {
        padding: 22px 18px;
    }

    .order-success-card > h1 {
        font-size: 25px;
    }

    .order-success-actions {
        grid-template-columns: 1fr;
    }

    .order-success-info-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .order-success-info-row strong {
        text-align: left;
    }
}


.order-success-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 25px;
}

.success-pdf-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    border: 1px solid #ef4444;
    border-radius: 10px;
    background: #ffffff;
    color: #ef4444;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.success-pdf-btn:hover {
    background: #ef4444;
    color: #ffffff;
}

@media (max-width: 650px) {
    .order-success-actions {
        grid-template-columns: 1fr;
    }
}
