.cpof-form-container {
    max-width: 100%;
    margin: 0 auto;
    font-family: Arial, sans-serif;
}

.cpof-preview-container {
    position: relative;
    margin-bottom: 20px;
    text-align: center;
    background: #f5f5f5;
    padding: 10px;
    border-radius: 8px;
    overflow: hidden;
}

.cpof-plate-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.cpof-plate-text-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 40px; /* Adjust based on image size */
    font-weight: bold;
    color: #000;
    font-family: "Charles Wright", "Arial Black", sans-serif;
    text-transform: uppercase;
    white-space: nowrap;
    letter-spacing: 2px;
}

.cpof-order-form {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.cpof-form-group {
    margin-bottom: 20px;
}

.cpof-form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 5px;
}

.cpof-half-width {
    flex: 1;
    margin-bottom: 15px; /* Adjust margin if needed to align with other fields */
}

@media (max-width: 480px) {
    .cpof-form-row {
        flex-direction: column;
        gap: 0;
    }
    .cpof-half-width {
        margin-bottom: 20px;
    }
}

.cpof-form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}

#cpof_order_form .cpof-form-group input[type="text"],
#cpof_order_form .cpof-form-group input[type="email"],
#cpof_order_form .cpof-form-group input[type="tel"],
#cpof_order_form .cpof-form-group select,
#cpof_order_form .cpof-form-group textarea {
    width: 100% !important;
    min-height: 56px !important;
    border-radius: 14px !important;
    border: 1px solid #EDEDED !important;
    padding: 16px 18px !important;
    background: #fff !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 19.6px !important;
    color: #24272C !important;
    box-sizing: border-box !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
}

#cpof_order_form .cpof-form-group select {
    min-height: 56px !important;
}

#cpof_order_form .cpof-form-group input[type="text"]:focus,
#cpof_order_form .cpof-form-group input[type="email"]:focus,
#cpof_order_form .cpof-form-group input[type="tel"]:focus,
#cpof_order_form .cpof-form-group select:focus,
#cpof_order_form .cpof-form-group textarea:focus {
    outline: none !important;
    border-color: #C3C552 !important;
    box-shadow: 0 0 0 3px rgba(195, 197, 82, 0.12) !important;
}

.cpof-radio-group label {
    display: inline-block;
    margin-right: 15px;
    font-weight: normal;
}

.cpof-total-price {
    margin: 20px 0;
    font-size: 18px;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.cpof-btn {
    background: #C3C552;
    color: #000;
    border: none;
    padding: 12px 20px;
    min-height: 56px !important;
    font-size: 16px;
    border-radius: 14px !important;
    cursor: pointer;
    width: 100%;
    font-weight: bold;
}

.cpof-btn:hover {
    background: #bbbd49;
}

.cpof-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
    display: none;
}

.cpof-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.cpof-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Product Selection Styles */
.cpof-product-option {
    transition: all 0.3s ease !important;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.cpof-product-option:hover {
    box-shadow: 0 4px 12px rgba(195, 197, 82, 0.3);
    transform: translateY(-4px);
    border-color: #C3C552 !important;
}

/* Product Image Preview */
#cpof_preview_product_image {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background: #f9f9f9;
}

/* Order Summary Styles */
.cpof-order-summary {
    position: sticky;
    top: 20px;
}

/* Payment Method Selection */
input[type="radio"][name="payment_method"] {
    cursor: pointer;
}

label[style*="flex: 1"] input[type="radio"]:checked {
    accent-color: #C3C552;
}

label[style*="flex: 1"]:has(input[type="radio"]:checked) {
    border-color: #C3C552 !important;
    background: #fffef0 !important;
}

label[style*="flex: 1"]:hover {
    border-color: #C3C552;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cpof-steps-container {
        flex-direction: column !important;
    }

    .cpof-step {
        flex: 1 !important;
    }
}

/* Responsive improvements */
@media (max-width: 1024px) {
    /* Slightly reduce gaps on tablet */
    .cpof-products-list {
        gap: 12px;
    }
}

@media (max-width: 768px) {
    /* Collapse products to single column on small tablets / large phones */
    .cpof-products-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    /* Make order summary flow under products and not stick */
    .cpof-order-summary {
        position: static;
        margin-top: 18px;
    }

    /* Ensure buttons are comfortable and full width on small screens */
    .cpof-btn {
        padding: 12px 14px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    /* Mobile: single column product list */
    .cpof-products-list {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    /* Product card sizing for mobile */
    .cpof-product-option {
        min-height: 200px; /* keep consistent visual height */
        padding: 10px;
    }

    .cpof-product-option img {
        height: auto; /* user's requested image height preserved */
    }

    /* Form rows stack cleanly */
    .cpof-form-row {
        flex-direction: column;
        gap: 12px;
    }

    .cpof-half-width {
        width: 100%;
        margin-bottom: 12px;
        flex: none;
    }

    /* Preview image should scale on mobile */
    .cpof-preview-container .cpof-plate-image {
        max-height: 160px;
        width: auto;
        height: auto;
    }

    /* Make the form container use available width and add comfortable padding */
    .cpof-form-container {
        max-width: 100% !important;
        padding: 0 12px;
        box-sizing: border-box;
    }

    .cpof-order-form {
        padding: 16px;
        width: 100%;
        box-sizing: border-box;
    }

    /* Force inputs/selects/textarea to use full width on mobile */
    .cpof-order-form .cpof-form-group input[type="text"],
    .cpof-order-form .cpof-form-group input[type="email"],
    .cpof-order-form .cpof-form-group input[type="tel"],
    .cpof-order-form .cpof-form-group select,
    .cpof-order-form .cpof-form-group textarea {
        width: 100% !important;
    min-height: 56px !important;
        display: block;
        box-sizing: border-box;
    }

    /* Make primary buttons clearly full-width on mobile */
    .cpof-btn {
        width: 100% !important;
    min-height: 56px !important;
    }

    .cpof-message {
        width: 100%;
        box-sizing: border-box;
    }
}

.cpof-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9999;
    padding: 20px;
}

.cpof-modal-content {
    background: #fff;
    padding: 34px 30px;
    border-radius: 14px;
    max-width: 560px;
    min-width: 320px;
    width: 90%;
    min-height: 240px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.cpof-modal-content h3 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 26px;
}

.cpof-modal-content p {
    margin-bottom: 24px;
    font-size: 16px;
    color: #333;
}

.cpof-modal-content .cpof-btn {
    width: auto;
    min-width: 140px;
}
