/**
 * FlexCheckout Frontend Styles
 */

/* Field visibility animations */
.flexcheckout-field-hidden {
    display: none !important;
}

.flexcheckout-field-hiding {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    margin: 0 !important;
    padding: 0 !important;
    transition: opacity 0.3s ease, max-height 0.3s ease, margin 0.3s ease, padding 0.3s ease;
}

.flexcheckout-field-showing {
    opacity: 1;
    max-height: 200px;
    transition: opacity 0.3s ease, max-height 0.3s ease;
}

/* Animation: Fade */
.flexcheckout-animation-fade .flexcheckout-field-hiding {
    opacity: 0;
}

.flexcheckout-animation-fade .flexcheckout-field-showing {
    opacity: 1;
}

/* Animation: Slide */
.flexcheckout-animation-slide .flexcheckout-field-hiding {
    max-height: 0;
    opacity: 0;
}

.flexcheckout-animation-slide .flexcheckout-field-showing {
    max-height: 200px;
    opacity: 1;
}

/* Custom field styling */
.flexcheckout-field {
    margin-bottom: 20px;
}

.flexcheckout-field label {
    display: block;
    margin-bottom: 5px;
}

.flexcheckout-field label .required {
    color: #e2401c;
}

.flexcheckout-field input,
.flexcheckout-field select,
.flexcheckout-field textarea {
    width: 100%;
}

/* Section headings */
.flexcheckout-field-heading {
    margin-top: 30px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

.flexcheckout-field-heading h3 {
    margin: 0;
    font-size: 18px;
}

/* File upload field */
.flexcheckout-file-upload {
    position: relative;
    padding: 20px;
    border: 2px dashed #ddd;
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
}

.flexcheckout-file-upload:hover {
    border-color: #999;
}

.flexcheckout-file-upload.dragover {
    border-color: #2271b1;
    background: rgba(34, 113, 177, 0.05);
}

.flexcheckout-file-upload input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.flexcheckout-file-upload-text {
    color: #666;
}

.flexcheckout-file-upload-preview {
    margin-top: 10px;
}

.flexcheckout-file-upload-preview img {
    max-width: 100px;
    max-height: 100px;
}

/* Pro file field styling */
.flexcheckout-file-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f9f9f9;
}

.flexcheckout-file-wrapper .flexcheckout-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.flexcheckout-file-wrapper .flexcheckout-file-name {
    flex: 1;
    color: #666;
    font-size: 14px;
}

.flexcheckout-file-wrapper .flexcheckout-file-name.has-file {
    color: #2271b1;
    font-weight: 500;
}

.flexcheckout-file-wrapper .flexcheckout-file-remove {
    cursor: pointer;
    color: #b32d2e;
    font-size: 18px;
    font-weight: bold;
    padding: 0 5px;
}

.flexcheckout-file-wrapper .flexcheckout-file-remove:hover {
    color: #a00;
}

.flexcheckout-file-wrapper .flexcheckout-file-info {
    width: 100%;
    color: #999;
    font-size: 12px;
    margin-top: 5px;
}

.flexcheckout-file-wrapper::before {
    content: "📎";
    font-size: 20px;
}

/* Section Heading field */
.flexcheckout-heading-field {
    margin-top: 30px !important;
    margin-bottom: 20px !important;
    padding: 0 !important;
}

.flexcheckout-heading-field .flexcheckout-section-heading {
    margin: 0 0 5px;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    padding-bottom: 10px;
    border-bottom: 2px solid #ddd;
}

