/* Checkout Styles */
.checkout-header {
    text-align: center;
    margin: 2rem 0;
}

.checkout-title {
    font-size: 2.5rem;
    color: #1e293b;
    font-weight: 700;
}

.checkout-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
    padding: 0 1rem;
}

.payment-section {
    margin-top: 2rem;
    grid-template-columns: 1fr;
}

.checkout-form {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.form-section h2 {
    font-size: 1.5rem;
    color: #1e293b;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.payment-methods {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.payment-method {
    display: flex;
    align-items: flex-start;
    padding: 2rem 1.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    margin-bottom: 1rem;
}

.payment-method:hover {
    border-color: var(--theme-color);
    background-color: rgba(var(--theme-color-rgb), 0.05);
}

.payment-method input[type="radio"] {
    margin-top: 0.5rem;
    margin-right: 1.5rem;
    transform: scale(1.8);
}

[dir="rtl"] .payment-method input[type="radio"] {
    margin-right: 0;
    margin-left: 1.5rem;
}

.payment-method-label {
    flex: 1;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.payment-method-name {
    display: block;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    text-align: center;
}

.payment-method-description {
    display: block;
    color: #64748b;
    font-size: 0.85rem;
    text-align: center;
    margin-bottom: 0.5rem;
}

.payment-provider-link {
    display: inline-block;
    margin-top: 0.5rem;
    color: var(--theme-color);
    font-size: 0.75rem;
    text-decoration: underline;
    transition: opacity 0.2s;
}

.payment-provider-link:hover {
    opacity: 0.8;
}

.payment-instructions {
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.6;
    text-align: center;
    white-space: pre-wrap;
}

.account-details {
    margin-top: 1rem;
    padding-top: 0.5rem;
    border-top: 1px dashed #e2e8f0;
}

.account-details h4 {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    text-align: center;
}

.account-details-content {
    padding: 0.75rem;
    background-color: #f1f5f9;
    border: 2px solid #e2e8f0;
    border-radius: 0.375rem;
    font-family: monospace;
    font-size: 0.85rem;
    white-space: pre-wrap;
    text-align: center;
    direction: ltr;
    font-weight: bold;
    color: #334155;
}

.payment-instruction-note {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #64748b;
    text-align: center;
}

/* Payment method logos */
.payment-method::before {
    content: '';
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.8;
}

[dir="rtl"] .payment-method::before {
    right: auto;
    left: 0.75rem;
}

/* Payment method logos */
.payment-method label[for^="payment_method_"]::before {
    content: '';
    display: block;
    width: 65px;
    height: 70px;
    margin: 0 auto 0.75rem;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Payment method specific logos */
.payment-method label[for*="bank_transfer"]::before {
    background-image: url('https://dakiii.com/saas/img/attijari.png');
}

.payment-method label[for*="cod"]::before {
    background-image: url('https://dakiii.com/saas/img/cod.png');
}

.payment-method label[for*="inwi_money"]::before {
    background-image: url('https://zwaj.ma/images/inwi_money.png');
}

.payment-method label[for*="madmoun"]::before {
    background-image: url('https://zwaj.ma/images/madmoun_logo.svg');
}

.payment-method label[for*="paypal"]::before {
    background-image: url('https://zwaj.ma/images/paypal.svg');
}

.no-payment-methods {
    padding: 1.5rem;
    text-align: center;
    background-color: #fee2e2;
    color: #991b1b;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.form-input:focus {
    outline: none;
    border-color: var(--theme-color, #10b981);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Center form inputs */
.form-input {
    text-align: center;
}

textarea.form-input {
    text-align: center;
}

.checkout-summary {
    position: sticky;
    top: 2rem;
}

.summary-section {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.summary-section h2 {
    font-size: 1.25rem;
    color: #1e293b;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.order-items {
    margin-bottom: 1.5rem;
}

.order-item {
    display: flex;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.order-item:last-child {
    border-bottom: none;
}

.order-item .item-image {
    width: 64px;
    height: 64px;
    border-radius: 0.5rem;
    overflow: hidden;
    margin-right: 1rem;
}

.order-item .item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.order-item .item-details {
    flex: 1;
}

.order-item h3 {
    font-size: 1rem;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.order-item .item-quantity {
    color: #64748b;
    font-size: 0.875rem;
}

.order-item .item-price {
    font-weight: 600;
    color: var(--theme-color);
}

.summary-totals {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    color: #64748b;
}

.summary-row.total {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
    font-weight: 600;
    color: #1e293b;
    font-size: 1.25rem;
}

.place-order-button {
    width: 100%;
    padding: 1rem;
    background: var(--theme-color, #10b981);
    color: #ffffff;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 1.4rem;
    cursor: pointer;
    transition: background 0.2s;
    height: 70px;
}

.place-order-button:hover {
    filter: brightness(110%);
}

@media (max-width: 768px) {
    .checkout-content {
        grid-template-columns: 1fr;
    }

    .checkout-form,
    .checkout-summary {
        margin: 0;
    }

    .checkout-summary {
        position: static;
    }
    
    .payment-section {
        margin-top: 1rem;
    }
}

[dir="rtl"] .order-item .item-image {
    margin-right: 0;
    margin-left: 1rem;
}

[dir="rtl"] .form-group label {
    text-align: right;
}

/* Center form inputs */
.form-input {
    text-align: center;
}

textarea.form-input {
    text-align: center;
}