/* --- Main Layout --- */
#api-checkout-page .checkout-layout {
    display: flex !important;
    align-items: flex-start !important;
    gap: 30px !important;
    justify-content: center;
}

/* --- Form / Customer Details Column (Left) --- */
#api-checkout-page .customer-details {
    max-width: 600px;
    display: flex;
    flex-direction: column;
    flex: 2 !important;
    min-width: 300px !important;
    order: 1 !important;
}
.summary-total {
    margin-top: 30px;
}
form#custom-checkout-form {
    display: flex;
    flex-direction: column;
    gap: 20px; /* Space between each form row */
}

#api-checkout-page .form-row {
    display: flex;
    flex-direction: column;
    gap: 5px; /* Space between label and input */
}

#api-checkout-page .form-row label {
    display: block !important;
}

#api-checkout-page .form-row input {
    width: 100% !important;           /* FIX: Uncommented to make inputs full-width */
    padding: 10px !important;          /* FIX: Uncommented for better input spacing */
    box-sizing: border-box !important;
    font-size: 16px !important;
}

#api-checkout-page #checkout-message {
    margin-top: 15px !important;
}

/* --- Order Summary Column (Right) --- */
#api-checkout-page .order-summary {
    display: flex;
    flex-direction: column;
    max-width: 600px;
    flex: 1 !important;
    min-width: 300px !important;
    /*order: 2 !important;*/
    background-color: #f7f7f7 !important;
    padding: 20px !important;
    border-radius: 5px !important;
}

div#summary-items-container {
    display: flex;
    flex-direction: column;
    gap: 15px; /* Space between each item in the cart */
}

/* FIX: This section is updated for a side-by-side image/text layout */
.summary-item {
    display: flex !important;
    /* flex-direction: row; is the default, no need to declare it */
    align-items: center !important; /* Vertically aligns image and text */
    gap: 15px !important;
}
.summary-item-image {
    display: flex
}
.summary-item-image img {
    display:flex;
    width: 60px !important;
    height: 60px !important;
    object-fit: cover !important;
    border-radius: 4px !important;
    width: 60px !important;
    height: 60px !important;
}

.summary-item-details {
    display: flex !important;
    justify-content: space-between !important;
    width: 100% !important;
}


/* --- General Styling for all inputs and dropdowns --- */
/* We modify this rule to include 'select' so dropdowns match the input fields */
#api-checkout-page .form-row input,
#api-checkout-page .form-row select {
    width: 100% !important;
    padding: 10px !important;
    box-sizing: border-box !important;
    font-size: 16px !important;
    border: 1px solid #ccc !important; /* Added for consistent styling */
    border-radius: 4px !important;
}

/* --- New CSS for the Phone Input Group --- */
/* This container will hold the country code and phone number side-by-side */
.phone-input-group {
    display: flex !important;
}

/* Style for the country code dropdown */
.phone-input-group select#phone-code {
    flex: 0 0 auto; /* Let it take its natural width */
    border-right: none !important; /* Merge the border with the input field */
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

/* Style for the phone number input next to it */
.phone-input-group input#phone {
    flex: 1 1 auto; /* Allow it to fill the remaining space */
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

/* Style for the country code dropdown */
.phone-input-group select#phone-code {
    width: 85px !important; /* Explicitly set a smaller width */
    flex-shrink: 0 !important; /* Prevent it from shrinking further */
    border-right: none !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

/* --- Responsive Styles for Small Screens --- */
@media (max-width: 768px) {

    /* 1. Stack the main columns vertically instead of side-by-side */
    #api-checkout-page .checkout-layout {
        flex-direction: column !important;
    }

    /* 2. Make the order summary appear FIRST in the vertical stack */
    #api-checkout-page .order-summary {
        order: 1 !important;
        max-width: 100% !important; /* Optional: Allow it to use full width on mobile */
    }

    /* 3. Make the customer details form appear SECOND in the vertical stack */
    #api-checkout-page .customer-details {
        order: 2 !important;
        max-width: 100% !important; /* Optional: Allow it to use full width on mobile */
    }
    .summary-item-details {
        /* 1. Change layout from horizontal to vertical */
        flex-direction: column !important;

        /* 2. Align items to the left instead of spreading them out */
        align-items: flex-start !important;

        /* 3. Add a small gap between the stacked name and price */
        gap: 5px !important;
    }
}


/*pesapal*/

/* 1. Container Polish */
.entry-content.alignwide.wp-block-post-content {
    background: #ffffff;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    max-width: 900px !important;
    margin: 40px auto;
}

/* 2. Style Order Details Header */
ul.order_details {
    display: flex;
    background: #f8faff;
    padding: 25px;
    border-radius: 12px;
    list-style: none;
    justify-content: space-between;
    border: 1px solid #e2e8f0;
    margin-bottom: 40px;
}

ul.order_details li {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #64748b;
    border-right: 1px solid #cbd5e1;
    padding-right: 20px;
    flex: 1;
    text-align: center;
}

ul.order_details li:last-child {
    border-right: none;
}

ul.order_details li strong {
    display: block;
    font-size: 1.1rem;
    color: #1e293b;
    text-transform: none;
    margin-top: 5px;
}

/* 3. Highlight the Total Amount */
ul.order_details li.total strong span {
    color: #2c5aa0;
    font-weight: 800;
}

/* 4. Payment Section Heading */
p strong:contains("Powered by PesaPal") {
    display: block;
    font-size: 1.2rem;
    color: #1e293b;
    margin: 30px 0 15px;
    text-align: center;
}

/* 5. The PesaPal Iframe Container */
#pesapal-iframe-holder {
    background: #ffffff;
    border: 2px solid #f1f5f9;
    border-radius: 12px;
    overflow: hidden;
    padding: 10px;
}

/* 6. Styling the Loader */
#pesapal-iframe-loader-msg {
    padding: 60px 0;
    background: #ffffff;
}

#loader-img {
    width: 50px;
    filter: hue-rotate(190deg); /* Adjusts loader color to match your blue */
}

#loader-text {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    color: #64748b;
    letter-spacing: 0.5px;
}

/* 7. Hide duplicate content if your code is printing twice */
/* If you see the payment box twice, use this: */
#pesapal-iframe-holder ~ #pesapal-iframe-holder {
    display: none;
}
body > div.wp-site-blocks > header > header > div{
    display:none!important;
}

/* 8. Mobile Adjustments */
@media (max-width: 600px) {
    ul.order_details {
        flex-direction: column;
        gap: 15px;
    }
    ul.order_details li {
        border-right: none;
        border-bottom: 1px solid #cbd5e1;
        padding-bottom: 10px;
        padding-right: 0;
    }
    ul.order_details li:last-child {
        border-bottom: none;
    }
}