.flexcheckout-heading-field .flexcheckout-section-description {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* HTML field */
.flexcheckout-html-field {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #2271b1;
}

.flexcheckout-html-field p:last-child {
    margin-bottom: 0;
}

/* Multiselect field */
.flexcheckout-multiselect {
    min-height: 100px;
}

/* Date/Time picker native styling */
input[type="date"].input-text,
input[type="time"].input-text,
input[type="datetime-local"].input-text {
    padding: 8px 12px;
    font-size: 14px;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Date/Time picker enhancements */
.flexcheckout-datepicker,
.flexcheckout-timepicker {
    position: relative;
}

.flexcheckout-datepicker::after,
.flexcheckout-timepicker::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* Radio buttons styling */
.flexcheckout-radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.flexcheckout-radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
}

.flexcheckout-radio-option input[type="radio"] {
    width: auto;
    margin: 0;
}

/* Checkbox styling */
.flexcheckout-checkbox-field {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.flexcheckout-checkbox-field input[type="checkbox"] {
    width: auto;
    margin-top: 3px;
}

/* Validation error styling */
.flexcheckout-field.woocommerce-invalid input,
.flexcheckout-field.woocommerce-invalid select,
.flexcheckout-field.woocommerce-invalid textarea {
    border-color: #e2401c;
}

.flexcheckout-field .flexcheckout-error {
    color: #e2401c;
    font-size: 13px;
    margin-top: 5px;
}

/* Required field indicator */
.flexcheckout-field.validate-required label::after {
    content: ' *';
    color: #e2401c;
}

/* Debug mode indicator */
.flexcheckout-debug-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    max-width: 400px;
    max-height: 300px;
    overflow: auto;
    padding: 15px;
    background: #1d2327;
    color: #fff;
    font-family: monospace;
    font-size: 12px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 99999;
}

.flexcheckout-debug-panel h4 {
    margin: 0 0 10px;
    color: #00a32a;
}

.flexcheckout-debug-panel .debug-item {
    margin-bottom: 5px;
    padding: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.flexcheckout-debug-panel .debug-label {
    color: #72aee6;
}

/* Additional Information section in order details */
.woocommerce-additional-fields h2 {
    margin-top: 30px;
    font-size: 20px;
}

/* Custom field in order table */
.flexcheckout-custom-field-row th {
    font-weight: normal;
    color: #666;
}

/* ======================================
   Field Width Classes
   ====================================== */
.form-row.form-row-half {
    float: left;
    width: 48%;
    margin-right: 4%;
}

.form-row.form-row-half:nth-child(2n) {
    margin-right: 0;
}

.form-row.form-row-third {
    float: left;
    width: 31.33%;
    margin-right: 3%;
}

.form-row.form-row-third:nth-child(3n) {
    margin-right: 0;
}

.form-row.form-row-quarter {
    float: left;
    width: 23%;
    margin-right: 2.66%;
}

.form-row.form-row-quarter:nth-child(4n) {
    margin-right: 0;
}

/* Clearfix for field rows */
.woocommerce-billing-fields::after,
.woocommerce-shipping-fields::after,
.woocommerce-additional-fields::after {
    content: "";
    display: table;
    clear: both;
}

/* ======================================
   Pricing Indicator
   ====================================== */
.flexcheckout-price-indicator {
    font-weight: normal;
    font-size: 0.85em;
    color: #2ecc71;
    margin-left: 5px;
}

/* ======================================
   Date Picker Field
   ====================================== */
.flexcheckout-type-date input[type="date"],
.flexcheckout-type-datetime input[type="datetime-local"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 100%;
    font-size: 14px;
}

/* ======================================
   Time Picker Field
   ====================================== */
.flexcheckout-type-time input[type="time"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 100%;
    font-size: 14px;
}

/* ======================================
   Color Picker Field
   ====================================== */
.flexcheckout-colorpicker {
    width: 60px;
    height: 40px;
    padding: 0;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.flexcheckout-colorpicker::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.flexcheckout-colorpicker::-webkit-color-swatch {
    border: none;
    border-radius: 2px;
}

/* ======================================
   Range Slider Field
   ====================================== */
.flexcheckout-range-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
}

.flexcheckout-range {
    flex: 1;
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    background: #ddd;
    border-radius: 4px;
    outline: none;
}

.flexcheckout-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #2271b1;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.flexcheckout-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #2271b1;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.flexcheckout-range-value {
    min-width: 40px;
    text-align: center;
    font-weight: bold;
    color: #333;
}

/* ======================================
   Multi-Select Field
   ====================================== */
.flexcheckout-multiselect {
    min-height: 100px;
}

/* ======================================
   Image Select Field
   ====================================== */
.flexcheckout-image-select-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.flexcheckout-image-option {
    position: relative;
    cursor: pointer;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    transition: all 0.2s ease;
    min-width: 80px;
}

.flexcheckout-image-option:hover {
    border-color: #2271b1;
}

.flexcheckout-image-option.selected,
.flexcheckout-image-option input:checked + img,
.flexcheckout-image-option input:checked ~ span {
    border-color: #2271b1;
}

.flexcheckout-image-option.selected {
    border-color: #2271b1;
    background: #f0f6fc;
}

.flexcheckout-image-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.flexcheckout-image-option img {
    max-width: 60px;
    max-height: 60px;
    display: block;
    margin: 0 auto 8px;
}

.flexcheckout-image-option span {
    display: block;
    font-size: 12px;
    color: #333;
}

/* ======================================
   File Upload Field
   ====================================== */
.flexcheckout-file-wrapper {
    position: relative;
}

.flexcheckout-file-dropzone {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    background: #fafafa;
    transition: all 0.2s ease;
    cursor: pointer;
}

.flexcheckout-file-dropzone:hover,
.flexcheckout-file-dropzone.dragover {
    border-color: #2271b1;
    background: #f0f6fc;
}

.flexcheckout-file-dropzone .dashicons {
    font-size: 40px;
    width: 40px;
    height: 40px;
    color: #999;
    margin-bottom: 10px;
}

.flexcheckout-file-dropzone p {
    margin: 0;
    color: #666;
}

.flexcheckout-file-info {
    margin-top: 10px;
    padding: 10px;
    background: #f0f6fc;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flexcheckout-file-name {
    font-weight: 500;
}

.flexcheckout-file-remove {
    color: #dc3545;
    cursor: pointer;
    padding: 5px;
}

/* ======================================
   Heading/Section Field
   ====================================== */
.flexcheckout-type-heading {
    margin-top: 30px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

.flexcheckout-type-heading label {
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
}

/* ======================================
   Paragraph Field
   ====================================== */
.flexcheckout-paragraph {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
    padding: 10px 0;
}

/* ======================================
   Checkbox Group Field
   ====================================== */
.flexcheckout-checkbox-group-field {
    margin-bottom: 15px;
}

.flexcheckout-checkbox-group-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
}

.flexcheckout-checkbox-group-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.flexcheckout-checkbox-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    transition: all 0.2s ease;
}

