:root {
    --color-primary: #006642;
    --color-primary-rgb: 0, 102, 66;

    --color-secondary: #E6B904;
    --color-secondary-rgb: 230, 185, 4;

    --color-tertiary: #CC0000;
    --color-tertiary-rgb: 204, 0, 0;

    --color-muted: #777;
    --color-muted-rgb: 170, 170, 170;

    --color-background: #fff;
    --color-background-rgb: 255, 255, 255;
    --color-foreground: #222;

    --color-border: #e5e7eb;

    /* Spacing system */
    --space-unit: 4px;
    --space-1: var(--space-unit);
    --space-2: calc(var(--space-unit) * 2);
    --space-3: calc(var(--space-unit) * 3);
    --space-4: calc(var(--space-unit) * 4);
    --space-5: calc(var(--space-unit) * 5);
    --space-6: calc(var(--space-unit) * 6);
    --space-7: calc(var(--space-unit) * 7);
    --space-8: calc(var(--space-unit) * 9);

    /* Typography */
    /*--text-sm: 0.9rem;*/
    /*--text-xs: 0.8rem;*/
    /*--text-base: 1rem;*/
    /*--text-lg: 1.125rem;*/
    /*--text-xl: 1.25rem;*/
    /*--text-2xl: 1.5rem;*/
    /*--text-3xl: 2rem;*/

    /* Layout */
    --max-width: 1200px;
    --border-radius: 12px;

    --breadcrumb-height: 64px;
    --header-height: 80px;
}

.site-header {
    position: fixed;
    display: flex;
    align-items: center;
    top: 0;
    background-color: rgba(var(--color-background-rgb), 0.8);
    backdrop-filter: blur(8px);
    width: 100vw;
    height: var(--header-height);
    box-shadow: 0 4px 8px -1px rgba(var(--color-primary-rgb), 0.2); /* Smooth shadow */
    z-index: 100;
}

.site-header ul {
    list-style: none;
    padding-left: unset;
    margin-bottom: 0;
}

.site-header a {
    font-size: 14px;
}

.site-header-content-wrapper {
    margin: 0 auto;
    width: 100%;
    max-width: 1200px;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
}

.site-branding {
    max-width: 60vw;

    & img {
        width: 100%;
    }
}

.main-navigation {
    flex: 1;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
}

.nav-list {
    display: flex;
    justify-content: center;
    gap: 8px;

    & li {
        position: relative;
    }
}

.nav-link {
    font-family: unset;
    border: none;
    background-color: transparent;
    font-size: 14px;
    display: flex;
    align-items: center;
    padding: 12px;
    text-decoration: none;
    color: var(--color-foreground);
    transition: background-color 0.3s ease, color 0.3s ease;
    text-wrap: nowrap;
    border-radius: var(--border-radius);

    & svg {
        margin-left: 8px
    }
}

.nav-link:hover {
    color: var(--color-primary);
    background-color: rgba(var(--color-primary-rgb), 0.1);
}

/* Submenu styling */
.submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    box-shadow: 0 3px 5px rgba(0,0,0,0.1);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    border-radius: var(--border-radius);
}

.dropdown-icon {
    transition: transform 0.3s ease;
}

/* Active states */
.nav-link[aria-expanded="true"] + .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-link[aria-expanded="false"] + .submenu {
    transition: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
}

.nav-link[aria-expanded="true"] .dropdown-icon {
    transform: rotate(180deg);
}

/* Mobile menu toggle */
.menu-toggle, .menu-close {
    display: none;
    background: none;
    border: none;
    padding: 12px;
}

.menu-close {
    display: none;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-toggle {
    background: none;
    border: none;
    padding: 12px;
    border-radius: var(--border-radius);
    color: var(--color-foreground);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-toggle:hover {
    color: var(--color-primary);
    background-color: rgba(var(--color-primary-rgb), 0.1);
    transform: scale(1.05);
}

.sns-24-login-link {
    display: inline-block;
    transition: transform 0.3s ease;
}

.sns-24-login-link:hover {
    transform: scale(0.95);
}

.sns-24-login-link img {
    height: 44px;
}

/* Search Modal Styles */
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.search-modal.active {
    opacity: 1;
    visibility: visible;
}

.search-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-modal.active .search-modal-backdrop {
    background: rgba(0, 0, 0, 0.8);
}

.search-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px;
    padding: 0;
    transition: transform 0.3s ease;
}

.search-modal.active .search-modal-content {
    transform: translate(-50%, -50%) scale(1);
}

.search-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--color-border);
}

.search-modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--color-foreground);
    font-weight: 600;
}

.search-modal-close {
    background: none;
    border: none;
    padding: 8px;
    border-radius: var(--border-radius);
    color: var(--color-muted);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-modal-close:hover {
    color: var(--color-foreground);
    background-color: rgba(var(--color-muted-rgb), 0.1);
}

.search-form {
    padding: 24px;
}

.search-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    padding: 16px 60px 16px 20px;
    border: 2px solid var(--color-border);
    border-radius: var(--border-radius);
    font-size: 16px;
    color: var(--color-foreground);
    background: white;
    transition: all 0.3s ease;
    outline: none;
}

.search-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.1);
}

.search-input::placeholder {
    color: var(--color-muted);
}

.search-submit {
    position: absolute;
    right: 8px;
    background: var(--color-primary);
    border: none;
    padding: 10px;
    border-radius: calc(var(--border-radius) - 2px);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-submit:hover {
    background: rgba(var(--color-primary-rgb), 0.9);
    transform: scale(1.05);
}

.search-submit:active {
    transform: scale(0.95);
}

/* Prevent body scroll when modal is open */
.search-modal-open {
    overflow: hidden;
}

/* Mobile menu styles */
@media (max-width: 1024px) {

    .site-header-content-wrapper {
        padding: 8px;
    }

    .menu-toggle {
        display: block;
    }

    .main-navigation {
        width: 100vw;
        height: 100vh;
        position: fixed;
        top: 0;
        left: -100vw;
        background-color: white;
        z-index: 100;
        transition: left 0.3s ease;
        flex-direction: column;
        justify-content: start;
        gap: 0;
        overflow-y: auto;;

        &.active {
            left: 0;
        }
    }

    .nav-list {
        flex-direction: column;
        width: 100%;
        padding: 16px;
        flex-shrink: 0;

        & button {
            width: 100%;
        }

        & .submenu {
            box-shadow: none;
        }
    }

    .header-actions {
        margin-top: auto;
        padding: 16px;
        flex-direction: column;
        gap: 24px;
    }

    .search-toggle {
        order: 1;
        padding: 16px;

        & svg {
            width: 24px;
            height: 24px;
        }
    }

    .sns-24-login-link-container {
        order: 2;

        & img {
            height: 64px;
        }
    }

    .menu-close {
        display: block;
        margin: 12px 8px;
        align-self: end;
    }

    .nav-link[aria-expanded="true"] + .submenu {
        position: unset;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    /* Mobile search modal adjustments */
    .search-modal-content {
        width: 95%;
        margin: 0 auto;
    }

    .search-modal-header {
        padding: 20px 20px 12px;
    }

    .search-modal-header h2 {
        font-size: 1.1rem;
    }

    .search-form {
        padding: 20px;
    }

    .search-input {
        padding: 14px 50px 14px 16px;
        font-size: 16px; /* Prevent zoom on iOS */
    }

    .search-submit {
        right: 6px;
        padding: 8px;
    }
}