<?php

// sticky-header

if (false === get_option('organic_farm_sticky_header')) {
    add_option('organic_farm_sticky_header', 'off');
}

// Define the custom CSS based on the 'organic_farm_sticky_header' option

if (get_option('organic_farm_sticky_header', 'off') !== 'on') {
    $organic_farm_custom_style .= '.menu_header.fixed {';
    $organic_farm_custom_style .= 'position: static;';
    $organic_farm_custom_style .= '}';
}

if (get_option('organic_farm_sticky_header', 'off') !== 'off') {
    $organic_farm_custom_style .= '.menu_header.fixed {';
    $organic_farm_custom_style .= 'position: fixed; box-shadow: none; background: var(--theme-heading-color);';
    $organic_farm_custom_style .= '}';

    $organic_farm_custom_style .= '.admin-bar .fixed {';
    $organic_farm_custom_style .= ' margin-top: 32px;';
    $organic_farm_custom_style .= '}';
}


//colors
$color = get_theme_mod('organic_grocery_primary_color', '#d30c1f');

$color_heading = get_theme_mod('organic_grocery_heading_color', '#1a2225');

$color_fade = get_theme_mod('organic_grocery_primary_fade', '#fbe2e5');
$slider_overlay = get_theme_mod( 'organic_grocery_slider_overlay','#1a2225');


$organic_farm_custom_style .= ":root {";
    $organic_farm_custom_style .= "--theme-primary-color: {$color};";
    $organic_farm_custom_style .= "--theme-heading-color: {$color_heading};";
    $organic_farm_custom_style .= "--theme-primary-fade: {$color_fade};";
    $organic_farm_custom_style .= "--slider-overlay: {$slider_overlay};";
$organic_farm_custom_style .= "}";

$organic_grocery_slider_heading_color = get_theme_mod( 'organic_grocery_slider_heading_color','#ffffff');
$organic_farm_custom_style .='#slider .carousel-caption h2 {';
$organic_farm_custom_style .='color: '.esc_attr($organic_grocery_slider_heading_color).';';
$organic_farm_custom_style .='}';

$organic_grocery_slider_excerpt_color = get_theme_mod( 'organic_grocery_slider_excerpt_color','#ffffff');
$organic_farm_custom_style .='#slider .slider-excerpt {';
$organic_farm_custom_style .='color: '.esc_attr($organic_grocery_slider_excerpt_color).';';
$organic_farm_custom_style .='}';