.flexcheckout-checkbox-option:hover {
    border-color: #2271b1;
    background: #f8f9fa;
}

.flexcheckout-checkbox-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
}

.flexcheckout-checkbox-option input[type="checkbox"]:checked + .flexcheckout-checkbox-label {
    font-weight: 500;
    color: #2271b1;
}

.flexcheckout-checkbox-option:has(input:checked) {
    border-color: #2271b1;
    background: #f0f6fc;
}

.flexcheckout-checkbox-label {
    flex: 1;
    font-size: 14px;
    color: #333;
}

/* Inline checkbox group variant */
.flexcheckout-checkbox-group-inline .flexcheckout-checkbox-group-wrapper {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
}

.flexcheckout-checkbox-group-inline .flexcheckout-checkbox-option {
    flex: 0 1 auto;
}

/* ======================================
   Multi-File Upload Field
   ====================================== */
.flexcheckout-multifile-wrapper {
    display: block;
}

.flexcheckout-multifile-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    background: #f9f9f9;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.flexcheckout-multifile-dropzone:hover,
.flexcheckout-multifile-dropzone.dragover {
    border-color: #0073aa;
    background: #f0f6fc;
}

.flexcheckout-multifile-dropzone .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: #999;
    margin-bottom: 10px;
}

.flexcheckout-multifile-text {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.flexcheckout-multifile-hint {
    font-size: 12px;
    color: #777;
    margin-top: 5px;
}

.flexcheckout-multifile-input {
    display: none;
}

.flexcheckout-multifile-list {
    list-style: none;
    margin: 10px 0 0 0;
    padding: 0;
}

.flexcheckout-multifile-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 5px;
}

