.minimog-inline-checkout {
    margin-top: 50px;
    margin-bottom: 50px;
    border-radius: 5px;
    background-color: #ffffff;
}

/* Two-column layout */
.minimog-inline-checkout-container {
    display: flex;
    flex-direction: row;
    max-width: full-width;
    margin: 0 auto;
}

/* Video column (left) */
.minimog-inline-checkout-video {
    flex: 1;
    max-width: 50%;
}

.video-wrapper {
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.video-wrapper video,
.video-wrapper iframe {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    display: block;
}

.video-description {
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.video-description h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 20px;
    color: #333;
}

.video-description p {
    margin: 0;
    color: #666;
    line-height: 1.5;
}

/* Form column (right) */
.minimog-inline-checkout-form {
    flex: 1;
    max-width: 50%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    padding: 30px;
    border-radius: 5px;
}

.minimog-inline-checkout-wrapper {
    max-width: 100%;
    margin: 0 auto;
}

.minimog-inline-checkout h2 {
    margin-bottom: 30px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.minimog-inline-checkout h3 {
    margin-bottom: 20px;
    font-size: 18px;
    padding-top: 5px;
    font-weight: 500;
    color: #444;
}

.minimog-inline-checkout .form-row {
    margin-bottom: 20px;
}

.minimog-inline-checkout label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
}

.minimog-inline-checkout input[type="text"],
.minimog-inline-checkout input[type="tel"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 15px;
    transition: border-color 0.3s ease;
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.minimog-inline-checkout input[type="text"]:focus,
.minimog-inline-checkout input[type="tel"]:focus {
    border-color: #999;
    outline: none;
}

.minimog-inline-checkout .woocommerce-invalid input {
    border-color: #e2401c;
    box-shadow: 0 0 2px 1px rgba(226, 64, 28, 0.2);
}

.minimog-inline-checkout .place-order {
    text-align: center;
}

.minimog-inline-checkout .place-order button {
    padding: 12px 30px;
    font-size: 16px;
    text-transform: uppercase;
    width: 100%;
    max-width: 300px;
    border-radius: 3px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.minimog-inline-checkout .place-order button:hover {
    opacity: 0.9;
}

.minimog-inline-checkout .woocommerce-error {
    margin: 0 0 20px;
    padding: 10px 15px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    color: #721c24;
}

.minimog-inline-checkout .processing-message {
    color: #555;
    font-size: 14px;
    margin-top: 15px;
    padding: 15px;
    background-color: rgba(0, 123, 255, 0.05);
    border: 1px solid rgba(0, 123, 255, 0.1);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.minimog-inline-checkout .processing-message span {
    font-weight: 500;
}

/* Animated spinner */
.loader-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid rgba(0, 123, 255, 0.1);
    border-radius: 50%;
    border-top-color: #007bff;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Button spinner specific styles */
.button-spinner {
    width: 16px;
    height: 16px;
    border-width: 2px;
    border-color: rgba(255, 255, 255, 0.2);
    border-top-color: #ffffff;
    margin-right: 8px;
    vertical-align: middle;
    box-shadow: none;
}

/* Styling for button in loading state */
.button.loading {
    opacity: 0.8;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.minimog-inline-checkout .woocommerce-form__label {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.minimog-inline-checkout .woocommerce-form__input-checkbox {
    margin-right: 8px;
}

.minimog-inline-checkout .shipping_address {
    padding: 15px;
    margin-top: 10px;
    margin-bottom: 20px;
    background-color: #f1f1f1;
    border-radius: 4px;
}

.minimog-inline-checkout .payment_methods {
    list-style: none;
    padding: 0;
    margin: 0;
}

.minimog-inline-checkout .payment_methods li {
    margin-bottom: 10px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.minimog-inline-checkout .payment_methods input[type="radio"] {
    margin-right: 8px;
}

.minimog-inline-checkout textarea {
    height: 100px;
}

/* Form field styles with icons */
.input-icon-wrapper {
    position: relative;
    display: block;
}

.input-icon {
    position: absolute;
    left: 0;
    top: 0;
    width: 48px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f9f9f9;
    border-right: 1px solid #e0e0e0;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
    color: #666;
}

.input-icon i {
    font-size: 18px;
}

.woocommerce-checkout .input-text {
    padding-left: 58px !important;
    height: 50px;
    border: 1px solid #e0e0e0 !important;
    border-radius: 4px !important;
    background: #fff;
    font-size: 16px;
}

.woocommerce-checkout .form-row label {
    font-weight: 600;
    margin-bottom: 5px;
}

/* Submit button */
#inline_place_order {
    width: 100%;
    height: 54px;
    background-color: #00c853;
    color: white;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 4px;
    margin-top: 15px;
    text-transform: none;
}

#inline_place_order:hover {
    background-color: #00a844;
}

/* Product info in form */
.woocommerce-billing-fields h3 {
    font-size: 22px;
    margin-bottom: 20px;
    text-align: center;
}

/* RTL text support for Arabic placeholders */
input::placeholder {
    text-align: right;
    direction: rtl;
}

/* Product info at the top of the form */
.inline-checkout-product-info {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.inline-checkout-product-image {
    width: 60px;
    margin-right: 15px;
}

.inline-checkout-product-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.inline-checkout-product-details {
    flex: 1;
}

.inline-checkout-product-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
    line-height: 1.3;
}

.inline-checkout-product-price {
    font-size: 18px;
    font-weight: bold;
    color: #000;
}

/* Form field spacing */
.woocommerce-billing-fields__field-wrapper p {
    margin-bottom: 15px;
}

/* Adjust form title */
.woocommerce-billing-fields h3 {
    font-size: 20px;
    margin-bottom: 25px;
    text-align: center;
    font-weight: 600;
}

/* Ensure fields have correct size */
.woocommerce-checkout .form-row {
    margin: 0 0 15px;
}

/* Additional shadow to inputs */
.woocommerce-checkout .input-text:focus {
    box-shadow: 0 0 5px rgba(0, 200, 83, 0.3);
    border-color: #00c853 !important;
    outline: none;
}

/* Mobile responsive styling */
@media (max-width: 767px) {
    .minimog-inline-checkout {
        padding: 20px 15px;
        margin-top: 30px;
        margin-bottom: 30px;
    }
    
    .minimog-inline-checkout-container {
        flex-direction: column;
    }
    
    .minimog-inline-checkout-video,
    .minimog-inline-checkout-form {
        max-width: 100%;
    }
    
    .minimog-inline-checkout h2 {
        font-size: 20px;
    }
    
    .minimog-inline-checkout .place-order button {
        width: 100%;
    }
}

/* Hide cart when buy now is clicked */
body.buy-now-clicked .cart-canvas-content,
body.buy-now-clicked .cart-canvas-overlay,
.cart-canvas-content.hide-cart,
.cart-canvas-overlay.hide-cart {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    transform: translate3d(100%, 0, 0) !important;
    transition: none !important;
    animation: none !important;
    pointer-events: none !important;
    z-index: -1 !important;
}

body.buy-now-clicked {
    overflow: auto !important;
    padding-right: 0 !important;
}

/* Override any theme animations or transitions */
.buy-now-active * {
    animation-play-state: paused !important;
    transition: none !important;
}

/* Alternative method to keep cart closed */
@keyframes hideCart {
    0%, 100% {
        visibility: hidden !important;
        opacity: 0 !important;
        transform: translate3d(100%, 0, 0) !important;
    }
}

.minimog-inline-checkout .col2-set,
.minimog-inline-checkout #customer_details {
    background-color: #ffffff;
    border-radius: 6px;
}

.minimog-inline-checkout .woocommerce-billing-fields {
    padding: 10px;
}

.minimog-inline-checkout .woocommerce-billing-fields__field-wrapper {
    background-color: #ffffff;
}

.inline-checkout-section {
    margin-bottom: 50px;
    padding: 30px;
    border-radius: 5px;
    background-color: #ffffff;
}

/* Loading spinner */
.loader-spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 4px solid #00c853;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.processing-message {
    text-align: center;
    margin-top: 20px;
    font-weight: bold;
}

/* Product info in form */
.woocommerce-billing-fields h3 {
    font-size: 22px;
    margin-bottom: 20px;
    text-align: center;
}

/* Product info at the top of the form */
.inline-checkout-product-info {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.inline-checkout-product-image {
    width: 60px;
    margin-right: 15px;
}

.inline-checkout-product-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.inline-checkout-product-details {
    flex: 1;
}

.inline-checkout-product-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
    line-height: 1.3;
}

.inline-checkout-product-price {
    font-size: 18px;
    font-weight: bold;
    color: #000;
}

/* Form field spacing */
.woocommerce-billing-fields__field-wrapper p {
    margin-bottom: 15px;
}

/* Adjust form title */
.woocommerce-billing-fields h3 {
    font-size: 20px;
    margin-bottom: 25px;
    text-align: center;
    font-weight: 600;
}

/* Ensure fields have correct size */
.woocommerce-checkout .form-row {
    margin: 0 0 15px;
}

/* Additional shadow to inputs */
.woocommerce-checkout .input-text:focus {
    box-shadow: 0 0 5px rgba(0, 200, 83, 0.3);
    border-color: #00c853 !important;
    outline: none;
}

/* Inline form field styles for labels and inputs on the same line */
.field-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 8px;
}

/* Label styling */
.field-wrapper label {
    flex: none;
    margin-bottom: 5px !important;
    font-size: 15px;
    white-space: nowrap;
    color: #333;
}

/* Input wrapper */
.field-wrapper .input-icon-wrapper {
    flex: none;
    width: 100%;
    min-width: 0;
}
/* Adjust the form spacing */
.woocommerce-billing-fields__field-wrapper {
    margin-top: 20px;
}

.woocommerce-billing-fields__field-wrapper p.form-row {
    margin-bottom: 20px !important;
}

/* Responsive layout */
@media (max-width: 767px) {
    .field-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .field-wrapper label,
    .field-wrapper .input-icon-wrapper {
        flex: 0 0 100%;
        width: 100%;
    }
}

/* Make sure the inputs look good */
.minimog-inline-checkout input[type="text"],
.minimog-inline-checkout input[type="tel"] {
    margin: 0;
    border-radius: 4px !important;
}

/* Ensure icons fit nicely */
.input-icon {
    width: 45px;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

/* Refine inputs with icons */
.input-icon-wrapper input {
    height: 48px !important;
    padding-left: 55px !important;
}

/* Adjust title and spacing for the inline layout */
.woocommerce-billing-fields h3 {
    margin-bottom: 25px;
    text-align: left;
    font-size: 18px;
    font-weight: 500;
    color: #444;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

/* Make the form fields cleaner */
.minimog-inline-checkout .col2-set {
    margin-bottom: 20px;
}

/* Adjust input field sizing */
.input-icon-wrapper {
    width: 100%;
    height: 48px;
}

/* Strengthen label visibility */
.field-wrapper label {
    font-weight: 500;
}

/* Add a subtle hover effect to inputs */
.minimog-inline-checkout input[type="text"]:hover,
.minimog-inline-checkout input[type="tel"]:hover {
    border-color: #bbb !important;
}

/* Make the checkout button more prominent */
.minimog-inline-checkout .form-row.place-order {
    margin-top: 25px;
}

/* Custom styling for required asterisk */
.required {
    color: #e2401c;
    font-weight: 700;
    border: 0 !important;
}

/* Error message styling */
.checkout-error-message {
    margin-bottom: 15px;
    padding: 10px 15px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    color: #721c24;
}

.checkout-error-message p {
    margin: 0;
    font-size: 14px;
}

/* Processing message styling */
.processing-message {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
    padding: 15px;
    margin-top: 15px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Make sure loading is only shown when explicitly triggered */
.processing-message.force-hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
} 

/* Define the bounce animation keyframes */
@keyframes buttonBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Apply the bounce animation to the button */
.astra-buy-now-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(90deg, #ff7300 0%, #ffb347 100%) !important;
    color: #fff !important;
    font-weight: bold;
    font-size: 1rem;
    border: none !important;
    border-radius: 6px;
    padding: 22px 0;
    margin-top: 8px;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-shadow: none !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background 0.2s, box-shadow 0.2s;
    gap: 12px;

    /* Bounce Animation Properties */
    animation: 1.5s infinite !important;
    animation-duration: 1.5s !important;
    animation-timing-function: ease !important;
    animation-delay: 0s !important;
    animation-iteration-count: infinite !important;
    animation-direction: normal !important;
    animation-fill-mode: none !important;
    animation-play-state: running !important;
    animation-name: buttonBounce !important;
    animation-timeline: auto !important;
    animation-range-start: normal !important;
    animation-range-end: normal !important;
}

.astra-buy-now-button:hover {
    background: linear-gradient(90deg, #ff8c1a 0%, #ffd580 100%) !important;
    box-shadow: 0 4px 16px rgba(255, 115, 0, 0.15);
}

.astra-buy-now-button i {
    margin-right: 16px;
    font-size: 1rem;
}

.astra-buy-now-button .arabic-text {
    font-family: 'Arial', sans-serif;
    margin-left: 6px;
    font-weight: bold;
    font-size: 1rem;
}

/* Make sure the container allows the button to be full width */
.single_add_to_cart_button,
.astra-buy-now-button {
    min-width: 0;
    flex: 1 1 100%;
}

/* Add spacing between the two buttons */
.single_add_to_cart_button {
    border-radius: 6px !important;
    font-size: 1rem !important;
    padding: 14px 0 !important;
    min-width: 180px;
    background-color: white !important;
    border: #000 solid 1px !important;
    border-color: #000 !important;
    color: #000 !important;
    width: 100% !important;
}

/* Responsive for mobile */
@media (max-width: 600px) {
    .cart-row {
        flex-direction: row;
        gap: 10px;
        align-items: center;
    }
    .cart-row .quantity {
        width: auto;
        flex-shrink: 0;
    }
    .cart-row .add-to-cart-custom {
        flex-grow: 1;
        width: 100%;
    }
    .astra-buy-now-button {
        font-size: 1rem;
        padding: 14px 0;
        border-radius: 10px;
    }
    .astra-buy-now-button i,
    .astra-buy-now-button .arabic-text {
        font-size: 1rem;
    }
    .single_add_to_cart_button {
        font-size: 1rem !important;
        padding: 12px 0 !important;
        border-radius: 6px !important;
    }
}

button.astra-buy-now-button,
.single_add_to_cart_button.astra-buy-now-button,
.astra-buy-now-button {
    background: linear-gradient(90deg, #ff7300 0%, #ffb347 100%) !important;
    color: #fff !important;
    border: none !important;
    box-shadow: none !important;
}

button.astra-buy-now-button.button,
button.astra-buy-now-button.alt,
.single_add_to_cart_button.astra-buy-now-button.button,
.single_add_to_cart_button.astra-buy-now-button.alt {
    background: linear-gradient(90deg, #ff7300 0%, #ffb347 100%) !important;
    color: #fff !important;
    border: none !important;
    box-shadow: none !important;
}

/* Ensure the form stacks its children vertically */
.cart.custom-cart-layout {
    margin-top: 20px; /* Adjust this value as needed */
    display: flex;
    flex-direction: column;
    gap: 15px; /* Add spacing between rows */
}

/* Make the quantity label visible and position it correctly */
.cart.custom-cart-layout .quantity {
    display: flex;
    flex-direction: column; /* Stack label and input vertically */
    /* Remove flex-shrink/grow if set elsewhere for quantity */
    flex-shrink: 0;
    flex-grow: 0;
}

.cart.custom-cart-layout label[for^="quantity_"] {
    position: static;
    clip: auto;
    height: auto;
    width: auto;
    margin: 0 0 5px 0; /* Space below the label */
    overflow: visible;
    clip-path: none;
    font-weight: bold; /* Match image appearance */
    display: block; /* Ensure it takes its own line */
    text-align: left; /* Align label to the left */
}

/* Ensure the cart row lays out its children horizontally */
.cart-row {
    display: flex;
    align-items: center;
    gap: 15px; /* Add spacing between quantity and add to cart button */
    width: 100%; /* Make sure the row takes full width */
}

/* Style the quantity input field to match the image */
.cart-row .quantity input.input-text.qty.text {
    background-color: #f0f0f0;
    border: none !important;
    border-radius: 8px;
    text-align: center;
    padding: 10px 5px;
    width: 90px; /* Adjust width as needed */
    height: 45px; /* Adjust height as needed */
    margin: 0; /* Remove default margins */
}
.input-text.qty.text {
    margin-top: 18px !important; /* Adjust margin to match image */
}

/* Style the plus and minus buttons if they are part of the quantity wrapper */
.quantity .qib-button {
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 8px !important; /* Adjust padding */
    color: #333 !important; /* Darker color for buttons */
    font-size: 20px !important; /* Larger size for buttons */
}

.quantity .qib-button:hover {
    color: #000 !important;
}

/* Allow the add to cart button to take available space */
.cart-row .add-to-cart-custom {
    flex-grow: 1;
}

/* Ensure the buy now button takes full width */
button.astra-buy-now-button {
    width: 100%;
    /* Existing styles for button appearance */
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(90deg, #ff7300 0%, #ffb347 100%) !important;
    color: #fff !important;
    font-weight: bold;
    font-size: 2rem;
    border: none !important;
    border-radius: 12px;
    padding: 22px 0;
    margin-top: 8px;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-shadow: none !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background 0.2s, box-shadow 0.2s;
    gap: 12px;

    /* Bounce Animation Properties */
    animation: 1.5s infinite !important;
    animation-duration: 1.5s !important;
    animation-timing-function: ease !important;
    animation-delay: 0s !important;
    animation-iteration-count: infinite !important;
    animation-direction: normal !important;
    animation-fill-mode: none !important;
    animation-play-state: running !important;
    animation-name: buttonBounce !important;
    animation-timeline: auto !important;
    animation-range-start: normal !important;
    animation-range-end: normal !important;
}

.astra-buy-now-button:hover {
    background: linear-gradient(90deg, #ff8c1a 0%, #ffd580 100%) !important;
    box-shadow: 0 4px 16px rgba(255, 115, 0, 0.15);
}

.astra-buy-now-button i {
    margin-right: 16px;
    font-size: 2.2rem;
}

.astra-buy-now-button .arabic-text {
    font-family: 'Arial', sans-serif;
    margin-left: 12px;
    font-weight: bold;
    font-size: 1.2rem;
}

/* Adjust the quantity input margin to prevent interference from label styles */
.quantity input[type="number"] {
    margin: 0 !important;
}

/* Responsive for mobile */
@media (max-width: 600px) {
    .cart-row {
        flex-direction: row;
        gap: 10px;
        align-items: center;
        width: 100%;
    }
    .cart-row .quantity {
        width: auto;
        flex-shrink: 0;
    }
    .cart-row .add-to-cart-custom {
        flex-grow: 1;
    }
    .astra-buy-now-button {
        font-size: 1rem;
        padding: 14px 0;
        border-radius: 10px;
    }
    .astra-buy-now-button i,
    .astra-buy-now-button .arabic-text {
        font-size: 1rem;
    }
    .single_add_to_cart_button {
        font-size: 1rem !important;
        padding: 12px 0 !important;
        border-radius: 6px !important;
    }
}