/* ========================================
   IP Checkout Page Styles
   ======================================== */

.ip-checkout-page {
    font-family: 'Vazirmatn', -apple-system, sans-serif;
    direction: rtl;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    color: var(--ip-dark);
}

/* Header */
.ip-checkout-header {
    background: linear-gradient(135deg, var(--ip-primary), #8b5cf6);
    color: white;
    padding: 30px 40px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 20px 50px rgba(99,102,241,0.25);
}
.ip-checkout-header h1 {
    margin: 0 0 8px;
    font-size: 32px;
    color: white;
    font-weight: 900;
}
.ip-checkout-header p {
    margin: 0;
    opacity: 0.95;
    font-size: 15px;
}

/* Grid */
.ip-checkout-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 30px;
    align-items: start;
}

/* Product Info */
.ip-checkout-product {
    display: grid;
    grid-template-columns: 100px 1fr auto;
    gap: 20px;
    background: white;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--ip-border);
    margin-bottom: 24px;
    align-items: center;
}
.ip-cp-image {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--ip-light);
}
.ip-cp-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.ip-cp-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 40px;
    opacity: 0.5;
}
.ip-cp-info h3 {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 800;
}
.ip-cp-info p {
    margin: 0;
    font-size: 13px;
    color: var(--ip-gray);
    line-height: 1.6;
}
.ip-cp-price {
    text-align: left;
}
.ip-cp-price-old {
    display: block;
    font-size: 13px;
    color: #94a3b8;
    text-decoration: line-through;
}
.ip-cp-price-new {
    font-size: 24px;
    font-weight: 900;
    color: var(--ip-primary);
}

/* Coupon */
.ip-checkout-coupon {
    background: white;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--ip-border);
    margin-bottom: 24px;
}
.ip-checkout-coupon > label {
    display: block;
    font-weight: 700;
    margin-bottom: 12px;
    font-size: 14px;
}
.ip-coupon-input {
    display: flex;
    gap: 10px;
}
.ip-coupon-input input {
    flex: 1;
    padding: 12px 14px;
    border: 2px solid var(--ip-border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.ip-coupon-input input:focus {
    outline: none;
    border-color: var(--ip-primary);
}
.ip-coupon-msg {
    margin-top: 10px;
    font-size: 13px;
}
.ip-coupon-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #d1fae5;
    color: #065f46;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
}
.ip-coupon-tag button {
    background: none;
    border: none;
    color: #065f46;
    cursor: pointer;
    font-size: 14px;
    padding: 0 4px;
}
.ip-coupon-tag button:hover { color: var(--ip-danger); }
.ip-coupon-summary {
    margin-top: 12px;
    padding: 12px;
    background: var(--ip-light);
    border-radius: 10px;
    font-size: 13px;
}
.ip-coupon-summary > div {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
}

/* Methods */
.ip-checkout-methods {
    background: white;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--ip-border);
    margin-bottom: 24px;
}
.ip-checkout-methods h2 {
    font-size: 18px;
    font-weight: 800;
    margin: 0 0 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--ip-border);
}
.ip-methods-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}
.ip-method-option {
    cursor: pointer;
}
.ip-method-option input { display: none; }
.ip-method-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    border: 2px solid var(--ip-border);
    border-radius: 12px;
    transition: all 0.2s;
    text-align: center;
}
.ip-method-option.active .ip-method-card {
    border-color: var(--ip-primary);
    background: #eef2ff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99,102,241,0.15);
}
.ip-method-icon {
    font-size: 32px;
    margin-bottom: 8px;
}
.ip-method-card strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
    color: var(--ip-dark);
}
.ip-method-card small {
    font-size: 12px;
    color: var(--ip-gray);
}

/* Method Sections */
.ip-method-section {
    display: none;
    animation: ipFadeIn 0.3s ease;
}
.ip-method-section.active { display: block; }

@keyframes ipFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Network Select */
.ip-network-select {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}
.ip-network-option { cursor: pointer; }
.ip-network-option input { display: none; }
.ip-network-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    border: 2px solid var(--ip-border);
    border-radius: 12px;
    transition: all 0.2s;
    text-align: center;
}
.ip-network-option.active .ip-network-card {
    border-color: var(--ip-primary);
    background: #eef2ff;
}
.ip-network-icon {
    font-size: 24px;
    margin-bottom: 6px;
}
.ip-network-card strong {
    font-size: 14px;
    color: var(--ip-dark);
}
.ip-network-card small {
    font-size: 11px;
    color: var(--ip-gray);
}

/* Wallet Info */
.ip-wallet-info {
    margin-bottom: 20px;
}
.ip-wallet-info > label {
    display: block;
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 8px;
}
.ip-wallet-address {
    display: flex;
    gap: 8px;
}
.ip-wallet-address input {
    flex: 1;
    padding: 12px 14px;
    background: var(--ip-light);
    border: 2px solid var(--ip-border);
    border-radius: 10px;
    font-family: monospace;
    font-size: 13px;
}
.ip-copy-btn {
    padding: 12px 20px;
    background: var(--ip-primary);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
}
.ip-copy-btn:hover { background: var(--ip-primary-dark); }

.ip-wallet-note {
    margin-top: 10px;
    padding: 12px 14px;
    background: #fef3c7;
    border-radius: 10px;
    font-size: 13px;
    color: #92400e;
    border-right: 4px solid var(--ip-warning);
}
.ip-wallet-note strong {
    color: #78350f;
    font-weight: 900;
}