.flexcheckout-multifile-item .dashicons {
    color: #666;
}

.flexcheckout-multifile-name {
    flex: 1;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.flexcheckout-multifile-remove {
    background: none;
    border: none;
    color: #d63638;
    font-size: 18px;
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
}

.flexcheckout-multifile-remove:hover {
    color: #a00;
}

.flexcheckout-multifile-info {
    display: block;
    margin-top: 8px;
    color: #777;
    font-size: 12px;
}

/* ======================================
   Radio with Images Field
   ====================================== */
.flexcheckout-radio-images-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.flexcheckout-radio-image-option {
    position: relative;
    cursor: pointer;
}

.flexcheckout-radio-image-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.flexcheckout-radio-image-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #fff;
    transition: all 0.2s ease;
    min-width: 80px;
    text-align: center;
}

.flexcheckout-radio-image-box:hover {
    border-color: #999;
}

.flexcheckout-radio-image-option.selected .flexcheckout-radio-image-box,
.flexcheckout-radio-image-input:checked + .flexcheckout-radio-image-box {
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.flexcheckout-radio-image-box img {
    max-width: 80px;
    max-height: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
    margin-bottom: 8px;
    border-radius: 4px;
}

.flexcheckout-radio-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: #f5f5f5;
    border-radius: 4px;
    margin-bottom: 8px;
}

.flexcheckout-radio-image-placeholder .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: #ccc;
}

.flexcheckout-radio-image-label {
    font-size: 13px;
    color: #333;
    line-height: 1.3;
}

.flexcheckout-radio-image-check {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background: #0073aa;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
}

.flexcheckout-radio-image-check .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    color: #fff;
}

.flexcheckout-radio-image-option.selected .flexcheckout-radio-image-check,
.flexcheckout-radio-image-input:checked + .flexcheckout-radio-image-box .flexcheckout-radio-image-check {
    display: flex;
}

/* ======================================
   Radio with Colors Field
   ====================================== */
.flexcheckout-radio-colors-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
}

