/**
 * Header & Footer Styles
 * 
 * @package lemonx-starter
 */

/* ===== CSS Variables (Customizer values injected via inline styles) ===== */
:root {
    --header-bg: #ffffff;
    --header-text: #333333;
    --header-hover: #0073aa;
    --topbar-bg: #333333;
    --topbar-text: #ffffff;
    --footer-bg: #1a1a1a;
    --footer-text: #cccccc;
    --footer-link: #ffffff;
    --footer-hover: #0073aa;
    --cta-bg: #0073aa;
    --cta-text: #ffffff;
    --back-to-top-bg: #0073aa;
}

/* ===== Container ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =========================================================================
   TOP BAR
   ========================================================================= */

.top-bar {
    background-color: var(--topbar-bg);
    color: var(--topbar-text);
    font-size: 14px;
    line-height: 1.4;
}

.top-bar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px;
    gap: 20px;
}

.top-bar a {
    color: inherit;
    text-decoration: none;
}

.top-bar a:hover {
    opacity: 0.8;
}

.top-bar-left,
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

@media (max-width: 768px) {
    .top-bar-inner {
        flex-direction: column;
        text-align: center;
        gap: 5px;
    }
}

/* =========================================================================
   HEADER - BASE STYLES
   ========================================================================= */

.site-header {
    background-color: var(--header-bg);
    color: var(--header-text);
    position: relative;
    z-index: 100;
}

.site-header.header-border {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.site-header.header-transparent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background-color: transparent;
}

.site-header.header-transparent.header-border {
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

/* Header Inner */
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    gap: 20px;
}

.header-inner.container {
    padding-left: 20px;
    padding-right: 20px;
}

/* ===== Sticky Header ===== */
.site-header.header-sticky {
    position: sticky;
    top: 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.site-header.header-sticky.is-scrolled {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.site-header.header-sticky.sticky-scroll-up.is-hidden {
    transform: translateY(-100%);
}

/* Transparent header when scrolled */
.site-header.header-transparent.is-scrolled {
    background-color: var(--header-bg);
}

/* =========================================================================
   HEADER - BRANDING
   ========================================================================= */

.site-branding {
    flex-shrink: 0;
}

.site-branding a {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.site-branding img,
.custom-logo {
    width: auto;
    height: auto;
    max-width: 100%;
}

.site-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.site-description {
    font-size: 12px;
    margin: 2px 0 0;
    opacity: 0.7;
}

/* =========================================================================
   HEADER - NAVIGATION
   ========================================================================= */

.main-navigation {
    display: none;
}

@media (min-width: 992px) {
    .main-navigation {
        display: block;
    }
}

.primary-menu {
    display: flex;
    align-items: center;
    gap: 5px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.primary-menu li {
    position: relative;
}

.primary-menu a {
    display: block;
    padding: 10px 15px;
    color: var(--header-text);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.primary-menu a:hover,
.primary-menu .current-menu-item > a,
.primary-menu .current-menu-ancestor > a {
    color: var(--header-hover);
}

/* Dropdown menus */
.primary-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--header-bg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    list-style: none;
    z-index: 100;
}

.primary-menu li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.primary-menu .sub-menu a {
    padding: 8px 20px;
    font-weight: 400;
}

.primary-menu .sub-menu .sub-menu {
    top: 0;
    left: 100%;
}

/* =========================================================================
   HEADER - RIGHT SECTION
   ========================================================================= */

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Header Search */
.header-search {
    position: relative;
}

.search-toggle {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--header-text);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.search-toggle:hover {
    color: var(--header-hover);
}

.search-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 300px;
    background: var(--header-bg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    padding: 15px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    z-index: 100;
}

.header-search.is-open .search-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.search-dropdown .search-form {
    display: flex;
}

.search-dropdown .search-field {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    font-size: 14px;
}

.search-dropdown .search-submit {
    padding: 10px 15px;
    background: var(--header-hover);
    color: #fff;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

/* Fullscreen Search */
.search-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 9999;
}

.search-fullscreen.is-open {
    opacity: 1;
    visibility: visible;
}

.search-fullscreen .search-close {
    position: absolute;
    top: 30px;
    right: 30px;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 10px;
}

.search-fullscreen .search-form {
    width: 100%;
    max-width: 600px;
    padding: 0 20px;
}

.search-fullscreen .search-field {
    width: 100%;
    padding: 20px;
    font-size: 24px;
    background: transparent;
    border: none;
    border-bottom: 2px solid #fff;
    color: #fff;
    outline: none;
}

.search-fullscreen .search-field::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-fullscreen .search-submit {
    display: none;
}

/* CTA Button */
.header-cta-button {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background-color: var(--cta-bg);
    color: var(--cta-text);
    text-decoration: none;
    font-weight: 600;
    border-radius: 4px;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.header-cta-button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    color: var(--cta-text);
}

@media (max-width: 991px) {
    .header-cta-button {
        display: none;
    }
}

/* =========================================================================
   HEADER - MOBILE MENU TOGGLE
   ========================================================================= */

.menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: none;
    border: none;
    cursor: pointer;
    gap: 5px;
}

@media (min-width: 992px) {
    .menu-toggle {
        display: none;
    }
    
    .header-layout-minimal .menu-toggle {
        display: flex;
    }
}

.hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--header-text);
    transition: all 0.3s ease;
}

.menu-toggle.active .hamburger:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active .hamburger:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .hamburger:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* =========================================================================
   HEADER - LAYOUT VARIATIONS
   ========================================================================= */

/* Centered Layout */
.header-layout-centered .header-inner {
    flex-direction: column;
    text-align: center;
}

.header-layout-centered .header-top {
    padding-bottom: 10px;
}

.header-layout-centered .header-bottom {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.header-layout-centered .primary-menu {
    justify-content: center;
}

/* Logo Center Layout */
.header-layout-logo-center .header-inner {
    justify-content: space-between;
}

.header-layout-logo-center .header-left,
.header-layout-logo-center .header-right {
    flex: 1;
}

.header-layout-logo-center .header-left {
    justify-content: flex-start;
}

.header-layout-logo-center .header-right {
    justify-content: flex-end;
}

.header-layout-logo-center .site-branding {
    text-align: center;
}

/* Minimal Layout */
.header-layout-minimal .main-navigation {
    display: none !important;
}

.fullscreen-navigation {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--header-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 99;
}

.fullscreen-navigation.is-open {
    opacity: 1;
    visibility: visible;
}

.fullscreen-navigation .main-navigation {
    display: block !important;
}

.fullscreen-navigation .primary-menu {
    flex-direction: column;
    text-align: center;
    gap: 10px;
}

.fullscreen-navigation .primary-menu a {
    font-size: 24px;
    padding: 15px 30px;
}

/* =========================================================================
   MOBILE NAVIGATION
   ========================================================================= */

@media (max-width: 991px) {
    .main-navigation {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--header-bg);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .main-navigation.active {
        display: block;
        max-height: 80vh;
        overflow-y: auto;
    }
    
    .primary-menu {
        flex-direction: column;
        padding: 20px;
        gap: 0;
    }
    
    .primary-menu a {
        padding: 12px 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }
    
    .primary-menu .sub-menu {
        position: static;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        padding-left: 20px;
        background: transparent;
    }
}

/* =========================================================================
   FOOTER - BASE STYLES
   ========================================================================= */

.site-footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
}

.site-footer a {
    color: var(--footer-link);
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-footer a:hover {
    color: var(--footer-hover);
}

/* Footer Main */
.footer-main {
    padding: 60px 0;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
}

@media (max-width: 768px) {
    .footer-inner {
        flex-direction: column;
        text-align: center;
    }
}

/* Footer Branding */
.footer-branding {
    max-width: 300px;
}

.footer-logo {
    margin-bottom: 15px;
}

.footer-logo img {
    width: auto;
    height: auto;
    max-width: 100%;
}

.footer-site-title {
    font-size: 24px;
    font-weight: 700;
}

.footer-description {
    margin-top: 15px;
    font-size: 14px;
    line-height: 1.6;
    opacity: 0.8;
}

/* Footer Navigation */
.footer-navigation {
    flex-shrink: 0;
}

.footer-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 30px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-menu a {
    font-size: 14px;
}

/* =========================================================================
   FOOTER - WIDGETS
   ========================================================================= */

.footer-widgets {
    padding: 60px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-widgets-grid {
    display: grid;
    gap: 40px;
}

.footer-widgets-grid.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.footer-widgets-grid.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.footer-widgets-grid.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 991px) {
    .footer-widgets-grid.columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .footer-widgets-grid.columns-2,
    .footer-widgets-grid.columns-3,
    .footer-widgets-grid.columns-4 {
        grid-template-columns: 1fr;
    }
}

.footer-widget-column .widget {
    margin-bottom: 30px;
}

.footer-widget-column .widget:last-child {
    margin-bottom: 0;
}

.footer-widget-column .widget-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--footer-link);
}

