<?php

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template variables passed via extract().
$available_days  = isset( $available_days ) ? $available_days : [];
$visible_columns = isset( $visible_columns ) ? $visible_columns : 7;
$hidden_columns  = isset( $hidden_columns ) ? $hidden_columns : [];
// phpcs:enable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
?>
<style id="sugar-calendar-bookings-calendar-styles">
    .sugar-calendar-bookings-calendar__header,
    .sugar-calendar-bookings-calendar__content,
    .sugar-calendar-bookings-calendar__footer {
        grid-template-columns: repeat(<?php echo esc_attr( $visible_columns ); ?>, minmax(0, 1fr));
    }

	<?php
	// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template variable in foreach loop.
	foreach ( $available_days as $day ) :
		?>

    .sugar-calendar-bookings-calendar__cell--<?php echo esc_attr( $day ); ?> {
        --enabled: 100%;
    }

	<?php endforeach; ?>

	<?php
	// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template variable in foreach loop.
	foreach ( $hidden_columns as $column ) :
		?>

    .sugar-calendar-bookings-calendar__cell--<?php echo esc_attr( $column ); ?> {
        display: none !important;
    }

	<?php endforeach; ?>
</style>