.flexcheckout-radio-color-option {
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.flexcheckout-radio-color-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.flexcheckout-radio-color-swatch {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #ddd;
    transition: all 0.2s ease;
    box-shadow: inset 0 0 0 2px #fff;
}

.flexcheckout-radio-color-swatch:hover {
    border-color: #999;
    transform: scale(1.1);
}

.flexcheckout-radio-color-option.selected .flexcheckout-radio-color-swatch,
.flexcheckout-radio-color-input:checked + .flexcheckout-radio-color-swatch {
    border-color: #0073aa;
    border-width: 3px;
    transform: scale(1.1);
}

.flexcheckout-radio-color-check {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
}

.flexcheckout-radio-color-check .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.flexcheckout-radio-color-option.selected .flexcheckout-radio-color-check,
.flexcheckout-radio-color-input:checked + .flexcheckout-radio-color-swatch .flexcheckout-radio-color-check {
    display: block;
}

.flexcheckout-radio-color-label {
    font-size: 11px;
    color: #666;
    text-align: center;
    max-width: 50px;
    line-height: 1.2;
}

/* ======================================
   Responsive Adjustments
   ====================================== */
@media (max-width: 768px) {
    .form-row.form-row-half,
    .form-row.form-row-third,
    .form-row.form-row-quarter {
        float: none;
        width: 100%;
        margin-right: 0;
    }

    .flexcheckout-radio-group {
        gap: 8px;
    }
    
    .flexcheckout-debug-panel {
        max-width: 300px;
        font-size: 11px;
    }

    .flexcheckout-image-select-wrapper {
        gap: 10px;
    }

    .flexcheckout-image-option {
        min-width: 70px;
    }
    
    .flexcheckout-radio-images-wrapper {
        gap: 10px;
    }
    
    .flexcheckout-radio-image-box img {
        max-width: 60px;
        max-height: 60px;
    }
    
    .flexcheckout-radio-colors-wrapper {
        gap: 8px;
    }
    
    .flexcheckout-radio-color-swatch {
        width: 32px;
        height: 32px;
    }
    
    .flexcheckout-multifile-dropzone {
        padding: 20px 15px;
    }
}

/* Spinning animation for upload loading */
@keyframes fc-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.flexcheckout-multifile-item.loading .dashicons {
    animation: fc-spin 1s linear infinite;
}

/* ======================================
   Inline Validation Styles
   ====================================== */
.flexcheckout-validated {
    position: relative;
}

.flexcheckout-validation-indicator {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
}

.flexcheckout-validated.validating .flexcheckout-validation-indicator {
    display: flex;
    background: #f0f0f0;
    color: #666;
}

.flexcheckout-validated.validating .flexcheckout-validation-indicator::before {
    content: "...";
}

.flexcheckout-validated.valid .flexcheckout-validation-indicator {
    display: flex;
    background: #d4edda;
    color: #28a745;
}

.flexcheckout-validated.valid .flexcheckout-validation-indicator::before {
    content: "✓";
}

.flexcheckout-validated.invalid .flexcheckout-validation-indicator {
    display: flex;
    background: #f8d7da;
    color: #dc3545;
}

.flexcheckout-validated.invalid .flexcheckout-validation-indicator::before {
    content: "✗";
}

/* Input styling for validation states */
.flexcheckout-validated input:not([type="checkbox"]):not([type="radio"]),
.flexcheckout-validated textarea,
.flexcheckout-validated select {
    padding-right: 35px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.flexcheckout-validated.valid input:not([type="checkbox"]):not([type="radio"]),
.flexcheckout-validated.valid textarea,
.flexcheckout-validated.valid select {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 1px #28a745;
}

.flexcheckout-validated.invalid input:not([type="checkbox"]):not([type="radio"]),
.flexcheckout-validated.invalid textarea,
.flexcheckout-validated.invalid select {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 1px #dc3545;
}

/* Inline error message */
.flexcheckout-validation-message {
    display: none;
    font-size: 12px;
    margin-top: 5px;
    padding: 5px 10px;
    border-radius: 4px;
}

.flexcheckout-validated.invalid .flexcheckout-validation-message {
    display: block;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.flexcheckout-validated.valid .flexcheckout-validation-message.success-message {
    display: block;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Character counter */
.flexcheckout-char-counter {
    font-size: 11px;
    color: #666;
    text-align: right;
    margin-top: 3px;
}

.flexcheckout-char-counter.warning {
    color: #ffc107;
}

.flexcheckout-char-counter.error {
    color: #dc3545;
}

/* ======================================
   Google Places Autocomplete
   ====================================== */
.flexcheckout-places-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4285f4;
    pointer-events: none;
}

.flexcheckout-places-icon .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Make room for the icon */
#billing_address_1,
#shipping_address_1 {
    padding-right: 35px;
}

/* Google Places Autocomplete dropdown styling */
.pac-container {
    z-index: 999999 !important;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    font-family: inherit;
    font-size: 14px;
}

.pac-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    line-height: 1.4;
}

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

.pac-item:hover,
.pac-item-selected {
    background-color: #f7f7f7;
}

.pac-icon {
    display: none;
}

.pac-item-query {
    font-weight: 600;
    color: #333;
}

.pac-matched {
    font-weight: 700;
}

/* Hide "Powered by Google" logo in dropdown */
.pac-logo::after {
    display: none;
}

/* Address autocomplete active state */
#billing_address_1.pac-target-input:focus,
#shipping_address_1.pac-target-input:focus {
    border-color: #4285f4;
    box-shadow: 0 0 0 1px #4285f4;
}