.footer-widget-column ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-widget-column li {
    margin-bottom: 10px;
}

.footer-widget-column a {
    font-size: 14px;
    opacity: 0.8;
}

.footer-widget-column a:hover {
    opacity: 1;
}

/* =========================================================================
   FOOTER - BOTTOM BAR
   ========================================================================= */

.footer-bottom {
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

@media (max-width: 768px) {
    .footer-bottom-inner {
        flex-direction: column;
        text-align: center;
    }
}

.footer-bottom-left,
.footer-bottom-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.site-info {
    font-size: 14px;
    opacity: 0.7;
}

.site-info p {
    margin: 0;
}

/* =========================================================================
   FOOTER - CENTERED LAYOUT
   ========================================================================= */

.footer-layout-centered .footer-centered-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.footer-layout-centered .footer-logo {
    display: flex;
    justify-content: center;
}

.footer-layout-centered .footer-menu {
    justify-content: center;
    margin: 30px 0;
}

.footer-layout-centered .social-icons {
    justify-content: center;
    margin: 20px 0;
}

.footer-layout-centered .site-info {
    margin-top: 20px;
}

/* =========================================================================
   FOOTER - MINIMAL LAYOUT
   ========================================================================= */

.footer-layout-minimal .footer-bottom {
    border-top: none;
}

.footer-layout-minimal .footer-bottom-inner {
    justify-content: center;
}

/* =========================================================================
   SOCIAL ICONS
   ========================================================================= */

.social-icons {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--footer-link);
    transition: all 0.2s ease;
}

.social-icon:hover {
    background: var(--footer-hover);
    color: #fff;
    transform: translateY(-2px);
}

.social-icon svg {
    width: 18px;
    height: 18px;
}

/* =========================================================================
   BACK TO TOP BUTTON
   ========================================================================= */

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--back-to-top-bg);
    color: #fff;
    border: none;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 99;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

/* Button Styles */
.back-to-top-circle {
    border-radius: 50%;
}

.back-to-top-square {
    border-radius: 0;
}

.back-to-top-rounded {
    border-radius: 8px;
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
    }
}
