<?php
/**
 * Section Field Template
 * 
 * This template displays a section for a property.
 * 
 * HOW TO OVERRIDE THIS TEMPLATE:
 * 1. Copy this file from: wp-content/plugins/havenlytics/templates/archive/sections/section.php
 * 2. Paste it to your theme at: wp-content/themes/your-theme/havenlytics/archive/sections/section.php
 * 3. Modify the copied file to customize the section display
 * 
 * @package     Havenlytics
 * @subpackage  Templates/archive/sections
 * @since       2.0.0
 */
if (!defined('ABSPATH')) {
    exit;
}

// Prefix all variables with hvnly_ to avoid global namespace conflicts
$hvnly_section = $args['section'] ?? array();
$hvnly_property_id = $args['property_id'] ?? 0;
$hvnly_fields = $args['fields'] ?? array();

if (empty($hvnly_fields)) {
    return;
}
?>

<div class="hvnly-property-card-section hvnly-property-card-section-<?php echo esc_attr($hvnly_section['id']); ?>">
    <?php 
    $hvnly_renderer = new HvnlyNab\Frontend\PropertyCardRenderer();
    foreach ($hvnly_fields as $hvnly_field): 
        $hvnly_renderer->render_field($hvnly_field, $hvnly_property_id);
    endforeach; 
    ?>
</div>