/* TX Input */
.ip-tx-input > label {
    display: block;
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 8px;
}
.ip-tx-input input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--ip-border);
    border-radius: 10px;
    font-family: monospace;
    font-size: 13px;
}
.ip-tx-input input:focus {
    outline: none;
    border-color: var(--ip-primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.ip-tx-input small {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--ip-gray);
}

/* PayPal Info */
.ip-paypal-info {
    text-align: center;
    padding: 30px 20px;
    background: #eff6ff;
    border-radius: 12px;
}
.ip-paypal-icon {
    font-size: 48px;
    margin-bottom: 12px;
}
.ip-paypal-info h3 {
    margin: 0 0 8px;
    font-size: 18px;
    color: #1e40af;
}
.ip-paypal-info p {
    margin: 0;
    font-size: 14px;
    color: #1e40af;
    line-height: 1.7;
}

/* Sidebar */
.ip-checkout-sidebar {
    position: sticky;
    top: 100px;
}
.ip-order-summary {
    background: white;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--ip-border);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.ip-order-summary h3 {
    font-size: 18px;
    font-weight: 800;
    margin: 0 0 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--ip-border);
}
.ip-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 14px;
}
.ip-summary-row span { color: var(--ip-gray); }
.ip-summary-row strong { color: var(--ip-dark); font-weight: 700; }
.ip-summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    margin-top: 12px;
    border-top: 2px dashed var(--ip-border);
    font-size: 16px;
}
.ip-summary-total span { color: var(--ip-gray); font-weight: 700; }
.ip-summary-total strong {
    font-size: 24px;
    color: var(--ip-success);
    font-weight: 900;
}
.ip-summary-security {
    margin-top: 16px;
    padding: 12px;
    background: #ecfdf5;
    border-radius: 10px;
    text-align: center;
    font-size: 13px;
    color: #065f46;
    font-weight: 700;
}

/* Payment Message */
.ip-payment-msg {
    margin-top: 16px;
    font-size: 14px;
}

/* Cart Products */
.ip-checkout-products {
    background: white;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--ip-border);
    margin-bottom: 24px;
}
.ip-cart-product {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--ip-light);
    align-items: center;
}
.ip-cart-product:last-child { border-bottom: none; }
.ip-cart-product .ip-cp-image {
    width: 80px;
    height: 80px;
}

/* Pending Box */
.ip-pending-box,
.ip-owned-box,
.ip-payment-result {
    max-width: 600px;
    margin: 60px auto;
    background: white;
    border-radius: 24px;
    padding: 50px 40px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.08);
    border: 1px solid var(--ip-border);
}
.ip-pending-icon,
.ip-owned-icon,
.ip-result-icon {
    font-size: 80px;
    margin-bottom: 20px;
}
.ip-pending-box h2,
.ip-owned-box h2,
.ip-payment-result h1 {
    font-size: 26px;
    font-weight: 900;
    margin: 0 0 16px;
    color: var(--ip-dark);
}
.ip-pending-info,
.ip-result-summary {
    background: var(--ip-light);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    text-align: right;
}
.ip-pending-info > div,
.ip-result-summary > div {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}
.ip-pending-info span,
.ip-result-summary span { color: var(--ip-gray); }
.ip-pending-info strong,
.ip-result-summary strong { color: var(--ip-dark); }

.ip-pending-actions,
.ip-result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
    flex-wrap: wrap;
}

/* Login Required */
.ip-checkout-login-required {
    max-width: 500px;
    margin: 60px auto;
    background: white;
    border-radius: 24px;
    padding: 50px 40px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.08);
}
.ip-checkout-icon {
    font-size: 80px;
    margin-bottom: 20px;
}
.ip-checkout-login-required h2 {
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 12px;
}
.ip-checkout-login-required p {
    color: var(--ip-gray);
    margin: 0 0 24px;
}
.ip-checkout-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Empty State */
.ip-empty-state {
    max-width: 500px;
    margin: 60px auto;
    background: white;
    border-radius: 24px;
    padding: 60px 40px;
    text-align: center;
    border: 2px dashed var(--ip-border);
}
.ip-empty-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* Payment Result */
.ip-payment-success { border-color: var(--ip-success); }
.ip-payment-failed { border-color: var(--ip-danger); }

/* Responsive */
@media (max-width: 900px) {
    .ip-checkout-grid { grid-template-columns: 1fr; }
    .ip-checkout-sidebar { position: static; }
    .ip-methods-grid,
    .ip-network-select { grid-template-columns: 1fr; }
    .ip-checkout-product {
        grid-template-columns: 80px 1fr;
        grid-template-areas: "image info" "price price";
    }
    .ip-cp-image { grid-area: image; width: 80px; height: 80px; }
    .ip-cp-info { grid-area: info; }
    .ip-cp-price { grid-area: price; text-align: right; margin-top: 12px; }
}

@media (max-width: 600px) {
    .ip-checkout-page { padding: 0 12px; margin: 20px auto; }
    .ip-checkout-header { padding: 20px; border-radius: 16px; }
    .ip-checkout-header h1 { font-size: 22px; }
    .ip-coupon-input { flex-direction: column; }
    .ip-wallet-address { flex-direction: column; }
    .ip-pending-actions,
    .ip-result-actions,
    .ip-checkout-buttons { flex-direction: column; }
    .ip-pending-actions .ip-btn,
    .ip-result-actions .ip-btn,
    .ip-checkout-buttons .ip-btn { width: 100%; }
}