<?php
/**
 * Classic header layout — Logo | Nav | utilities.
 *
 * @package Kutby
 * @since   2.6.0
 */

declare(strict_types=1);

namespace Kutby\Header\Layouts;

use Kutby\Header\Components\CTAButton;
use Kutby\Header\Components\Logo;
use Kutby\Header\Components\MobileToggle;
use Kutby\Header\Components\Navigation;
use Kutby\Header\Components\Search;
use Kutby\Header\Contracts\HeaderLayoutInterface;
use Kutby\Header\Support\HeaderContext;

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

/**
 * Class ClassicHeader
 */
final class ClassicHeader implements HeaderLayoutInterface {

	/**
	 * {@inheritdoc}
	 */
	public function id(): string {
		return 'classic';
	}

	/**
	 * {@inheritdoc}
	 */
	public function label(): string {
		return 'كلاسيكي';
	}

	/**
	 * {@inheritdoc}
	 */
	public function option_keys(): array {
		return array(
			'height',
			'menu_position',
			'show_search',
			'search_style',
			'cta_enabled',
			'cta_text',
			'cta_url',
		);
	}

	/**
	 * {@inheritdoc}
	 */
	public function render( HeaderContext $ctx ): void {
		?>
		<header class="kutby-header kutby-header--classic">
			<div class="kutby-container kutby-header__inner">
				<?php Logo::render( $ctx ); ?>
				<?php MobileToggle::render( $ctx ); ?>
				<?php
				Navigation::render(
					$ctx,
					array(
						'position' => $ctx->string( 'menu_position', 'right' ),
					)
				);
				?>
				<div class="kutby-header__utilities">
					<?php Search::render( $ctx ); ?>
					<?php CTAButton::render( $ctx ); ?>
				</div>
			</div>
		</header>
		<?php
	}
}
