/* =============================================
   HJ Theme — Checkout Styles
   ============================================= */

/* ── Wrapper ── */
.hj-checkout-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px 80px;
    min-height: 60vh;
}

/* ── Page title ── */
.hj-checkout-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: #2d1b2e;
    margin: 0 0 24px;
}

/* ── Two-column grid ── */
.hj-checkout-grid {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 32px;
    align-items: start;
}

/* ── Section card ── */
.hj-checkout-section {
    background: #fff;
    border: 1.5px solid #f0e0e5;
    border-radius: 16px;
    padding: 22px 22px 24px;
    margin-bottom: 20px;
}

.hj-checkout-section h3 {
    font-size: 1rem;
    font-weight: 800;
    color: #2d1b2e;
    margin: 0 0 18px;
    padding-bottom: 12px;
    border-bottom: 1.5px solid #f5eff1;
}

/* ── Form elements ── */
.hj-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.hj-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.hj-form-group:last-child {
    margin-bottom: 0;
}

.hj-form-group label {
    font-size: 13px;
    font-weight: 700;
    color: #555;
}

.hj-form-group input,
.hj-form-group textarea,
.hj-form-group select {
    padding: 11px 14px;
    border: 1.5px solid #e8d0d8;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    color: #2d1b2e;
    background: #fff;
    outline: none;
    transition:
        border-color 0.18s,
        box-shadow 0.18s;
    width: 100%;
    box-sizing: border-box;
}

.hj-form-group input:focus,
.hj-form-group textarea:focus {
    border-color: #e8577a;
    box-shadow: 0 0 0 3px rgba(232, 87, 122, 0.1);
}

.hj-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* ── Payment options ── */
.hj-payment-options {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.hj-payment-radio {
    display: none;
}

.hj-payment-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 14px;
    border: 2px solid #e8d0d8;
    border-radius: 12px;
    font-weight: 700;
    font-size: 13px;
    text-align: center;
    transition: all 0.18s;
    background: #fff;
    user-select: none;
    cursor: pointer;
    flex: 1;
    min-width: 90px;
}

/* Generic checked state */
.hj-payment-radio:checked + .hj-payment-label {
    border-width: 2.5px;
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
}

/* Per-method checked colors */
.hj-payment-radio[value='bkash']:checked + .hj-payment-label {
    border-color: #e2136e;
    color: #e2136e;
    background: #fff0f7;
}

.hj-payment-radio[value='nagad']:checked + .hj-payment-label {
    border-color: #f6821f;
    color: #f6821f;
    background: #fff5ee;
}

.hj-payment-radio[value='rocket']:checked + .hj-payment-label {
    border-color: #8b1fc8;
    color: #8b1fc8;
    background: #f8f0ff;
}

.hj-payment-radio[value='cash']:checked + .hj-payment-label {
    border-color: #198754;
    color: #198754;
    background: #f0fff5;
}

.hj-payment-icon {
    font-size: 16px;
}

/* ── Payment info box ── */
.hj-payment-info-box {
    display: none;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 4px;
    font-size: 14px;
    line-height: 1.7;
    border: 1.5px solid #ddd;
    background: #f9f9f9;
}

.hj-payment-info-box.active {
    display: block;
}

/* Number + copy row */
.hj-number-wrap {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 4px 0 10px;
}

.hj-number-text {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.hj-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-left: 4px;
    color: #fff;
    transition: opacity 0.2s;
    font-family: inherit;
}

.hj-copy-btn:hover {
    opacity: 0.85;
}

/* ── Order Summary (right col) — STICKY ── */
.hj-checkout-summary-col {
    height: 100%;
}

.hj-order-summary {
    background: #fff;
    border: 1.5px solid #f0e0e5;
    border-radius: 16px;
    padding: 22px 22px 24px;
    position: sticky;
    top: 90px;
}

.hj-order-summary::-webkit-scrollbar {
    width: 4px;
}

.hj-order-summary::-webkit-scrollbar-thumb {
    background: #f0d8e0;
    border-radius: 4px;
}

.hj-order-summary h3 {
    font-size: 1rem;
    font-weight: 800;
    color: #2d1b2e;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1.5px solid #f5eff1;
    background: #fff;
    z-index: 1;
}

/* Order items */
.hj-order-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 18px;
}

.hj-order-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fdf8f9;
    border-radius: 12px;
    padding: 10px 12px;
}

