<?php
/**
 * Social proof — счётчики (ученики, лет, отзывов, педагогов)
 * .bento .pksh-section
 *
 * @package Dekart
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

$data           = Pksh_Data::instance();
$social_counters = $data->get_social_counters();
$social_icons    = Pksh_Data::social_icons();
?>

<section class="bento pksh-section" aria-label="Социальное доказательство">
	<div class="bento__full">
		<div class="social-counters">
			<?php if ( ! empty( $social_counters ) ) : ?>
				<?php foreach ( $social_counters as $i => $counter ) :
					$icon   = isset( $social_icons[ $i ] ) ? $social_icons[ $i ] : '✅';
					$number = $counter['counter_number'] ?? '';
					$label  = $counter['counter_label'] ?? '';
					if ( empty( $number ) ) { continue; }
				?>
				<div class="social-counter">
					<div class="social-counter__top"></div>
					<div class="social-counter__body">
						<span class="social-counter__icon"><?php echo esc_html( $icon ); ?></span>
						<div class="social-counter__number"><?php echo esc_html( $number ); ?></div>
						<div class="social-counter__label"><?php echo esc_html( $label ); ?></div>
					</div>
				</div>
				<?php endforeach; ?>
			<?php else : ?>
				<!-- Fallback: пока CF не заполнены -->
				<div class="social-counter">
					<div class="social-counter__top"></div>
					<div class="social-counter__body">
						<span class="social-counter__icon">🎓</span>
						<div class="social-counter__number">500+</div>
						<div class="social-counter__label">выпускников в топ-школах</div>
					</div>
				</div>
				<div class="social-counter">
					<div class="social-counter__top"></div>
					<div class="social-counter__body">
						<span class="social-counter__icon">📅</span>
						<div class="social-counter__number">12</div>
						<div class="social-counter__label">лет готовим к школе</div>
					</div>
				</div>
				<div class="social-counter">
					<div class="social-counter__top"></div>
					<div class="social-counter__body">
						<span class="social-counter__icon">⭐</span>
						<div class="social-counter__number">4.8</div>
						<div class="social-counter__label">средняя оценка родителей</div>
					</div>
				</div>
				<div class="social-counter">
					<div class="social-counter__top"></div>
					<div class="social-counter__body">
						<span class="social-counter__icon">👩‍🏫</span>
						<div class="social-counter__number">15+</div>
						<div class="social-counter__label">педагогов высшей категории</div>
					</div>
				</div>
			<?php endif; ?>
		</div>
	</div>
</section>
