/**
 * Smart Location Frontend Styles
 */

/* Clearfix for WPForms wrap container */
.wpforms-smart-location-wrap {
    clear: both;
}

.wpforms-smart-location-wrap::after {
    content: "";
    display: table;
    clear: both;
}

.wpforms-smart-location-wrap .wpforms-sublabel-hide {
    display: none !important;
}

/* WPForms Field Size Compatibility (Small, Medium, Large) */
.wpforms-field-small.wpforms-smart-location-wrap,
.wpforms-field-small .wpforms-smart-location-wrap,
.wpforms-field-small.wpforms-field-smart_location .wpforms-smart-location-wrap {
    max-width: 250px !important;
    width: 100% !important;
}

.wpforms-field-medium.wpforms-smart-location-wrap,
.wpforms-field-medium .wpforms-smart-location-wrap,
.wpforms-field-medium.wpforms-field-smart_location .wpforms-smart-location-wrap {
    max-width: 60% !important;
    width: 100% !important;
}

.wpforms-field-large.wpforms-smart-location-wrap,
.wpforms-field-large .wpforms-smart-location-wrap,
.wpforms-field-large.wpforms-field-smart_location .wpforms-smart-location-wrap {
    max-width: 100% !important;
    width: 100% !important;
}

@media (max-width: 600px) {
    .wpforms-field-medium.wpforms-smart-location-wrap,
    .wpforms-field-medium .wpforms-smart-location-wrap,
    .wpforms-field-medium.wpforms-field-smart_location .wpforms-smart-location-wrap {
        max-width: 100% !important;
    }
}

/* Stacked sub-field row blocks with clean 12px vertical spacing */
.wpforms-smart-location-wrap .wpforms-field-row-block {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-bottom: 12px !important; /* Fix zero-spacing touching issue */
    float: none !important;
    clear: both !important;
    display: block !important;
}

/* Remove bottom margin from the last visible sub-field block */
.wpforms-smart-location-wrap .wpforms-field-row-block:last-child,
.wpforms-smart-location-wrap .wpforms-field-row-block:last-of-type {
    margin-bottom: 0 !important;
}

/* Ensure dropdowns & fallback inputs span 100% of container with standardized height and padding */
.wpforms-smart-location-wrap select,
.wpforms-smart-location-wrap input {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    height: 44px !important;
    padding: 8px 12px !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.wpforms-smart-location-wrap select {
    padding-right: 36px !important;
    
    /* Standardize and center dropdown arrow vertically */
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="20" height="20" fill="%2364748b"><path d="M7 10l5 5 5-5z"/></svg>') !important;
    background-repeat: no-repeat !important;
    background-position: calc(100% - 14px) center !important;
    background-size: 16px !important;
}

/* Spacing for manual fallback input fields when activated */
.wpforms-smart-location-wrap .wpforms-smart-location-other-input {
    margin-top: 8px !important;
}