.hj-order-item img {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.hj-order-item-icon {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    background: #fce4ec;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

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

.hj-order-item-name {
    font-size: 13px;
    font-weight: 700;
    color: #2d1b2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hj-order-item-qty {
    font-size: 12px;
    color: #aaa;
    margin-top: 2px;
}

.hj-order-item-subtotal {
    font-size: 14px;
    font-weight: 800;
    color: #e8577a;
    flex-shrink: 0;
}

/* Totals */
.hj-order-totals {
    border-top: 1.5px solid #f5eff1;
    padding-top: 14px;
    margin-bottom: 18px;
}

.hj-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
    color: #555;
    border-bottom: 1px solid #f9f0f3;
}

.hj-total-row:last-child {
    border-bottom: none;
}

.hj-total-grand {
    font-size: 17px !important;
    font-weight: 800 !important;
    color: #2d1b2e !important;
    padding-top: 12px !important;
    margin-top: 4px;
    border-top: 2px solid #f0e0e5 !important;
    border-bottom: none !important;
}

.hj-total-grand strong {
    color: #e8577a;
    font-size: 20px;
}

/* Error */
.hj-checkout-error {
    background: #fff0f0;
    border: 1.5px solid #ffb3b3;
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 13px;
    color: #c0392b;
    margin-bottom: 14px;
    font-weight: 600;
}

/* Place Order button */
.hj-place-order-btn {
    display: block;
    width: 100%;
    background: #e8577a;
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 15px;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    text-align: center;
    transition:
        background 0.18s,
        transform 0.15s,
        box-shadow 0.18s;
    box-shadow: 0 4px 16px rgba(232, 87, 122, 0.3);
    font-family: inherit;
    letter-spacing: 0.3px;
    margin-bottom: 12px;
}

.hj-place-order-btn:hover {
    background: #d43f64;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(232, 87, 122, 0.38);
}

.hj-place-order-btn:disabled {
    background: #ddd;
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Back link */
.hj-checkout-back-link {
    display: block;
    text-align: center;
    margin-top: 14px;
    font-size: 13px;
    color: #bbb;
    text-decoration: none;
    transition: color 0.15s;
}

.hj-checkout-back-link:hover {
    color: #e8577a;
}

/* ── Empty state ── */
.hj-checkout-empty {
    text-align: center;
    padding: 80px 20px;
}

.hj-checkout-empty span {
    font-size: 4rem;
    display: block;
    margin-bottom: 14px;
}

.hj-checkout-empty h3 {
    font-size: 1.4rem;
    font-weight: 800;
    color: #2d1b2e;
    margin: 0 0 20px;
}

.hj-checkout-back {
    display: inline-block;
    background: #e8577a;
    color: #fff;
    padding: 12px 32px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    transition: background 0.18s;
}

.hj-checkout-back:hover {
    background: #d43f64;
    color: #fff;
}

/* ── Success Modal ── */
.hj-order-success-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.hj-order-success-box {
    background: #fff;
    border-radius: 20px;
    padding: 44px 36px;
    max-width: 440px;
    width: 100%;
    text-align: center;
    box-shadow: 0 12px 50px rgba(0, 0, 0, 0.2);
    animation: hjSuccessPop 0.35s ease both;
}

@keyframes hjSuccessPop {
    from {
        opacity: 0;
        transform: scale(0.88) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.hj-success-icon {
    font-size: 4rem;
    margin-bottom: 12px;
    animation: hjBounce 0.5s 0.2s ease both;
}

@keyframes hjBounce {
    0% {
        transform: scale(0);
    }
    70% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.hj-order-success-box h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: #2d1b2e;
    margin: 0 0 10px;
}

.hj-order-success-box p {
    font-size: 14px;
    color: #888;
    margin: 0 0 16px;
    line-height: 1.6;
}

.hj-order-number {
    background: #fff0f4;
    border: 1.5px solid #f5d0dc;
    border-radius: 10px;
    padding: 10px 18px;
    font-size: 15px;
    font-weight: 800;
    color: #e8577a;
    margin-bottom: 22px;
    display: inline-block;
}

.hj-success-continue-btn {
    display: inline-block;
    background: #e8577a;
    color: #fff;
    padding: 13px 36px;
    border-radius: 30px;
    font-weight: 800;
    font-size: 15px;
    text-decoration: none;
    transition:
        background 0.18s,
        transform 0.15s;
    box-shadow: 0 4px 14px rgba(232, 87, 122, 0.3);
}

.hj-success-continue-btn:hover {
    background: #d43f64;
    color: #fff;
    transform: translateY(-1px);
}

/* ── Responsive ── */
@media (max-width: 820px) {
    .hj-checkout-grid {
        grid-template-columns: 1fr;
    }

    .hj-checkout-summary-col {
        order: -1;
    }
}

@media (max-width: 500px) {
    .hj-form-row {
        grid-template-columns: 1fr;
    }

    .hj-payment-options {
        gap: 8px;
    }

    .hj-payment-label {
        font-size: 12px;
        padding: 10px 8px;
    }
}
